纯CSS实现预加载动画效果

所属分类: 网页制作 / CSS 阅读数: 1923
收藏 0 赞 0 分享

效果图

这里写图片描述

下载地址:http://xiazai.jb51.net/201709/yuanma/css_loading_jb51.rar

<style>
    #loading {
        position:absolute;
        left:0;
        top:0;
        width:100%;
        height:100%;
        background: #121220;
        overflow:hidden;
        z-index:9999;
    }
    /*加载圈*/
    .spinner {
        margin:0 auto;
        width:60px;
        height:60px;
        position:relative;
        top:40%;
    }
    .container1 > div,.container2 > div,.container3 > div {
        width:15px;
        height:15px;
        background-color:#fff;
        border-radius:100%;
        position:absolute;
        -webkit-animation:bouncedelay 1.2s infinite ease-in-out;
        animation:bouncedelay 1.2s infinite ease-in-out;
        -webkit-animation-fill-mode:both;
        animation-fill-mode:both;
    }
    .spinner .spinner-container {
        position:absolute;
        width:100%;
        height:100%;
    }
    .container2 {
        -webkit-transform:rotateZ(45deg);
        transform:rotateZ(45deg);
    }
    .container3 {
        -webkit-transform:rotateZ(90deg);
        transform:rotateZ(90deg);
    }
    .circle1 {
        top:0;
        left:0;
    }
    .circle2 {
        top:0;
        right:0;
    }
    .circle3 {
        right:0;
        bottom:0;
    }
    .circle4 {
        left:0;
        bottom:0;
    }
    .container2 .circle1 {
        -webkit-animation-delay:-1.1s;
        animation-delay:-1.1s;
    }
    .container3 .circle1 {
        -webkit-animation-delay:-1.0s;
        animation-delay:-1.0s;
    }
    .container1 .circle2 {
        -webkit-animation-delay:-0.9s;
        animation-delay:-0.9s;
    }
    .container2 .circle2 {
        -webkit-animation-delay:-0.8s;
        animation-delay:-0.8s;
    }
    .container3 .circle2 {
        -webkit-animation-delay:-0.7s;
        animation-delay:-0.7s;
    }
    .container1 .circle3 {
        -webkit-animation-delay:-0.6s;
        animation-delay:-0.6s;
    }
    .container2 .circle3 {
        -webkit-animation-delay:-0.5s;
        animation-delay:-0.5s;
    }
    .container3 .circle3 {
        -webkit-animation-delay:-0.4s;
        animation-delay:-0.4s;
    }
    .container1 .circle4 {
        -webkit-animation-delay:-0.3s;
        animation-delay:-0.3s;
    }
    .container2 .circle4 {
        -webkit-animation-delay:-0.2s;
        animation-delay:-0.2s;
    }
    .container3 .circle4 {
        -webkit-animation-delay:-0.1s;
        animation-delay:-0.1s;
    }
    @-webkit-keyframes bouncedelay {
        0%,80%,100% {
            -webkit-transform:scale(0.0)
        }
        40% {
            -webkit-transform:scale(1.0)
        }
    }
    @keyframes bouncedelay {
        0%,80%,100% {
            transform:scale(0.0);
            -webkit-transform:scale(0.0);
    }
        40% {
            transform:scale(1.0);
            -webkit-transform:scale(1.0);
        }
    }
</style>
<body>
    <div id="loading" >
        <div class="spinner">
          <div class="spinner-container container1">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
          </div>
          <div class="spinner-container container2">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
          </div>
          <div class="spinner-container container3">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
          </div>
        </div>
    </div>
</body>

以上所述是小编给大家介绍的纯CSS实现预加载动画效果,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!

更多精彩内容其他人还在看

CSS圆角边框制作指南与实例

这篇文章主要介绍了CSS圆角边框制作指南与实例,这里突出讲解了以纯代码实现的小圆角 来消灭锯齿的方法,需要的朋友可以参考下
收藏 0 赞 0 分享

css实现移动端图片文字水平居中

这篇文章主要为大家详细介绍了css实现移动端图片文字水平居中的方法,如何实现图片以及文字的整体水平居中,本文为大家提供两种解决办法,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

Div+CSS对HTML的table表格定位用法实例

这篇文章主要介绍了Div+CSS对HTML的table表格定位用法实例,文中讲到了CSS的定位差异问题需要的朋友可以参考下
收藏 0 赞 0 分享

使用div+CSS将页脚始终控制在页面最下方的方法

这篇文章主要介绍了使用div+CSS将页脚始终控制在页面最下方的方法,文中介绍了设置container以及使用绝对定位两种方法来解决,需要的朋友可以参考下
收藏 0 赞 0 分享

你值得拥有的CSS下拉菜单效果

这篇文章主要介绍了你值得拥有的多种CSS下拉菜单效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

CSS利用伪元素实现导航栏斜线分隔

这篇文章主要介绍了CSS利用伪元素实现导航栏斜线分隔的相关资料
收藏 0 赞 0 分享

纯CSS3打造属于自己的“小黄人”

这篇文章主要为大家详细介绍了纯CSS3打造属于自己的“小黄人”的相关代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

浅谈各种浏览器下的CSS Hack兼容性写法

这篇文章主要介绍了各种浏览器下的CSS Hack兼容性写法,CSS Hack大致可以分为内部Hack和选择器Hack以及HTML头部引用Hack,需要的朋友可以参考下
收藏 0 赞 0 分享

学习DIV+CSS网页布局之一列布局

学习DIV+CSS网页布局中的一列布局,本文为大家分享的是DIV+CSS网页布局教程的第一篇,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

学习DIV+CSS网页布局之两列布局

学习DIV+CSS网页布局中的两列布局,本文为大家分享的是DIV+CSS网页布局教程的第二篇,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享
查看更多