Record player
Craft 01 · CSS, audio
A turntable built out of gradients and transforms.
Wired to a real YouTube playlist: what I actually have on repeat.
Gradients, not images
There isn't a single image of a turntable in it. The plinth is a linear gradient with a hairline of white on its top edge and a long shadow under it, the platter is a conic gradient whose alternating greys catch light like brushed metal, and the grooves are one repeating radial gradient on the disc. The only bitmap is the label in the middle, which is the cover of whatever's playing.
"repeating-radial-gradient(circle closest-side at 50% 50%,
rgba(0,0,0,0.4) 0 0.6%, transparent 0.6% 2.9%,
rgba(255,255,255,0.04) 2.9% 3.5%, transparent 3.5% 5.8%)"Spinning is a CSS animation that never stops existing; pausing a record only sets its play state to paused, so the disc halts where it is instead of snapping back to zero. People who ask for reduced motion get a still record.
The arm follows the song
A real needle doesn't sit in one spot. It starts at the outer edge and drifts toward the label as the side plays, so the arm here does the same: parked at 129°, dropped to 139.1° when a song starts, and from there it's just the song's progress mapped onto the remaining twelve degrees.
const ARM_PARKED = 129;
const ARM_START = 139.1;
const ARM_END = 151;
const ratio = total > 0 ? Math.min(progress / total, 1) : 0;
const armAngle = live
? ARM_START + (ARM_END - ARM_START) * ratio
: ARM_PARKED;What's on it
The records are my actual YouTube playlist, read on the server and cached for an hour. YouTube titles are messy, so each one is split into artist and song, anything private or blocked from embedding is dropped before it can fail in the player, and the cover, album and year come from Apple's catalogue because YouTube thumbnails are video stills, not sleeves. If the API key is missing or YouTube is down, the page serves a playlist bundled with the site, so the deck is never empty.