generated

This commit is contained in:
forgejo-actions 2024-01-08 16:15:11 +00:00
parent 818c0d8f09
commit 1691df4e77
2 changed files with 13 additions and 9 deletions

View file

@ -1,12 +1,16 @@
window.addEventListener("scroll", () => { window.onload = (event) => {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop; if ((document.documentElement.scrollHeight / window.screen.availHeight ) > 1.5) {
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; window.addEventListener("scroll", () => {
var scrolled = (winScroll / height) * 100; var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
document.getElementById('progress').style.width = scrolled + "%"; var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById('progress').style.width = scrolled + "%";
const toTop = document.getElementById('totop'); const toTop = document.getElementById('totop');
if ((window.scrollY > 0 && !toTop.classList.contains("show")) || (window.scrollY <= 0 && toTop.classList.contains("show"))) { if ((window.scrollY > 0 && !toTop.classList.contains("show")) || (window.scrollY <= 0 && toTop.classList.contains("show"))) {
toTop.classList.toggle("show"); toTop.classList.toggle("show");
}
});
} }
}); }

Binary file not shown.