animations are now skippable yay
This commit is contained in:
parent
08d04f2667
commit
556e471281
3 changed files with 44 additions and 7 deletions
26
assets/main.js
Normal file
26
assets/main.js
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue