# CD Case: Four Discs

> 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.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Interactive 3D](https://www.sandbase.ai/skills/interactive-3d)
- Version: 0.1.0
- Runs online: yes
- Page: https://www.sandbase.ai/skills/interactive-3d/cd-case

## What you get

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.

## Install

Download the Skill package from https://www.sandbase.ai/skills/interactive-3d/cd-case (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/cd-case build an interactive <your product object> with <your variants>
```

## How it works

1. **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.
2. **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.
3. **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.

## Examples

- CD Case interactive demo (scene)
- CD Case: Four Discs (video)
