svg+css实现精美音乐播放器ui代码

代码语言:html

所属分类:布局界面

代码描述:svg+css实现精美音乐播放器ui代码

代码标签: svg css 精美 音乐 播放器 ui 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />

     <style>

.main-music-card {
    margin:70px auto;
  max-width: 420px;
  width: 90%;
  padding: 18px;
  border-radius: 35px;
  background: #000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: -apple-system, system-ui, sans-serif;
  color: white;
  transition: all 0.3s ease;
}

.track-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.album-art {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.album-art:hover {
  transform: scale(1.05);
}

.track-details {
  flex-grow: 1;
  overflow: hidden;
}

.track-title {
  font-size: 1.3em;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.artist-name {
  font-size: 0.9em;
  color: #d1d1d6;
  margin-top: 2px;
}

.volume-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 38px;
  height: 32px;
}

.volume-bars .bar {
  width: 3px;
  background: linear-gradient(180deg, #00c6ff, #0072ff);
  border-radius: 2px;
  animation: bounce 0.8s infinite ease-in-out;
  animation-delay: var(--delay);
  animation-play-state: running;
}

@keyframes bounce {
  0%,
  100% {
    height: 6px;
  }
  50% {
    height: 26px;
  }
}

.playback-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8em;
  color: #8e8e93;
}

.current-time::before {
  content: "0:00";
  animation: timer 45s steps(45) infinite;
  display: inline-block;
  animation-play-state: running;
}
@keyframes timer {
  0% {
    content: "0:00";
  }
  2.22% {
    content: "0:01";
  }
  4.44% {
    content: "0:02";
  }
  6.67% {
    content: "0:03";
  }
  8.89% {
    content: "0:04";
  }
  11.11% {
    content: "0:05";
  }
  13.33% {
    content: "0:06";
  }
  15.56% {
    content: "0:07";.........完整代码请登录后点击上方下载按钮下载查看

网友评论0