-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
45 lines (38 loc) · 1.35 KB
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function stars() {
let count = 150;
let scene = document.querySelector('.night');
let w = 0;
while(w < count) {
let star = document.createElement("w");
let x = Math.floor(Math.random() * window.innerWidth);
let y = Math.floor(Math.random() * window.innerHeight);
let duration = Math.random() * 10;
let size = Math.random() * 2;
star.style.left = x+'px';
star.style.top = y+'px';
star.style.width = 1+size+'px';
star.style.height = 1+size+'px';
star.style.animationDuration = 10+duration+'s';
star.style.animationDelay = duration+'s';
scene.appendChild(star);
w++
}
}
stars();
function spotify() {
let playerSpotify = document.getElementById("iframe"),
playerhtml = document.querySelector(".player"),
check = document.getElementById("checkbox");
if (check.checked == false) {
playerSpotify.style.visibility = "visible";
playerSpotify.style.width = "60%"
playerSpotify.src = "https://open.spotify.com/embed/playlist/35xI4hSJ8MdO1xkXwsd56a"
playerhtml.style.display = "none";
playerhtml.pause();
} else {
playerSpotify.style.visibility ="hidden";
playerSpotify.style.width = "0";
playerSpotify.src = "";
playerhtml.style.display = "flex";
}
}