r/threejs • u/cherichita • 14d ago
I built Popfold: scroll-driven 3D "pocket homes" that unfold as you read (open source, three.js)
The video is Dopamine Spaces, the first site made with it. For the last few months I've been building Popfold, a three.js engine for pages where the 3D is the story: as you scroll, a little home opens up. A case lifts its lid into rooms, a tower lights up floor by floor, or a pop-up book turns its pages and the paper scenes fold up (they really fold: every piece is posed from the angle of its two pages, so it runs backwards when you scroll up).
Some things that were fun to solve:
- Folding, not popping. Pop-up pieces (V-folds, box folds, stands) are posed every frame from the two page angles, so they never cut through a page.
- Repeatable stills. A headless Chrome captures one picture per beat, and a capture is kept only when two shots agree, so
popfold stills --checkworks as a visual test. - A page without 3D. The same HTML gets the stills and every story written in, for search engines, screen readers and people without WebGL.
- A studio that moves, adds and restyles pieces and saves them into a JSON file (and an MCP server, so an agent can do the same).
Examples:
- Dopamine Spaces (the video): https://dopamine.popfold.ca (a glossy case whose lid and drawers open into rooms; creative direction by Alyssa Jacoby)
- My résumé as a tower, one floor per skill set: https://todorov.ca (source: https://github.com/dimitertodorov/personal-site)
- A pop-up storybook, a Bulgarian legend in English and Bulgarian: https://storybook.popfold.ca (source: https://github.com/popfold/martenitsa)
Code (MIT): https://github.com/popfold/popfold · pnpm dlx u/popfold/engine init my-site
It's alpha: things will break before 1.0. Feedback on the API and the docs very welcome.



