How I built this site (so far)
This site is my own case study: an award-level portfolio built from an empty branch with Next.js, React Three Fiber, GSAP and Lenis — with a fully custom dashboard behind it. These notes collect the decisions and the traps, written while they were still fresh.
One clock to rule the scroll
Smooth scroll libraries and animation libraries both want to own the frame loop. The whole site runs on a single contract: GSAP's ticker drives lenis.raf, and Lenis reports scroll back to ScrollTrigger. Nothing else is allowed to own a requestAnimationFrame.
The trap: wiring this through a ref to the Lenis component fails silently — the instance doesn't exist yet when the effect runs, and wheel input goes dead. Use the useLenis() hook in a child component instead; it re-renders when the instance is actually created.
A preloader that tells the truth
Counters that animate to 100 on a timer are theatre. This one gates on real signals — document.fonts.ready, drei's useProgress for GPU-ready textures — and blends them with elapsed time so the number glides instead of jumping between loader steps.
The portrait that inverts
The hero portrait is a shader plane in a persistent canvas behind the DOM. A liquid-edged mask follows the cursor and flips the duotone — like developing a photograph. The dissolve on scroll is per-pixel noise: each pixel owns a threshold and fades as scroll passes it.
When the type-checker ran out of memory
Adding Mongoose and Better Auth pushed TypeScript 5.9 to 4.4 GB of heap and a build-worker crash — two bundled copies of the MongoDB driver types didn't help. The fix was the native compiler: tsgo checks the same project in about four seconds at a tenth of the memory. It runs as its own step, chained into the build.
Rules that survived contact
Two colors, one easing vocabulary, no ad-hoc motion — restraint reads as confidence.
Everything registers through gsap.matchMedia — reduced-motion support is a scored category, not a nice-to-have.
Verify visually, not just with a green build — the two worst bugs (dead scroll, hidden WebGL planes) both compiled cleanly.
More notes as the build continues — the dashboard, the admin editor this post will eventually be written in, and the awards polish pass.