diff --git a/frontend/index.html b/frontend/index.html
index eefd45b..4c3f6cd 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -6,6 +6,15 @@
+
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 4ccf7be..9ffd2d2 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -2800,6 +2800,7 @@ function PixelMountains() {
const skyRef = useRef(null)
const fadeTimerRef = useRef(null)
const skyTimerRef = useRef(null)
+ const themeSyncedRef = useRef(false)
function drawCanvas(canvas, theme) {
if (!canvas || !theme) return
@@ -2825,6 +2826,7 @@ function PixelMountains() {
const theme = document.documentElement.dataset.theme === 'dark' ? 'dark' : 'light'
setActiveTheme((current) => {
if (theme === current) return current
+ if (!themeSyncedRef.current) return theme
window.clearTimeout(fadeTimerRef.current)
window.clearTimeout(skyTimerRef.current)
setPreviousTheme(current)
@@ -2836,6 +2838,7 @@ function PixelMountains() {
}
syncTheme()
+ themeSyncedRef.current = true
const observer = new MutationObserver(syncTheme)
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] })
return () => {