ai generated solutions to our ai generated problems

This commit is contained in:
2026-06-20 01:12:56 +01:00
parent d1731c24c2
commit 6f8c8800ec
2 changed files with 21 additions and 6 deletions
+3
View File
@@ -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 () => {