Starting to implement starting animation.

This commit is contained in:
Ulysse Cura 2026-03-07 22:56:16 +01:00
parent 91028666f5
commit 084da8ba67
4 changed files with 72 additions and 22 deletions

28
files/startup_quotes.json Normal file
View File

@ -0,0 +1,28 @@
{
"quotes": [
{
"text": "Cogito ergo sum",
"author": "René Descartes"
},
{
"text": "74ls181",
"author": "Texas Instruments"
},
{
"text": "Reaper",
"author": "Cockos"
},
{
"text": "Nausicaä",
"author": "Ghibli"
},
{
"text": "C",
"author": "Dennis Ritchie"
},
{
"text": "Pico",
"author": "Raspberry Pi"
}
]
}

View File

@ -1,11 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>
Compteur Electrique
</title>
<title>Compteur Electrique</title>
<meta charset="utf-8">
<script type="text/javascript" src="scripts/session_startup_animation.js"></script>
</head>
<body>
<body style="
opacity: 1;
">
<p id="logo">Nothin' to see for the moment,</p>
<p>Please go outside, sing to the ant.</p>
</body>
</html>

View File

@ -0,0 +1,35 @@
function session_startup_animation()
{
let body = document.querySelector("body");
body.style.opacity = 0;
let quotes = null;
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "files/startup_quotes.json", false);
xmlhttp.send();
if (xmlhttp.status==200) {
quotes = JSON.parse(xmlhttp.responseText)["quotes"];
}
console.log(quotes.length);
}
function interrupt_starting_animation()
{
}
window.onkeydown = () => {
interrupt_starting_animation();
window.onkeydown = null;
}
window.onload = () => {
if(!sessionStorage.getItem("hasExecutedSessionStartupAnimation"))
{
sessionStorage.setItem("hasExecutedSessionStartupAnimation", "true");
session_startup_animation();
}
}

View File

@ -1,17 +0,0 @@
Cogito ergo sum
René Descartes
74ls181
Texas Instruments
Reaper
Cockos
Nausicaä
Ghibli
C
Dennis Ritchie
Pico
Raspberry Pi