All effects
Parameter playground

Drag a slider: the demo replays itself so the difference is visible, and the matching number inside the prompt is rewritten. Copy it and you take a prompt tuned to your taste.

Max tilt 12° The card sways and holds: 12 is restrained, 20 is theatrical; the glare follows
Glare size 220px The card sways once: bigger reads as glass reflection, 80 is a pinprick
Card Effects

3D Tilt Glow Card

A card that tilts in 3D following your pointer, with a radial light reflection and a springy return.

AI Prompt
Add a 3D tilt effect to a card component: the card tilts in 3D perspective (rotateX/rotateY, max about 12 degrees) following the pointer position, with a radial gradient light reflection (a 220px glare) overlaid on its surface that tracks the pointer. When the pointer leaves, the card eases back to flat with a spring damping animation instead of snapping. Build it with pure CSS and vanilla JavaScript.

How it works

The effect combines three layered techniques. First, pointer tracking: a pointermove listener computes the cursor position relative to the card center and normalizes it to a -1 to 1 range on both axes. Second, perspective rotation: those values drive rotateX and rotateY transforms, capped at around 12 degrees so the card reads as tilt rather than spin. A parent container with CSS perspective (typically 800 to 1000px) is what makes the rotation render as true 3D depth. Third, the glow layer: a radial-gradient positioned at the same pointer coordinates is composited on top of the card, simulating a reflective sheen that follows your hand.

The polish lives in the exit animation. Naive implementations zero the rotation the moment the pointer leaves, which looks robotic. Here the release values are handed to a spring simulation (or a CSS transition with an overshooting cubic-bezier) so the card swings slightly past flat and settles, the same way a physical object would. Using requestAnimationFrame for the tracking loop and keeping all motion on transform properties ensures the animation stays on the GPU compositor and never triggers layout work, which is why it holds 60fps even on mid-range phones.

How to use this prompt

Copy the prompt and paste it into your AI coding tool with the component you want to enhance. If you use React or Vue, mention that in the same message so the assistant wraps the logic in a component hook instead of inline listeners. For touch devices, ask the AI to duplicate the behavior with touch events - the prompt already hints at pointer support, but being explicit about mobile gets you a result that works everywhere on the first try.

Tips for better results

Keep the max angle between 8 and 15 degrees; anything steeper starts to distort text readability. If the card contains interactive children like buttons, ask the AI to preserve their click targets by tilting the inner wrapper instead of the card itself. And on low-end hardware, disable the glow layer via prefers-reduced-motion to respect users who opt out of decorative animation.

Keep exploring