-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
30 lines (28 loc) · 1.03 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
document.addEventListener('scroll', (event) => {
let scrollTop = document.documentElement["scrollTop"] || document.body["scrollTop"];
let scrollBottom = (document.documentElement["scrollHeight"] || document.body["scrollHeight"]) - document.documentElement.clientHeight;
let scrollPercent = scrollTop / scrollBottom * 100 + "%";
document
.querySelector('#progress-bar')
.style.width = scrollPercent;
},
{ passive: true }
);
const discovers = document.querySelectorAll(".discoverbtn");
discovers.forEach((discover) => {
discover.addEventListener('click', (event) => {
const animfadins = document.querySelectorAll(".animfadin");
animfadins.forEach((animfadin) => {
animfadin.classList.add('animated');
animfadin.classList.add('fadeInUp');
setTimeout(function(){
animfadin.classList.remove('animated');
animfadin.classList.remove('fadeInUp');
},3000);
});
// event.preventDefault;
// // console.log(event);
// const hash = this.hash;
// console.log(hash);
});
});