加载loading动画

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>加载动画</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body,
      html {
        /* background-color: #333; */
        position: relative;
        width: 100%;
        height: 100%;
      }
      .loader {
        position: absolute;
        width: 80px;
        height: 100px;
        left: 50%;
        top: 50%;
        margin-left: -40px;
        margin-top: -50px;
      }
      .loader .dot {
        left: 35%;
        position: absolute;
        width: 10px;
        height: 10px;
        background: skyblue;
        -webkit-border-radius: 50%;
        -moz-border-radius: 50%;
        border-radius: 50%;
        transform-origin: 10px 40px;
        animation: dotrotate 2s cubic-bezier(0.775, 0.005, 0.31, 1) infinite;
      }
      .loader .dot .first {
        position: absolute;
        width: 8px;
        height: 8px;
        top: 50%;
        left: 50%;
        margin-left: -4px;
        margin-top: -4px;
        border-radius: 50%;
        background: skyblue;
        animation-delay: 0.2s;
        animation: 1.7s dotscale cubic-bezier(0.775, 0.005, 0.31, 1) infinite;
      }
      .loader .dot:nth-of-type(2) {
        animation-delay: 0.2s;
      }
      .loader .dot:nth-of-type(3) {
        animation-delay: 0.3s;
      }
      .loader .dot:last-of-type {
        animation-delay: 0.4s;
      }
      @keyframes dotrotate {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(360deg);
        }
      }
      @keyframes dotscale {
        0%,
        10% {
          width: 16px;
          height: 16px;
          margin-left: -8px;
          margin-top: -8px;
        }
        50% {
          width: 8px;
          height: 8px;
          margin-left: -4px;
          margin-top: -4px;
        }
        90%,
        100% {
          width: 16px;
          height: 16px;
          margin-left: -8px;
          margin-top: -8px;
        }
      }
      .loader p {
        font-size: 12px;
        font-weight: bold;
        color: #fff;
        margin: 0;
        position: absolute;
        bottom: 0;
        text-align: center;
        width: 100%;
      }
      .loader p span {
        animation: 1.7s fontMove cubic-bezier(0.775, 0.005, 0.31, 1) infinite;
      }
      .loader p span:nth-of-type(2) {
        animation-delay: 0.2s;
      }
      .loader p span:nth-of-type(3) {
        animation-delay: 0.3s;
      }
      .loader p span:last-of-type {
        animation-delay: 0.4s;
      }
      @keyframes fontMove {
        0% {
          font-size: 12px;
        }
        50% {
          font-size: 14px;
        }
        100% {
          font-size: 12px;
        }
      }
    </style>
  </head>
  <body>
    <div class="loader">
      <div class="dot">
        <div class="first"></div>
      </div>
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
    </div>
  </body>
</html>

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值