css加载中动画

html 复制代码
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
<style>
#loader .square:nth-child(5n+1) {
    background: #0F9;
    animation-delay: 0s;
}
#loader .square:nth-child(5n+2) {
    background: #0CF;
    animation-delay: 0.1s;
}
#loader .square:nth-child(5n+3) {
    background: #93F;
    animation-delay: 0.2s;
}
#loader .square:nth-child(5n+4) {
    background: #F66;
    animation-delay: 0.3s;
}
#loader .square:nth-child(5n+5) {
    background: #FFF35C;
    animation-delay: 0.4s;
}

#loader {
    width: 500px;
    position: absolute;
    text-align: center;
    left: calc(50% - 250px);
    top: calc(50% - 10px);
}

#loader .square {
    display: inline-block;
    height: 10px;
    width: 10px;
    margin: 10px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, .3);
    animation: wave 1s cubic-bezier(.455,.03,.515,.955) infinite;
}

@keyframes wave {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0);
    }
}
</style>
 </head>
 <body>

  <div id="loader">
        <div class="square"></div>
        <div class="square"></div>
        <div class="square"></div>
        <div class="square"></div>
        <div class="square"></div>
		<div>加载中。。。</div>
    </div>
 </body>
</html>
相关推荐
zhoulcc26 分钟前
前端响应处理:AjaxResult与TableDataInfo的JSON结构区别及统一取值方案
前端·后端·bug·ajaxresult·tabledatainfo
泯泷36 分钟前
第二章:你的第一个Lit组件 - 从零到"Hello, World"
前端·javascript·web components
lichenyang4531 小时前
网页与 JavaScript 注入基础
前端
lichenyang4532 小时前
理解注入脚本所需的 JavaScript 基础
前端
涛涛ing2 小时前
我们开源了公司的内部组件库,然后被各业务线骂成了筛子
前端
赵_叶紫2 小时前
1.Java AES-GCM 加解密入门:理解原理与字符串实战
前端
anyup2 小时前
uView Pro X 2.0 发布:弃用 UTS,全面支持 TypeScript 的 uni-app x 蒸汽模式 UI 框架
前端·uni-app·ai编程
多加点辣也没关系2 小时前
JavaScript|第42章:安全与最佳实践
开发语言·javascript·安全
泯泷2 小时前
第三章:lit-html的威力 - 精通声明式模板
前端·javascript·web components
艾莉丝努力练剑3 小时前
【AI接入大模型SDK】解决接口连接异常问题
前端·c++·人工智能·学习·ai·架构