Oban → Craignure
Afloat
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardAfloat(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/card-afloatAbout this component
A ferry ticket card floating on the water, its lower edge under the surface: it bobs and rocks gently on its own, and pressing it pushes that side under, sending a ripple out across the water before it rights itself and bobs back up.
- Dependencies
- None
- Difficulty
- Intermediate
- Reduced motion
- Respected
- Theme
- Light and dark
- Follows page color-scheme
Triggers4
- Click
- Spring
- Ambient
- Card
Techniques4
- requestAnimationFrame
- Spring
- Event position
- Keyframes
Accessibility
Keyboard and screen readers
The ticket is real text in an article labelled with the route; pressing is a pointer flourish only, so it needs no keyboard equivalent.
Reduced motion
The ticket floats still and a press only sends the ripple.
Use it in anything you build, commercial and client work included. Licence
More cards
See allWalnut · bellows in good order
Lighthouse · Sutherland