Basic controls css and autoscroll
All checks were successful
Build / build (push) Successful in 6m42s

This commit is contained in:
2024-02-16 15:31:30 +01:00
parent 0816b0f897
commit 09a4b138d1
3 changed files with 93 additions and 5 deletions

View File

@ -0,0 +1,20 @@
const controls = document.querySelector(".controls");
const song = document.querySelector("iframe.song").contentWindow;
var scroll;
function pageScroll() {
song.scrollBy(0, 1);
scroll = setTimeout(pageScroll, 80);
}
document.querySelector("#autoscroll").addEventListener("click", function() {
if (this.classList.contains("active")) {
clearTimeout(scroll);
} else {
pageScroll();
}
this.classList.toggle("active");
});
// Display the controls on JS-enabled browsers
window.addEventListener("load", () => controls.classList.remove = "hidden");