实现贴纸粒子系统,添加 HeroScene 组件,优化 Next.js 配置,更新依赖

This commit is contained in:
2026-08-31 22:06:36 +08:00
parent 77b928c442
commit 836239beca
9 changed files with 756 additions and 3 deletions
+29
View File
@@ -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;