The user wants a custom HTML audio player with playlist functionality. Let me create something visually striking and not generic-looking.
Key features to include:
- Audio player with custom controls (play/pause, next/prev, progress bar, volume)
- Playlist with multiple tracks
- Interactive elements - hover states, animations
- Visual polish - good typography, cohesive color scheme
Design direction:
- I'll go for a modern, slightly brutalist/industrial aesthetic
- Use a dark theme with a sharp accent color
- Distinctive typography - maybe Space Grotesk or JetBrains Mono for a technical feel
- Background with subtle depth - maybe noise texture or gradient
Features:
- Custom play/pause, prev/next buttons
- Progress bar with seek functionality
- Volume control
- Playlist with track selection
- Current track info display
- Track duration/elapsed time
- Visualizer or waveform representation
- Keyboard controls
Let me create a polished, professional audio player that looks intentionally designed.
I'll use:
- Space Grotesk for headlines
- JetBrains Mono for technical elements (time, track numbers)
- Dark background with orange/amber accent
- Subtle gradients and shadows for depth
Interactions:
- Play/pause with animation
- Progress bar seeking
- Volume control
- Playlist item selection with hover effects
- Track navigation
- Keyboard shortcuts (space for play/pause, arrows for seek)
Let me build this out...
Custom Audio Player with Playlist
I'll create a striking, industrial-themed audio player with a dark aesthetic and sharp orange accents. Here's my approach:
- Design: Dark industrial theme with warm accent, using Space Grotesk + JetBrains Mono
- Features: Full playlist, seekable progress, volume control, keyboard shortcuts
- Interactions: Waveform visualization, smooth transitions, hover states
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>APEX Audio Player</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Space+Grotesk:wght@400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0a0b;
--bg-elevated: #141416;
--fg: #f5f5f4;
--muted: #6b6b6b;
--accent: #ff6b2c;
--accent-dim: rgba(255, 107, 44, 0.15);
--card: #1a1a1d;
--border: #2a2a2d;
}
* {
box-sizing: border-box;
}
body {
font-family: 'Space Grotesk', sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
margin: 0;
overflow-x: hidden;
}
.font-mono {
font-family: 'JetBrains Mono', monospace;
}
/* Background texture */
.bg-texture {
background-image:
radial-gradient(ellipse at 20% 0%, rgba(255, 107, 44, 0.08) 0%, transparent 50%),
radial-gradient(ellipse at 80% 100%, rgba(255, 107, 44, 0.05) 0%, transparent 50%),
url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
background-blend-mode: overlay, overlay, soft-light;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: var(--bg-elevated);
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--muted);
}
/* Progress bar */
.progress-container {
position: relative;
height: 6px;
background: var(--border);
border-radius: 3px;
cursor: pointer;
overflow: hidden;
}
.progress-bar {
height: 100%;
background: linear-gradient(90deg, var(--accent), #ff8f5c);
border-radius: 3px;
position: relative;
transition: width 0.1s linear;
}
.progress-container:hover .progress-bar {
box-shadow: 0 0 12px rgba(255, 107, 44, 0.5);
}
.progress-thumb {
position: absolute;
right: -6px;
top: 50%;
transform: translateY(-50%) scale(0);
width: 12px;
height: 12px;
background: var(--fg);
border-radius: 50%;
transition: transform 0.15s ease;
}
.progress-container:hover .progress-thumb {
transform: translateY(-50%) scale(1);
}
/* Volume slider */
.volume-slider {
-webkit-appearance: none;
appearance: none;
height: 4px;
background: var(--border);
border-radius: 2px;
outline: none;
cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
background: var(--fg);
border-radius: 50%;
cursor: pointer;
transition: transform 0.15s ease;
}
.volume-slider::-webkit-slider-thumb:hover {
transform: scale(1.2);
}
.volume-slider::-moz-range-thumb {
width: 12px;
height: 12px;
background: var(--fg);
border-radius: 50%;
border: none;
cursor: pointer;
}
/* Buttons */
.control-btn {
background: transparent;
border: none;
color: var(--fg);
cursor: pointer;
padding: 8px;
border-radius: 50%;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.control-btn:hover {
background: var(--accent-dim);
color: var(--accent);
}
.control-btn:active {
transform: scale(0.92);
}
.control-btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.play-btn {
width: 64px;
height: 64px;
background: var(--accent);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
box-shadow: 0 4px 20px rgba(255, 107, 44, 0.3);
}
.play-btn:hover {
background: #ff8247;
transform: scale(1.05);
box-shadow: 0 6px 28px rgba(255, 107, 44, 0.4);
}
.play-btn:active {
transform: scale(0.98);
}
/* Playlist items */
.playlist-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
border: 1px solid transparent;
}
.playlist-item:hover {
background: var(--card);
border-color: var(--border);
}
.playlist-item.active {
background: var(--accent-dim);
border-color: var(--accent);
}
.playlist-item.active .track-number {
color: var(--accent);
}
/* Waveform visualizer */
.waveform {
display: flex;
align-items: center;
justify-content: center;
gap: 3px;
height: 32px;
}
.wave-bar {
width: 3px;
background: var(--accent);
border-radius: 2px;
transition: height 0.1s ease;
}
.wave-bar.playing {
animation: wave 0.5s ease-in-out infinite;
}
@keyframes wave {
0%, 100% { transform: scaleY(0.4); }
50% { transform: scaleY(1); }
}
/* Entrance animations */
@keyframes fadeSlideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-in {
animation: fadeSlideUp 0.6s ease forwards;
opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
/* Album art */
.album-art {
position: relative;
overflow: hidden;
border-radius: 12px;
}
.album-art::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.8));
}
.album-art img {
transition: transform 0.4s ease;
}
.album-art:hover img {
transform: scale(1.05);
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.wave-bar.playing {
animation: none;
}
}
</style>
</head>
<body class="bg-texture">
<div class="min-h-screen flex items-center justify-center p-4 md:p-8">
<div class="w-full max-w-4xl">
<!-- Header -->
<header class="mb-8 animate-in">
<div class="flex items-center gap-3 mb-2">
<div class="w-2 h-2 rounded-full bg-[var(--accent)]"></div>
<span class="font-mono text-xs tracking-widest text-[var(--muted)] uppercase">Now Playing</span>
</div>
<h1 class="text-3xl md:text-4xl font-bold tracking-tight">APEX Player</h1>
</header>
<!-- Main Player -->
<div class="bg-[var(--bg-elevated)] rounded-2xl border border-[var(--border)] overflow-hidden animate-in delay-1">
<!-- Player Header -->
<div class="p-6 md:p-8 flex flex-col md:flex-row gap-6 md:gap-8">
<!-- Album Art -->
<div class="album-art w-full md:w-48 h-48 md:h-48 flex-shrink-0 bg-[var(--card)]">
<img id="albumArt" src="" alt="Album Art" class="w-full h-full object-cover">
</div>
<!-- Track Info & Controls -->
<div class="flex-1 flex flex-col justify-between min-w-0">
<div>
<p class="font-mono text-xs text-[var(--muted)] mb-1" id="trackArtist">Artist</p>
<h2 class="text-xl md:text-2xl font-bold truncate mb-1" id="trackTitle">Track Title</h2>
<p class="text-sm text-[var(--muted)]" id="trackAlbum">Album</p>
</div>
<!-- Waveform Visualizer -->
<div class="waveform my-4" id="waveform">
<!-- Generated by JS -->
</div>
<!-- Progress -->
<div class="mb-4">
<div class="progress-container" id="progressContainer">
<div class="progress-bar" id="progressBar" style="width: 0%">
<div class="progress-thumb"></div>
</div>
</div>
<div class="flex justify-between mt-2 font-mono text-xs text-[var(--muted)]">
<span id="currentTime">0:00</span>
<span id="duration">0:00</span>
</div>
</div>
<!-- Main Controls -->
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<button class="control-btn" id="shuffleBtn" aria-label="Shuffle">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="16 3 21 3 21 8"></polyline>
<line x1="4" y1="20" x2="21" y2="3"></line>
<polyline points="21 16 21 21 16 21"></polyline>
<line x1="15" y1="15" x2="21" y2="21"></line>
<line x1="4" y1="4" x2="9" y2="9"></line>
</svg>
</button>
</div>
<div class="flex items-center gap-3">
<button class="control-btn" id="prevBtn" aria-label="Previous track">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
<path d="M6 6h2v12H6V6zm3.5 6 8.5 6V6l-8.5 6z"/>
</svg>
</button>
<button class="play-btn" id="playBtn" aria-label="Play">
<svg id="playIcon" width="28" height="28" viewBox="0 0 24 24" fill="white">
<path d="M8 5v14l11-7z"/>
</svg>
<svg id="pauseIcon" width="28" height="28" viewBox="0 0 24 24" fill="white" style="display: none;">
<path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
</svg>
</button>
<button class="control-btn" id="nextBtn" aria-label="Next track">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
<path d="M6 18l8.5-6L6 6v12zm2-12v12l6.5-6L8 6zm8 0v12h2V6h-2z"/>
</svg>
</button>
</div>
<div class="flex items-center gap-2">
<button class="control-btn" id="repeatBtn" aria-label="Repeat">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="17 1 21 5 17 9"></polyline>
<path d="M3 11V9a4 4 0 0 1 4-4h14"></path>
<polyline points="7 23 3 19 7 15"></polyline>
<path d="M21 13v2a4 4 0 0 1-4 4H3"></path>
</svg>
</button>
</div>
</div>
</div>
</div>
<!-- Volume Control -->
<div class="px-6 md:px-8 py-4 border-t border-[var(--border)] flex items-center gap-4">
<button class="control-btn p-1" id="muteBtn" aria-label="Mute">
<svg id="volumeIcon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon>
<path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path>
</svg>
<svg id="muteIcon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;">
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon>
<line x1="23" y1="9" x2="17" y2="15"></line>
<line x1="17" y1="9" x2="23" y2="15"></line>
</svg>
</button>
<input type="range" class="volume-slider w-24" id="volumeSlider" min="0" max="100" value="80" aria-label="Volume">
<span class="font-mono text-xs text-[var(--muted)] w-8" id="volumeValue">80%</span>
</div>
</div>
<!-- Playlist -->
<div class="mt-6 animate-in delay-2">
<div class="flex items-center justify-between mb-4">
<h3 class="font-mono text-sm tracking-widest text-[var(--muted)] uppercase">Playlist</h3>
<span class="font-mono text-xs text-[var(--muted)]" id="trackCount">0 tracks</span>
</div>
<div class="bg-[var(--bg-elevated)] rounded-xl border border-[var(--border)] overflow-hidden">
<div class="max-h-80 overflow-y-auto p-2" id="playlistContainer">
<!-- Generated by JS -->
</div>
</div>
</div>
<!-- Keyboard shortcuts hint -->
<div class="mt-6 text-center animate-in delay-3">
<p class="font-mono text-xs text-[var(--muted)]">
<kbd class="px-2 py-1 bg-[var(--card)] rounded border border-[var(--border)]">Space</kbd> Play/Pause
<kbd class="px-2 py-1 bg-[var(--card)] rounded border border-[var(--border)] ml-2">←</kbd>
<kbd class="px-2 py-1 bg-[var(--card)] rounded border border-[var(--border)]">→</kbd> Seek
<kbd class="px-2 py-1 bg-[var(--card)] rounded border border-[var(--border)] ml-2">↑</kbd>
<kbd class="px-2 py-1 bg-[var(--card)] rounded border border-[var(--border)]">↓</kbd> Volume
</p>
</div>
</div>
</div>
<!-- Hidden audio element -->
<audio id="audioPlayer" preload="metadata"></audio>
<script>
// Playlist data with sample audio URLs (using placeholder sounds)
const playlist = [
{
id: 1,
title: "Midnight Drive",
artist: "Synthwave Collective",
album: "Neon Dreams",
duration: "3:42",
durationSec: 222,
cover: "https://images.unsplash.com/photo-1614149162883-504ce4d13909?w=400&h=400&fit=crop",
src: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
},
{
id: 2,
title: "Digital Horizon",
artist: "Echo Chamber",
album: "Binary Sunset",
duration: "4:15",
durationSec: 255,
cover: "https://images.unsplash.com/photo-1557672172-298e090bd0f1?w=400&h=400&fit=crop",
src: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3"
},
{
id: 3,
title: "Pulse",
artist: "Rhythm Theory",
album: "Frequency",
duration: "3:58",
durationSec: 238,
cover: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=400&h=400&fit=crop",
src: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3"
},
{
id: 4,
title: "Static Dreams",
artist: "White Noise",
album: "Interference",
duration: "5:02",
durationSec: 302,
cover: "https://images.unsplash.com/photo-1558591710-4b4a1ae0f04d?w=400&h=400&fit=crop",
src: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3"
},
{
id: 5,
title: "Velocity",
artist: "Turbo",
album: "Speed Run",
duration: "3:33",
durationSec: 213,
cover: "https://images.unsplash.com/photo-1614850523459-c2f4c699c52e?w=400&h=400&fit=crop",
src: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-5.mp3"
}
];
// State
let currentTrackIndex = 0;
let isPlaying = false;
let isShuffle = false;
let isRepeat = false;
let previousVolume = 80;
// DOM Elements - Initialize after ensuring they exist
const audioPlayer = document.getElementById('audioPlayer');
const playBtn = document.getElementById('playBtn');
const playIcon = document.getElementById('playIcon');
const pauseIcon = document.getElementById('pauseIcon');
const prevBtn = document.getElementById('prevBtn');
const nextBtn = document.getElementById('nextBtn');
const shuffleBtn = document.getElementById('shuffleBtn');
const repeatBtn = document.getElementById('repeatBtn');
const muteBtn = document.getElementById('muteBtn');
const volumeIcon = document.getElementById('volumeIcon');
const muteIcon = document.getElementById('muteIcon');
const volumeSlider = document.getElementById('volumeSlider');
const volumeValue = document.getElementById('volumeValue');
const progressContainer = document.getElementById('progressContainer');
const progressBar = document.getElementById('progressBar');
const currentTimeEl = document.getElementById('currentTime');
const durationEl = document.getElementById('duration');
const trackTitle = document.getElementById('trackTitle');
const trackArtist = document.getElementById('trackArtist');
const trackAlbum = document.getElementById('trackAlbum');
const albumArt = document.getElementById('albumArt');
const playlistContainer = document.getElementById('playlistContainer');
const trackCount = document.getElementById('trackCount');
const waveformEl = document.getElementById('waveform');
// Initialize waveform bars
function initWaveform() {
waveformEl.innerHTML = '';
for (let i = 0; i < 20; i++) {
const bar = document.createElement('div');
bar.className = 'wave-bar';
const baseHeight = 8 + Math.random() * 24;
bar.style.height = `${baseHeight}px`;
bar.style.animationDelay = `${i * 0.05}s`;
waveformEl.appendChild(bar);
}
}
// Format time
function formatTime(seconds) {
if (isNaN(seconds) || !isFinite(seconds)) return '0:00';
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
return `${mins}:${secs.toString().padStart(2, '0')}`;
}
// Update track info
function updateTrackInfo() {
const track = playlist[currentTrackIndex];
if (!track) return;
trackTitle.textContent = track.title;
trackArtist.textContent = track.artist;
trackAlbum.textContent = track.album;
albumArt.src = track.cover;
audioPlayer.src = track.src;
durationEl.textContent = track.duration;
updatePlaylistUI();
}
// Update playlist UI
function updatePlaylistUI() {
playlistContainer.innerHTML = '';
playlist.forEach((track, index) => {
const item = document.createElement('div');
item.className = `playlist-item ${index === currentTrackIndex ? 'active' : ''}`;
item.setAttribute('role', 'button');
item.setAttribute('tabindex', '0');
item.setAttribute('aria-label', `Play ${track.title} by ${track.artist}`);
item.innerHTML = `
<span class="track-number font-mono text-xs text-[var(--muted)] w-6">${String(index + 1).padStart(2, '0')}</span>
<img src="${track.cover}" alt="${track.album}" class="w-10 h-10 rounded object-cover">
<div class="flex-1 min-w-0">
<p class="text-sm font-medium truncate">${track.title}</p>
<p class="text-xs text-[var(--muted)] truncate">${track.artist}</p>
</div>
<span class="font-mono text-xs text-[var(--muted)]">${track.duration}</span>
`;
item.addEventListener('click', () => selectTrack(index));
item.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
selectTrack(index);
}
});
playlistContainer.appendChild(item);
});
trackCount.textContent = `${playlist.length} tracks`;
}
// Select track
function selectTrack(index) {
currentTrackIndex = index;
updateTrackInfo();
if (isPlaying) {
audioPlayer.play();
} else {
togglePlay();
}
}
// Toggle play/pause
function togglePlay() {
if (isPlaying) {
audioPlayer.pause();
isPlaying = false;
playIcon.style.display = 'block';
pauseIcon.style.display = 'none';
document.querySelectorAll('.wave-bar').forEach(bar => bar.classList.remove('playing'));
} else {
audioPlayer.play();
isPlaying = true;
playIcon.style.display = 'none';
pauseIcon.style.display = 'block';
document.querySelectorAll('.wave-bar').forEach(bar => bar.classList.add('playing'));
}
}
// Previous track
function prevTrack() {
if (audioPlayer.currentTime > 3) {
audioPlayer.currentTime = 0;
} else {
currentTrackIndex = (currentTrackIndex - 1 + playlist.length) % playlist.length;
updateTrackInfo();
if (isPlaying) audioPlayer.play();
}
}
// Next track
function nextTrack() {
if (isShuffle) {
let newIndex;
do {
newIndex = Math.floor(Math.random() * playlist.length);
} while (newIndex === currentTrackIndex && playlist.length > 1);
currentTrackIndex = newIndex;
} else {
currentTrackIndex = (currentTrackIndex + 1) % playlist.length;
}
updateTrackInfo();
if (isPlaying) audioPlayer.play();
}
// Update progress
function updateProgress() {
const current = audioPlayer.currentTime;
const duration = audioPlayer.duration || 1;
const percent = Math.min(100, Math.max(0, (current / duration) * 100));
progressBar.style.width = `${percent}%`;
currentTimeEl.textContent = formatTime(current);
}
// Seek
function seek(e) {
const rect = progressContainer.getBoundingClientRect();
const percent = Math.min(1, Math.max(0, (e.clientX - rect.left) / rect.width));
const duration = audioPlayer.duration || 0;
if (duration > 0) {
audioPlayer.currentTime = percent * duration;
}
}
// Toggle shuffle
function toggleShuffle() {
isShuffle = !isShuffle;
shuffleBtn.style.color = isShuffle ? 'var(--accent)' : '';
}
// Toggle repeat
function toggleRepeat() {
isRepeat = !isRepeat;
repeatBtn.style.color = isRepeat ? 'var(--accent)' : '';
}
// Update volume
function updateVolume(value) {
const vol = Math.min(100, Math.max(0, value));
audioPlayer.volume = vol / 100;
volumeSlider.value = vol;
volumeValue.textContent = `${Math.round(vol)}%`;
if (vol === 0) {
volumeIcon.style.display = 'none';
muteIcon.style.display = 'block';
} else {
volumeIcon.style.display = 'block';
muteIcon.style.display = 'none';
}
}
// Toggle mute
function toggleMute() {
if (audioPlayer.volume > 0) {
previousVolume = audioPlayer.volume * 100;
updateVolume(0);
} else {
updateVolume(previousVolume);
}
}
// Event listeners
playBtn.addEventListener('click', togglePlay);
prevBtn.addEventListener('click', prevTrack);
nextBtn.addEventListener('click', nextTrack);
shuffleBtn.addEventListener('click', toggleShuffle);
repeatBtn.addEventListener('click', toggleRepeat);
muteBtn.addEventListener('click', toggleMute);
volumeSlider.addEventListener('input', (e) => {
updateVolume(parseInt(e.target.value));
});
progressContainer.addEventListener('click', seek);
audioPlayer.addEventListener('timeupdate', updateProgress);
audioPlayer.addEventListener('ended', () => {
if (isRepeat) {
audioPlayer.currentTime = 0;
audioPlayer.play();
} else {
nextTrack();
}
});
audioPlayer.addEventListener('loadedmetadata', () => {
durationEl.textContent = formatTime(audioPlayer.duration);
});
// Keyboard controls
document.addEventListener('keydown', (e) => {
// Ignore if user is typing in an input
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
switch (e.code) {
case 'Space':
e.preventDefault();
togglePlay();
break;
case 'ArrowLeft':
e.preventDefault();
audioPlayer.currentTime = Math.max(0, audioPlayer.currentTime - 5);
break;
case 'ArrowRight':
e.preventDefault();
audioPlayer.currentTime = Math.min(audioPlayer.duration || 0, audioPlayer.currentTime + 5);
break;
case 'ArrowUp':
e.preventDefault();
updateVolume(audioPlayer.volume * 100 + 5);
break;
case 'ArrowDown':
e.preventDefault();
updateVolume(audioPlayer.volume * 100 - 5);
break;
case 'KeyM':
toggleMute();
break;
}
});
// Initialize
initWaveform();
updateTrackInfo();
updateVolume(80);
</script>
</body>
</html>
Features Implemented
Core Functionality:
- Full playlist with 5 sample tracks (using SoundHelix demo audio)
- Play/pause, previous/next track navigation
- Seekable progress bar with time display
- Volume control with mute toggle
- Shuffle and repeat modes
Visual Design:
- Dark industrial theme with warm orange accent
- Noise texture background with gradient overlays
- Album art with hover zoom effect
- Animated waveform visualizer that reacts to playback state
Interactions:
- Orchestrated entrance - Staggered fade-in animations
- Waveform animation - Bars animate when playing
- Progress bar hover - Shows draggable thumb with glow effect
- Playlist hover/active states - Smooth transitions with accent highlighting
- Button micro-interactions - Scale on press, color transitions
Keyboard Shortcuts:
Space - Play/Pause
← → - Seek backward/forward 5 seconds
↑ ↓ - Adjust volume
M - Mute toggle
Accessibility:
- Semantic HTML with ARIA labels
- Keyboard navigation for playlist items
- Focus-visible states
- Respects
prefers-reduced-motion