StealThis .dev

Music — Search (artists · albums · tracks)

A tactile, Spotify-style music search built in vanilla JS. A prominent rounded input with an animated search icon drives debounced live filtering over a fictional catalog of artists, albums, songs and playlists. Results group into a themed Top result card plus Songs, Artists, Albums and Playlists sections, with a category chip row to narrow scope. Matched substrings highlight in the accent color, recent searches persist with clear-all, and arrow-key navigation plus Enter triggers simulated playback with animated equalizers, play counts and durations.

Lab에서 열기
html css vanilla-js
Targets: JS HTML

Code

Search (artists · albums · tracks)

A dark-first music search component centered on a prominent rounded input with an animated magnifier that tilts and tints to the accent on focus. As you type, a debounced client-side filter sweeps a fictional catalog and groups the hits into a themed Top result card followed by Songs, Artists, Albums and Playlists sections. Each result carries CSS-drawn album art (no images), and the matched part of every name highlights inline in the accent color.

A chip row — All / Songs / Artists / Albums / Playlists — narrows the result set, swapping the layout between the grouped overview and a single focused list. Rows reveal a play overlay and play count on hover, songs show duration timestamps, and artist art is rendered round. Press the arrow keys to walk through results and Enter to “play”: the active row picks up its cover-pulled accent and an animated four-bar equalizer, while a toast confirms what’s now playing. When the field is empty, recent searches appear instead, persisted to localStorage with per-item remove and a clear-all action.

Everything is theme-driven from CSS custom properties, with role="combobox"/role="option" wiring, aria-selected chips, AA-contrast body text, visible focus rings, a responsive layout down to ~360px, and a prefers-reduced-motion fallback. No frameworks, no images, and no audio — playback is simulated with class toggles and timers.

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