CSS 3D & Perspective
Helical DNA Stair
26 CSS 3D rungs twist into a rotating DNA double-helix staircase with depth-faded opacity; pointer drag and click add momentum to the spin.
cssmedium 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
Science/biotech hero sections, ambient background loops, CSS 3D capability demos.
When not to
Layouts requiring text legibility over the animation; low-end mobile where 26 transformed divs plus rAF may cause jank.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change STEPS to 32, increase RADIUS to 90, and swap the bar gradient colors from cyan (#39c0ed) to a purple (#a855f7) to match a biotech brand palette. 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
- rung count (STEPS=26)
- twist rate (STEP_ANGLE=32 deg per step)
- helix radius (RADIUS=72)
- vertical rise per step (STEP_Y=15)
- auto-spin speed (spin += 0.42)
- node and bar colors (#39c0ed)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion guard (static fallback at spin=18)
- visibilitychange pause/resume
- depth-cue opacity formula (compositor-friendly, no filter)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- All geometry is rebuilt on resize via innerHTML clear — brief flash on window resize
- perspective hardcoded at 760px; very wide viewports may look flat
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.