Skip to content

Commit fdb6f2c

Browse files
committed
fixed ui not zooming out
1 parent 6407073 commit fdb6f2c

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99
}
1010

11-
animation: var(--animate-bounce); /* bounce 1s infinite */
11+
/*animation: var(--animate-bounce);*/ /* bounce 1s infinite */
1212

1313
@keyframes bounce {
1414
0%, 100% {

src/pages/home/Home.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export default function Home() {
1616
setIsVisible(true);
1717
};
1818

19+
const handleClose = () => {
20+
setIsVisible(false);
21+
zoomOutRef.current?.();
22+
};
23+
1924
useEffect(() => {
2025
if (!canvasRef.current) return;
2126
const { zoomOut } = main(canvasRef.current, handleOpen);
@@ -36,7 +41,7 @@ export default function Home() {
3641
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[90vw] h-[90vh] z-50">
3742
<LevelComponent
3843
key={mountKey}
39-
onClose={() => setIsVisible(false)}
44+
onClose={() => handleClose()}
4045
lvl={lvlNum}
4146
/>
4247
</div>

src/pages/home/solarsystem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export function main(canvas, onPlanetFocus) {
132132
// Zoom out — resets focus and starts the camera tween back to the initial position.
133133
// Called both by canvas clicks on empty space and externally (e.g. the ✕ button).
134134
function zoomOut() {
135+
console.log("Hi");
135136
focusedPlanet = null;
136137
paused = false;
137138
tweening = true;

0 commit comments

Comments
 (0)