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 小时前
虚拟列表兼容老DOM操作
前端
悦悦子a啊2 小时前
Python之--基本知识
开发语言·前端·python
安全系统学习3 小时前
系统安全之大模型案例分析
前端·安全·web安全·网络安全·xss
涛哥码咖3 小时前
chrome安装AXURE插件后无效
前端·chrome·axure
OEC小胖胖4 小时前
告别 undefined is not a function:TypeScript 前端开发优势与实践指南
前端·javascript·typescript·web
行云&流水4 小时前
Vue3 Lifecycle Hooks
前端·javascript·vue.js
Sally璐璐4 小时前
零基础学HTML和CSS:网页设计入门
前端·css
老虎06274 小时前
JavaWeb(苍穹外卖)--学习笔记04(前端:HTML,CSS,JavaScript)
前端·javascript·css·笔记·学习·html
三水气象台4 小时前
用户中心Vue3网页开发(1.0版)
javascript·css·vue.js·typescript·前端框架·html·anti-design-vue
灿灿121384 小时前
CSS 文字浮雕效果:巧用 text-shadow 实现 3D 立体文字
前端·css