Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/retro-cosmic-arcade/llms.txt
Use this file to discover all available pages before exploring further.
Polaroid is a draggable, tilt-and-hover-animated project card designed to look like a physical polaroid photograph. Each card can be given an initial rotation angle so a grid of cards looks like they were casually tossed onto a desk. The card exposes title, description, DEMO and SRC link slots, an optional colored badge stamp at the top-right corner, and an optional “MOCK DATA” warning label for work-in-progress projects.
Props
The project name. Rendered twice: once in the scanline panel area using
font-vt323 text-y2k-cyan text-2xl, and again beneath the panel in font-silkscreen text-black text-sm.A short project description rendered below the title in
font-inter text-gray-600 text-xs leading-tight.Optional short text (e.g.
"NEW", "WIP", "HOT") rendered as a rotated stamp in the top-right corner of the card. The badge uses bg-y2k-magenta text-white font-silkscreen with a rotate-12 transform and a 2px black border. Omit this prop to hide the badge entirely.The card’s initial CSS rotation in degrees, applied via Framer Motion’s
initial={{ rotate: rotation }}. Use small positive and negative values (e.g. -5 to 5) to create a scattered-cards layout. Defaults to 0 if omitted.When
true, a yellow "MOCK DATA" stamp is rendered in the bottom-right corner of the card footer, rotated -6deg. Use this to visually flag cards that display placeholder content. Defaults to false if omitted.Usage
Single card
Scattered grid
Drag behavior
The component uses Framer Motion’sdrag prop with dragConstraints to allow the card to be dragged around within a bounded box relative to its resting position:
| Constraint | Value |
|---|---|
left | -50px |
right | 50px |
top | -50px |
bottom | 50px |
cursor-grab at rest and cursor-grabbing while the card is being dragged, matching expected drag interaction feedback.
Hover and drag gestures
| Gesture | Framer Motion value |
|---|---|
whileHover | scale: 1.05, zIndex: 50 |
whileDrag | scale: 1.1, zIndex: 50, rotate: 0 |
initial | rotate: <rotation prop> |
zIndex: 50 is applied on both hover and drag so the active card always floats above its siblings in a stacked layout.
Card anatomy
Styling notes
- The card body is
w-64 bg-white— a fixed 256px width. Wrap cards in a flex or grid container to control overall layout. - The
scanlinesclass on the overlay div adds a CSS repeating-linear-gradient pattern that simulates an old CRT scan-line effect. This class must be defined in your global stylesheet. - DEMO and SRC
<a>tags are currently hardcoded tohref="#".
Caveats
Because drag uses Framer Motion’s internal layout system,
Polaroid cards must not be placed inside an element with overflow: hidden unless you intend to clip the drag area.Dependencies
- Framer Motion —
motion.divwithdrag,dragConstraints,whileHover,whileDrag, andinitialare all used.