Starting to implement starting animation.
This commit is contained in:
parent
91028666f5
commit
084da8ba67
|
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
14
index.html
14
index.html
|
|
@ -1,11 +1,15 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>
|
<title>Compteur Electrique</title>
|
||||||
Compteur Electrique
|
<meta charset="utf-8">
|
||||||
</title>
|
<script type="text/javascript" src="scripts/session_startup_animation.js"></script>
|
||||||
</head>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
Cogito ergo sum
|
|
||||||
René Descartes
|
|
||||||
|
|
||||||
74ls181
|
|
||||||
Texas Instruments
|
|
||||||
|
|
||||||
Reaper
|
|
||||||
Cockos
|
|
||||||
|
|
||||||
Nausicaä
|
|
||||||
Ghibli
|
|
||||||
|
|
||||||
C
|
|
||||||
Dennis Ritchie
|
|
||||||
|
|
||||||
Pico
|
|
||||||
Raspberry Pi
|
|
||||||
Loading…
Reference in New Issue