过渡的动画遮罩层

LinMeng
• 阅读 690
<template>
  <div class="modal-open">
    <!-- 动画遮罩层 -->
    <div class="plan-cover cover_company_166" :class="animateFlagTopDown == true ? ['zIndex'] : ''">
      <div class="plan-cover-top" :class="animateFlagTopDown == true ? ['coverFadeOutUp'] : ''">
        <img class="plan-cover-logo" src="@/assets/images/planBook/company.png" alt="" />
        <div class="plan-cover-slogan">
          <img src="@/assets/images/planBook/slogan_taikang.png" alt="" />
        </div>
      </div>
      <div class="plan-cover-center">
        <div :class="animateFlag == true ? 'colorNone' : ''" class="line"></div>
        <div class="btn" :class="animateFlag == true ? ['animated', 'coverZoomOut'] : ''" @click="openDetail">亲启</div>
      </div>
      <div class="plan-cover-bottom" :class="animateFlagTopDown == true ? ['coverFadeOutDown'] : ''">
        <span class="customer-info"
          >敬呈
          <span v-show="!showNameflag">亲爱的</span>
          <span v-show="showNameflag">{{ insuredName || "" }}</span>
          客户</span
        >
        <div class="customer-count">{{ count }}</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "BenefitTransform",
  data() {
    return {
      animateFlag: false,
      animateFlagTopDown: false, //  上下动画待“亲启”结束(0.5s)后开启
      showNameflag: false, //  是否展示客户名称
      count: 5,
      animatebBegin: null,
      insuredName: "",
    };
  },
  created() {
    // 进入页面两秒钟后获得客户姓名
    // && 5s定时器结束后进入详情页面
    this.animatebBegin = setInterval(() => {
      // console.log(this.count);
      this.count--;
      if (this.count == 3) {
        this.showNameflag = true;
        this.insuredName = utils.getStore("insuredName");
      }
      if (this.count == 0) {
        this.animateFlag = true;
        setTimeout(() => {
          this.animateFlagTopDown = true;
          clearInterval(this.animatebBegin);
        }, 500);
        setTimeout(() => {
          this.$emit("isAnimateEnd", true);
        }, 800);
      }
    }, 1000);
    //
  },

  methods: {
    // 点击亲启触发动画
    openDetail() {
      this.animateFlag = true;
      clearInterval(this.animatebBegin);
      setTimeout(() => {
        this.animateFlagTopDown = true;
      }, 500);
      setTimeout(() => {
        this.$emit("isAnimateEnd", true);
      }, 800);
    },
  },
  // 页面离开后销毁定时器
  destroyed() {
    clearInterval(this.animatebBegin);
  },
};
</script>

<style lang="less" scoped>
.zIndex {
  z-index: -9999;
}
.modal-open {
  position: fixed;
  width: 100%;
  height: 100%;
}
.plan-cover {
  height: 100%;
  z-index: 9999;
}

.plan-cover-top {
  height: 55%;
  padding-top: 15%;
  background-color: #c7000b;
}

.plan-cover-top .plan-cover-logo {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto;
}

.plan-cover-top .plan-cover-slogan {
  -webkit-box-flex: 1;
  margin: 4% auto 0;
  width: 153px;
  img {
    width: 100%;
  }
}

.plan-cover-bottom {
  display: block;
  -webkit-box-flex: 1;
  width: 100%;
  height: 40%;
  background-color: #c7000b;
}

.plan-cover-bottom .customer-info {
  position: absolute;
  left: 50%;
  top: 70%;
  vertical-align: middle;
  color: #fff;
  -webkit-transform: translate(-50%, -50%);
  font-size: 18px;
}

.plan-cover-bottom .customer-count {
  display: block;
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 13%;
  height: 30px;
  line-height: 30px;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.plan-cover-center .line {
  width: 100%;
  height: 1px;
  background: #fff;
  position: absolute;
  left: 0;
  top: 55%;
  -webkit-transform: translateY(-50%);
}
.plan-cover-center .colorNone {
  background: transparent;
}

.plan-cover-center .btn {
  width: 88px;
  height: 88px;
  background: #fff;
  border-radius: 50%;
  color: #c7000b;
  position: absolute;
  text-align: center;
  line-height: 88px;
  font-size: 18px;
  font-weight: 700;
  left: 50%;
  top: 55%;
  margin-left: -44px;
  margin-top: -44px;
}
.coverZoomOut {
  -webkit-animation-duration: 0.4s;
  -webkit-animation-name: coverZoomOut;
  -webkit-animation-fill-mode: forwards;
}

.coverFadeOutDown,
.coverFadeOutUp {
  -webkit-animation-duration: 0.6s;
  -webkit-animation-fill-mode: forwards;
}

.coverFadeOutUp {
  -webkit-animation-name: coverFadeOutUp;
}

.coverFadeOutDown {
  -webkit-animation-name: coverFadeOutDown;
}

@-webkit-keyframes coverZoomOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    -webkit-transform: scale3d(4, 4, 4);
    transform: scale3d(4, 4, 4);
  }
}

@-webkit-keyframes coverFadeOutUp {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }
}

@-webkit-keyframes coverFadeOutDown {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }
}
.coverFadeOutDown,
.coverFadeOutUp {
  -webkit-animation-duration: 0.6s;
  -webkit-animation-fill-mode: forwards;
}

.coverFadeOutUp {
  -webkit-animation-name: coverFadeOutUp;
}

.coverFadeOutDown {
  -webkit-animation-name: coverFadeOutDown;
}
</style>
点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Souleigh ✨ Souleigh ✨
2年前
前端性能优化 - 雅虎军规
无论是在工作中,还是在面试中,web前端性能的优化都是很重要的,那么我们进行优化需要从哪些方面入手呢?可以遵循雅虎的前端优化35条军规,这样对于优化有一个比较清晰的方向.35条军规1.尽量减少HTTP请求个数——须权衡2.使用CDN(内容分发网络)3.为文件头指定Expires或CacheControl,使内容具有缓存性。4.避免空的
Stella981 Stella981
2年前
Android So动态加载 优雅实现与原理分析
背景:漫品Android客户端集成适配转换功能(基于目标识别(So库35M)和人脸识别库(5M)),导致apk体积50M左右,为优化客户端体验,决定实现So文件动态加载.!(https://oscimg.oschina.net/oscnet/00d1ff90e4b34869664fef59e3ec3fdd20b.png)点击上方“蓝字”关注我
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Wesley13 Wesley13
2年前
35岁是技术人的天花板吗?
35岁是技术人的天花板吗?我非常不认同“35岁现象”,人类没有那么脆弱,人类的智力不会说是35岁之后就停止发展,更不是说35岁之后就没有机会了。马云35岁还在教书,任正非35岁还在工厂上班。为什么技术人员到35岁就应该退役了呢?所以35岁根本就不是一个问题,我今年已经37岁了,我发现我才刚刚找到自己的节奏,刚刚上路。
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这
LinMeng
LinMeng
Lv1
争取早日实现“代码自由” wa !!!
文章
50
粉丝
7
获赞
33