CSS 3D & Perspective
Depth-Sorted Petals
44 pink gradient petals arranged in 4 concentric rings open and close in 3D perspective, depth-sorted back-to-front around a glowing central hub.
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, floral or organic themes, ambient looping art installations.
When not to
Light backgrounds (hardcoded deep plum). Contexts needing legible foreground text — petals fill the viewport.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change petal color to blue-violet by replacing the rgba(232,121,185,...) gradient stops with rgba(139,92,246,...) and updating the hub gradient to match. 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
- ring count (RINGS=4)
- petals per ring (PER=11)
- perspective focal length (FOV=560)
- petal pitch oscillation amplitude (0.5)
- ring rotation speed (spin: 0.0016)
- background color (#241327)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- manual back-to-front depth sort (quads.sort by zc)
- DPR-aware canvas sizing
- visibility pause/resume
- reduced-motion static frame fallback
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Background color hardcoded in both CSS and fillRect — must change both
- No aria semantics; purely decorative canvas
- nudge decay via pointer/click adds mild interactivity but no persistent state
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.