-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
73 lines (60 loc) · 2.08 KB
/
script.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
let finished = true;
let target = null;
let downloadLink = document.querySelector("article a");
function scroll(e){
if (!finished) {
target.focus();
return;
}
finished = false;
let video = document.querySelector('iframe.pillars');
let peepoSpot = document.querySelector('.peepoSpot');
let progress = 0;
let peepoProgress = 0;
let id = setInterval(scrollDown, 20);
target = e.target;
if (target.value.includes("Pablo")){
video = document.querySelector('iframe.deadbolt');
downloadLink.href = "files/deadbolt.exe";
downloadLink.children[0].style.display = "block";
}
else if (target.value.includes("Melcher")){
video = document.querySelector('iframe.papers');
downloadLink.href = "files/papersplease.msi";
downloadLink.children[0].style.display = "block";
}
else{
downloadLink.href = "files/pillars.tar.gz";
downloadLink.children[0].style.display = "block";
}
console.log(downloadLink.children[0].style);
if (video == peepoSpot){
video = document.querySelector('#peepo');
downloadLink.children[0].style.display = "none";
}
video.style.display = 'inline-block';
function scrollDown(){
if (peepoSpot.style.bottom === '-100%'){
peepoSpot.classList.remove("peepoSpot");
video.classList.add("peepoSpot");
finished = true;
clearInterval(id);
}else if (peepoSpot.style.bottom === '-32%' && progress <100 && peepoSpot.id === "peepo"){
video.style.bottom = (100-progress) + '%';
progress +=2;
}else if(progress>100){
peepoSpot.style.bottom = -peepoProgress + '%';
peepoProgress +=2;
}
else{
video.style.bottom = (100-progress) + '%';
peepoSpot.style.bottom = -peepoProgress + '%';
progress +=2;
peepoProgress +=2;
}
}
}
const button = document.querySelectorAll('.menu li button');
button.forEach((b)=> {
b.addEventListener('click', scroll);
});