diff --git a/assets/js/papermod.js b/assets/js/papermod.js index 13437a82..f25f1e46 100644 --- a/assets/js/papermod.js +++ b/assets/js/papermod.js @@ -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 + '%'); }) }