前端思考 前端思考
Home
Notes
Terminal
Demos
Editor Online (opens new window)
图博 (opens new window)
Github (opens new window)
Home
Notes
Terminal
Demos
Editor Online (opens new window)
图博 (opens new window)
Github (opens new window)
  • CSS3 雷达扫描效果

<template>
  <div class="box-radar">
    <div class="radar"></div>
  </div>
</template>
<style>
.box-radar{
    height:300px;
    background: #092756;
    background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%),-moz-linear-gradient(top, rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), -moz-linear-gradient(-45deg, #670d10 0%, #092756 100%);
    background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -webkit-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -webkit-linear-gradient(-45deg, #670d10 0%,#092756 100%);
    background: -o-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -o-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -o-linear-gradient(-45deg, #670d10 0%,#092756 100%);
    background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -ms-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -ms-linear-gradient(-45deg, #670d10 0%,#092756 100%);
    background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), linear-gradient(to bottom, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), linear-gradient(135deg, #670d10 0%,#092756 100%);
    display:flex;
    justify-content: center;
    align-items:center;
}
.box-radar:before{
    content:'';
    position:absolute;
    left:0;
    width:100%;
    height:100%;
    z-index:0;
    background: -webkit-linear-gradient(top, transparent 20px, rgba(255,255,255,.2) 21px),-webkit-linear-gradient(left, transparent 20px, rgba(255,255,255,.2) 21px);
    background-size: 21px 21px;
}
.radar {
  background: -webkit-radial-gradient(center, rgba(104, 225, 244, 0.3) 0%, rgba(104, 225, 244, 0) 75%), 
              -webkit-repeating-radial-gradient(rgba(104, 225, 244, 0) 5.8%, rgba(104, 225, 244, 0) 18%, #62d7eb 18.6%, rgba(104, 225, 244, 0) 18.9%), -webkit-linear-gradient(90deg, rgba(104, 225, 244, 0) 49.5%, #62d7eb 50%, #62d7eb 50%, rgba(104, 225, 244, 0) 50.2%), 
              -webkit-linear-gradient(0deg, rgba(104, 225, 244, 0) 49.5%, #62d7eb 50%, #62d7eb 50%, rgba(104, 225, 244, 0) 50.2%);
  background: radial-gradient(center, rgba(104, 225, 244, 0.3) 0%, rgba(104, 225, 244, 0) 75%), 
              repeating-radial-gradient(rgba(104, 225, 244, 0) 5.8%, rgba(104, 225, 244, 0) 18%, #62d7eb 18.6%, rgba(104, 225, 244, 0) 18.9%), 
              linear-gradient(90deg, rgba(104, 225, 244, 0) 49.5%, #62d7eb 50%, #62d7eb 50%, rgba(104, 225, 244, 0) 50.2%), 
              linear-gradient(0deg, rgba(104, 225, 244, 0) 49.5%, #62d7eb 50%, #62d7eb 50%, rgba(104, 225, 244, 0) 50.2%);
  width: 200px;
  height: 200px;
  max-height: 75vh;
  max-width: 75vh;
  position: relative;
  left: 5px;
  top: -4px;
  border-radius: 50%;
  border: 1px solid #62d7eb;
  overflow: hidden;
}
.radar:before {
  content: ' ';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: blips 5s infinite;
  animation-timing-function: linear;
  animation-delay: 1.4s;
}
.radar:after {
  content: ' ';
  display: block;
  background-image: linear-gradient(44deg, rgba(0, 255, 51, 0) 50%, #20ff4d 100%);
  width: 50%;
  height: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: radar-beam 5s infinite;
  animation-timing-function: linear;
  transform-origin: bottom right;
  border-radius: 100% 0 0 0;
}

@keyframes radar-beam {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes blips {
  14% {
    background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%);
  }
  14.0002% {
    background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%);
  }
  25% {
    background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 56% 86%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%);
  }
  26% {
    background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 56% 86%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%);
    opacity: 1;
  }
  100% {
    background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 56% 86%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
  }
}

</style>
<script>
export default {
  data: () => ({
    userName: '',
    pwd:''
  }),
  methods:{
    doSubmit(){
      
    }
  }
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115