vue页面动画(进入页面时)

1.直接上代码

<template>
<div>
  <div class="main-box">
    <div class="g-of-h">
      <div class="g-f-l box-l animated"></div>
      <div class="g-f-l box-r animated"></div>
    </div>
    <div class="box-b animated"></div>
  </div>
</div>
</template>

<script>
export default {
  name: "animate"
}
</script>

<style scoped>
.g-of-h{
  overflow: hidden;
}
.g-f-l{
  float: left;
}
.g-f-r{
  float: right;
}
.main-box{
  width: 1200px;
  margin: 0 auto;
}
.box-l{
  width: 200px;
  height: 200px;
  background-color: #8a6de9;
  animation-name: fadeLeftIn;
  -webkit-animation-name: fadeLeftIn;
}
.box-r{
  margin-left: 20px;
  width: 500px;
  height: 200px;
  background-color: #FDB9B9;
  animation-name: fadeRightIn;
  -webkit-animation-name: fadeRightIn;
}
.box-b{
  width: 720px;
  height: 200px;
  animation-name: fadeBottomIn;
  -webkit-animation-name: fadeBottomIn;
  background-color: #888888;
  margin-top: 20px;
}
.animated {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
@keyframes fadeLeftIn {
  0%{
    opacity: 0;
    transform: translate3d(-100%,0,0);
  }
  100%{
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeRightIn {
  0%{
    opacity: 0;
    transform: translate3d(100%,0,0);
  }
  100%{
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeBottomIn {
  0%{
    opacity: 0;
    transform: translate3d(0,100%,0);
    -webkit-transform: translate3d(0,100%,0);
  }
  100%{
    opacity: 1;
    transform: none;
    -webkit-transform: none;
  }
}
</style>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • ¥开启¥ 【iAPP实现进入界面执行逐一显】 〖2017-08-25 15:22:14〗 《//首先开一个线程,因...
    小菜c阅读 6,630评论 0 17
  • Swift1> Swift和OC的区别1.1> Swift没有地址/指针的概念1.2> 泛型1.3> 类型严谨 对...
    cosWriter阅读 11,157评论 1 32
  • error code(错误代码)=0是操作成功完成。error code(错误代码)=1是功能错误。error c...
    Heikki_阅读 3,458评论 1 9
  • 我们现在去日本旅游,首选,一定是北海道。有很大的螃蟹,还有薰衣草,还有滑雪胜地,还有札幌啤酒。还有一般人都不知道的...
    一溪风月阅读 1,435评论 2 7
  • 小时候离老家近,经常回去。上了大学以后,就只有寒暑假回来,能陪外公外婆的时间越来越少。工作以后就更少了,春节值班的...
    马小马吖阅读 165评论 0 0