Build 3D WebGL Canvas Experience
ink_build_threejs_experienceGenerate interactive Three.js WebGL scenes for hero backgrounds, particle fields, or geometric visuals with GPU protections and clean teardown.
Instructions
PURPOSE: Generate high-performance, responsive 3D WebGL scenes using Three.js (particle constellations, geometric wireframes, morphing meshes, or interactive hero canvases) with memory-safe lifecycles.
BEHAVIOR: Generates client-side HTML container, full-bleed CSS, and JavaScript module code purely in-memory. Zero filesystem mutations. Incorporates GPU protections: automatically clamps window.devicePixelRatio to 2, attaches window resize listeners, pauses requestAnimationFrame on hidden browser tabs via the Page Visibility API, and exposes a clean teardown disposal function (geometries, materials, renderer.dispose()).
USAGE GUIDELINES:
When to use: Use when a page needs an interactive 3D hero background, ambient particle field, or futuristic geometric visual experience.
When NOT to use: Do NOT use for standard 2D UI widgets or layouts (use ink_craft_component instead), nor for basic CSS animations without WebGL.
Alternatives: Use ink_craft_component for 2D UI components; use ink_create_base for scaffolding the full application shell.
RETURNS: ResultEnvelope containing canvas mounting 'html', full-bleed responsive 'css', initialization and teardown 'js', and lifecycle documentation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sceneType | No | Type of 3D WebGL scene to generate with Three.js | particle-constellation |
| particleCount | No | Number of particle points (clamped between 100 and 5000 for GPU thermal and battery efficiency) | |
| accentColorHex | No | Primary accent color in 6-digit hex format (#RRGGBB) used for points, materials, and point lights | #38bdf8 |
| enableMouseParallax | No | When true, registers smooth pointer move listeners with lerp damping for gentle depth parallax |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool | |
| status | Yes | Execution outcome status | |
| summary | Yes | Concise, human-readable executive summary of the tool outcome | |
| evidence | No | Audit trail, source references, and generated artifact locations | |
| warnings | Yes | Operational cautions, craft advice, or non-blocking warnings | |
| nextActions | No | Actionable sequential recommendations or subsequent tool suggestions |