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>
相关推荐
lichenyang4531 小时前
React ajax中的跨域以及代理服务器
前端·react.js·ajax
呆呆的小草1 小时前
Cesium距离测量、角度测量、面积测量
开发语言·前端·javascript
一 乐2 小时前
民宿|基于java的民宿推荐系统(源码+数据库+文档)
java·前端·数据库·vue.js·论文·源码
testleaf3 小时前
前端面经整理【1】
前端·面试
好了来看下一题3 小时前
使用 React+Vite+Electron 搭建桌面应用
前端·react.js·electron
啃火龙果的兔子3 小时前
前端八股文-react篇
前端·react.js·前端框架
小前端大牛马3 小时前
react中hook和高阶组件的选型
前端·javascript·vue.js
刺客-Andy3 小时前
React第六十二节 Router中 createStaticRouter 的使用详解
前端·javascript·react.js
萌萌哒草头将军5 小时前
🚀🚀🚀VSCode 发布 1.101 版本,Copilot 更全能!
前端·vue.js·react.js
GIS之路5 小时前
OpenLayers 图层叠加控制
前端·信息可视化