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>
相关推荐
GreenTea4 小时前
GrokBot 核心成员 Lauren Tan:每月交付 2000 个 PR 的人,是怎么用 AI 的
前端·后端·架构
mCell5 小时前
用 Knip 清理 AI Coding 留下的冗余代码
前端·ai编程·前端工程化
笃行3506 小时前
使用Rokid AIUI做了一个童年推箱子游戏
前端
excel7 小时前
前端加密的作用与使用场景
前端
计算机魔术师8 小时前
纽约时报版权诉讼披露:微软高管内部称训练 AI 是人类历史上最大规模劳动窃取
前端
去伪存真8 小时前
大模型的参数量为什么那么大?
前端·人工智能
IT_陈寒8 小时前
Java空指针这次真把我坑惨了
前端·人工智能·后端
八荒启·交互动画10 小时前
# Web特效020—让 Web 特效真正动起来:时间循环应该怎么接
前端·webgl·网页特效·八荒启-交互动画·八荒启
动恰客流统计10 小时前
线下零售数字化浪潮下,客流统计的3个核心发展趋势
大数据·前端·人工智能
用户9385156350710 小时前
从小米前端面试题,彻底搞懂闭包、作用域链与 useState 惰性初始化
前端·面试