From 84d5cfc2fc58973060e9893e1aff4175ca41eba4 Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 25 Oct 2024 22:23:28 -0400 Subject: * --- html/broughlike/index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'html/broughlike') diff --git a/html/broughlike/index.html b/html/broughlike/index.html index cebc5cf..0a732c5 100644 --- a/html/broughlike/index.html +++ b/html/broughlike/index.html @@ -472,9 +472,18 @@ return []; } - let combatAnimationEnabled = true; + let combatAnimationEnabled = localStorage.getItem('combatAnimationEnabled'); + if (combatAnimationEnabled === null) { + combatAnimationEnabled = true; // default to on...is that a good idea? + localStorage.setItem('combatAnimationEnabled', combatAnimationEnabled); + } else { + combatAnimationEnabled = combatAnimationEnabled === 'true'; + } + document.getElementById('toggleShake').textContent = combatAnimationEnabled ? 'Turn Shake Off' : 'Turn Shake On'; + function toggleShake() { combatAnimationEnabled = !combatAnimationEnabled; + localStorage.setItem('combatAnimationEnabled', combatAnimationEnabled); document.getElementById('toggleShake').textContent = combatAnimationEnabled ? 'Turn Shake Off' : 'Turn Shake On'; } -- cgit 1.4.1-2-gfad0