30 lines
1005 B
TypeScript
30 lines
1005 B
TypeScript
"use client";
|
|
|
|
import { Canvas } from "@react-three/fiber";
|
|
import { PerspectiveCamera } from "@react-three/drei";
|
|
|
|
import { StickerDrop, StickerCamera } from "@/components/canvas/StickerDrop";
|
|
|
|
export function HeroScene() {
|
|
return (
|
|
// z-30 keeps it above the BackgroundGrid (z-20) to prevent mix-blend-difference from making it gray
|
|
<div className="z-30 fixed inset-0 w-full h-full pointer-events-none">
|
|
<Canvas
|
|
dpr={[1, 2]}
|
|
gl={{ alpha: true, antialias: true }}
|
|
>
|
|
{/* Camera rig: horizontal FOV 60/38 + scroll-driven distance lerp(24, 32).
|
|
StickerCamera drives fov/aspect/z every frame; PerspectiveCamera is the
|
|
makeDefault camera it mutates. */}
|
|
<PerspectiveCamera makeDefault position={[0, 0, 24]} near={0.1} far={200} />
|
|
<StickerCamera />
|
|
|
|
{/* Falling stickers: 1:1 re-implementation of the original particle system */}
|
|
<StickerDrop />
|
|
</Canvas>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default HeroScene;
|