代碼:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>css實(shí)現(xiàn)漣漪+旋轉(zhuǎn)動(dòng)畫效果 </title>
</head>
<style>
body{
background-color: #010e4b;
}
.radar {
border: 1px solid #42dff1;
-webkit-box-shadow: 0 0 14px #42dff1;
box-shadow: 0 0 14px #42dff1;
.line-hor {
width: 100%;
height: 50%;
position: absolute;
top: 0;
left: 0;
border-bottom: 1px solid rgba(66,223,241,0.2);
}
.line-ver {
width: 50%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border-right: 1px solid rgba(66,223,241,0.2);
}
.cover {
position: relative;
left: -100%;
top: -100%;
width: 150%;
height: 150%;
overflow: hidden;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-webkit-animation: rotation 3s linear infinite;
animation: rotation 3s linear infinite;
}
.round{
position: absolute;
width: 7vw;
height: 7vw;
left: 0;
bottom: 0;
background: #42dff1;
border-radius: 100%;
-webkit-animation: animate 3s linear infinite;
z-index: -1;
}
.sector {
position: absolute;
bottom: 0;
right: 0;
-webkit-transform: rotate(25deg);
transform: rotate(25deg);
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
width: 100%;
height: 80%;
background: linear-gradient(185deg,#42dff1 40%,hsla(0,0%,100%,0) 90%);
}
}
.radar-b, .radar {
width: 7vw;
height: 7vw;
display: inline-block;
border-radius: 100%;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
overflow: hidden;
}
.radar .sec-border {
width: 5vw;
height: 5vw;
}
.radar .thi-border{
width: 3vw;
height: 3vw;
}
.radar .four-border{
width: 1vw;
height: 1vw;
}
.radar .sec-border, .radar .thi-border , .radar .four-border {
border: 1px solid rgba(66,223,241,0.2);
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
}
@keyframes rotation { // 旋轉(zhuǎn)動(dòng)畫
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(1turn);
transform: rotate(1turn);
}
}
@keyframes animate { //漣漪動(dòng)畫
0%{
transform: scale(0.1);
opacity: 0.4;
}
100%{
transform: scale(1);
opacity: 0;
}
}
.hc-text { // 旋轉(zhuǎn)動(dòng)畫
margin: 0;
text-align: center;
width: 100%;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.hc-text .g-font-risk {
margin-bottom: 8px;
color: #51f2ff;
font-size: 1.3vw;
}
.hc-text .hc-name {
color: #fff;
font-size: .95vw;
}
</style>
<body>
<div class="radar">
<div class="line-hor"></div>
<div class="line-ver"></div>
<div class="sec-border"></div>
<div class="thi-border"></div>
<div class="four-border"></div>
<div class="cover">
<div class="sector"></div>
</div>
<div class="round">
</div>
<div class="hc-text">
<div class="font g-font-risk">
<div class="font-child" style="text-align: center;">
<span > 11
</span>
</div>
</div>
<div class="hc-name">主機(jī)</div>
</div>
</div>
</body>
</html>