First commit
Some checks failed
Blowfish Docs Deploy / build (push) Has been cancelled
Blowfish Docs Deploy / deploy (push) Has been cancelled
Test Build / Build Example Site (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Update Hugo version / updateBlowfish (push) Has been cancelled
Some checks failed
Blowfish Docs Deploy / build (push) Has been cancelled
Blowfish Docs Deploy / deploy (push) Has been cancelled
Test Build / Build Example Site (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Update Hugo version / updateBlowfish (push) Has been cancelled
Delete exampleSite Add initial content, images & docker-compose.yml Use extend-head.html for analytics Set remote url to gitea.novicelab.io Remove original .git due to "shallow update not allowed" error
This commit is contained in:
13
assets/js/scroll-to-top.js
Normal file
13
assets/js/scroll-to-top.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function scrollToTop() {
|
||||
const scrollToTop = document.getElementById("scroll-to-top");
|
||||
if (window.scrollY > window.innerHeight * 0.5) {
|
||||
scrollToTop.classList.remove("translate-y-4", "opacity-0");
|
||||
scrollToTop.classList.add("translate-y-0", "opacity-100");
|
||||
} else {
|
||||
scrollToTop.classList.remove("translate-y-0", "opacity-100");
|
||||
scrollToTop.classList.add("translate-y-4", "opacity-0");
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("scroll", scrollToTop);
|
||||
window.addEventListener("load", scrollToTop);
|
||||
Reference in New Issue
Block a user