Reproductor de Música Estilo Tarjeta

Intermedio

Una interfaz moderna de reproductor de música basada en tarjetas con portadas de álbumes, controles interactivos y animaciones suaves.

Vista Previa en Vivo

Implementación del Código

HTML
<div class="card-music-player">
  <div class="player-header">
    <h1 class="player-title">Mi Música</h1>
    <div class="player-stats">
      <span class="total-songs">24 canciones</span>
      <span class="total-duration">1h 32m</span>
    </div>
  </div>
  
  <div class="now-playing-card">
    <div class="album-art-container">
      <div class="album-art">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='grad1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23ff6b6b;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%234ecdc4;stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23grad1)'/%3E%3Ccircle cx='100' cy='100' r='60' fill='%23fff' opacity='0.2'/%3E%3Ccircle cx='100' cy='100' r='20' fill='%23333'/%3E%3C/svg%3E" alt="Portada del Álbum">
        <div class="play-overlay">
          <button class="main-play-btn" id="main-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>
        </div>
      </div>
      <div class="vinyl-effect"></div>
    </div>
    
    <div class="track-info">
      <h2 class="track-title" id="current-track-title">Sueños de Medianoche</h2>
      <p class="track-artist" id="current-track-artist">Luna y Las Estrellas</p>
      <div class="track-details">
        <span class="album-name">Vibraciones Cósmicas</span>
        <span class="release-year">2024</span>
      </div>
    </div>
    
    <div class="progress-section">
      <div class="time-display">
        <span id="current-time">2:34</span>
        <span id="total-time">4:12</span>
      </div>
      <div class="progress-bar-container">
        <div class="progress-bar" id="progress-bar">
          <div class="progress-fill" id="progress-fill"></div>
          <div class="progress-handle" id="progress-handle"></div>
        </div>
      </div>
    </div>
    
    <div class="player-controls">
      <button class="control-btn" id="shuffle-btn" aria-label="Aleatorio">
        <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" aria-label="Anterior">
        <svg viewBox="0 0 24 24" fill="currentColor">
          <path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/>
        </svg>
      </button>
      
      <button class="control-btn play-pause-btn" id="play-pause-btn" aria-label="Reproducir/Pausar">
        <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" aria-label="Siguiente">
        <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" aria-label="Repetir">
        <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">
      <button class="control-btn" id="volume-btn" aria-label="Volumen">
        <svg 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.02z"/>
        </svg>
      </button>
      <div class="volume-slider">
        <input type="range" id="volume-slider" min="0" max="100" value="75">
        <div class="volume-fill"></div>
      </div>
    </div>
  </div>
  
  <div class="playlist-section">
    <h3 class="playlist-title">A Continuación</h3>
    <div class="music-cards-container">
      <div class="music-card active" data-title="Sueños de Medianoche" data-artist="Luna y Las Estrellas" data-album="Vibraciones Cósmicas" data-duration="4:12">
        <div class="card-album-art">
          <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cdefs%3E%3ClinearGradient id='grad2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23ff6b6b;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%234ecdc4;stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23grad2)'/%3E%3Ccircle cx='40' cy='40' r='25' fill='%23fff' opacity='0.2'/%3E%3Ccircle cx='40' cy='40' r='8' fill='%23333'/%3E%3C/svg%3E" alt="Álbum">
          <div class="card-play-btn">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M8 5v14l11-7z"/>
            </svg>
          </div>
        </div>
        <div class="card-info">
          <h4 class="card-title">Sueños de Medianoche</h4>
          <p class="card-artist">Luna y Las Estrellas</p>
          <span class="card-duration">4:12</span>
        </div>
        <div class="card-actions">
          <button class="action-btn" aria-label="Me gusta">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
            </svg>
          </button>
          <button class="action-btn" aria-label="Más">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
            </svg>
          </button>
        </div>
      </div>
      
      <div class="music-card" data-title="Ondas Estelares" data-artist="Colectivo Cósmico" data-album="Espacio Profundo" data-duration="3:45">
        <div class="card-album-art">
          <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cdefs%3E%3ClinearGradient id='grad3' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%236c5ce7;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%23a8e6cf;stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23grad3)'/%3E%3Ccircle cx='40' cy='40' r='25' fill='%23fff' opacity='0.2'/%3E%3Ccircle cx='40' cy='40' r='8' fill='%23333'/%3E%3C/svg%3E" alt="Álbum">
          <div class="card-play-btn">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M8 5v14l11-7z"/>
            </svg>
          </div>
        </div>
        <div class="card-info">
          <h4 class="card-title">Ondas Estelares</h4>
          <p class="card-artist">Colectivo Cósmico</p>
          <span class="card-duration">3:45</span>
        </div>
        <div class="card-actions">
          <button class="action-btn" aria-label="Me gusta">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
            </svg>
          </button>
          <button class="action-btn" aria-label="Más">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
            </svg>
          </button>
        </div>
      </div>
      
      <div class="music-card" data-title="Noches de Neón" data-artist="Sociedad Synthwave" data-album="Futuro Retro" data-duration="5:28">
        <div class="card-album-art">
          <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cdefs%3E%3ClinearGradient id='grad4' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23fd79a8;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%23fdcb6e;stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23grad4)'/%3E%3Ccircle cx='40' cy='40' r='25' fill='%23fff' opacity='0.2'/%3E%3Ccircle cx='40' cy='40' r='8' fill='%23333'/%3E%3C/svg%3E" alt="Álbum">
          <div class="card-play-btn">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M8 5v14l11-7z"/>
            </svg>
          </div>
        </div>
        <div class="card-info">
          <h4 class="card-title">Noches de Neón</h4>
          <p class="card-artist">Sociedad Synthwave</p>
          <span class="card-duration">5:28</span>
        </div>
        <div class="card-actions">
          <button class="action-btn liked" aria-label="No me gusta">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
            </svg>
          </button>
          <button class="action-btn" aria-label="Más">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
            </svg>
          </button>
        </div>
      </div>
      
      <div class="music-card" data-title="Brisa del Océano" data-artist="Colectivo Ambiental" data-album="Sonidos de la Naturaleza" data-duration="6:15">
        <div class="card-album-art">
          <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cdefs%3E%3ClinearGradient id='grad5' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%2300b894;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%2300cec9;stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23grad5)'/%3E%3Ccircle cx='40' cy='40' r='25' fill='%23fff' opacity='0.2'/%3E%3Ccircle cx='40' cy='40' r='8' fill='%23333'/%3E%3C/svg%3E" alt="Álbum">
          <div class="card-play-btn">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M8 5v14l11-7z"/>
            </svg>
          </div>
        </div>
        <div class="card-info">
          <h4 class="card-title">Brisa del Océano</h4>
          <p class="card-artist">Colectivo Ambiental</p>
          <span class="card-duration">6:15</span>
        </div>
        <div class="card-actions">
          <button class="action-btn" aria-label="Me gusta">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
            </svg>
          </button>
          <button class="action-btn" aria-label="Más">
            <svg viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
            </svg>
          </button>
        </div>
      </div>
    </div>
  </div>
</div>

Características del Fragmento

Diseño Responsivo: Sí
Soporte para Modo Oscuro: Sí
Categoría: content-cards
Nivel de Dificultad: Intermedio

Compatibilidad del Navegador

🟢
chrome 60+
🟠
firefox 55+
🔵
safari 10+
🟦
edge 15+