mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 06:01:56 -07:00
feat: retire data-animations from index.html, login.html, and base_dashboard.html
This commit is contained in:
+1
-23
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user