css3 实现页面加载动画(pc+移动)

 先看一下效果吧

效果截图

 css

<style>
    html,
    body {
      width: 100%;
      height: 100%;
    }

    #load_more_box {
      position: fixed;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      background-color: #fff;
      z-index: 99999999;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      font-size: 14px !important;
    }

    .load_more_wrap {
      transform: translateY(-200%);
    }

    .load_tip {
      color: #cc9856;
    }

    /* 根据自己需求调整行高以及 span的高度就行*/
    /* 建议移动端调整成行高  40px   span为10px  延伸高度为30px */

    .load_more_box {
      height: 80px;
      line-height: 80px;
      position: relative;
      text-align: center;

    }

    .load_more_box span {
      width: 10px;
      height: 10px;
      margin: 0 1px;
      display: inline-block;
      vertical-align: middle;
      background: #cc9856;
      animation: load_more_box 1.5s infinite ease-in-out;
    }

    .load_more_box span:nth-child(2) {
      animation-delay: .2s;
    }

    .load_more_box span:nth-child(3) {
      animation-delay: .4s;
    }

    .load_more_box span:nth-child(4) {
      animation-delay: .6s;
    }

    .load_more_box span:nth-child(5) {
      animation-delay: .8s;
    }

    @keyframes load_more_box {
      0% {
        height: 10px;
        background: #cc9856;
      }

      25% {
        height: 60px;
        background: #e86666;
      }

      50% {
        height: 10px;
        background: #cc9856;
      }

      100% {
        height: 10px;
        background: #cc9856;
      }
    }

    .bounce {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      color: #cc9856;
      height: 100%;
      font: normal bold 6rem "Product Sans", sans-serif;
      white-space: nowrap;
    }

    .letter {
      animation: bounce 0.75s cubic-bezier(0.05, 0, 0.2, 1) infinite alternate;
      display: inline-block;
      transform: translate3d(0, 0, 0);
      margin-top: 0.5em;
      text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;
      font: normal 500 6rem 'Varela Round', sans-serif;
      font-size: 22px;
      font-weight: 600;
    }

    .letter:nth-child(1) {
      animation-delay: 0s;
    }

    .letter:nth-child(2) {
      animation-delay: .2s;
    }

    .letter:nth-child(3) {
      animation-delay: .4s;
    }

    .letter:nth-child(4) {
      animation-delay: .6s;
    }

    .letter:nth-child(5) {
      animation-delay: .8s;
    }

    .letter:nth-child(6) {
      animation-delay: 0.4166666667s;
    }

    @keyframes bounce {
      0% {
        transform: translate3d(0, 0, 0);
        text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;
      }

      100% {
        transform: translate3d(0, -14px, 0);
        text-shadow: rgba(255, 255, 255, 0.4) 0 1em 0.35em;
      }
    }
  </style>

html

<div id="load_more_box">
   <div class="load_more_wrap">
      <div class="load_more_box">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
      </div>
      <div class="load_tip bounce">
        <span class="letter">努</span>
        <span class="letter">力</span>
        <span class="letter">加</span>
        <span class="letter">载</span>
        <span class="letter">中</span>
      </div>
   </div>
 </div>

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不会做饭的程序员

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值