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>
相关推荐
Keya1 分钟前
DevEco Studio 使用技巧全面解析
前端·前端框架·harmonyos
_Rookie._2 分钟前
web请求 错误拦截
前端
青鸟北大也是北大9 分钟前
CSS单位与字体样式全解析
前端·css·html
咖啡の猫12 分钟前
TypeScript 开发环境搭建
前端·javascript·typescript
co松柏33 分钟前
AI+Excalidraw,用自然语言画手绘风格技术图
前端·人工智能·后端
用户812748281512040 分钟前
安卓Settings值原理源码剖析存储最大的字符数量是多少?
前端
用户812748281512044 分钟前
安卓14剖析SystemUI的ShadeLogger/LogBuffer日志动态控制输出dumpsy机制
前端
Ankkaya1 小时前
cloudflare + github 实现留言板
前端·github
是你的小橘呀1 小时前
单页应用路由怎么搞?React Router 从原理到实战全解析!
前端·javascript
xuedaobian1 小时前
2025年我是怎么用AI写代码的
前端·程序员·ai编程