UI Micro-interactions
Inverted Reading Glass
A white circular lens tracks the cursor using mix-blend-mode:difference, inverting text colors beneath it to reveal near-invisible dark text on black.
csslight complexitysubtle motionpointer
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Hero sections with hidden or low-contrast text that rewards exploration. Interactive art installations or editorial reveals.
When not to
Contexts requiring legible text at all times — text is nearly invisible without the lens. Touch-only devices get limited experience (auto-orbit fallback is narrow).
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the lens size from clamp(150px, 20vw, 250px) to clamp(80px, 12vw, 140px) and set the lerp factor from 0.15 to 0.08 for a heavier lag effect.
Safe to edit
- lens diameter (clamp(150px, 20vw, 250px))
- lerp smoothing factor (0.15)
- text content (.text-content span)
- text base color (#333333)
- auto-orbit radius multiplier (0.1)
Keep intact
- mix-blend-mode: difference on .lens
- IIFE wrapper
- visibilitychange stop/start
- prefersReducedMotion guard
Known limitations
- Text is nearly invisible without interaction — not accessible as standalone content
- Reduced-motion mode freezes lens at center with no fallback reveal
- Auto-orbit loop runs a second rAF loop alongside animate() — two concurrent rAF chains
More UI Micro-interactions components
- Add to Cart FlyProduct tile flings a mini clone in a bezier arc into a cart icon on click; badge count bumps with a spring bounce. Auto-cycles as demo.
- 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 mockup with draggable list rows; pulling down reveals a teal arc spinner that fills and rotates, then triggers a skeleton-row flash on release.
- 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.