• vue3 物体飘落效果


    html

    1. <template>
    2. <div class="content">
    3. <transition-group name="petal-fall" tag="ul">
    4. <img
    5. v-for="(petal, index) in petals"
    6. :key="index"
    7. class="petal"
    8. :src="petal.image"
    9. :style="petal.style"
    10. />
    11. transition-group>
    12. div>
    13. template>

    js

    css

    1. .content{
    2. background-image: url(../../../assets/web/service/BackgroundService.png);
    3. background-repeat: no-repeat;
    4. background-size:cover;
    5. width:100%;
    6. height:100vh;
    7. position: relative;
    8. .petal {
    9. position: absolute;
    10. width: 5vw;
    11. height: 5vw;
    12. animation: fallAnimation linear infinite;
    13. }
    14. @keyframes fallAnimation {
    15. 0% {
    16. transform: translateY(-100vh);
    17. }
    18. 100% {
    19. transform: translateY(110%);
    20. }
    21. }
    22. }

  • 相关阅读:
    使用 Python 进行测试(7)...until you make it
    开源云管平台有哪些?有哪些优势?
    【Mysql】复合查询详解+实战操作(多表查询、自链接、子查询等)
    为什么要学习TypeScript
    day13:MyBatis映射文件深入
    十六、java 中常见日期格式的设置
    Grafana 快速配置可视化面板
    PCA和LDA数据降维计算(含数学例子推导过程)
    1102、判断语句、while循环、for循环
    Mybatis 设计
  • 原文地址:https://blog.csdn.net/m0_59570698/article/details/134331888