页面加载特效

前端 2019-11-17 967

代码如下:

<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <title>Title</title>  
    <style>  
        *{  
            margin: 0;  
            padding: 0;  
        }  
        body{  
            display: flex;  
            justify-content: center;  
            align-items: center;  
            height: 100vh;  
            background: #0074d0;  
        }  
        .loader{  
            position: relative;  
            width: 200px;  
            height: 200px;  
            border-radius: 50%;  
            box-shadow: 0 0 0 15px #080b1d;  
        }  
        .loader::before{  
            content: '';  
            position: absolute;  
            top: 0;  
            left: 0;  
            right: 0;  
            bottom: 0;  
            background: linear-gradient(45deg, #0b0f25 30%, #2196f3);  
            border-radius: 50%;  
            animation: animate 1s linear infinite;  
        }  
        .loader::after{  
            content: '';  
            position: absolute;  
            top: 8px;  
            left: 8px;  
            right: 8px;  
            bottom: 8px;  
            background: #0b0f25;  
            border-radius: 50%;  
            box-shadow: inset 0 0 0 5px #080b1d;  
        }  
        @keyframes animate {  
            0%{  
                transform: rotate(0deg);  
            }  
            100%{  
                transform: rotate(360deg);  
            }  
        }  
    </style>  
</head>  
<body>  
    <div class="loader"></div>  
</body>  
</html>  

效果:

 

标签:前端

文章评论

评论列表

已有0条评论