Change spheres rotation angle – ThreeJs

I have a little trouble with my sphere i want a Box to rotate on its surface in a specific angle.
The red in the picture showes its current direction and the green how i want it.Screenshot
I have already tried rotateAroundWorldAxis on the z achsis and 45 degree but it isnt working (The angle is weird enter image description here)

` rotateAroundWorldAxis(
group,
new THREE.Vector3(0, 0, 1),
THREE.Math.degToRad(45)
)
function rotateAroundWorldAxis(object, axis, radians) {
const rotWorldMatrix = new THREE.Matrix4()
rotWorldMatrix.makeRotationAxis(axis.normalize(), radians)

    rotWorldMatrix.multiply(object.matrix)

    object.matrix = rotWorldMatrix

    object.rotation.setFromRotationMatrix(object.matrix)
  }`

Add a button for random playback of tracks in the player

I want to add a small player to my site to listen to music. I found a beautiful example that I liked and want to change and finish it a little.

Specifically, I want to add a button here to randomly play tracks.

To start, I add this button to the html:

<button type="submit" id="btn-random">
   <i class="fas fa-random"></i>
</button>

Next, I add a check to the next track switching function, if the random button has an active class, then the tracks will play randomly:

else if (to == 'next') {
        stop();
        if (document.getElementById("btn-random").classList.contains("active")) {
          let songs = document.getElementById("sourceUrl").length - 1;
          let randomSong = Math.floor(Math.random() * songs) + 1;
        } else {
          currentSong = (++currentSong)%playlist.length;
        }
        playpause();
    }

Next, it remains to make sure that when you click on the random button, the active class turns on and off. To do this, I make a onclick function for this button and implement it:

<button type="submit" id="btn-random" onclick="random()">
   <i class="fas fa-random"></i>
</button>

//

var randomTrack = false;

function random() {
  if (randomTrack) {
        document.getElementById('btn-random').classList.add("active");
        randomTrack = false;
    }
    else {
        document.getElementById('btn-random').classList.remove("active");
        randomTrack = true;
    }
}

But in the end, when the random button has an active class and I try to switch the song, I get an error:

Failed to load resource: the server responded with a status of 409 ()

What could be the problem?

var song = new Audio;
var isStopped = true;
var currentSong = 0;
var playlist = [];
var playlistVisible = false;
var randomTrack = false;

function skip(to) {
    if (to == 'prev') {
        stop();
        currentSong = (--currentSong)%playlist.length;
        if (currentSong < 0) {
            currentSong += playlist.length;
        }
        playpause();
    }
    else if (to == 'next') {
        stop();
        if (document.getElementById("btn-random").classList.contains("active")) {
          let songs = document.getElementById("sourceUrl").length - 1;
              let randomSong = Math.floor(Math.random() * songs) + 1;
        } else {
          currentSong = (++currentSong)%playlist.length;
        }
        playpause();
    }
}

function playpause() {
  if (!song.paused) {
        song.pause();
        document.getElementById("glow").classList.add("disable-animation");
    }
  else if (playlist.length == 0){
    togglePlaylist();
  }
    else {
      if (isStopped) {
            song.src = playlist[currentSong];
        }
        song.play();
        songFile = playlist[currentSong].split("/");
        songName = document.getElementById("songName");
        songName.innerHTML = songFile[songFile.length - 1].split('.').slice(0, -1).join('.');
        document.getElementById("glow").classList.remove("disable-animation");
        isStopped = false;
    }
}

function random() {
  if (randomTrack) {
        document.getElementById('btn-random').classList.add("active");
        randomTrack = false;
    }
    else {
        document.getElementById('btn-random').classList.remove("active");
        randomTrack = true;
    }
}

function stop() {
    song.pause();
    document.getElementById("glow").classList.add("disable-animation");
    song.currentTime = 0;
    document.getElementById("seek").value = 0;
    isStopped = true;
    document.getElementById("songName").innerHTML = "playing track..";
}

function setPos(pos) {
    song.currentTime = pos;
}

function mute() {
    if (song.muted) {
        song.muted = false;
        document.getElementById('mute').className = "fa fa-volume-up";
    }
    else {
        song.muted = true;
        document.getElementById('mute').className = "fa fa-volume-off";
    }
}

function setVolume(volume) {
    song.volume = volume;
}

function togglePlaylist() {
    if (playlistVisible) {
        document.getElementById('playlist').className = "hide";
        document.getElementById('player').className = "";
        playlistVisible = false;
    }
    else {
        document.getElementById('player').className = "hide";
        document.getElementById('playlist').className = "";
        playlistVisible = true;
    }
}

function addList() {
    sourceUrl = document.getElementById('sourceUrl').value;
    sourceUrl.split(",").forEach((file) => {
        fileUrl = file.trim();
        if (fileUrl != "" && playlist.indexOf(fileUrl) == -1) {
            parent = document.getElementById('list');
            listItem = document.createElement('div');
            listItem.setAttribute('class','list-item');

            wrapper = document.createElement('div');
            wrapper.setAttribute('class','wrap-text');

            span = document.createElement('span');
      songFile = fileUrl.split("/");
            span.innerHTML = songFile[songFile.length - 1].split('.').slice(0, -1).join('.');

            wrapper.appendChild(span);
            listItem.appendChild(wrapper);

            btn = document.createElement('button');
            btn.setAttribute('onclick','removeList(this)');
            btn.innerHTML = '&times;';

            listItem.appendChild(btn);
            parent.appendChild(listItem);
            playlist.push(fileUrl);
        }
    });
  document.getElementById('sourceUrl').value = '';
}

function removeList(item) {
    index = playlist.indexOf(item.parentElement.firstChild.innerText);
    if (index != -1){
        playlist.splice(index,1);
        item.parentElement.remove();
    }
}

song.addEventListener('error', function(){
    stop();
    document.getElementById("songName").innerHTML = "error loading audio";
});

song.addEventListener('timeupdate', function() {
    curtime = parseInt(song.currentTime,10);
    document.getElementById('seek').max = song.duration;
    document.getElementById('seek').value = curtime;
});

song.addEventListener("ended", function() {
    song.pause();
    song.currentTime = 0;
    document.getElementById('seek').value = 0;
    if ((currentSong + 1) >= playlist.length) {
        currentSong = 0;    
    }
    else {
        currentSong++;
    }
    stop();
    song.src = playlist[currentSong];
    playpause();
});

var input = document.getElementById("sourceUrl");
input.addEventListener("keyup", function(event) {
    if (event.keyCode === 13) {
        event.preventDefault();
        addList();
    }
});


// This area of code is only for preview purposes only

document.getElementById('sourceUrl').value = ["https://www.bensound.com/bensound-music/bensound-summer.mp3",
"https://www.bensound.com/bensound-music/bensound-anewbeginning.mp3",
"https://www.bensound.com/bensound-music/bensound-littleidea.mp3",
"https://www.bensound.com/bensound-music/bensound-cute.mp3",
"https://www.bensound.com/bensound-music/bensound-memories.mp3"];
addList();
document.getElementById("glow").classList.remove("disable-animation");

// Code for preview ends here
* {
  box-sizing: border-box;
}
html {
  background: #000000;
}
html,
body,
.container {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  white-space: nowrap;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.container {
  display: flex;
  align-items: center;
  justify-content: center;
}
.glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: linear-gradient(0deg, #000000, #262626);
  border-radius: 50%;
}
.glow::before,
.glow::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  background: linear-gradient(
    45deg,
    #ebc6df,
    #ebc6c9,
    #e1c6eb,
    #c6c9eb,
    #c6e8eb,
    #e373fb,
    #f787e6,
    #cb87f7,
    #87a9f7,
    #87f7ee
  );
  background-size: 400%;
  max-width: calc(300px + 4px);
  max-height: calc(300px + 4px);
  width: calc(300px + 4px);
  height: calc(300px + 4px);
  z-index: -1;
  animation: animate 20s linear infinite;
  border-radius: 50%;
}
.disable-animation::before,
.disable-animation::after {
  animation-play-state: paused;
}
.glow::after {
  filter: blur(28px);
}
#player,
#playlist {
  width: 243px;
  height: 212px;
  text-align: center;
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
#songName {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 30px;
}
.playlist-btn {
  width: 243px;
  margin-top: 30px;
  text-align: center;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.hide {
  display: none;
}
#list {
  height: 118px;
  max-height: 118px;
  margin-top: 16px;
  font-size: 12px;
  overflow-x: hidden;
  overflow-y: scroll;
  color: #fff;
  text-align: left;
  padding-left: 8px;
  border: 2px solid #262626;
  border-radius: 5px;
}
.list-item {
  line-height: 30px;
  height: 30px;
  margin-top: 4px;
}
.list-container button {
  width: 30px;
  padding: 0;
  float: right;
  margin-right: 4px;
}
.add-list {
  padding: 4px 6px;
}
.wrap-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
  display: inline-block;
}
#sourceUrl {
  background: none;
  padding: 8px;
  border: 2px solid #1f1f1f;
  border-radius: 47px;
  outline: none;
  color: white;
  height: 30px;
  width: 192px;
}
#sourceUrl:active,
#sourceUrl:focus {
  border: 2px solid #0088ff;
}
.text {
  color: #ffffff;
  display: block;
}
button {
  background: #000000;
  color: #ffffff;
  background: linear-gradient(0deg, #000000, #262626);
  font-size: 14px;
  border: none;
  outline: none;
  padding: 0px 15px;
  width: 55px;
  height: 30px;
  line-height: 30px;
  border-radius: 32px;
}
button:hover {
  box-shadow: 0 0 8px 0px #ffffff61;
}
button:active {
  box-shadow: inset 0 0 6px 0px #ffffff61;
}

#seek,
#volume {
  -webkit-appearance: none;
  border: 1px solid #000000;
  height: 5px;
  vertical-align: middle;
  border-radius: 20px;
  background-color: #232323;
  outline: none;
}
#seek::-webkit-slider-thumb,
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid #000000;
  border-radius: 10px;
  background: #ffffff;
}
#seek {
  display: block;
  width: 230px;
}
.scrollbar::-webkit-scrollbar {
  max-width: 5px;
  max-height: 5px;
}
.scrollbar::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #333;
}
.scrollbar::-webkit-scrollbar-thumb:hover {
  box-shadow: inset 0 0 1px 1px #5c6670;
}

.scrollbar::-webkit-scrollbar-track:hover {
  border: 1px solid #000000;
  border-radius: 20px;
  background-color: #232323;
}

@keyframes animate {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 400% 0;
  }
  100% {
    background-position: 0 0;
  }
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" rel="stylesheet" type="text/css">
<div class="container">
  <div id="glow" class="glow disable-animation">
    <div id="player">
      <span class="text">iu player</span>
      <br>
      <span id="songName" class="text">playing track..</span>
      <br>
      <div class="playback_controls">
        <button onclick="skip('prev')">
          <i class="fa fa-fast-backward"></i>
        </button>
        <button onclick="playpause()">
          <i class="fa fa-play"></i><i class="fa fa-pause"></i>
        </button>
        <button onclick="stop()">
          <i class="fa fa-stop"></i>
        </button>
        <button onclick="skip('next')">
          <i class="fa fa-fast-forward"></i>
        </button>
      </div>
      <br>
      <div id="seekbar">
        <input type="range" oninput="setPos(this.value)" id="seek" value="0" max="">
      </div>
      <br>
      <div class="volume_controls">
        <button onclick="mute()">
          <i id="mute" class="fa fa-volume-up"></i>
        </button>
        <input type="range" id="volume" oninput="setVolume(this.value)" min="0" max="1" step="0.01" value="1">
      </div>
    </div>

    <div id="playlist" class="hide">
      <span class="text">iu playlist</span>
      <div class="list-container">

        <div id="list" class="scrollbar"></div>

        <div class="add-list">
          <input id="sourceUrl" type="text" placeholder="enter audio url" />
          <button onclick="addList()">+</button>
        </div>

      </div>
    </div>

    <div class="playlist-btn">
      <button id="btn-random" onclick="random()">
        <i class="fas fa-random"></i>
      </button>
      <button onclick="togglePlaylist()">
        <i id="playlist-btn" class="fa fa-list"></i>
      </button>
    </div>

  </div>
</div>

Typescript: import { groupBy } from ‘lodash’ ReferenceError: require is not defined

I’m trying to use groupBy from lodash in a .ts file like this:

import { groupBy } from 'lodash';

But after tsc .index.ts -w the resulting index.js turns that import into var lodash_1 = require("lodash"); and the following error appears:

index.js:28 Uncaught ReferenceError: require is not defined

Here is my package.json:

{
  "name": "final_exercise",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "lodash-es": "^4.17.21",
    "require": "^0.4.4",
    "typescript-require": "^0.3.0"
  }

The error happens with and without require and typescript-require being installed. Installing
require needed the npm audit fix --force, not sure if that’s normal or not.

tsconfig.json

{
  "compilerOptions": {
    "target": "ES2019",
    "module": "commonjs",
    "lib": ["ES2019", "dom", "dom.iterable"],
    "strict": true,
    "sourceMap": true,
  }
}

I also have this on the end of index.html, else the error would be ReferenceError: exports is not defined:

<script> var exports = {}; </script>
<script src="index.js"></script>

Since I’m new to Typescript, to modules and everything associated, I must be doing something wrong or I’m missing something. I’ve checked all similar questions with answers but nothing so far has worked.

Thanks for any help.

React+Material UI: How to change the font size of the Select component?

I’m developing a web app using React + Material UI. I would like to change the font size of the Select component. I’m having to use the MenuProps property, as the code snippet that follows. However, it’s not working.

const MenuProps = {
    PaperProps: {
        sx: {
            '& .MuiMenuItem-root': {
                fontSize: 10,
            },
        },
        style: {
            fontSize: 10,
        },
    },
};

const MultipleSelectTags = () => {
    const [tagFilter, setTagFilter] = useState([]);

    const handleChange = (event) => {
        const {
            target: { value },
        } = event;
        setTagFilter(
            typeof value === 'string' ? value.split(',') : value,
        );
    };

    return (
        <div>
            <FormControl sx={{ m: 1, width: 200 }} size="small">
                <InputLabel>Tag</InputLabel>
                <Select
                    multiple
                    value={tagFilter}
                    onChange={handleChange}
                    input={<OutlinedInput label="Tag" />}
                    renderValue={(selected) => selected.join(', ')}
                    MenuProps={MenuProps}
                >
                    {names.map((name) => (
                        <MenuItem key={name} value={name}>
                            <Checkbox checked={tagFilter.indexOf(name) > -1} />
                            <ListItemText primary={name} />
                        </MenuItem>
                    ))}
                </Select>
            </FormControl>
        </div>
    );
}

Can somebody help me?

A group of friends is going on holiday together [Solution]

A group of friends is going on holiday together. They have come to a meeting point (the start of the journey) using N cars. There are P[K] people and S[K] seats in the K-th car for K in range [0..N-1]. Some of the seats in the cars may be free, so it is possible for some of the friends to change the car they are in. The friends have decided that, in order to be ecological, they will leave some cars parked at the meeting point and travel with as few cars as possible.

Write a function: function solution(P, S);

that, given two arrays P and S, consisting of N integers each, returns the minimum number of cars needed to take all of the friends on holiday.

Examples:

Given P = [1, 4, 1] and S = [1, 5, 1], the function should return 2. A person from car number 0 can travel in car number 1 instead. This way, car number 0 can be left parked at the meeting point.

Given P = [4, 4, 2, 4] and S = [5, 5, 2, 5], the function should return 3. One person from car number 2 can travel in car number 0 and the other person from car number 2 can travel in car number 3.

Given P = [2, 3, 4, 2] and S = [2, 5, 7, 2], the function should return 2. Passengers from car number 0 can travel in car number 1 and passengers from car number 3 can travel in car number 2.

Write an efficient algorithm for the following assumptions:

N is an integer within the range [1 .. 100,000]

each element of arrays P and S is an integer within the range [1 .. 9]

every friend had a seat in the car they came in; that is, P[K] ≤ S[K] for each K within the range [0..N-1]

How can I make background half visible when I press the button?

How can I make half of the screen partially black when I click on button, like on the picture :

mobile

I made mobile navigation like that and specified that background color should be white:

.nav-links-row-mobile{
    display: none;
    top:0;
    position: absolute;
    left:0;
    list-style: none;
    background-color: #ffffff;
    margin: 0;
    padding: 50px;
    height: 100%;
}
 <div class="nav-links ">
                    
                    <ul class="nav-links-row-mobile">
                        <div class="nav-logo nav-logo-mobile">
                            <a href="index.html">
                            <h1>Brit</h1><span class="grey">lex</span>
                        </a>
                        </div>
                        <li><a href="#!">Home</a></li>
                        <li><a href="#!">Skills</a></li>
                        <li><a href="#!">About Us</a></li>
                        <li><a href="#!">Pricing</a></li>
                        <li><a href="#!">Contacts</a></li>
                    </ul>
                </div>

But how can I make 2nd half of the screen half black or partially visible?

Thank you in advance!

Unable to use any react html parser or dangerouslySetInnerHTML(in a proper way) while calling content from API

Exactly While using parse for my coin description (line no 66 in attached screenshot), it throws those errors into console. And time when I remove parse and used instead of this, dangerouslySetInnerHTML it’s works.

But I want to know what was wrong with html-react-parser

<Typography variant="subtitle1" className={styles.description}>          
          { parse(coin?.description.en.split(". ")[0])}.

          {/* <Box
            dangerouslySetInnerHTML={{
              __html: coin?.description.en.split(".")[0],
            }} 
          /> */}
        </Typography>

Another Problem is with dangerouslySetInnerHTML, that am I writing it in correct syntax or way inside of typography within Box/div? And if it is then how I am going to put full stop after my content that fetched from api and put word limit to the content that is fetched.

content fetched from coin?.description

unable to use any react html parser

Socket.io error Malformed arrow function parameter list

// sever.js
    function cpuStats() {
        return new Promise((resolve) => {
            os.cpuUsage((value) => {
                let data = {
                    'cpu': (value * 100).toFixed(0),
                    'cpuCnt' : os.cpuCount(), 
                    'memory': memoryPer, // (os.freememPercentage() * 100).toFixed(2),
                    'memoryAva' : os.freemem(),
                    'memoryTot' : os.totalmem(),
                    'disk': usedInPercentage, //(os.totalmem() / 1024).toFixed(2)
                    'diskAva' : diskAvailable,
                    'diskTot' : diskTotal
                }
                resolve(data);
            })
        })
    }
    setInterval(() => {
        cpuStats()
            .then((data) => {
                console.log(data) // Testing
                socket.emit('serverData', data)
            })
    }, 5000);



    // client
    socket.on('serverData', data )=>{ 
        
        var cpu = document.getElementById('cpu');
        var memory = document.getElementById('memory');
        var disk = document.getElementById('disk');
        
        cpu.innerText = data.cpu;
        memory.innerText = data.memory;
        disk.innerText = data.disk;
        
    });

In server.js, I created an object called data using promise and then .
on client-side I’m getting only this error: Uncaught SyntaxError: Malformed arrow function parameter list

React final form change function doesn’t work correctly

I’m trying to play around with React-Final-Form library, Here is my sandbox link : https://codesandbox.io/s/nice-vaughan-czk7g9?file=/src/index.js

When I click on ‘Change’ button, I want the country field (coming from the initialValues) to be get set or its value should get changed to the new given value. But what’s happening is, country’s existing value gets picked up and a new object key-value pair with key as “country’s existing value” and value as the new value given gets appended.

Could someone helps what’s wrong I’m doing here and how could I change the value of the field via change function.

Thanks.

Hugo can not find created files by node when using concurrently

I have a node project which I build with concurrently with the following build pipe:

"scripts": {
  "build": "concurrently -g npm:build:*",
  "build:generate-db": "ts-node ./converter/main.ts",
  "build:tailwind": "npx tailwindcss -i ./src/input.css -o ./static/css/build.css --minify",
  "build:hugo": "hugo --minify",
},
  • build: Call’s all commands with prefix build in synchron order.
  • build:generate-db: Create .md files for hugo application from a database.
  • build:tailwind: Generates tailwind file and puts it in correct folder
  • build:hugo: Creates hugo website with .md files and tailwind file.

When I run the script hugo is not finding the .md files. When I run the script a second time hugo finds the .md files and create the website correct.

What I tried:

  • First I thought the problem is the time the file write requires (so hugo is trying to find the files before they got written). This is not the case: Even when I sleep 10 seconds after build:generate-db hugo is not able to find the files as well.
  • When I run build:generate-db and than build:hugo it’s working.
  • The tailwind file is created correctly. (it’s also file write so why is this one working?)
  • When you run the following config it’s working:
  "build": "concurrently -g npm:build:* & hugo --minify",
  "build:generate-db": "npm run converter",
  "build:tailwind": "npx tailwindcss -i ./src/input.css -o ./static/css/build.css --minify",

The Converter writes like this:

writeFileSync(`${resultPath}/${data[titleKey]}.md`, JSON.stringify(resultDto, null, 2))

How can I fix this problem?

class-validator – Validate that an array of strings matches a value

I’m using the class-validator npm package and would like to validate that the type property of request body matches one either ‘organization’ or ‘student’.

How would I do this with this package?

This doesn’t work:

@IsIn(['organization', 'student'])
type: string

Request body example:

{
   "type": "organization",
   "email": "[email protected]",
   "password": "veryscretpwd"
}

How preview some js code in the webpage after it loads from Inspect

I want to add a dropbox button to a website as live preview. but it doesn’t appear.

<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs"data-app-key="myappjey"></script>


    <div id="dropboxContainer"></div>

I have the button here
dropbox

And I want to add the same button here also just as a demo but can I save the JS code just for one reload or something

The other website

Uikit Sticky oversized content

Hello
I am using UIKIT’s sticky component on the image which needs sticky right away when scrolling starts.
It works fine but if the image is oversized to the viewport (like in laptops), so the sticky position does not work as long as the bottom of the photo is inside the viewport.
is there a way to immediately sticky the image when i scroll even though it is oversized to the viewport?

<!DOCTYPE html>
<html>

<head>
    <title>Sticky</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- UIkit CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/uikit.min.css" />

    <!-- UIkit JS -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/uikit.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/uikit-icons.min.js"></script>
</head>

<body>


    <div uk-sticky="sel-target: .uk-navbar-container; cls-active: uk-navbar-sticky; bottom: #transparent-sticky-navbar">
        <nav class="uk-navbar-container uk-navbar-transparent uk-background-primary uk-light" uk-navbar
            style="position: relative; z-index: 9999980;">
            <div class="uk-navbar-center">
                <ul class="uk-navbar-nav">
                    <li><a href="#">NAVBAR</a></li>
                </ul>
            </div>
        </nav>
    </div>


    <div id="test" class="uk-grid-collapse uk-child-width-1-2 uk-text-center" uk-grid>

        <div>
            <div class="uk-background-muted" uk-sticky="bottom: true; offset:80" style="z-index: 980;">
                <div>
                    <img data-src="http://placehold.jp/3d4070/ffffff/1200x1400.png?text=IMAGE" width="1200" height="1400"
                        loading="lazy" src="http://placehold.jp/3d4070/ffffff/1200x1400.png?text=IMAGE">
                </div>
            </div>
        </div>

        <div class="uk-background-muted uk-padding uk-dark">
            <article class="uk-article uk-text-left">

                <h1 class="uk-article-title"><a class="uk-link-reset" href="">Heading</a></h1>

                <p class="uk-article-meta">Written by <a href="#">Super User</a> on 12 April 2012. Posted in
                    <a href="#">Blog</a></p>

                <p class="uk-text-lead">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
                    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
                    quis nostrud exercitation ullamco laboris nisi ut aliquip.</p>

                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
                    ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
                    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.</p>


                    <div class="uk-grid-small uk-child-width-auto" uk-grid>
                        <div>
                            <a class="uk-button uk-button-text" href="#">Read more</a>
                        </div>
                        <div>
                            <a class="uk-button uk-button-text" href="#">5 Comments</a>
                        </div>
                    </div>

            </article>
        </div>
    </div>

    <div class="uk-container uk-container-expand uk-height uk-background-secondary">
        <div>
            <div class="uk-height-large uk-flex uk-flex-center uk-flex-middle">
                Footer</div>
        </div>
    </div>


</body>

</html>

How to use NPM modules in svelte

I am new to svelte and love the entire framework for small projects. But, for example, I wanted to access an FTP server or use Spotify API. I could not find a way to get NPM modules to run. I’ve tried using sapper, downloading the module in @types, importing the module in main.js and transfering it to the svelte file props.

I really am not sure which is the correct way to go about creating an app that uses NPM modules in svelte, so if someone could give me the definitive answer of what I need to research, that would be greatly appreciated.

Thanks