From cec3213d36ff6ee54fa7e636ba2638ec35246d59 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Sun, 8 Mar 2026 14:04:47 +0100 Subject: [PATCH] Removed page blinking at loading and fixed sound possible issue --- index.html | 2 +- scripts/session_startup_animation.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8f9b0cf..5148ed8 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - +

Nothin' to see for the moment,

Please go outside, sing to the ant.

diff --git a/scripts/session_startup_animation.js b/scripts/session_startup_animation.js index 360a593..fd55dcc 100644 --- a/scripts/session_startup_animation.js +++ b/scripts/session_startup_animation.js @@ -69,7 +69,7 @@ async function sessionStartupAnimation() document.body.removeChild(author_elem); document.body.removeChild(text_elem); - all_default_elements.forEach((elem) => elem.style.animation = "opacity-fade-in 0.2s"); + all_default_elements.forEach((elem) => elem.style.animation = "opacity-fade-in 0.5s"); all_default_elements.forEach((elem) => elem.style.opacity = 1); } @@ -81,7 +81,10 @@ function interruptStartingAnimation() let text_elem = document.body.querySelector(".startup-animation-text"); text_elem.getAnimations().forEach((animation) => animation.finish()); - sound.currentTime = 2.75; + if(sound.currentTime < 2.75) + { + sound.currentTime = 2.75; + } } window.onkeydown = () => { @@ -89,7 +92,10 @@ window.onkeydown = () => { window.onkeydown = null; } +// Only start animation per session window.onload = () => { + document.body.style.opacity = 1; + if(!sessionStorage.getItem("hasExecutedSessionStartupAnimation")) { sessionStorage.setItem("hasExecutedSessionStartupAnimation", "true");