CSS 3D & Perspective
Folded Map Terrain
12x12 quad grid forms rolling sine hills in isometric view with face-normal sun lighting. Pointer skews terrain phase; click boosts amplitude.
canvasheavy complexitymoderate motionpointer
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Dark-mode hero backgrounds, generative art displays, ambient terrain or map-themed sections.
When not to
Light backgrounds (dark navy hardcoded). Content-heavy layouts where surface motion competes with reading.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change grid resolution from G=12 to G=18, shift sun to {x:0.5,y:-0.8,z:0.3} for side lighting, and reduce cell size from 72 to 60 to keep quads in frame. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.
Safe to edit
- grid resolution (G=12)
- cell size (72*scale)
- sun direction (sun.x/y/z)
- height amplitude (0.62 multiplier)
- animation speed (t += 0.012)
- green palette RGB offsets
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- DPR-aware canvas sizing
- visibilitychange pause/resume
- prefers-reduced-motion static fallback
- IIFE wrapper
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- O(G^2) quads per frame — G beyond 20 may drop FPS on low-end devices
- Background color hardcoded in CSS (#0f2417)
- No aria role on canvas — purely decorative
More CSS 3D & Perspective components
- Rotating CubeGlowing sage-green wireframe cube slowly auto-rotates in CSS 3D with a subtle sine-wave tilt; pointer movement offsets the rotation to follow the cursor.
- Card Deck FanSeven gold-and-mauve playing cards fan open and closed in a sine-wave 3D arc using CSS rotateZ and perspective transform.
- Coverflow RingEight vivid gradient cards orbit in a 3D coverflow ring with CSS perspective and per-card reflections. Pointer X position steers rotation speed.
- Folding Paper4-panel paper accordion folds and unfolds in a zig-zag CSS 3D motion, slowly rotating on a dark green background. Cream front and sage back faces alternate.
- Isometric Blocks3x3 grid of soft lilac CSS 3D cubes bobs in a staggered sine wave on a dark lilac-tinted ground. Three shaded faces per cube simulate isometric lighting.
- Parallax DepthA glowing sun with colored orbiting dots on layered CSS 3D planes that tilt and parallax toward the pointer; auto-orbits until interaction.