css 录音声波动效

想要的效果:

类似微信的按住说话功能:

在这里插入图片描述

HTML
<div class="time-box">
    <span class="start-taste-line">
      <hr class="hr1" />
      <hr class="hr2" />
      <hr class="hr3" />
      <hr class="hr4" />
      <hr class="hr5" />
      <hr class="hr6" />
      <hr class="hr7" />
      <hr class="hr8" />
      <hr class="hr9" />
      <hr class="hr10" />
    </span>
 </div>
CSS
  .time-box .start-taste-line hr {
            background-color: red;  //声波颜色
            width: 3px;
            height: 6px;
            margin: 0 0.03rem;
            display: inline-block;
            border: none;
          }
          hr {
            animation: note 0.2s ease-in-out;
            animation-iteration-count: infinite;
            animation-direction: alternate;
          }

          .hr1 {
            animation-delay: -1s;
          }

          .hr2 {
            animation-delay: -0.9s;
          }

          .hr3 {
            animation-delay: -0.8s;
          }

          .hr4 {
            animation-delay: -0.7s;
          }

          .hr5 {
            animation-delay: -0.6s;
          }

          .hr6 {
            animation-delay: -0.5s;
          }

          .hr7 {
            animation-delay: -0.4s;
          }

          .hr8 {
            animation-delay: -0.3s;
          }

          .hr9 {
            animation-delay: -0.2s;
          }

          .hr10 {
            animation-delay: -0.1s;
          }

          @keyframes note {
            from {
              transform: scaleY(1);
            }
            to {
              transform: scaleY(4);
            }
          }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值