aligned eerything to be pixel-perfect

This commit is contained in:
8BitBiscotti
2024-12-12 09:38:33 +01:00
parent dc61e02c60
commit 7eede71229
10 changed files with 84 additions and 37 deletions
+31 -26
View File
@@ -1,9 +1,35 @@
let isLoading = true
let loadingScreenEl = document.createElement("div")
loadingScreenEl.className = "bgDiv"
let loadingImg = `<img class="loadingImg" draggable="false" src="/assets/byteDiceBlinkAnim_32x32.png">`
let closeText = `
<button class="loadingCornerText pxFont" onclick="stopShowingLoading()">
Press ESC to instantly close theloading screen<br>Click me to never see it again.
</button>
`
let tips = [
"Just don't die.",
"Did you know this is a tip?",
"Is thisn't not very un-understandable?",
"m".repeat(200),
"Bad at a game? Just press the \"get good at games\" button!"
]
let loadingText = `<p class="loadingText">Loading...<br>Tip: ${tips[randomIntFrom0(tips.length)]}</p>`
loadingScreenEl.innerHTML = loadingImg + closeText + loadingText
const showLoading = localStorage["showLoading"] || "true"
document.addEventListener("DOMContentLoaded", function() {
if (showLoading != "true") { return }
document.body.appendChild(loadingScreenEl)
const loadDur = randomFloat(3, 6) * 1000
const loadDur = randomFloat(3000, 6000)
setTimeout(function() {
removeLoadingScreen()
@@ -11,7 +37,10 @@ document.addEventListener("DOMContentLoaded", function() {
}, false)
function removeLoadingScreen() {
function removeLoadingScreen() {
if (!isLoading) { return }
isLoading = false
const fadeOutDur = 0.5
loadingScreenEl.style.animation = `fade-out ${fadeOutDur}s forwards`
@@ -32,27 +61,3 @@ document.addEventListener("keydown", function(event) {
removeLoadingScreen()
}
})
let loadingScreenEl = document.createElement("div")
loadingScreenEl.className = "bgDiv"
let loadingImg = `<img class="loadingImg" draggable="false" src="/assets/byteDiceBlinkAnim_32x32.png">`
let closeText = `
<button class="loadingCornerText pxFont" onclick="stopShowingLoading()">
Press ESC to instantly close theloading screen<br>Click me to never see it again.
</button>
`
let tips = [
"Just don't die.",
"This is a tip.",
"Is thisn't not very un-understandable?"
]
let loadingText = `<p class="loadingText">Loading...<br>Tip: ${tips[randomIntFrom0(tips.length)]}</p>`
loadingScreenEl.innerHTML = loadingImg + closeText + loadingText
const showLoading = localStorage["showLoading"] || true