实现贴纸粒子系统,添加 HeroScene 组件,优化 Next.js 配置,更新依赖
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"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;
|
||||
Reference in New Issue
Block a user