How it works
FLIP stands for First, Last, Invert, Play. First, you record the card's bounding rectangle. Last, you apply the final state (full-screen detail) and record its rectangle. Invert, you apply a transform that visually moves the element back to where it started - a translate plus scale built from the two rectangles. Play, you remove the transform with a transition, and the browser interpolates smoothly from start to finish. Because the only thing animating is a transform, the entire transition runs on the GPU compositor without triggering layout or paint, which is what keeps it at 60 frames per second on modest hardware.
The subtle part is content distortion: scaling a card up two or three times would stretch its text into a blur. The fix is counter-scaling - the inner content wrapper gets an inverse scale so its rendered size stays constant while the card shell grows. Border radius interpolates to zero as the card reaches full bleed, and the backdrop fades in on the compositor in parallel. Closing simply replays the transform back to the measured origin, which is why the reverse path feels identical.
How to use this prompt
This pattern fits any collection-to-detail flow: media galleries, product listings, article cards, or settings rows. Paste the prompt into your AI assistant alongside your markup and it will adapt the measurement logic to your layout. If your detail view is taller than the viewport, ask the AI to fade in scrollable content after the transform completes - mixing scroll with mid-flight transforms is the one place this technique gets janky.
Tips for better results
Keep transition duration between 400 and 600 milliseconds; shorter feels abrupt, longer feels sluggish. Use an ease-out curve on open and ease-in on close for natural acceleration. And always animate a single element rather than cross-fading two - the whole point is that the user's eye tracks one continuous object.