CD Case: Four Discs
- Skill del Lab
- v0.1.0
- Interactive 3D
A clear plastic CD case in your browser: tap to swing the lid open, drag to turn it, spin the disc and flip through four disc designs.
Esempio
CD Case interactive demo
L'esempio funziona in un frame isolato, senza accesso a questa pagina.
Esegui online
Eseguilo in un sandbox di SandBase e visualizza i risultati in Lab.
Apri in Lab ↗Cosa ottieni
Bring a product object and the variants it should come in. The Skill returns a downloadable Skill (meta prompt, lessons, verification) and a runnable reference scene.
Come funziona
- 01
Fill the case and design slots
CD Case needs two slots, case and designs, and takes optional materials, background, interaction, ui and extraPrompt, each a string of at most 2000 characters. Run node scripts/fill-prompt.mjs --slots slots.json --lang en --out prompt.md, using assets/prompts/examples/four-discs.json as a model. The filled meta prompt goes to your coding agent with any reference images.
- 02
Edit geometry and label drawings
node scripts/new-project.mjs --out my-case copies the reference app with the tray, rails, hub, hinged lid, clear plastic, four procedural labels, carousel and synthesized sound. Change src/case/geometry.ts for another object and src/case/labels.ts for other designs. It runs locally on Node 22.4 or newer, calls no model, and npm ci only fetches pinned packages.
- 03
Shoot and compare each round
npm run build:single writes dist-single/index.html, and npm run shoot -- --file dist-single/index.html needs local Chrome. Compare the screenshots of the closed, open and turned case, each design and the 345 by 345 embed with the reference. The report lists console errors, CSP violations, interaction proofs, design distinctness, reduced motion and frame rate. Listening to the sound is a manual check.
FAQ
What does the CD Case example do?
CD Case shows a clear plastic jewel case on a white studio backdrop holding a black disc with holographic stickers. Click it and the lid swings open on its left hinge. Drag to turn it, and past a quarter turn the silver data side shows rainbow streaks. Keys 1 to 4 switch between four discs, and S spins the disc.
Are the CD Case disc designs image files?
No. CD Case draws every label on a canvas in src/case/labels.ts with seeded shapes, gradients and line work, and the toolbar thumbnails come from the same canvases. The four designs are holographic stickers, gold with engraved line diagrams, a deep red rose and a glossy liquid swirl.
Can CD Case show a product other than a CD?
Yes. CD Case lets you replace the parts in src/case/geometry.ts, as long as the subject group stays named case, because the layout check and tap test read its screen box. Update the framing sizes in fit() in src/components/Stage.tsx too. It suits one rigid object with a single hinge, not physics or many objects.
How do I add a disc design to CD Case?
CD Case needs four edits for a new design: a drawing function in src/case/labels.ts, its finish in src/case/materials.ts, its id in src/config.ts and its name in src/i18n/strings.json. After that, shoot expects the new design to differ from every other design at thumbnail size.
Does CD Case need an API key or network?
No. CD Case calls no model or network service, so building it is free. The studio light is a few panels prefiltered in code because the CDN environment presets would be blocked by the sandbox. The built file needs no network and no storage.
How does CD Case behave on phones?
CD Case gives phones a low tier that draws the plastic as a transparent sheet instead of physical transmission, with no MSAA and smaller label textures. The toolbar shrinks to 28 px buttons in the 345 px embed. Phones were checked only under headless touch emulation, not on devices.
What can CD Case not do?
CD Case has no collision, the disc cannot be taken out and the lid holds no booklet. A tap inside the case's screen box opens the lid, so a tap just beside a turned case can still count. With reduced motion the scene starts paused and swaps designs with a cut.
Altri Skills
Tutti gli Skills Interactive 3D →
Resin Diorama
Live 3D resin-block dioramas in your browser: send a little tram across a clear turquoise sea, or ripple the bay of a cliff island. Synthesized sound, and every scene can be tuned.

3D Vehicle Worlds
Explore interactive 3D vehicle worlds in your browser, with varied terrain, camera controls and driving effects. Choose a playable example to begin.

3D Firefly Terrariums
Turn a thick glass miniature, scatter glowing fireflies and open its brass lid. Actual particles leave through the neck and return before it seals. A moonlit cabin, forest and real local lights in one offline HTML.

Jelly Candy: Fruit Bears
Six translucent fruit gummies on a white table. Grab any part and pull, lift a head until the neck stretches thin, press one flat until it springs back, flick one across the pile or pour in more. Fixed-step soft-body physics and a marching-cubes skin in one offline HTML.

WebGPU Soft-Body Gummy Bears
Four translucent gummy bears on an ivory floor, rendered with native WebGPU. A deterministic 36-second choreography stretches, presses, flips and tumbles them before they settle back to the exact rest pose. Drag any bear to stretch, squish or toss it. A fixed-step tetrahedral XPBD solver in one offline HTML.

Stone Stars: 3D Miniature Landmark City
Turn a city into a storybook 3D island around one landmark, with chapters, a daylight-to-starlight slider, street life and a matching scored 24-second film. Sample: a Gaudí-style basilica.

