removed top-left text if fake loading screen is disabled

This commit is contained in:
2025-01-23 17:58:05 +01:00
parent 6def14d791
commit ad49d8d8c6
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ document.addEventListener("DOMContentLoaded", async function() {
pauseAnimBtn(localStorage["isAnimating"] || "true") pauseAnimBtn(localStorage["isAnimating"] || "true")
debugPrint("isAnimating", isAnimating) debugPrint("isAnimating", isAnimating)
if (showLoading != "true") { if (fakeLoading != "true") {
removeLoadingScreen(true) removeLoadingScreen(true)
} }
else { else {
+9 -3
View File
@@ -29,7 +29,7 @@ async function loadTips() {
} }
const showLoading = localStorage["showLoading"] || "true" const fakeLoading = localStorage["fakeLoading"] || "true"
let selectedTip = "undefined" let selectedTip = "undefined"
@@ -57,6 +57,11 @@ function setLoadingProgress(newText) {
function startLoadingScreen() { function startLoadingScreen() {
loadingScreenProgress.innerHTML = `Loading...<br><br>Tip: ${selectedTip}` loadingScreenProgress.innerHTML = `Loading...<br><br>Tip: ${selectedTip}`
if (fakeLoading != "true") {
let cText = document.getElementById("loadingCornerText")
if (cText) { cText.remove() }
}
const loadDur = randomFloat(2000, 4000) const loadDur = randomFloat(2000, 4000)
debugPrint("loadDur initial", loadDur) debugPrint("loadDur initial", loadDur)
@@ -81,7 +86,8 @@ function removeLoadingScreen(rmCornerText = false) {
setTimeout(function() { setTimeout(function() {
loadingScreenEl.style.left = "100vw" loadingScreenEl.style.left = "100vw"
if (rmCornerText) { if (rmCornerText) {
document.getElementById("loadingCornerText").remove() let cText = document.getElementById("loadingCornerText")
if (cText) { cText.remove() }
} }
newTip() newTip()
}, fadeOutDur * 1000) }, fadeOutDur * 1000)
@@ -90,7 +96,7 @@ function removeLoadingScreen(rmCornerText = false) {
function stopShowingLoading() { function stopShowingLoading() {
localStorage["showLoading"] = false localStorage["fakeLoading"] = false
} }