animations are now skippable yay

This commit is contained in:
Luna 2025-11-14 22:16:40 -03:00
parent 08d04f2667
commit 556e471281
3 changed files with 44 additions and 7 deletions

26
assets/main.js Normal file
View file

@ -0,0 +1,26 @@
let stylesheet
window.addEventListener("load", () => {
stylesheet = document.styleSheets[0];
let skipNode = document.createElement("div");
skipNode.setAttribute("class", "skip-animation");
skipNode.setAttribute("onclick", "skipAnimation()");
document.body.appendChild(skipNode);
});
function skipAnimation() {
for (let node of document.getElementsByClassName("skip")) {
const animations = node.getAnimations();
for (let anim of animations) {
anim.finish();
}
}
for (let node of document.getElementsByClassName("splash")) {
const animations = node.getAnimations();
for (let anim of animations) {
anim.finish();
}
}
document.getElementsByClassName("skip-animation")[0].remove();
}