肖强的博客 肖强的博客
Home
Guide
Web Document
  • Plugins
  • Case
  • Animation
Components
  • Categories
  • Tags
  • Archives
Website Tools

xiaoQiang

因为爱所以爱
Home
Guide
Web Document
  • Plugins
  • Case
  • Animation
Components
  • Categories
  • Tags
  • Archives
Website Tools
  • 01.定制化

    • 01
    • 02
  • 02.入场-出场

  • views
xiaoQiang
2021-10-10

定制化02

定制化02

定制化02

<template>
  <div>
    <button @click="onShow = !onShow">显示/隐藏</button>
    <div class="day15" :class="{ show: onShow }">
      <div class="main"></div>
      <div class="coin">
        <span class="left"></span>
        <span class="right"></span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      onShow: false,
    }
  },
}
</script>
<style lang="less" scoped>
// SCSS_VAR_START
@Company: 30px;
@mainTime: 1.6s;
@coinTime: 2s;
// SCSS_VAR_END
button {
  border: none;
  outline: none;
  padding: 6px 15px;
  border-radius: 4px;
  background: #2c68ff;
  color: white;
}
.day15 {
  display: flex;
  height: 400px;
  align-items: center;
  justify-content: center;
  // overflow: hidden;
  .main {
    width: 198px;
    height: 278px;
    // background-image: url('http://yaru.vip:8080/images/animation/customization/02/group01.png');
    background-image: url('http://yaru.vip:8080/images/family/12.jpg');
    background-size: 100% 100%;
    z-index: 1;
    transform: scale(0);
  }
  .coin {
    position: absolute;
    width: 192px;
    height: 240px;
    transform: scale(0);
    z-index: 2;
    span {
      display: block;
      position: absolute;
    }
    .left {
      width: 50px;
      height: 50px;
      top: 140px;
      left: -25px;
      background: url('http://yaru.vip:8080/images/animation/customization/02/coin-bi.png')
        no-repeat;
      background-size: 100%;
    }
    .right {
      width: 22px;
      height: 22px;
      top: 120px;
      right: -15px;
      background: url('http://yaru.vip:8080/images/animation/customization/02/coin-small.png')
        no-repeat;
      background-size: 100%;
    }
  }
  &.show {
    .main {
      animation: day-scale @mainTime ease-out forwards;
    }
    .coin {
      animation: day-icon-scale @coinTime ease-out forwards;
    }
  }
  @keyframes day-scale {
    // 缩放
    0% {
      transform: scale(0);
    }
    21% {
      transform: scale(1);
    }
    30% {
      transform: scale(1.012);
    }
    43% {
      transform: scale(1);
    }
    56% {
      transform: scale(1.008);
    }
    70% {
      transform: scale(1);
    }
    84% {
      transform: scale(1.004);
    }
    100% {
      transform: scale(1);
    }
  }
  @keyframes day-icon-scale {
    0% {
      transform: scale(0);
    }
    5% {
      transform: scale(1);
    }
    20% {
      transform: scale(1.05);
    }
    28% {
      transform: scale(1);
    }
    38% {
      transform: scale(1.02);
    }
    48% {
      transform: scale(1);
    }
    60% {
      transform: scale(1.01);
    }
    72% {
      transform: scale(1);
    }
    86% {
      transform: scale(1.006);
    }
    100% {
      transform: scale(1);
    }
  }
}
</style>
#animation
上次更新: 2021-10-16 16:56:45
01
01

← 01 01→

最近更新
01
drag
12-22
02
入场/出场05
10-16
03
入场/出场04
10-16
更多文章>
icon组件不能用
时间左侧 © 2021-2021 时间右侧
冀公网安备 13108202000744号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
欢迎来到我的家
Back