UI Micro-interactions
Scratch Foil
A postcard under a matte wax coating (graphite, or clay in light mode); scratch with a finger to reveal a drawing, and past half the rest eases away.
canvasmedium complexitymoderate motionpointer+keyboardmobile-readyaccessible
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
A playful reveal: a gift, a reward, a hidden picture.
When not to
Hiding text people must read, or coupon and discount copy.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Matte paper register (graphite or clay wax on cream; #1C1B18 / #F4F1EA). Edit --sf-* tokens; replace the .sf-pic SVG; BRUSH and DONE set the brush and the auto-clear share.
Safe to edit
- --sf-* tokens
- .sf-pic SVG drawing
- BRUSH, DONE
Keep intact
- IIFE + prefix, reduced-motion, visibilitychange, theme hook, demo-v1
Known limitations
- Resizing re-covers a part-scratched card
More UI Micro-interactions components
- Add to Cart FlyNative Add button flings a product clone into a cart; first input cancels unfinished attract flights, while each manual action keeps its full 680ms flight…
- Notification BellSVG bell swings and rings with a ripple wave on click; a red badge counter pops in with a springy bounce and increments each ring. Auto-cycles every 2…
- Copy ConfirmCopy icon morphs to a drawn-stroke checkmark with a green button flash and a "Copied!" toast on click; auto-cycles as a demo loop.
- Swipe Card StackTinder-style draggable card stack — drag the top card left/right to reveal NOPE/LIKE stamps; fling-away animates it off-screen and cycles to the next card.
- Pull to RefreshA phone-frame list supports pointer/touch pull and a native Refresh button. First input stops attract refreshes; manual refresh completes its spinner, row…
- Accordion ExpandThree FAQ panels smoothly expand and collapse with a CSS height transition; a chevron rotates 180 degrees to indicate open state. Auto-cycles as demo.