Compare commits
3 Commits
052d0e502a
...
ae3aabbd27
| Author | SHA1 | Date |
|---|---|---|
|
|
ae3aabbd27 | |
|
|
fd9d19d275 | |
|
|
d8aef442a4 |
|
|
@ -5,8 +5,6 @@
|
||||||
<title>Compteur Electrique</title>
|
<title>Compteur Electrique</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="styles/general.css">
|
<link rel="stylesheet" href="styles/general.css">
|
||||||
<link rel="stylesheet" href="fonts/FuturaBold/FuturaBold.css">
|
|
||||||
<link rel="stylesheet" href="fonts/FuturaBoldItalic/FuturaBoldItalic.css">
|
|
||||||
|
|
||||||
<script type="text/javascript" src="scripts/session_startup_animation.js"></script>
|
<script type="text/javascript" src="scripts/session_startup_animation.js"></script>
|
||||||
<link rel="stylesheet" href="styles/session_startup_animation.css">
|
<link rel="stylesheet" href="styles/session_startup_animation.css">
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,13 @@ function waitForAnimationEnd(elem, animationName)
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elem.onanimationend = handleAnimationEnd;
|
elem.onanimationend = handleAnimationEnd;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let sound = new Audio("../assets/game-boy-advance-startup-sound.mp3");
|
||||||
|
|
||||||
async function sessionStartupAnimation()
|
async function sessionStartupAnimation()
|
||||||
{
|
{
|
||||||
// Page setup
|
// Page setup
|
||||||
|
|
@ -48,11 +51,10 @@ async function sessionStartupAnimation()
|
||||||
text_elem.className = "startup-animation-text";
|
text_elem.className = "startup-animation-text";
|
||||||
text_elem.innerHTML = quote.text;
|
text_elem.innerHTML = quote.text;
|
||||||
|
|
||||||
let sound = new Audio("../assets/game-boy-advance-startup-sound.mp3");
|
|
||||||
sound.play();
|
|
||||||
|
|
||||||
document.body.appendChild(text_elem);
|
document.body.appendChild(text_elem);
|
||||||
|
|
||||||
|
sound.play();
|
||||||
|
|
||||||
await waitForAnimationEnd(text_elem, "text-animation");
|
await waitForAnimationEnd(text_elem, "text-animation");
|
||||||
|
|
||||||
// Fade out for both
|
// Fade out for both
|
||||||
|
|
@ -73,8 +75,13 @@ async function sessionStartupAnimation()
|
||||||
|
|
||||||
function interruptStartingAnimation()
|
function interruptStartingAnimation()
|
||||||
{
|
{
|
||||||
// Bad but works in this context
|
let author_elem = document.body.querySelector(".startup-animation-author");
|
||||||
window.location.reload();
|
author_elem.getAnimations().forEach((animation) => animation.finish());
|
||||||
|
|
||||||
|
let text_elem = document.body.querySelector(".startup-animation-text");
|
||||||
|
text_elem.getAnimations().forEach((animation) => animation.finish());
|
||||||
|
|
||||||
|
sound.currentTime = 2.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onkeydown = () => {
|
window.onkeydown = () => {
|
||||||
|
|
@ -83,7 +90,7 @@ window.onkeydown = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
//if(!sessionStorage.getItem("hasExecutedSessionStartupAnimation"))
|
if(!sessionStorage.getItem("hasExecutedSessionStartupAnimation"))
|
||||||
{
|
{
|
||||||
sessionStorage.setItem("hasExecutedSessionStartupAnimation", "true");
|
sessionStorage.setItem("hasExecutedSessionStartupAnimation", "true");
|
||||||
sessionStartupAnimation();
|
sessionStartupAnimation();
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
top: 25%;
|
top: 25%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
animation: text-animation 2.5s ease-in-out, opacity-fade-in 1s;
|
animation: text-animation 3s ease-in-out, opacity-fade-in 1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.startup-animation-author {
|
.startup-animation-author {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue