resent-1.8/javascript/asdf.txt

28 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-02-20 08:44:30 -08:00
var launchInterval = -1;
var launchCounter = 1;
var launchCountdownNumberElement = null;
var launchCountdownProgressElement = null;
function launchTick() {
launchCountdownNumberElement.innerText = "" + Math.floor(6.0 - launchCounter * 0.06);
launchCountdownProgressElement.style.width = "" + launchCounter + "%";
if(++launchCounter > 100) {
clearInterval(launchInterval);
setTimeout(() => { document.getElementById("launch_countdown_screen").remove(); main(); }, 50);
}
}
window.addEventListener("load", () => {
launchCountdownNumberElement = document.getElementById("launchCountdownNumber");
launchCountdownProgressElement = document.getElementById("launchCountdownProgress");
launchInterval = setInterval(launchTick, 50);
});
<div style="margin:0px;width:100%;height:100%;font-family:sans-serif;display:flex;align-items:center;user-select:none;" id="launch_countdown_screen">
<div style="margin:auto;text-align:center;">
<h1>This file is from <span style="color:#AA0000;">${date}</span></h1>
<h2>Game will launch in <span id="launchCountdownNumber">5</span>...</h2>
<div style="border:2px solid black;width:100%;height:15px;padding:1px;margin-bottom:20vh;"><div id="launchCountdownProgress" style="background-color:#555555;width:0%;height:100%;"></div></div>
</div>
</div>