• css3 loading 效果2


    代码:

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
    #box{
        position: relative;
        width: 40px;
        height: 40px;
        margin: 100px;
    }
    #box span{
        display: block;
        width: 20px;
        height: 20px;
        position: absolute;
        bottom: 0;
        background-color: #9b59b6;
    }
    #box span:nth-child(1){-webkit-animation:preloader1 1.5s infinite ease-in-out;}
    #box span:nth-child(2){-webkit-animation:preloader2 1.5s infinite ease-in-out;left: 20px;}
    #box span:nth-child(3){-webkit-animation:preloader3 1.5s infinite ease-in-out;top: 0px;}
    #box span:nth-child(4){-webkit-animation:preloader4 1.5s infinite ease-in-out;top: 0px;left: 20px;}
    @-webkit-keyframes preloader1{
        0%{transform:translateX(0px) translateY(0px) rotate(0deg);border-radius: 0px;}
        50%{transform:translateX(-20px) translateY(-10px) rotate(-180deg);border-radius: 20px;background-color: #3498db;}
        80%{transform:translateX(0px) translateY(0px) rotate(-360deg); border-radius:0px;}
        100%{transform:translateX(0px) translateY(0px) rotate(-360deg); border-radius:0px;}
    }
    @-webkit-keyframes preloader2{
        0%{transform:translateX(0px) translateY(0px) rotate(0deg);border-radius: 0px;}
        50%{transform:translateX(20px) translateY(-10px) rotate(180deg);border-radius: 20px;background-color: #f1c40f;}
        80%{transform:translateX(0px) translateY(0px) rotate(360deg); border-radius:0px;}
        100%{transform:translateX(0px) translateY(0px) rotate(360deg); border-radius:0px;}
    }
    @-webkit-keyframes preloader3{
        0%{transform:translateX(0px) translateY(0px) rotate(0deg);border-radius: 0px;}
        50%{transform:translateX(-20px) translateY(10px) rotate(-180deg);border-radius: 20px;background-color: #2ecc71;}
        80%{transform:translateX(0px) translateY(0px) rotate(-360deg); border-radius:0px;}
        100%{transform:translateX(0px) translateY(0px) rotate(-360deg); border-radius:0px;}
    }
    @-webkit-keyframes preloader4{
        0%{transform:translateX(0px) translateY(0px) rotate(0deg);border-radius: 0px;}
        50%{transform:translateX(20px) translateY(10px) rotate(180deg);border-radius: 20px;background-color: #e74c3c;}
        80%{transform:translateX(0px) translateY(0px) rotate(360deg); border-radius:0px;}
        100%{transform:translateX(0px) translateY(0px) rotate(360deg); border-radius:0px;}
    }
    </style>
    </head>
    <body>
        <div id="box">
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </div>
    </body>
    </html>

    效果图:

    高否?富否?帅否? 否? 滚去学习!
  • 相关阅读:
    swagger多个分组代码展示
    rabbitMQ基本概念
    谈谈微信支付曝出的漏洞
    谈谈离职和跳槽
    一个著名的任务调度系统是怎么设计的?
    BAT等公司必问的8道Java经典面试题,你都会了吗?
    从世界杯竞猜骗局谈二分法
    Spring4+Spring MVC+MyBatis整合思路
    十张图让你了解阿里公司架构设计的发展变化史
    一位00后程序员的成长历程
  • 原文地址:https://www.cnblogs.com/baixc/p/4430366.html
Copyright © 2020-2023  润新知