Radar.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <div class="container">
  3. <div class="animete-box">
  4. <div class="animete-boy animete-1 animated heartBeat"></div>
  5. <div class="animete-girl animete-2 animated heartBeat"></div>
  6. <div class="dot"></div>
  7. <div class="pulse"></div>
  8. <div class="pulse2"></div>
  9. <div class="pulse3"></div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: "Radar"
  16. }
  17. </script>
  18. <style scoped>
  19. html{
  20. background: #fff;
  21. background-size:7.5rem auto;
  22. -webkit-overflow-scrolling: touch;
  23. min-height: 100vh;
  24. }
  25. body{
  26. background: #fff;
  27. background-size:cover;
  28. max-width: 8rem;
  29. -webkit-overflow-scrolling: touch;
  30. margin: 0 auto;
  31. min-height: 100vh;
  32. }
  33. .animete-box{
  34. width: 200px;
  35. height: 200px;
  36. position: absolute;
  37. left: 50%;
  38. top: 50%;
  39. transform: translate(-50%, -50%);
  40. border-radius: 50%;
  41. }
  42. .container {
  43. width: 100%;
  44. overflow: hidden;
  45. display: block;
  46. margin: 0 auto;
  47. }
  48. /*css3波纹*/
  49. .wrap__uc-waves{overflow:hidden;height:1rem;width:100%;position:absolute;bottom:0;}
  50. .wrap__uc-waves .wave{width:15rem; transform-origin:center bottom; position:absolute;left:0;bottom:0;}
  51. .wrap__uc-waves .w1{
  52. background-size:cover; height:.5rem; animation:anim_wave 5s linear infinite;}
  53. .wrap__uc-waves .w2{
  54. background-size:cover; height:.7rem; animation:anim_wave 6s linear infinite;}
  55. @keyframes anim_wave {
  56. 0% {
  57. transform: translateX(0) translateZ(0) scaleY(1)
  58. }
  59. 50% {
  60. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  61. }
  62. 100% {
  63. transform: translateX(-50%) translateZ(0) scaleY(1)
  64. }
  65. }
  66. .animete-box:before {
  67. content: ' ';
  68. display: block;
  69. position: absolute;
  70. width: 100%;
  71. height: 100%;
  72. border-radius: 50%;
  73. }
  74. .animete-box:after {
  75. content: ' ';
  76. display: block;
  77. background-image: linear-gradient(44deg, rgba(0, 255, 51, 0) 50%, green 100%);
  78. width: 50%;
  79. height: 50%;
  80. position: absolute;
  81. top: 5px;
  82. left: 5px;
  83. animation: radar-beam 5s infinite;
  84. animation-timing-function: linear;
  85. transform-origin: bottom right;
  86. border-radius: 100% 0 0 0;
  87. }
  88. @keyframes radar-beam {
  89. 0% {
  90. transform: rotate(0deg);
  91. }
  92. 100% {
  93. transform: rotate(360deg);
  94. }
  95. }
  96. .animete-boy{
  97. width: 5px;
  98. height: 5px;
  99. background: blue;
  100. background-size: 50px 50px;
  101. border-radius: 250px;
  102. }
  103. .animete-girl{
  104. width: 5px;
  105. height: 5px;
  106. background: green;
  107. background-size: 50px 50px;
  108. border-radius: 250px;
  109. }
  110. .animete-1{
  111. position: absolute;
  112. left: 100px;
  113. top: 50px;
  114. z-index: 3;
  115. }
  116. .animete-2{
  117. position: absolute;
  118. left: 200px;
  119. top: 10px;
  120. z-index: 3;
  121. }
  122. .animete-3{
  123. position: absolute;
  124. left: 300px;
  125. top: 300px;
  126. z-index: 3;
  127. }
  128. .animete-4{
  129. position: absolute;
  130. left: 280px;
  131. top: 120px;
  132. z-index: 3;
  133. }
  134. .animete-5{
  135. position: absolute;
  136. left: 250px;
  137. top: 180px;
  138. z-index: 3;
  139. }
  140. @keyframes heartBeat {
  141. 0% {
  142. -webkit-transform: scale(1);
  143. transform: scale(1);
  144. }
  145. 14% {
  146. -webkit-transform: scale(1.5);
  147. transform: scale(1.5);
  148. }
  149. 22% {
  150. -webkit-transform: scale(1.2);
  151. transform: scale(1.2);
  152. }
  153. 28% {
  154. -webkit-transform: scale(1);
  155. transform: scale(1);
  156. }
  157. 42% {
  158. -webkit-transform: scale(1.2);
  159. transform: scale(1.2);
  160. }
  161. 54% {
  162. -webkit-transform: scale(1.0);
  163. transform: scale(1.0);
  164. }
  165. 60%{
  166. -webkit-transform: scale(1.1);
  167. transform: scale(1.1);
  168. }
  169. 80%{
  170. -webkit-transform: scale(1);
  171. transform: scale(1);
  172. }
  173. }
  174. .heartBeat {
  175. -webkit-animation-name: heartBeat;
  176. animation-name: heartBeat;
  177. -webkit-animation-duration: 3s;
  178. animation-duration: 3s;
  179. -webkit-animation-timing-function: ease;
  180. animation-timing-function: ease;
  181. }
  182. .animated {
  183. -webkit-animation-duration: 1s;
  184. animation-duration: 1s;
  185. -webkit-animation-fill-mode: both;
  186. animation-fill-mode: both;
  187. }
  188. @keyframes warn {
  189. 0% {
  190. transform: scale(0);
  191. opacity: 0.0;
  192. }
  193. 25% {
  194. transform: scale(0.25);
  195. opacity: 0.1;
  196. }
  197. 50% {
  198. transform: scale(0.5);
  199. opacity: 0.3;
  200. }
  201. 75% {
  202. transform: scale(0.75);
  203. opacity: 0.5;
  204. }
  205. 100% {
  206. transform: scale(1);
  207. opacity: 0.0;
  208. }
  209. }
  210. /* 保持大小不变的小圆圈 */
  211. .dot {
  212. position: absolute;
  213. background: #e20000;
  214. width: 5px;
  215. height: 5px;
  216. left: 50%;
  217. top: 50%;
  218. border-radius: 10px;
  219. z-index: 2;
  220. }
  221. /* 产生动画(向外扩散变大)的圆圈 */
  222. .pulse {
  223. position: absolute;
  224. width: 200px;
  225. height: 200px;
  226. left: 50%;
  227. top: 50%;
  228. margin-top: -100px;
  229. margin-left: -100px;
  230. border: 3px solid green;
  231. box-shadow: 0px 0px 20px green inset;
  232. border-radius: 150px;
  233. z-index: 1;
  234. opacity: 0;
  235. animation: warn 1.8s linear;
  236. animation-iteration-count: infinite!important;
  237. }
  238. .pulse2 {
  239. position: absolute;
  240. width: 200px;
  241. height: 200px;
  242. left: 50%;
  243. top: 50%;
  244. margin-top: -100px;
  245. margin-left: -100px;
  246. border: 3px solid green;
  247. box-shadow: 0px 0px 20px green inset;
  248. border-radius: 150px;
  249. z-index: 1;
  250. opacity: 0;
  251. animation: warn 1.8s linear;
  252. animation-delay:0.6s;
  253. animation-iteration-count: infinite!important;
  254. }
  255. .pulse3 {
  256. position: absolute;
  257. width: 200px;
  258. height: 200px;
  259. left: 50%;
  260. top: 50%;
  261. margin-top: -100px;
  262. margin-left: -100px;
  263. border: 3px solid green;
  264. box-shadow: 0px 0px 20px green inset;
  265. border-radius: 150px;
  266. z-index: 1;
  267. opacity: 0;
  268. animation: warn 1.8s linear;
  269. animation-delay:0.3s;
  270. animation-iteration-count: infinite!important;
  271. }
  272. </style>