2026 · Design & build · ThreeJS · Next · GSAP · Lenis · motion
Butterfly

I built Butterfly, a redesign of a crypto venture firm's website with a 3D butterfly that flies down the page as you scroll. I started from the firm's real public content, renamed it Butterfly, and spent the week on the motion.
What it does
- A 3D butterfly weaves left and right as you scroll. When you stop, its wings run a slow idle loop. When you scroll, your scroll speed drives the wing animation, so it flaps faster the faster you go.
- An ASCII filter can redraw the model in text characters.
- Behind it, 5,000 particles swirl around attractors on the GPU, using WebGPU compute in three.js. Scrolling turns the field and speeds it up.
- A "control gui" popover on the hero has sliders for the model's size, position, smoothing and animation speed, plus the ASCII switch, so the motion can be tuned live in the browser.
How I built it
It's Next.js 16 with React Three Fiber, GSAP ScrollTrigger and Lenis. I tied Lenis to ScrollTrigger through a scroller proxy and ran both off GSAP's ticker, so the smooth scroll and the scroll animations read the same position. The 3D canvas only renders when something changes, not on every frame.
On phones the butterfly flew off the screen, so its sideways swing now scales with the viewport width.
What broke and what I'd fix
- The loader could hang forever if an asset never reported in. I made it count each texture on its own and added a 10-second timeout that lets the page in anyway, even if the model isn't ready.
- The model first shipped as a .gltf with a separate .bin file and four textures. After it crashed, I switched to a single 9.5 MB .glb. That file already holds the four textures, but the page still loads them again on their own, so it downloads about 16 MB for one butterfly. That's the first thing I'd fix.
- There's no fallback for the particles. A browser without WebGPU gets the butterfly but no particle field.
I built it over 35 commits from February to March 2026.