fix: canvases

This commit is contained in:
TrèsAbhi committed 2025-09-27 17:51:29 -05:00
1 parent 7b728596ca
commit 766801826c
7 files changed
+31 -17

No files matched your search

@@ -18,6 +18,10 @@ import { pwaInfo } from "virtual:pwa-info";
onOfflineReady() {
console.log("PWA offline ready");
},
onNeedRefresh() {
document.documentElement.classList.add("pwa-refresh");
},
});
pwaInstallHandler.addListener((canInstall) => {
@@ -5,6 +5,7 @@ import { useRef, useState } from "react";
import { Color, SpotLight, SpotLightHelper } from "three";
import { degToRad } from "three/src/math/MathUtils.js";
import { isHalloween } from "../../../../../../core/blitzkit/isHalloween";
import { Tankopedia } from "../../../../../../stores/tankopedia";
import { HelpingSpotLight } from "../../../../../HelpingSpotLight";
const LIGHTS_COUNT = 5;
@@ -18,6 +19,7 @@ const TARGET_FRAME_RATE = 30;
export function Lighting() {
const [cast, setCast] = useState(true);
const revealed = Tankopedia.use((state) => state.revealed);
const topLight = useRef<SpotLight>(null!);
const frontLight = useRef<SpotLight>(null!);
@@ -29,7 +31,7 @@ export function Lighting() {
const samples = useRef<number[]>([]);
useFrame(({ clock }) => {
if (!cast) return;
if (!cast || !revealed) return;
const dt = clock.elapsedTime - last.current;
last.current = clock.elapsedTime;
@@ -140,7 +140,9 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
}}
>
<Suspense>
<TankSandbox ref={canvas} thicknessRange={thicknessRange} />
{!skeleton && (
<TankSandbox ref={canvas} thicknessRange={thicknessRange} />
)}
</Suspense>
</Box>
</Box>