Webstore 3D Animation
The product is the hero. The motion earns its place or it gets cut. A beautiful viewer that delays the buy button is a failed viewer.
These rules outrank personal taste.
Rules that outrank everything else
- Product truth beats spectacle. Never invent geometry, materials, colours, or specs the real product does not have. If no model exists, use photographs, CSS 3D, or plainly marked placeholders. Say what is missing instead of quietly faking it.
- One hero moment per page. Pick one primary 3D interaction. Everything else is a small supporting micro-interaction. Two competing showpieces means neither one lands.
- Motion must have a job. Every animation answers one of: show the shape, show a feature, show a variant, confirm an action. "It looks cool" is not a job.
- The page is fast before it is pretty. Do not block first paint or the buy button on WebGL. A static image is the loading state and the no-WebGL fallback, not an afterthought.
- Nothing ships unaudited. Verify in a real browser at desktop and phone widths, with reduced motion on and off, and with JavaScript/WebGL unavailable. Never claim a check you could not run.
- The user's brand and platform rules win. If they supply a brand kit, a Shopify theme constraint, or a design system, those hard rules beat the defaults in this skill.
Procedure
0. Brief
Ask at most five questions in one message, skipping anything already answered:
- What is the product, and what single thing should the visitor notice about it?
- Where does this live: Shopify, WooCommerce, custom React/Vue, or a static page?
- Which assets exist: GLB/GLTF, turntable photos, product stills, logo, copy, brand colours?
- What should the visitor do after watching: buy, configure, add to cart, or just browse?
- Any hard constraints: performance budget, accessibility standard, no-WebGL policy, framework in use?
If assets are missing, state the substitute you will use and keep going. Do not block on a model you do not have.
1. Choose the job
Pick one primary pattern from references/recipes.md, write down its feeling and duration, then choose at most two supporting micro-interactions. Anything not chosen is forbidden for this build.
Use the decision rule: if the animation cannot be explained in one sentence without the words "spin", "cool", or "modern", it has no job. Cut it.
2. Asset reality check
Read references/tech-and-assets.md. Decide honestly:
- Real GLB/GLTF exists: inspect scale, origin, pivot, material count, texture sizes, and licensing before building. Optimize before shipping.
- Photos only: use a short frame sequence, layered parallax, or CSS 3D. Do not pretend flat images are a model.
- Nothing exists: build the motion system with a clearly labelled placeholder asset and hand the client a spec for the real asset.
Write down the asset path, its size, and the fallback image path.
3. Pick the stack
Also in references/tech-and-assets.md:
- Vanilla Three.js for drop-in store widgets and theme embeds.
- React Three Fiber when the storefront is already React and the viewer shares state with the page.
- CSS 3D transforms for lightweight tilt, cards, and icon depth — no WebGL needed.
- Video or frame sequences for photoreal spins that must look identical everywhere.
- 2D only (Lottie/CSS) for cart confirmations and UI delight.
Choose the least powerful tool that does the job. Do not add a 3D engine for a 200 ms hover tilt.
4. Art direction
Before code, write four lines:
- Light: one source of direction (soft key + rim), never flat ambient-only.
- Camera: focal length and one default angle that flatters the product; constrain the viewer so the user cannot reach an ugly angle.
- Material: roughness and metalness matched to the real product; avoid default shiny-plastic look.
- Curve: easing and duration from
references/recipes.md; no linear motion except a steady turntable.
5. Build
- Copy
assets/starter/as the starting point for a vanilla Three.js viewer. Keep its loading, lazy-init, reduced-motion, pause-offscreen, and disposal logic; theme it on top. - Semantic HTML first: real
<button>controls, real<a>links, alt text on the fallback image, visible focus rings. - Never scroll-jack, never trap focus, never autoplay a spin that cannot be stopped.
- Auto-rotate may start once and must stop permanently at the first user interaction.
- Label every control with text or
aria-label; keyboard users can operate the viewer. - Keep copy real. Use plainly marked placeholders rather than invented statistics or testimonials.
6. Optimize
Work through references/performance-a11y.md:
- Cap device pixel ratio, pause rendering when offscreen or hidden, dispose GPU resources, lazy-load the viewer below the fold.
- Compress geometry and textures; ship only the textures the chosen variant needs.
- Provide a low-cost mobile path: fewer frames, lower DPR, or a static poster.
- Record the budget before and after: file sizes, draw calls, and observed frame rate.
7. Verify
In a real browser, on desktop and at roughly 390 px wide:
- Page loads with the buy button usable before 3D appears.
- Viewer renders, drag/keyboard controls work, and the fallback image shows with WebGL disabled or the model missing.
prefers-reduced-motion: reduce: no autoplay, no drifting, no transitions; controls still work.- No console errors, no layout shift when the canvas mounts, no horizontal overflow.
- Leave the tab, return, and resize: rendering resumes correctly and memory does not climb.
- Look at a screenshot. Does the product read clearly at a glance, or is the lighting doing it no favours?
Fix every failure and rerun. Report only the checks you actually performed.
8. Handoff
Tell the user: pattern chosen and why, assets assumed, stack, budget numbers, verification results, and what is needed from them to make the product asset real.
Anti-patterns
- Infinite auto-spin that never stops, or spins while offscreen.
- Full-screen WebGL canvas behind text with unreadable contrast.
- Scroll hijacking to drive a model the visitor did not ask to see.
- Default PBR sphere lighting, grey studio blob, or purple-blue gradient reflections.
- A 5 MB model for a 300 px thumbnail.
- Faking product colours, materials, or features the customer cannot return.
- "Fade and slide up on every scroll" as a substitute for a 3D idea.
- Missing fallback, missing alt text, missing focus state.
- Claiming 60 fps from code inspection alone.
Files
references/recipes.md: pattern menu, feelings, durations, pitfallsreferences/tech-and-assets.md: asset pipeline and stack choicesreferences/performance-a11y.md: budgets, accessibility, verification checklistassets/starter/: copyable vanilla Three.js turntable with the safety rails already in place