Initial Commit
This commit is contained in:
parent
bdbb15e52e
commit
c20d262f7c
26 changed files with 1006 additions and 0 deletions
11
static/js/progress.js
Normal file
11
static/js/progress.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
var h = document.documentElement,
|
||||
b = document.body,
|
||||
st = 'scrollTop',
|
||||
sh = 'scrollHeight',
|
||||
progress = document.querySelector('.progress'),
|
||||
scroll;
|
||||
|
||||
document.addEventListener('scroll', function() {
|
||||
scroll = (h[st]||b[st]) / ((h[sh]||b[sh]) - h.clientHeight) * 100;
|
||||
progress.style.setProperty('--scroll', scroll + '%');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue