From f10065887de43c02037893b9ee2642ea5cceb0e8 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:24:32 -0500 Subject: [PATCH] black background --- .../src/components/TankopediaSandbox/index.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/website/src/components/TankopediaSandbox/index.tsx b/packages/website/src/components/TankopediaSandbox/index.tsx index c5c54550f..b04433138 100644 --- a/packages/website/src/components/TankopediaSandbox/index.tsx +++ b/packages/website/src/components/TankopediaSandbox/index.tsx @@ -1,3 +1,4 @@ +import type { QuicklimeEvent } from "quicklime"; import { Suspense, useEffect, useRef } from "react"; import { applyPitchYawLimits } from "../../core/blitz/applyPitchYawLimits"; import { modelTransformEvent } from "../../core/blitzkit/modelTransform"; @@ -14,7 +15,7 @@ import { CanvasAutoClear } from "../CanvasAutoClear"; import { CanvasControl } from "../CanvasControl"; import { DynamicArmor } from "../DynamicArmor"; import { InitialCameraAligner } from "../InitialCameraAligner"; -import { Lighting } from "../Lighting"; +import { Lighting, transitionEvent } from "../Lighting"; import { SceneProps } from "../SceneProps"; import { ShotDisplay } from "../ShotDisplay"; import { SmartCanvas } from "../SmartCanvas"; @@ -31,6 +32,7 @@ export function TankopediaSandbox({ skeleton, thicknessRange, }: TankSandboxProps) { + const wrapper = useRef(null); const canvas = useRef(null); const hasImprovedVerticalStabilizer = useEquipment("protagonist", 122); const hasDownImprovedVerticalStabilizer = useEquipment("protagonist", 124); @@ -104,12 +106,20 @@ export function TankopediaSandbox({ } } + function handleTransitionEvent(event: QuicklimeEvent) { + if (!wrapper.current) return; + + wrapper.current.style.backgroundColor = `rgba(0, 0, 0, ${1 - event.data})`; + } + poseEvent.on(handlePoseEvent); + transitionEvent.on(handleTransitionEvent); return () => { poseEvent.off(handlePoseEvent); + transitionEvent.off(handleTransitionEvent); }; - }); + }, []); useEffect(() => { const [pitch, yaw] = applyPitchYawLimits( @@ -138,7 +148,7 @@ export function TankopediaSandbox({ }, [display]); return ( -
+