CSS 3D & Perspective
Floating Coin
A glossy gold coin spins on its Y-axis and bobs up/down with a reactive shadow; pointer X position adjusts spin speed in real time.
csslight 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
Game UIs, reward/achievement screens, crypto/NFT landing pages, or any dark-theme hero needing a tactile 3D object.
When not to
Light backgrounds (dark amber is hardcoded). Contexts where constant rotation is distracting alongside body text.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the front face star emoji to '💎', set the base spin speed to 2.5 (spin variable), and update the background to #0d1b2a for a night-blue theme. 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
- base spin speed (spin=1.6)
- bob amplitude (Math.sin(t)*4)
- coin size (34vmin)
- front/back face content (★ / 3D)
- background color (#1b1405)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- prefers-reduced-motion guard + static fallback
- visibilitychange stop/start pair
- transform-style:preserve-3d on #coin and #wrap
- backface-visibility:hidden on .face
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Coin size in vmin — may appear too large on ultra-wide viewports
- No click interactivity; pointer only affects spin speed, not state
- Background color hardcoded in CSS body rule
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.