feat: retire data-animations from index.html, login.html, and base_dashboard.html

This commit is contained in:
James Smith
2026-05-19 22:25:38 +01:00
parent 2b25d5cbad
commit cafc2554de
3 changed files with 4 additions and 35 deletions
+1 -23
View File
@@ -11990,34 +11990,12 @@
}).catch(err => console.warn('Failed to save theme to server:', err));
}
// Animation toggle functions
function toggleAnimations() {
const html = document.documentElement;
const currentState = html.getAttribute('data-animations');
const newState = currentState === 'off' ? 'on' : 'off';
if (newState === 'on') {
html.removeAttribute('data-animations');
} else {
html.setAttribute('data-animations', newState);
}
// Save to localStorage for persistence
localStorage.setItem('intercept-animations', newState);
}
// Load saved theme and animations on page load
// Load saved theme on page load
(function () {
// First apply localStorage theme for instant load (no flash)
const localTheme = localStorage.getItem('intercept-theme') || 'dark';
document.documentElement.setAttribute('data-theme', localTheme);
// Apply animations preference
const localAnimations = localStorage.getItem('intercept-animations');
if (localAnimations === 'off') {
document.documentElement.setAttribute('data-animations', 'off');
}
// Then fetch from server to sync (in case changed on another device)
fetch('/settings/theme')
.then(r => r.json())
-7
View File
@@ -74,13 +74,6 @@
100% { top: 100%; }
}
/* Animations toggle */
[data-animations="off"] .scanline,
[data-animations="off"] .radar-bg,
[data-animations="off"] .grid-bg {
display: none;
}
/* Dashboard main content */
.dashboard-content {
flex: 1;
+3 -5
View File
@@ -2,12 +2,10 @@
<html lang="en">
<head>
<script>
// Apply animations preference immediately to prevent flash
// Apply UI tier immediately to prevent flash
(function() {
var animations = localStorage.getItem('intercept-animations');
if (animations === 'off') {
document.documentElement.setAttribute('data-animations', 'off');
}
var tier = localStorage.getItem('intercept-ui-tier') || 'enhanced';
document.documentElement.setAttribute('data-ui-tier', tier);
})();
</script>
<meta charset="UTF-8" />