diff --git a/game.js b/game.js index d182e35..f4619ce 100644 --- a/game.js +++ b/game.js @@ -38,7 +38,25 @@ let text_verbosity = "verbose"; let autoVerbose = true; -let textFade = false; +const textFadeChoices = { + stays: { + name: "Text Stays", + animation: "none", + next: "dims" + }, + dims: { + name: "Text Dims", + animation: "log-dim 10s linear", + next: "fades" + }, + fades: { + name: "Text Fades", + animation: "log-fade 10s linear", + next: "stays" + } +}; + +let textFade = textFadeChoices["stays"]; let newline = " "; @@ -5333,16 +5351,13 @@ function updatePreview(name) { } function toggleTextFade() { + textFade = textFadeChoices[textFade.next]; + const button = document.querySelector("#button-option-toggleTextFade"); - if (textFade) { - document.querySelectorAll(".log").forEach(log => log.style.setProperty("--fade-animation", "none")); - button.textContent = "Text Stays" - } else { - document.querySelectorAll(".log").forEach(log => log.style.setProperty("--fade-animation", "log-fade 10s linear")); - button.textContent = "Text Fades" - } + button.innerText = textFade.name; + + document.querySelectorAll(".log").forEach(log => log.style.setProperty("--fade-animation", textFade.animation)); - textFade = !textFade; } function debugLog() { diff --git a/stroll.html b/stroll.html index 01a68b3..fb8b063 100644 --- a/stroll.html +++ b/stroll.html @@ -4,6 +4,7 @@