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>
相关推荐
岁月宁静6 小时前
深度定制:在 Vue 3.5 应用中集成流式 AI 写作助手的实践
前端·vue.js·人工智能
心易行者6 小时前
10天!前端用coze,后端用Trae IDE+Claude Code从0开始构建到平台上线
前端
saadiya~7 小时前
ECharts 实时数据平滑更新实践(含 WebSocket 模拟)
前端·javascript·echarts
fruge7 小时前
前端三驾马车(HTML/CSS/JS)核心概念深度解析
前端·css·html
百锦再7 小时前
Vue Scoped样式混淆问题详解与解决方案
java·前端·javascript·数据库·vue.js·学习·.net
烛阴7 小时前
Lua 模块的完整入门指南
前端·lua
浪里行舟8 小时前
国产OCR双雄对决?PaddleOCR-VL与DeepSeek-OCR全面解析
前端·后端
znhy@1238 小时前
CSS易忘属性
前端·css
瓜瓜怪兽亚8 小时前
前端基础知识---Ajax
前端·javascript·ajax
AI智能研究院9 小时前
(四)从零学 React Props:数据传递 + 实战案例 + 避坑指南
前端·javascript·react.js