Cards
Holographic Foil Card
A dark card tilts in 3D up to 20deg as the pointer moves over it; rainbow foil gradient and radial glare shift with cursor position via CSS custom properties.
cssmedium complexitymoderate motionpointermobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Product cards, trading-card showcases, NFT or collectible displays, hero feature cards needing tactile depth.
When not to
Dense card grids where hover state would constantly trigger on adjacent items. Touch-only devices get no tilt — foil still appears but 3D feel is absent.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Adjust the existing palette tokens and effect parameters while preserving manual control. First deliberate input stops idle demo work while manual feedback finishes. Keep demo-v1 lifecycle marker, __foreverPreview.demoEnabled initialization and forever:interactive handler. Preserve reduced motion, visibility suspension and theme switching.
Safe to edit
- card title (.holo-title text)
- max rotation angle (20 in handleMouseMove)
- lerp smoothing factor (0.1)
- foil gradient colors (.holo-card::before)
- card aspect ratio (2.5 / 3.5)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- CSS custom properties --pos-x/--pos-y driving foil position
- IIFE wrapper
- prefers-reduced-motion guard in both CSS and JS
- visibilitychange stop/start
- idle orbit demo (.holo-demo shares the :hover sheen rule; a real pointer takes over)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
- sticky demo-v1 preview lifecycle; stop attract work, retain manual feedback and settling
- pointer/touch takeover, keyboard access and visibility suspension
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
Known limitations
- Light re-theme via the [data-theme=light] token block; catalog bg/accent describe the dark default
- Touch support moves foil but does not tilt the card (touchmove maps to mousemove but no orientation tracking)
- Control state is local to each mount; format changes preserve preview takeover but create a fresh source instance.
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
More Cards components
- 3D Tilt ParallaxDark card tilts in 3D toward the cursor; badge, orb, and text layers float at distinct Z-depths. A radial shine tracks the pointer; auto-rotates until…
- Frosted GlassA frosted glass card floats over three slowly drifting color blobs (gold, cream, tan); the panel lifts slightly on hover.
- Spotlight HoverDark card with a peach radial glow and a CSS-masked grid that both track the cursor; auto-orbits when the pointer is away.
- Gradient-Border GlowDark card framed by a spinning conic powder-blue, tan and slate gradient border with a soft blurred aura glow behind it; auto-rotates continuously.
- Reveal on HoverDark gradient card that dims and zooms its background art on hover while a hidden title-and-copy panel slides up from the bottom.
- Holographic IridescentA 3D-tilting card with a warm iridescent sheen and conic foil chip that shift with pointer position; drifts idly until first deliberate input.