Removed page blinking at loading and fixed sound possible issue
This commit is contained in:
parent
ae3aabbd27
commit
cec3213d36
|
|
@ -10,7 +10,7 @@
|
||||||
<link rel="stylesheet" href="styles/session_startup_animation.css">
|
<link rel="stylesheet" href="styles/session_startup_animation.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body style="opacity: 0">
|
||||||
<p>Nothin' to see for the moment,</p>
|
<p>Nothin' to see for the moment,</p>
|
||||||
<p>Please go outside, sing to the ant.</p>
|
<p>Please go outside, sing to the ant.</p>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ async function sessionStartupAnimation()
|
||||||
document.body.removeChild(author_elem);
|
document.body.removeChild(author_elem);
|
||||||
document.body.removeChild(text_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);
|
all_default_elements.forEach((elem) => elem.style.opacity = 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,7 +81,10 @@ function interruptStartingAnimation()
|
||||||
let text_elem = document.body.querySelector(".startup-animation-text");
|
let text_elem = document.body.querySelector(".startup-animation-text");
|
||||||
text_elem.getAnimations().forEach((animation) => animation.finish());
|
text_elem.getAnimations().forEach((animation) => animation.finish());
|
||||||
|
|
||||||
|
if(sound.currentTime < 2.75)
|
||||||
|
{
|
||||||
sound.currentTime = 2.75;
|
sound.currentTime = 2.75;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onkeydown = () => {
|
window.onkeydown = () => {
|
||||||
|
|
@ -89,7 +92,10 @@ window.onkeydown = () => {
|
||||||
window.onkeydown = null;
|
window.onkeydown = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only start animation per session
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
|
document.body.style.opacity = 1;
|
||||||
|
|
||||||
if(!sessionStorage.getItem("hasExecutedSessionStartupAnimation"))
|
if(!sessionStorage.getItem("hasExecutedSessionStartupAnimation"))
|
||||||
{
|
{
|
||||||
sessionStorage.setItem("hasExecutedSessionStartupAnimation", "true");
|
sessionStorage.setItem("hasExecutedSessionStartupAnimation", "true");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue