# IDEA.md – a playground of your own for design and 3D in the browser This is a self-contained brief. Give it in full to Claude Code (or a similar tool) to build a site of your own. It draws on Burn Tokens Repeat, a playground for graphic design, typography and 3D that was designed in Claude Design, built with Claude Code and given its icon by Codex. ## 1. What to build A static site that is a playground: a made-up agency with a strong graphic style (Burn Tokens Repeat is inspired by TDR – The Designers Republic), and a department of interactive 3D experiments in the browser. It should be fast, work offline and store nothing about the visitor beyond what's shown. In Burn Tokens Repeat: - **a home page, a 404 page and an agency page**, each with its own graphic style - **three design systems**, each with its own colours, fonts and components, which a page picks by the stylesheets it loads - **3D experiments in three.js**: spheres along curves, spirals, fields, a cube, a lab that loads 3D models, with a panel for parameters - **a render archive**: a gallery of thumbnails and a lightbox at full resolution - **an installable web app** with an offline page - **no cookies**, and a sticker that shows what the site stores in the browser and can delete it ## 2. Stack and architecture What **matters** is marked; the rest can be swapped. - **PHP with no framework and no build step.** Each page is a short file that sets a few variables (title, description, stylesheets, scripts, Open Graph) and includes shared parts for the head, top bar and footer. - **Important: clean URLs and absolute paths.** No `.php` or `.html` in links. `.htaccess` redirects old forms and rewrites `/page/` to `page.php`. Everything fetched – images, models, scripts – has an absolute path. - **The design systems as separate stylesheets** with their own `:root` variables, and shared stylesheets for the top bar and the 3D panel. - **three.js via an import map** at a pinned version. A shared module binds the renderer and camera to the page's stage and handles resizing. - **A service worker**: pages network-first with an offline page as fallback, own files cached and refreshed in the background, three.js from the CDN cached for good. Video and range requests are never cached. Bump a version when the caching changes. ## 3. Decisions that turned out to matter **Clean URLs from the start.** With `/3d/lab/` instead of `/3d/lab.php`, relative paths break. Decide that everything is absolute before the first page is written. **Screenshots of every page automatically.** A script takes a picture of every page in a headless browser, with the GPU switched on so WebGL draws, and with a longer wait for heavy scenes. The pictures serve both for review and as preview images. **Old code can get a new life.** The sphere calculations started as a VB program from the early 2000s that generated objects for POV-Ray, and the 3D lab as a lab assignment in C with IRIS GL on SGI from 1998. Give the coding agent the old code or its description and let it translate to JavaScript and three.js. **An image pipeline for the gallery.** Drop in a PNG, run a script that makes a full-size WebP and a thumbnail, and add a block to the gallery. The lightbox derives the large image from the thumbnail's path. **Trim the fonts.** A script reads which characters the pages actually show – following `include` into the shared parts – and removes the font subsets and files nothing needs. **Be open about storage.** The sticker lists exactly which keys the site stores, and its button deletes them and the site's caches. Update the list when new storage is added. ## 4. Pitfalls - **Relative paths under clean URLs** point one directory off. Use absolute ones. - **iOS 26+ puts a blur over the top edge** of a home-screen web app. The usual fix – a fixed, opaque container over the whole screen – did not work here. What worked was normal document flow with a top bar stuck to the top (`position: sticky`). Test on a real phone, and re-add the icon to the home screen after manifest changes. - **Apache has its own `/icons/` alias.** Put the app icons somewhere else. - **WebGL in a headless browser** draws nothing without a GPU. Switch it on in the screenshot script. - **Never link to the shared parts directly.** Block the directory in `.htaccess`. ## 5. Requirements and measurements - No cookies; storage limited and declared. - The site works offline after the first visit. - Share preview images (1200 × 630) for every page. ## 6. How it's verified - Locally in Docker with the same Apache and `.htaccess` as in production. - Screenshots of every page after changes, reviewed by a human. - The web app and the iOS behaviour on a real phone. ## 7. Way of working - **Design first** in a design tool: the pages and the design systems. - **One experiment at a time**, using an existing page as a template. - **Write the conventions down** (paths, variables, design systems) in the project's instructions. ## 8. The prompt > Build a playground for graphic design and 3D in the browser: a made-up [agency] with a strong graphic style, [three] design systems of its own and a department of interactive 3D experiments in [three.js]. [PHP] with no framework and no build step, clean URLs, installable and offline, and no cookies. > > Read all of IDEA.md below first. > > Start with the design and the design systems, and take a screenshot of every page after every change. > > [paste IDEA.md here]