mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-21 18:11:37 +01:00
make the progress bar disappear near the bottom
This commit is contained in:
parent
13876beb0a
commit
56560e3a03
@ -116,8 +116,9 @@ function progressBar() {
|
|||||||
var bar = document.getElementById("progressBar");
|
var bar = document.getElementById("progressBar");
|
||||||
|
|
||||||
document.addEventListener('scroll', () => {
|
document.addEventListener('scroll', () => {
|
||||||
var scrollPercent = document.documentElement.scrollTop / (document.documentElement.scrollHeight - window.innerHeight) * 100 + '%';
|
var scrollPercent = document.documentElement.scrollTop / (document.documentElement.scrollHeight - window.innerHeight) * 100;
|
||||||
bar.style.setProperty("--scrollAmount", scrollPercent);
|
if (scrollPercent >= 99) { scrollPercent = 0 };
|
||||||
|
bar.style.setProperty("--scrollAmount", scrollPercent + '%');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user