录音中的动画~

这段代码展示了一个使用HTML和CSS实现的动态录音特效,其中包含一系列波浪形动画,代表着声音的波动。通过调整CSS的@keyframes来控制动画效果,实现不同频率的波浪动画,营造出音频播放的视觉效果。
摘要由CSDN通过智能技术生成
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div class="mask">
    <div class="apss">
      <!-- //录音特效 -->
      <div class="ap_animation" v-show="is_one">
        <div class="ap">
          <div class="box">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
          </div>
        </div>
        <div class="ap aps">
          <div class="box">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
          </div>
        </div>
      </div>
      <!-- daojishi  -->
    </div>
  </div>
  <style>
    
.mask {
  position: fixed;
  left: 0;
  top: 0px;
  width: 100%;
  height: 90%;
  background: rgba(0, 0, 0, 0.5);
}
.apss {
  /* border: 1px solid #000; */
  /* pointer-events: ;
     */
  position: absolute;
  top: 50%;
  right: 50%;
  width: 200px;
  height: 100px;
  margin-top: -50px;
  margin-right: -100px;
}
.ap {
  position: relative;
  height: 50px;
  width: 22px;
  margin: 0 auto;
  /* border: 1px solid #000; */
}
.aps {
  transform-origin: center center;
  transform: rotate(180deg);
  /* border: 1px solid #0f0; */
  margin: 0 auto;

  
}
.box div {
  display: inline-block;
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 30px;
  /* //不喜欢该颜色改成想要的动画颜色 */
  background-color: rgb(78, 176, 255);
  transform-origin: bottom;
  border-radius: 5px 5px 0 0;
}
.aps .box div {
  background-color: rgb(0, 141, 255);
  bottom: 0px;
}
.box div:nth-child(1) {
  left: -60px;
  animation: musicWave 0.5s infinite linear both alternate;
}
.box div:nth-child(2) {
  left: -40px;
  animation: musicWave 0.8s infinite linear both alternate;
}
.box div:nth-child(3) {
  left: -20px;
  animation: musicWave 0.6s infinite linear both alternate;
}
.box div:nth-child(4) {
  left: 0px;
  animation: musicWave 0.7s infinite linear both alternate;
}
.box div:nth-child(5) {
  left: 20px;
  animation: musicWave 0.7s infinite linear both alternate;
}
.box div:nth-child(6) {
  left: 40px;
  animation: musicWave 0.6s infinite linear both alternate;
}
.box div:nth-child(7) {
  left: 60px;
  animation: musicWave 0.8s infinite linear both alternate;
}
.box div:nth-child(8) {
  left: 80px;
  animation: musicWave 0.5s infinite linear both alternate;
}
@keyframes musicWave {
  0% {
    height: 8px;
  }
  100% {
    height: 30px;
    
  }
}
  </style>
</body>
</html>

效果如下:

不过是动态的哦 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值