Voice Message Bubble

A chat voice note whose waveform ignites bar by bar as the scripted playback sweeps through.

0:00

Build a voice-message bubble like in a chat app. Structure: a dark pill-shaped bubble containing, left to right: a round accent-colored play button (36px), a waveform of ~20 thin vertical bars (3px wide, heights varied between 8 and 24px, gap 2.5px), and a monospace timer like "0:00". Use a FIXED array of bar heights so the waveform is identical on every render - no randomness. Behavior: clicking play starts a scripted playback of about 3.2 seconds driven by requestAnimationFrame. As the playhead progresses, each bar whose position has been passed switches from 30% white to the full accent color, so the waveform ignites left to right. The timer counts up in whole seconds. The play icon morphs to a pause icon while playing; clicking pause freezes progress, clicking play resumes from the same spot. When playback finishes it stops (no loop) and clicking again restarts from zero. Details: the button scales to 0.88 on press. Bars change color with a 0.15s linear transition - crisp, not mushy. Accessibility: the play button's aria-label reflects state ("Play voice message" / "Pause voice message"); the timer is aria-live="polite". Under prefers-reduced-motion, a click jumps straight between empty and fully-played states with no sweep. Colors as tokens: dark ink bubble, one accent, white at low opacity for unplayed bars. 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