mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-12-22 09:05:07 +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");
|
||||
|
||||
document.addEventListener('scroll', () => {
|
||||
var scrollPercent = document.documentElement.scrollTop / (document.documentElement.scrollHeight - window.innerHeight) * 100 + '%';
|
||||
bar.style.setProperty("--scrollAmount", scrollPercent);
|
||||
var scrollPercent = document.documentElement.scrollTop / (document.documentElement.scrollHeight - window.innerHeight) * 100;
|
||||
if (scrollPercent >= 99) { scrollPercent = 0 };
|
||||
bar.style.setProperty("--scrollAmount", scrollPercent + '%');
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user