css动画 新年快乐

18 篇文章 0 订阅
<template>
  <div class="home">
    <div class="bg">
      <div class="css2">
        <img
          style="margin-top: 1rem; width: 3rem; height: 4rem"
          src="~@/assets/img/bag3.png"
          alt=""
        />
      </div>
      <div class="css3">
        <img
          style="margin-top: 1rem; width: 3rem; height: 4rem"
          src="~@/assets/img/bag4.png"
          alt=""
        />
      </div>
      <div class="css1">
        <img
          style="width: 4.5rem; height: 3.5rem;"
          src="~@/assets/img/bag5.png"
          alt=""
        />
      </div>
      <div class="css4" @click="gocode">
        领取新年福袋
      </div>
    </div>
  </div>
</template>

<script>
//     import 自定义模块名称 from '模块标识符'
export default {
  data() {
    return {
      status: 1,
    };
  },
  mounted() {},
  methods: {
    gocode() {
   console.log("123")
    },
  },
  components: {},
  computed: {},
};
</script>

<style lang="scss" scoped>
.bg {
  // position: relative;
  // border: 1px solid red;
  // height: 754px;

  height: 13.5rem;
  //   border: 1px solid red;
  background-image: url(~@/assets/img/bagbg.png);
  background-size: 8rem;
}
.css1 {
  position: absolute;
  width: 3.5rem;
  height: 1.8rem;
  // background-color: red;
  color: white;
  left: 2.1rem;
  top: 5rem;
  // bottom: 8.5rem;
  -webkit-animation: mymove 1s; /* Chrome, Safari, Opera */
  animation: mymove 1s;
}

/* Chrome, Safari, Opera */
@-webkit-keyframes mymove {
  50% {
    top: 0;
  }
}

/* Standard syntax */
@keyframes mymove {
  0% {
    top: 0;
  }
}
.css2 {
  position: absolute;
  width: 120px;
  height: 300px;
  // background-color: rgb(80, 92, 255);
  color: white;
  top: 6.5rem;
  left: 10px;
  -webkit-animation: mymoves 2s; /* Chrome, Safari, Opera */
  animation: mymoves 2s;
}

/* Chrome, Safari, Opera */
@-webkit-keyframes mymoves {
  30% {
    left: -300px;
  }
}

/* Standard syntax */
@keyframes mymoves {
  0% {
    left: -300px;
  }
}
.css3 {
  position: absolute;
  width: 120px;
  height: 300px;
  // background-color: rgb(80, 92, 255);
  color: white;
  top: 6.5rem;
  right: 5px;
  -webkit-animation: mymovess 2s; /* Chrome, Safari, Opera */
  animation: mymovess 2s;
}

/* Chrome, Safari, Opera */
@-webkit-keyframes mymovess {
  30% {
    right: -300px;
  }
}

/* Standard syntax */
@keyframes mymovess {
  0% {
    right: -300px;
  }
}
.css4 {
  position: absolute;
  width: 2.7rem;
  height: .7rem;
  //   background-color: rgb(80, 92, 255);
  color: #ac2401;
  font-family: PingFangSC-Medium;
  font-weight: Medium;
  font-size: 18px;
  //   top: 6rem;
  left: 2.5rem;
  top: 9.5rem;
  // bottom: 2.5rem;
  //   bottom: -1rem;
  -webkit-animation: mymovesss 3s; /* Chrome, Safari, Opera */
  animation: mymovesss 3s;
  background-image: url(~@/assets/img/bagbtn.png);
  background-size: 2.7rem;
  text-align: center;
  line-height: .7rem;
}

/* Chrome, Safari, Opera */
@-webkit-keyframes mymovesss {
  30% {
    top: 0px;
  }
}

/* Standard syntax */
@keyframes mymovesss {
  0% {
    top: 0px;
  }
}
</style>
  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

周亚鑫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值