Cards
Card that opens into a modal
A card with two photos: on click it flies from its cell to the centre of the screen, grows 1.35× and flips in one motion — the back shows the second photo and a glass panel with a description and a link. Inside the window a click flips it back. Closing reverses the animation; focus is trapped, Escape closes.
What you can change
- image, imageBack, eyebrow, title, hint, backTitle, text, linkLabel, linkHref or custom panel content via children
- aspect, width, zoom, closeLabel
- accent, tone, radius and duration via the --vibeui-flip-002-radius and -duration variables (DURATION in code must match)
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/flip-002?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
One file, the only dependency is react-dom (createPortal), “use client”. The in-flow card is a div role=button with a photo, a flip badge and a glass panel (eyebrow, title, hint). On click getBoundingClientRect is measured and a position:fixed layer with perspective:1400px, a backdrop (12px blur) and a flyer is portalled into body: absolute at the window's size and position (the card ×zoom centred, never larger than the screen with a gutter), transform-style:preserve-3d, an initial translate/scale transform places it exactly over the card; the original is hidden with visibility:hidden. After a reflow and requestAnimationFrame the transform becomes translate(0) scale(1) rotateY(180deg) over .5s cubic-bezier(.2,.9,.25,1): flight, growth and flip as one motion, only transform animates — a composited layer, no layout recalculation and no photo re-rasterisation per frame. Sides are absolute inset:0 with backface-visibility:hidden and translateZ(1px); the back is pre-rotated 180° and carries the second photo and a panel with backTitle, text and a link; a click on a side flips the window, the close button is on both sides, the hidden side is inert. Closing returns the initial transform; after 500ms the layer is removed and focus returns to the card. While open: body overflow:hidden with scrollbar compensation, Escape closes, Tab cycles inside the window, resize re-centres. Palette --vibeui-flip-002-* with light-dark, Manrope via <link precedence>.
Tags
- flip
- modal
- flip card
- 3d
- morph
- expand
- dialog
- lightbox
- two photos
- card
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…