Connection Lost

A status pill that shakes offline, spins reconnecting, lands online

Connected

Create a connection status pill. A pill with a colored icon circle and a status label, moving through four states: Connected (green wifi), Connection lost (red wifi-off), Reconnecting (amber spinner), Back online (green check). Per-state choreography: entering "Connection lost", the whole pill headshakes (x: 0 → -5 → 5 → -3 → 0 over 400ms). In "Reconnecting", the icon rotates continuously (360deg per 1s, linear). Every state change: the icon circle's tint morphs (350ms), the new icon pops in with a spring (from 50% scale, stiffness 480, damping 22), and the label crossfades vertically (200ms) inside a fixed-width slot so the pill never resizes. Drive the states from real connectivity events (online/offline listeners plus a heartbeat ping); for an ambient demo, loop the four states every 1.7s. Accessibility: the pill uses role="status" and the label area aria-live="polite". If prefers-reduced-motion is set, swap states instantly with no shake or spin. Build the component, not this demo of it. - Ambient motion that IS the component may loop: a drifting background, a marquee, a spinner while something is genuinely loading. - Do not add any timer, interval, loop or script that performs a person's action by itself. No auto-hover, no auto-click, no cycling through states, no pretend submitting, no replaying the interaction on a schedule. - Every state that answers a person waits for a real event from that person. - Placeholder copy and sample content are welcome. Simulated behaviour is not.

Rate it
0
0

We'd like to measure how the site gets used, with Google Analytics. It sets cookies. Everything the site needs to work runs either way. How we handle data