-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
24 lines (19 loc) · 838 Bytes
/
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
document.addEventListener('DOMContentLoaded', () => {
ScrollReveal().reveal('.show', { enter: 'right',
wait: '1s',
move: '20px' });
ScrollReveal().reveal('.show1', { enter: 'right',
wait: '0.8s',
move: '20px' });
// Progress bar
let processScroll = () => {
let docElem = document.documentElement,
docBody = document.body,
scrollTop = docElem['scrollTop'] || docBody['scrollTop'],
scrollBottom = (docElem['scrollHeight'] || docBody['scrollHeight']) - window.innerHeight,
scrollPercent = scrollTop / scrollBottom * 100 + '%';
//console.log(scrollTop + ' / ' + scrollBottom + ' / ' + scrollPercent);
document.getElementById("progress-bar").style.setProperty("--scrollAmount", scrollPercent);
}
document.addEventListener('scroll', processScroll);
});