CSS3实现上下拉长加载动画效果

上下拉长加载动画效果

html 复制代码
<!DOCTYPE html>
<html>
  <head>
    <style>
      .container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 150px;
        height: 150px;
        margin: 50px auto;
      }

      .rectangle {
        width: 20px;
        height: 50px;
        background-color: #02A0E9;
      }

      .rectangle ~ .rectangle {
        margin-left: 10px;
      }

      .rectangle:nth-child(1) {
        animation: stretch 1.5s ease-in-out infinite 0.1s;
      }

      .rectangle:nth-child(2) {
        animation: stretch 1.5s ease-in-out infinite 0.3s;
      }

      .rectangle:nth-child(3) {
        animation: stretch 1.5s ease-in-out infinite 0.5s;
      }

      .rectangle:nth-child(4) {
        animation: stretch 1.5s ease-in-out infinite 0.7s;
      }

      .rectangle:nth-child(5) {
        animation: stretch 1.5s ease-in-out infinite 0.9s;
      }

      @keyframes stretch {
        0% {
          height: 50px;
        }
        50% {
          height: 120px;
        }
        100% {
          height: 50px;
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="rectangle"></div>
      <div class="rectangle"></div>
      <div class="rectangle"></div>
      <div class="rectangle"></div>
      <div class="rectangle"></div>
    </div>
  </body>
</html>
相关推荐
拉不动的猪2 分钟前
函数组件和异步组件
前端·javascript·面试
淮北49414 分钟前
html + css +js
开发语言·前端·javascript·css·html
你的人类朋友16 分钟前
适配器模式:适配就完事了bro!
前端·后端·设计模式
Setsuna_F_Seiei27 分钟前
CocosCreator 游戏开发 - 利用 AssetsBundle 技术对小游戏包体积进行优化
前端·cocos creator·游戏开发
黄毛火烧雪下38 分钟前
高效的项目构建和优化之前端构建工具
前端
90后的晨仔1 小时前
在 macOS 上轻松获取 GIF 图片总时长:多种实用方法详解
前端
技术钱1 小时前
vue3前端解析excel文件
前端·vue.js·excel
mapbar_front2 小时前
顺利通过试用期:避开三大陷阱,掌握三个关键点
前端·面试
why技术2 小时前
1K+Star的开源项目能给一个在校大学生带来什么?
前端·人工智能·后端
@PHARAOH2 小时前
HOW - localstorage 超时管理方案
前端·javascript·vue.js