From ec64c1c89e96fa15a030b04bf6bc508b6e791fc0 Mon Sep 17 00:00:00 2001 From: Heidi Date: Sat, 16 May 2026 12:22:20 +0100 Subject: [PATCH] fix --- src/App.jsx | 34 ++++++++++++++++- src/styles.css | 100 +++++++++++++++++-------------------------------- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 157530d..88822f0 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2205,8 +2205,10 @@ function PixelMountains() { ) const [previousTheme, setPreviousTheme] = useState(null) const [skyTransition, setSkyTransition] = useState('') + const [skyPaths, setSkyPaths] = useState({}) const activeCanvasRef = useRef(null) const previousCanvasRef = useRef(null) + const skyRef = useRef(null) const fadeTimerRef = useRef(null) const skyTimerRef = useRef(null) @@ -2254,9 +2256,39 @@ function PixelMountains() { } }, []) + useEffect(() => { + function quadraticPath(start, control, end) { + return `path("M ${start.x.toFixed(1)} ${start.y.toFixed(1)} Q ${control.x.toFixed(1)} ${control.y.toFixed(1)} ${end.x.toFixed(1)} ${end.y.toFixed(1)}")` + } + + function updateSkyPaths() { + const rect = skyRef.current?.getBoundingClientRect() + const width = rect?.width || window.innerWidth || 1920 + const height = rect?.height || window.innerHeight || 900 + const display = { x: width * 0.78, y: height * 0.18 } + const westSet = { x: width * 0.08, y: height * 0.67 } + const eastRise = { x: width * 0.94, y: height * 0.67 } + const westControl = { x: width * 0.46, y: height * -0.05 } + const eastControl = { x: width * 0.98, y: height * -0.03 } + + setSkyPaths({ + '--celestial-exit-path': quadraticPath(display, westControl, westSet), + '--celestial-enter-path': quadraticPath(eastRise, eastControl, display), + }) + } + + updateSkyPaths() + window.addEventListener('resize', updateSkyPaths) + return () => window.removeEventListener('resize', updateSkyPaths) + }, []) + return (