random loading messages!
This commit is contained in:
parent
74a13cb80b
commit
ed4c221f95
3 changed files with 33 additions and 5 deletions
|
|
@ -9,6 +9,7 @@ window.addEventListener("load", () => {
|
|||
document.body.appendChild(skipNode);
|
||||
});
|
||||
|
||||
// skip animations and shit
|
||||
function skipAnimation() {
|
||||
for (let node of document.getElementsByClassName("skip")) {
|
||||
const animations = node.getAnimations();
|
||||
|
|
@ -23,4 +24,19 @@ function skipAnimation() {
|
|||
}
|
||||
}
|
||||
document.getElementsByClassName("skip-animation")[0].remove();
|
||||
}
|
||||
}
|
||||
|
||||
// this randomizes the loading messages
|
||||
function Load (text) {
|
||||
const loadArray = text.split("\n")
|
||||
const loading = document.getElementsByClassName("loading")[0]
|
||||
|
||||
const r = Math.floor(Math.random() * loadArray.length)
|
||||
const loadText = loadArray[r]
|
||||
|
||||
loading.innerHTML = `<p class="skip">${loadText}.</p><p class="skip">${loadText}..</p><p class="skip">${loadText}...</p>`
|
||||
}
|
||||
|
||||
fetch("/assets/loading.txt")
|
||||
.then(r => r.text())
|
||||
.then(t => Load(t))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue