充电动效
lix_uan 114 2

效果图

1

HTML

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>充电特效</title>
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div class="main">
        <div class="wave"></div>
    </div>
</body>
</html>    

CSS

*{
    margin: 0;
    padding: 0;
}

body{
    height: 100vh;
    background-image: linear-gradient(to bottom , #7A88FF, #7AFFAF) ;
}

.main, .wave{
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
}

.main{
    border: 3px solid darkturquoise;
    padding: 10px;
}

.wave{
    background: darkturquoise;
    overflow: hidden;
}

.wave::after{
    content: "";
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.8);
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%,-60%);
    border-radius: 40%;
    animation: wave 5s linear infinite;
}

.wave::before{
    content: "充电中";
    position: absolute;
    left: 50%;
    top: 0px;
    color: darkturquoise;
    z-index: 99;
    transform: translate(-50%,40px);
}

@keyframes wave{
    100%{
        transform: translate(-50%,-60%) rotate(360deg);
    }
}
预览图
评论区

索引目录