v152 ยท CSS ยท Media

Video Gallery

Six simulated video players styled entirely by CSS :playing, :paused, and :muted pseudo-classes โ€” blue highlight when playing, amber when paused, mute icon overlay when muted. No JavaScript reads or sets class names for state; the CSS does it automatically.

:playing (blue) :paused (amber) :paused (initial, no style) ๐Ÿ”‡ :muted overlay
Click the play/pause/mute buttons on each card. The thumbnail background and badge change purely via CSS โ€” no JS class toggling.
/* State-driven thumbnail background โ€” pure CSS, no JS */ video:playing ~ .thumb { background: #dbeafe; } video:paused ~ .thumb { background: #fef3c7; } /* Mute icon via ::after โ€” only shown when :muted */ video:muted ~ .thumb::after { content: '๐Ÿ”‡'; position: absolute; bottom: 0.3rem; right: 0.3rem; } /* Progress bar color changes while :playing */ video:playing ~ .progress-track .fill { background: var(--accent-blue); }

see also