Aggiunto gitignore, inserite ottimizzazioni grafiche e piccole funzioni extra

This commit is contained in:
2025-10-08 21:41:40 +02:00
parent 23ddc667fe
commit ee7ac0e9f9
7 changed files with 386 additions and 32 deletions

View File

@@ -8,4 +8,35 @@ function scrollHeader() {
}
window.addEventListener("scroll", scrollHeader);
window.addEventListener("load", scrollHeader);
window.addEventListener("load", scrollHeader);
function scrollToTop() {
const b = document.getElementById("totop");
if (window.scrollY > 100) {
b.classList.add("active");
} else {
b.classList.remove("active");
}
}
window.addEventListener("scroll", scrollToTop);
window.addEventListener("load", scrollToTop);
document.getElementById("totop").addEventListener("click", () => {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
})
function preloader() {
const l = document.getElementById("loader");
setTimeout(() => {
l.classList.add("ready");
}, 1500);
}
window.addEventListener("load", preloader);
setTimeout(() => {
const l = document.getElementById("loader");
l.classList.add("ready");
}, 10000);