A scroll-driven flythrough built with React Three Fiber. The camera flies forward through a corridor of glowing gates toward an iridescent, living core, with HTML chapters scrolling in sync. Dark void, bloom, chromatic aberration — the "AI-generated" aesthetic, built to be extended.
npm install
npm run dev # open the printed localhost URL
npm run build # production build into /distRequires Node 18+.
src/App.jsx— Canvas, ScrollControls (setpages= number of chapters), HUD.src/scene/Experience.jsx— lighting, fog, the scroll "Rig" (camera path), postprocessing.src/scene/Objects.jsx— Core (hero), Gates (rings), Shards, Particles.src/scene/IridescentMaterial.js— the custom GLSL shader (fresnel + noise). This is the "alive" look.src/components/Overlay.jsx— the text chapters. Start editing here.src/index.css— design tokens (--cyan,--magenta…), overlay + HUD styles.
ScrollControls pages={5} makes the page 5 viewport-heights tall. useScroll().offset
(0→1) drives the camera's z in Rig. To add a chapter: add one entry in
Overlay.jsx AND bump pages in App.jsx to match.
- Colors: the
--*variables inindex.cssand theuColorA/B/CinIridescentMaterial.js. - Intensity:
Bloom intensityanduDisplaceon the Core. - Camera speed/path: the
z = 8 - offset * 74line inExperience.jsx.
dpr={[1, 1.75]}already caps retina cost — lower the max for weak devices.- Bloom + noise are the heaviest effects; drop
Noisefirst if mobile struggles. - Reduce
Particles countandGateslength on mobile via awindow.innerWidthcheck. - Respect
prefers-reduced-motion— reduce camera sway when set.
- Swap the Icosahedron Core for an AI-generated model (Meshy / Luma) — drop a
.glbin/publicand load it withuseGLTF. - Add a real HDRI to
<Environment />for richer reflections. - Trigger per-chapter events off
scroll.offsetranges (color shifts, object reveals).