From 8f029d7df21d9b43ac1d3555232a6c16925f4920 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Fri, 25 Oct 2024 17:05:24 +0200 Subject: [PATCH] Make globe bigger on phases 1 and 2 --- src/components/globe-map/controls.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/globe-map/controls.tsx b/src/components/globe-map/controls.tsx index 59d6328..45fdc87 100644 --- a/src/components/globe-map/controls.tsx +++ b/src/components/globe-map/controls.tsx @@ -24,12 +24,18 @@ export const Controls = ({ marker, active = false, enabled = false, groupRef, re const resetPosition = () => { groupRef.current.rotation.y = 0; - cameraControlsRef.current.setPosition(0, 1, 4.9, true); - cameraControlsRef.current.setTarget(0, 0, 0, true); + if (globePhase < 2) { + cameraControlsRef.current.setPosition(0, 1, 2.5, true); + cameraControlsRef.current.setTarget(0, 0.3, 0, true); + } else { + cameraControlsRef.current.setPosition(0, 1, 4, true); + cameraControlsRef.current.setTarget(0, 0, 0, true); + } }; + useEffect(() => { - if (globePhase === 0) { + if (globePhase === 0 || globePhase === 1) { resetPosition(); } }, [globePhase]);