Modern Music Player UI

Intermediate

A sleek and modern music player interface with gradient design, playback controls, progress bar and animated playlist.

Live Preview

Code Implementation

HTML
<div class="music-player">
  <div class="album-art">
    <div class="album-cover">
      <div class="play-indicator"></div>
    </div>
  </div>
  
  <div class="song-info">
    <h3 id="song-title">Beautiful Memories</h3>
    <p id="song-artist">Ambient Dreams</p>
  </div>
  
  <div class="progress-section">
    <div class="time-display">
      <span id="current-time">0:00</span>
      <span id="total-time">3:45</span>
    </div>
    <div class="progress-bar">
      <div class="progress-fill" id="progress-fill"></div>
      <div class="progress-handle" id="progress-handle"></div>
    </div>
  </div>
  
  <div class="player-controls">
    <button class="control-btn" id="shuffle-btn">
      <svg viewBox="0 0 24 24" fill="currentColor">
        <path d="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z"/>
      </svg>
    </button>
    <button class="control-btn" id="prev-btn">
      <svg viewBox="0 0 24 24" fill="currentColor">
        <path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/>
      </svg>
    </button>
    <button class="control-btn play-btn" id="play-btn">
      <svg class="play-icon" viewBox="0 0 24 24" fill="currentColor">
        <path d="M8 5v14l11-7z"/>
      </svg>
      <svg class="pause-icon" viewBox="0 0 24 24" fill="currentColor" style="display: none;">
        <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>
      </svg>
    </button>
    <button class="control-btn" id="next-btn">
      <svg viewBox="0 0 24 24" fill="currentColor">
        <path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/>
      </svg>
    </button>
    <button class="control-btn" id="repeat-btn">
      <svg viewBox="0 0 24 24" fill="currentColor">
        <path d="M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"/>
      </svg>
    </button>
  </div>
  
  <div class="volume-section">
    <svg class="volume-icon" viewBox="0 0 24 24" fill="currentColor">
      <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>
    </svg>
    <div class="volume-bar">
      <div class="volume-fill" id="volume-fill"></div>
      <div class="volume-handle" id="volume-handle"></div>
    </div>
  </div>
  
  <div class="playlist">
    <h4>Up Next</h4>
    <div class="playlist-item active" data-src="song1.mp3" data-title="Beautiful Memories" data-artist="Ambient Dreams" data-duration="3:45">
      <div class="song-details">
        <span class="song-name">Beautiful Memories</span>
        <span class="artist-name">Ambient Dreams</span>
      </div>
      <span class="song-duration">3:45</span>
    </div>
    <div class="playlist-item" data-src="song2.mp3" data-title="Ocean Waves" data-artist="Nature Sounds" data-duration="4:12">
      <div class="song-details">
        <span class="song-name">Ocean Waves</span>
        <span class="artist-name">Nature Sounds</span>
      </div>
      <span class="song-duration">4:12</span>
    </div>
    <div class="playlist-item" data-src="song3.mp3" data-title="Midnight Jazz" data-artist="Smooth Collective" data-duration="5:23">
      <div class="song-details">
        <span class="song-name">Midnight Jazz</span>
        <span class="artist-name">Smooth Collective</span>
      </div>
      <span class="song-duration">5:23</span>
    </div>
  </div>
  
  <audio id="audio-player"></audio>
</div>

Snippet Features

Responsive Design: Yes
Dark Mode Support: No
Category: content-cards
Difficulty Level: Intermediate

Browser Compatibility

🟢
chrome 61+
🟠
firefox 60+
🔵
safari 10.1+
🟦
edge 16+