Removed page blinking at loading and fixed sound possible issue
This commit is contained in:
parent
ae3aabbd27
commit
a0b0ca9316
|
|
@ -10,7 +10,7 @@
|
|||
<link rel="stylesheet" href="styles/session_startup_animation.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body style="opacity: 0">
|
||||
<p>Nothin' to see for the moment,</p>
|
||||
<p>Please go outside, sing to the ant.</p>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue