REFERENCE
- Gallery page: https://magpui.com/en/i/leather-wallet-card-peek-902d68
- First frame (image): https://dnioievkvxejjbxgwvko.supabase.co/storage/v1/object/public/media/leather-wallet-card-peek-902d68/shot.jpg
- Clip (mp4): https://dnioievkvxejjbxgwvko.supabase.co/storage/v1/object/public/media/leather-wallet-card-peek-902d68/clip.mp4
- Original post: https://x.com/iamncdai/status/2117279668240044542 by @iamncdai
Before building, download the first frame and look at it. If ffmpeg is available, download the clip and extract frames (ffmpeg -i clip.mp4 -vf fps=2 frame-%02d.png), then study the motion frame by frame. Match what you see; the text below describes it, the frames are the truth.
BUILD: A wallet component: a dark leather-like pocket with three payment cards tucked into it, only their top strips (about 14px each) peeking out, stacked like files. Pointing at a card makes it rise out of the pocket to show its full face with the balance; leaving makes it slide back down into the stack. It should feel physical and satisfying, like pulling a real card out of a wallet.
DESIGN SYSTEM: Component about 280x260px on a near-black page (#0A0A0C). Pocket: 280x170px, radius 14px, fill linear-gradient(180deg,#232327,#17171A), 1px inner border rgba(255,255,255,0.06), subtle stitched or embossed edge optional, soft shadow 0 20px 40px rgba(0,0,0,0.5). A semicircular thumb notch (about 44px wide) cut into the pocket's top edge center, showing the card behind. Small logo mark and the label Wallet bottom left (12px, #CFCFCF). Cards: 264x168px, radius 10px, layered back to front: green (#1E7A4A gradient), blue (#1A8FD6), orange (#F0480F). Each card's top strip shows the account name (11px semibold, white) left and masked number plus a small icon right. Raised card shows a label Balance (10px, 70% white) and the amount (22px semibold, tabular numbers) bottom left, and a small meta label bottom right.
MOTION: Hover/focus a card: it translates up by about 110px over 380ms with a spring (stiffness 320, damping 28, or cubic-bezier(0.22,1.2,0.36,1)), rises in z-order above the other cards, and the cards in front of it shift down 6px and dim to 85% brightness over 200ms. Balance content fades in with 8px upward offset, 180ms, delay 120ms. Leave: card returns over 300ms cubic-bezier(0.32,0.72,0,1), balance fades out in 120ms. Moving directly from one card to another swaps them without both being raised at once (shared active state).
SECTIONS: Parts: pocket, notch, wallet label, three cards (strip + face). States: idle (three strips peeking), hover/focus on a card (that card raised with balance), pressed (raised card scales to 0.98), switching between cards, reduced motion.
IMPLEMENTATION: React with Motion for React: each card is a motion.button with an animate y driven by an activeId state and layout-independent transforms; pocket is drawn above the cards with a clip so the lower part of the cards stays hidden. Use only transform and opacity for 60fps. prefers-reduced-motion: cross-fade the raised card in place with no travel. Keyboard: cards are focusable buttons in order; focus raises the card, Enter selects it, visible focus ring on the strip; announce the balance with aria-live polite.
ADAPT TO THE PROJECT: Reuse the project's existing design tokens, fonts and card components; map card colors to the closest brand or account colors. Do not copy logos, brand names or numbers from the original; use placeholder account names and balances.
SUCCESS CHECK:
- In idle state only the three top strips are visible above the pocket.
- Hovering or focusing a card raises it smoothly and shows its balance; leaving tucks it back.
- Moving from one card to the next never leaves two cards raised.