wavesurfer实现一款背景带音频频谱波动进度的音乐播放器代码

代码语言:html

所属分类:多媒体

代码描述:wavesurfer实现一款背景带音频频谱波动进度的音乐播放器代码

代码标签: wavesurfer 背景 音频 频谱 波动 进度 音乐 播放器 代码

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

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  <script src="https://use.typekit.net/tqi0rfb.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.5.0.css">
  
  
<style>
html {
  height: 100%;
}

body {
  background: #4f8ea5;
  background: radial-gradient(ellipse at center, #4f8ea5 0%, #343f53 50%, #1c1b26 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#4f8ea5", endColorstr="#1c1b26",GradientType=1 );
  font-family: "proxima-nova";
}

.clear:before, .time:before, .clear:after, .time:after {
  content: "";
  display: table;
}
.clear:after, .time:after {
  clear: both;
}

@-webkit-keyframes opacityAni {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes opacityAni {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.phone {
  -webkit-animation: opacityAni 400ms linear 1s forwards;
          animation: opacityAni 400ms linear 1s forwards;
  background: #1e1e28;
  background: linear-gradient(to bottom, #1e1e28 0%, #1e2e47 34%, #31bdf7 88%, #e8fefe 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#1e1e28", endColorstr="#e8fefe",GradientType=0 );
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  height: 500px;
  left: 50%;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  transform: translate(-50%, -50%);
  top: 50%;
  width: 320px;
}

.wavesurfer {
  box-sizing: border-box;
  cursor: pointer;
  height: 275px;
  margin-bottom: 30px;
  overflow: hidden;
  padding-top: 60px;
  pointer-events: none;
  position: relative;
  width: 100%;
  z-index: 1;
}

.wavesurfer__elem {
  height: 500px;
  left: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 170ms linear;
  top: 0;
  width: 100%;
  z-index: 0;
}
.wavesurfer__elem.show {
  opacity: 1;
}

.artist__image {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1), 0 0 0 10px rgba(255, 255, 255, 0.1), 0 0 5px 20px rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  height: 140px;
  margin: 0 auto 34px auto;
  position: relative;
  transition: all 170ms ease-in;
  width: 140px;
  z-index: 2;
}
.artist__image.play {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0), 0 0 0 10px rgba(255, 255, 255, 0), 0 0 5px 20px rgba(255, 255, 255, 0);
}

.artist__image-url {
  background: url("//repo.bfw.wiki/bfwrepo/image/5ef9ef9fbf5b0.png") no-repeat left top;
  background-size: cover;
  border-radius: 50%;
  height: 140px;
  width: 140px;
}

.time {
  color: rgba(255, 255, 255, 0.7);
  display: none;
  font-size: 14px;
  font-weight: 300;
  margin: 0 auto;
  pointer-events: none;
  text-align: center;
  width: 63px;
}
.time span {
  display: inline-block;
  float: left;
  width: 3px;
}
.time .time__minutes,
.time .time__seconds {
  width: 30px;
}
.time .time__minutes {
  text-align: right;
}
.time .time__seconds {
  text-align: left;
}

.progress {
  background: rgba(255, 255, 255, 0.2);
  bottom: 5px;
  display: none;
  height: 5px;
  left: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.progress__button {
  background-color: #fff;
  border-radius: 50%;
  height: 15px;
  left: 10px;
  position: absolute;
  top: -5px;
  transform: translateX(-50%);
  width: 15px;
  z-index: 1;
}

.progress__indicator {
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#00ffffff", endColorstr="#99ffffff",GradientType=1 );
  height: 3px;
  left: 0;
  position: absolute;
  top: 1px;
  width: 10px;
  z-index: 0;
}

@-webkit-keyframes artistNameAni {
  0% {
    transform: translateY(40px) scale(0.8);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes artistNameAni {
  0% {
    transform: translateY(40px) scale(0.8);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
.artist__name {
  -webkit-animation: artistNameAni 400ms linear 1000ms forwards;
          animation: artistNameAni 400ms linear 1000ms forwards;
  margin-bottom: 30px;
  position: relative;
  text-align: center;
  transform: translateY(40px) scale(0.8);
}
.artist__name h1 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 100;
  margin: 0;
  text-transform: uppercase;
}
.artist__name p {
  color: #fff;
  font-size: 18px;
  font-weight: 300;
  margin: 0 0 5px 0;
}

.love {
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  left: 30px;
  position: absolute;
  top: 10px;
}

.share {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  height: 5px;
  position: absolute;
  right: 35px;
  top: 20px;
  width: 5px;
}
.share:before, .share:after {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  content: "";
  height: 5px;
  position: absolute;
  top: -1px;
  width: 5px;
}
.share:before {
  left: -10px;
}
.share:after {
  right: -10px;
}

.controls {
  text-align: center;
}

@-webkit-keyframes buttonAni {
  0% {
    transform: translateY(120px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes buttonAni {
  0% {
    transform: translateY(120px);
  }
  100% {
    transform: translateY(0);
  }
}
.button__play {
  -webkit-animation: buttonAni 300ms cubic-bezier(0.48, 0.18, 0.44, 0.97) 1300ms forwards;
          animation: buttonAni 300ms cubic-bezier(0.48, 0.18, 0.44, 0.97) 1300ms forwards;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  height: 80px;
  outline: none;
  overflow: hidden;
  position: relative;
  transform: translateY(120px);
  width: 80px;
}

.button__play-iconplay {
  border-color: transparent transparent transparent #fff;
  border-style: solid;
  border-width: 13px 0 13px 20px;
  height: 0;
  left: 31px;
  position: absolute;
  top: 25px;
  width: 0;
}

.button__play-iconpause {
  display: none;
  height: 24px;
  left: 28px;
  position: absolute;
  top: 25px;
  width: 19px;
}
.button__play-iconpause:before, .button__play-iconpause:after {
  background: #fff;
  content: "";
  display: block;
  height: 24px;
  position: absolute;
  top: 0;
  width: 6px;
}
.button__play-iconpause:before {
  left: 0;
}
.button__play-iconpause:after {
  left: 13px;
}

.button__loader {
  background: rgba(255, 255, 255, 0.5);
  bottom: 0;
  height: 0;
  left: 0;
  position: absolute;
  width: 100%;
}

.button__prev,
.button__next {
  background: none;
  border: 1px solid #fff;
  border-radius: 50%;
  height: 50px;
  margin: 0 8px;
  position: relative;
  top: 15px;
  transform: translateY(120px);
  vertical-align: top;
  width: 50px;
}
.button__prev:before,
.button__next:before {
  border-style: solid;
  content: "";
  height: 0;
  position: absolute;
  top: 16px;
  width: 0;
}
.button__prev:after,
.button__next:after {
  background: #fff;
  border-radius: 1px;
  content: "";
  height: 14px;
  position: absolute;
  top: 17px;
  width: 2px;
}

.button__prev {
  -webkit-animation: buttonAni 300ms cubic-bezier(0.48, 0.18, 0.44, 0.97) 1200ms forwards;
          animation: buttonAni 300ms cubic-bezier(0.48, 0.18, 0.44, 0.97) 1200ms forwards;
}
.button.........完整代码请登录后点击上方下载按钮下载查看

网友评论0