diff --git a/files/startup_quotes.json b/files/startup_quotes.json new file mode 100644 index 0000000..0010159 --- /dev/null +++ b/files/startup_quotes.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/index.html b/index.html index db9680b..0bfbd99 100644 --- a/index.html +++ b/index.html @@ -1,11 +1,15 @@ - - Compteur Electrique - + Compteur Electrique + + - + + +

Please go outside, sing to the ant.

- \ No newline at end of file + diff --git a/scripts/session_startup_animation.js b/scripts/session_startup_animation.js new file mode 100644 index 0000000..044b0a8 --- /dev/null +++ b/scripts/session_startup_animation.js @@ -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(); + } +} diff --git a/startup_quotes.txt b/startup_quotes.txt deleted file mode 100644 index 6dbd3a0..0000000 --- a/startup_quotes.txt +++ /dev/null @@ -1,17 +0,0 @@ -Cogito ergo sum -René Descartes - -74ls181 -Texas Instruments - -Reaper -Cockos - -Nausicaä -Ghibli - -C -Dennis Ritchie - -Pico -Raspberry Pi \ No newline at end of file