From 7a4fa4b312a065172aa58c092c624d15486507f2 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sat, 14 Jun 2025 04:09:18 +0200 Subject: [PATCH] Fix dark mode flash by inlining critical script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move dark mode detection to inline script in HTML head - Prevents white flash in Firefox by applying theme before render - Clean up redundant code in dark-mode.js - Apply fix to all HTML pages for consistent behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- account.html | 6 ++++++ ajax.html | 6 ++++++ dark-mode.js | 8 -------- echo-test.html | 6 ++++++ index.html | 6 ++++++ items.html | 6 ++++++ mining.html | 6 ++++++ random.html | 6 ++++++ 8 files changed, 42 insertions(+), 8 deletions(-) diff --git a/account.html b/account.html index 48724ea..879f7f2 100644 --- a/account.html +++ b/account.html @@ -5,6 +5,12 @@ Account Information + diff --git a/ajax.html b/ajax.html index 3e697f8..05dd0ec 100644 --- a/ajax.html +++ b/ajax.html @@ -5,6 +5,12 @@ AJAX Demo + diff --git a/dark-mode.js b/dark-mode.js index 864291e..3d1a9f5 100644 --- a/dark-mode.js +++ b/dark-mode.js @@ -1,11 +1,3 @@ -// Apply saved theme immediately to prevent flash -(function() { - const savedTheme = localStorage.getItem('theme'); - if (savedTheme === 'dark') { - document.documentElement.setAttribute('data-theme', 'dark'); - } -})(); - // Dark mode toggle functionality function toggleDarkMode() { const html = document.documentElement; diff --git a/echo-test.html b/echo-test.html index 1ad8877..0dd087b 100644 --- a/echo-test.html +++ b/echo-test.html @@ -5,6 +5,12 @@ Echo Test + diff --git a/index.html b/index.html index 138c14d..e95ae7e 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,12 @@ Playground - Feature Showcase + diff --git a/items.html b/items.html index c9227d8..f1c4c03 100644 --- a/items.html +++ b/items.html @@ -5,6 +5,12 @@ Items Management - Test + diff --git a/mining.html b/mining.html index 826bd2a..8e939d9 100644 --- a/mining.html +++ b/mining.html @@ -5,6 +5,12 @@ Mining Resources - Playground + diff --git a/random.html b/random.html index 33427ad..d2e1dee 100644 --- a/random.html +++ b/random.html @@ -5,6 +5,12 @@ Random Number Generator +