Fix preloader overlay not being removed

This commit is contained in:
Ethan Paul 2021-01-31 19:50:11 -05:00
parent b7e6a9c585
commit 5514197ce4
No known key found for this signature in database
GPG Key ID: C5F5542B54A4D9C6
1 changed files with 6 additions and 1 deletions

View File

@ -95,6 +95,11 @@ window.addEventListener("DOMContentLoaded", function () {
});
window.addEventListener("load", function () {
window.addEventListener("load", async function () {
document.getElementById("preloader").classList.add("fadeout");
// I don't actually know how promises or async works
// ¯\_(ツ)_/¯
// https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep
await new Promise(r => setTimeout(r, 250))
document.getElementById("preloader").style.display = "none";
});