-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const loadingPrompts = [ | ||
"Detecting neutrinos", | ||
"Forming event horizons", | ||
"Annihilating particles", | ||
"Tunneling electrons", | ||
"Entangling photons", | ||
"Collapsing wavefunctions", | ||
"Quantising gravity", | ||
"Evaporating black holes", | ||
"Increasing entropy", | ||
]; | ||
|
||
const loadingTextInterval = setInterval(() => { | ||
const index = Math.floor(Math.random() * loadingPrompts.length); | ||
const loadText = document.getElementById("loader-text") as HTMLDivElement; | ||
loadText.textContent = `${loadingPrompts[index]}...`; | ||
}, 2000); | ||
|
||
export const onLoaded = () => { | ||
clearInterval(loadingTextInterval); | ||
const loadText = document.getElementById("loader-text") as HTMLDivElement; | ||
loadText.textContent = "Click to continue..."; | ||
|
||
const loadIcon = document.getElementById("loader-circle") as HTMLDivElement; | ||
const svg = loadIcon.children[0] as HTMLElement; | ||
svg.style.animation = "none"; | ||
|
||
const loadContainer = document.getElementById("loading") as HTMLDivElement; | ||
loadContainer.style.cursor = "pointer"; | ||
|
||
loadContainer.addEventListener("click", () => { | ||
loadContainer.style.display = "none"; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters