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(); } }