radar icon
by jorgeluis
HTML
<div class="radar">
<div class="pointer"></div>
<div class="ping"></div>
</div>
<br>
<div class="radar warning">
<div class="pointer"></div>
<div class="ping"></div>
</div>
SCSS
$size: 48px;
body{
background-color: #fff;
}
.radar {
background: radial-gradient(circle, #A0E2EE 14%, #2BB1C9 100%);
width: $size;
height: $size;
position: relative;
border-radius: $size / 2;
border: solid 2px #008096;
}
.radar:hover {
// background: none;
}
.radar:before {
content: "";
position: absolute;
display: block;
width: 100%;
height: 100%;
background-image: linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
background-size: 50% 50%;
border-radius: 50%;
}
.radar:after {
content: "";
position: absolute;
width: 20%;
height: 20%;
background: #008096;
top: 50%;
left: 50%;
margin-top: -10%;
margin-left: -10%;
border-radius: 50%;
}
.maplines {
position: absolute;
width: 100%;
height: 100%;
/* background-image: linear-gradient($white 1px, transparent 1px), linear-gradient(90deg, $white 1px, transparent 1px); */
backround: red;
background-size: 5px 5px;
}
.radar .pointer {
position: absolute;
z-index: 1024;
left: 0;
right: 0;
top: 0;
bottom: 50%;
will-change: transform;
transform-origin: 50% 100%;
border-radius: 50% 50% 0 0 / 100% 100% 0 0;
background-image: linear-gradient(135deg,
rgba(255, 255, 255, 0.6) 0%,
rgba(255, 255, 255, 0.02) 70%,
rgba(255, 255, 255, 0) 100%
);
clip-path: polygon(100% 0,
100% 10%, //控制扇形角度 100% => 135deg
50% 100%, 0 100%, 0 0);
animation: rotate360 3s infinite linear;
}
.radar .pointer:after {
content: "";
position: absolute;
width: 50%;
bottom: -1px;
border-top: 2px solid #008096;
//box-shadow: 0 0 3px rgba(00,0,255, 0.6);
border-radius: 9px;
}
@keyframes rotate360 {
0% {
transform: rotate(0deg);
}
to {
transform: rotate(-360deg);
}
}
.ping {
position: absolute;
left: 15%;
top: 48%;
width: 4px;
height: 4px;
margin: auto;
border-radius: 46px;
background: #fff;
box-shadow: 0 0...