Skip to content
Crafts

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.

Paused
0:00 / --:--
Nothing queuedChoose a record
Fig. 1The player itself. Pick a record; the arm swings in and starts its walk across the grooves.

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.

components/shared/MusicPlayer/Disc.tsx · tsx
"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%)"
The grooves: a dark ring, a gap, a faint highlight, a gap, repeated to the edge.

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.

components/shared/MusicPlayer/Turnable.tsx · tsx
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;

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.