StealThis .dev

Music — Waveform / Progress Scrubber

A SoundCloud-style waveform progress scrubber built from CSS-drawn vertical bars. The played portion fills with the accent color while the rest stays muted, and a glowing draggable playhead tracks position with a time tooltip. Hover shows a preview line, click or drag seeks instantly, and a playback-speed selector changes how fast the bars fill. Includes a compact reusable variant inside a now-playing queue, all simulated with timers and no audio.

Abrir no Lab
html css vanilla-js
Targets: JS HTML

Code

Waveform / Progress Scrubber

A reusable, SoundCloud-style waveform scrubber drawn entirely from CSS bars — no canvas, no images, no audio files. A deterministic generator blends a slow sine envelope with seeded noise so each track gets its own stable, real-looking waveform. The played portion fills with the accent color while the remainder stays muted; a glowing playhead with a tabular-numerals time tooltip marks the current position, and hovering anywhere over the bars reveals a thin preview line plus a timestamp bubble for the spot under the cursor.

Playback is simulated with requestAnimationFrame: the bars fill in real time, the play/pause button morphs between glyphs, an equalizer animates while playing, and the speed selector (0.5×–2×) changes the fill rate directly. You can seek by clicking or dragging the playhead, jump ±10s with the skip buttons, or drive everything from the keyboard — the scrubber exposes role="slider" with arrow-key, Shift, Home and End support and live aria-valuetext.

The same Scrubber controller powers a compact variant inside the now-playing queue, where each row carries its own miniature waveform, independent play/pause, and a live countdown duration. Starting any source pauses the others, so the demo behaves like a single coherent player. A small toast() helper surfaces actions like seeking, liking, and track completion.

Illustrative UI only — fictional artists, albums, tracks, and data. No real audio playback.