about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--html/broughlike/index.html11
1 files changed, 10 insertions, 1 deletions
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';
         }