zoukankan      html  css  js  c++  java
  • css animation @keyframes 动画

    需求:语音播放动态效果

    方案:使用如下图片,利用 css animation @keyframes  做动画

    html

    <span class="horn" :class="{'active': scope.row.isPlay}"></span>
    <audio :id="'audio_'+scope.row.commentId" ref="audio" :src="scope.row.voiceUrl"></audio>
     css
    .horn{
      width: 25px;
      height: 20px;
      background-image: url('../../../assets/images/voice/icon.png');
      background-size: 100% 100%;
      position: absolute;
      left: 10px;
      top: 50%;
      // margin-top: 50%;
      transform: translateY(-49%);
    }
    .horn.active{
      animation: fadeInOut 1s infinite;
    }
    @keyframes fadeInOut {
      0% {
        background-image: url('./assets/images/voice/1.png');
      }
      70% {
        background-image: url('./assets/images/voice/2.png');
      }
      90% {
        background-image: url('./../assets/images/voice/icon.png');
      }
    }
  • 相关阅读:
    vant 移动helloworld
    ts
    study vant
    uniapp 上传图片
    electron
    1
    测试vue模板
    [Java] Spring_1700_Spring_DataSource
    [Java] Spring_1600_AOP_XML
    [Java] Spring_1500_AOP_Annotation
  • 原文地址:https://www.cnblogs.com/tdxl/p/14278758.html
Copyright © 2011-2022 走看看