美文网首页
vue动画分享

vue动画分享

作者: 五更月下琉璃 | 来源:发表于2019-11-19 17:26 被阅读0次

动画属性

星光闪烁,涟漪效果

@keyframes living {
            0%{
                transform: scale(1);
                opacity: 0.5;  
            }
            50%{
                transform: scale(1.5);  
                opacity: 0;   /*圆形放大的同时,透明度逐渐减小为0*/
            }
            100%{
                transform: scale(1);
                opacity: 0.5;
            }
}
.live span{
            position: absolute;
            width: 100px;
            height: 100px;
            left: 0;
            bottom: 0;
            background: #fff;
            border-radius: 50%;
           animation: living 3s linear infinite;
            z-index: -1;
}
.live span:nth-child(2){
            animation-delay: 1.5s; /*第二个span动画延迟1.5秒*/
}

乱序

HTML部分

<button v-on:click="shuffles">Shuffles</button>
    <transition-group name="cell" tag="div" class="container">
      <div v-for="cell in cells" :key = "cell.id" class="cell">
        {{cell.number}}
      </div>
    </transition-group>

数据

cells: Array.apply(null,{length:81}).map(function(_,index){
        return {
          id: index,
          number: index%9+1
        }
      }),

方法

shuffles: function () {
      this.cells = _.shuffle(this.cells);
    }

样式

.container {
    position: relative;
    left: 400px;
    width: 238px;
    flex-wrap: wrap;
    display: flex;
    margin-top: 10px;
  }
   .cell {
      width: 25px;
      height: 25px;
      text-align: center;
      line-height: 20px;
      border: 1px solid #aaa;
      margin-right: -1px;
      margin-bottom: -1px;
    }
    .cell:nth-child(3n){
      margin-right: 0;
    }
    .cell:nth-child(27n){
      margin-bottom: 0;
    }
    .cell-move {
      transition: transform 1s;
    }

相关文章

  • Vue中的动画

    Vue动画 Vue动画API 定义不同的名称动画 第三方动画库Animate.css和Vue的结合使用 enter...

  • vue路由动画

    文章来源:Vue-router结合transition实现app动画切换效果实例分享

  • vue动画分享

    动画属性 星光闪烁,涟漪效果 乱序 HTML部分 数据 方法 样式

  • 前端系统学习 10. Vue高级用法

    Vue 高级用法 动画特效 transition 实现路由切换动画 App.vue Home -> List ->...

  • vue的动画特效

    一、Vue中的CSS动画原理transition标签 二、Vue中的JS动画与velocity.js 三、Vue中...

  • Vue动画

    vue动画 1. vue不能直接实现动画,只提供动画各阶段需要的class 2. 组件提供...

  • Vue神一般的打开姿势

    过渡&动画 vue 动画的理解 1)操作 css 的 trasition 或 animation2)vue 会给目...

  • Vue动画

    Vue动画 Vue动画 CSS transition 在进入/离开的过渡中,会有 6 个 class 切换。 对于...

  • 五、Vue动画 ------ 2020-05-07

    1、常见的能触发动画的操作及添加动画的方式 2、Vue动画的基本使用:通过添加CSS样式使用 3、Vue动画的基本...

  • 2021-01-08

    Vue过渡和动画 Vue过渡和动画官方文档[https://cn.vuejs.org/v2/guide/trans...

网友评论

      本文标题:vue动画分享

      本文链接:https://www.haomeiwen.com/subject/fuhgictx.html