SmallRader2.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <div class="smallRader">
  3. <div class="bgCircle">
  4. <div class="rader animete-box">
  5. <div class="dotWarning animete-1 animated heartBeat" v-if="RaderState == 1"></div>
  6. <div v-show="dotLists" v-for="dot in dotLists" :key="dot.id" class="dotNormal heartBeat"
  7. :style="{left:dot.x+'px',top:dot.y+'px',width:dot.s+'px',height:dot.s+'px'}"></div>
  8. </div>
  9. <span id="circle1"></span>
  10. <span id="circle2"></span>
  11. <span id="circle3"></span>
  12. <span id="circle4"></span>
  13. </div>
  14. <div class="timeShow">
  15. {{timeShow}}
  16. </div>
  17. <em class="state" v-if="RaderState == 0">区域环境安全</em>
  18. <em class="warning" v-if="RaderState != 0"><img src="../assets/img/main/waning.png" alt="">发现可疑信号</em>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. seconds: 0,
  26. show: true,
  27. RaderState: 0,
  28. timeShow: ' 00 : 00 : 00',
  29. dotLists: [],
  30. }
  31. },
  32. props: ['totalRs'],
  33. mounted() {
  34. let that = this;
  35. this.timer = setInterval(() => {
  36. that.getTime();
  37. }, 1000);
  38. },
  39. methods: {
  40. createDots() {
  41. let that = this;
  42. this.dotLists = [];
  43. for (var i = 0; i < 5; i++) {
  44. this.dotLists.push({
  45. x: that.getRandomInt(20, 120),
  46. y: that.getRandomInt(10, 110),
  47. s: that.getRandomInt(3, 10),
  48. id: i,
  49. })
  50. }
  51. },
  52. getRandomInt(min, max) {
  53. return Math.floor(Math.random() * (max - min + 1)) + min;
  54. },
  55. getTime() {
  56. let date = new Date();
  57. let year = date.getFullYear();
  58. let month = date.getMonth() + 1;
  59. let strDate = date.getDate();
  60. let Hours = date.getHours();
  61. let Minutes = date.getMinutes();
  62. let Seconds = date.getSeconds();
  63. if (month >= 1 && month <= 9) {
  64. month = "0" + month;
  65. }
  66. if (strDate >= 0 && strDate <= 9) {
  67. strDate = "0" + strDate;
  68. }
  69. if (Hours >= 0 && Hours <= 9) {
  70. Hours = "0" + Hours;
  71. }
  72. if (Minutes >= 0 && Minutes <= 9) {
  73. Minutes = "0" + Minutes;
  74. }
  75. if (Seconds >= 0 && Seconds <= 9) {
  76. Seconds = "0" + Seconds;
  77. }
  78. let thisdata = year + '-' + month + '-' + strDate;
  79. this.timeShow = thisdata;
  80. }
  81. },
  82. watch: {
  83. totalRs: function (val) {
  84. let that = this;
  85. that.createDots();
  86. that.RaderState = val.BoolSafe;
  87. },
  88. },
  89. }
  90. </script>
  91. <style scoped>
  92. .smallRader {
  93. width: 196px;
  94. height: 382px;
  95. overflow: hidden;
  96. display: block;
  97. background: rgba(27, 86, 200, 0.14);
  98. border: 1px solid #005EA2;
  99. margin-left: 30px;
  100. }
  101. .bgCircle {
  102. width: 163px;
  103. height: 163px;
  104. overflow: hidden;
  105. margin: 0 auto;
  106. margin-top: 38px;
  107. background: url("../assets/img/main/radar.png") top center no-repeat;
  108. background-size: 100% 100%;
  109. }
  110. .bgCircle span {
  111. position: relative;
  112. background: rgba(109, 193, 255, 0.07);
  113. border-radius: 250px;
  114. display: block;
  115. }
  116. #circle1 {
  117. width: 30px;
  118. height: 30px;
  119. top: 10px;
  120. left: 20px;
  121. animation: ghostUpdown 5s infinite alternate;
  122. -webkit-animation: ghostUpdown 5s infinite alternate;
  123. }
  124. #circle2 {
  125. width: 10px;
  126. height: 10px;
  127. top: 90px;
  128. left: 110px;
  129. }
  130. #circle3 {
  131. width: 34px;
  132. height: 34px;
  133. top: 123px;
  134. left: 112px;
  135. }
  136. #circle4 {
  137. width: 14px;
  138. height: 14px;
  139. top: 155px;
  140. left: 163px;
  141. }
  142. @keyframes ghostUpdown {
  143. from {
  144. margin-top: 100px;
  145. margin-left: 66px;
  146. }
  147. to {
  148. margin-top: 70px;
  149. }
  150. }
  151. @-webkit-keyframes ghostUpdown {
  152. from {
  153. margin-top: 100px;
  154. margin-left: 66px;
  155. }
  156. to {
  157. margin-top: 70px;
  158. }
  159. }
  160. .animete-box {
  161. width: 160px;
  162. height: 160px;
  163. position: absolute;
  164. left: 138px;
  165. top: 200px;
  166. transform: translate(-50%, -50%);
  167. border-radius: 50%;
  168. }
  169. /*css3波纹*/
  170. .wrap__uc-waves {
  171. overflow: hidden;
  172. height: 1rem;
  173. width: 100%;
  174. position: absolute;
  175. bottom: 0;
  176. }
  177. .wrap__uc-waves .wave {
  178. width: 15rem;
  179. transform-origin: center bottom;
  180. position: absolute;
  181. left: 0;
  182. bottom: 0;
  183. }
  184. .wrap__uc-waves .w1 {
  185. background-size: cover;
  186. height: .5rem;
  187. animation: anim_wave 5s linear infinite;
  188. }
  189. .wrap__uc-waves .w2 {
  190. background-size: cover;
  191. height: .7rem;
  192. animation: anim_wave 6s linear infinite;
  193. }
  194. @keyframes anim_wave {
  195. 0% {
  196. transform: translateX(0) translateZ(0) scaleY(1)
  197. }
  198. 50% {
  199. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  200. }
  201. 100% {
  202. transform: translateX(-50%) translateZ(0) scaleY(1)
  203. }
  204. }
  205. .animete-box:before {
  206. content: ' ';
  207. display: block;
  208. position: absolute;
  209. width: 100%;
  210. height: 100%;
  211. border-radius: 50%;
  212. }
  213. .animete-box:after {
  214. content: ' ';
  215. display: block;
  216. background-image: linear-gradient(44deg, rgba(0, 255, 51, 0) 50%, #6DC1FF 100%);
  217. width: 50%;
  218. height: 50%;
  219. position: absolute;
  220. top: 5px;
  221. left: 5px;
  222. animation: radar-beam 5s infinite;
  223. animation-timing-function: linear;
  224. transform-origin: bottom right;
  225. border-radius: 100% 0 0 0;
  226. }
  227. @keyframes radar-beam {
  228. 0% {
  229. transform: rotate(0deg);
  230. }
  231. 100% {
  232. transform: rotate(360deg);
  233. }
  234. }
  235. .dotWarning {
  236. width: 5px;
  237. height: 5px;
  238. background: #FFDD00;
  239. background-size: 50px 50px;
  240. border-radius: 250px;
  241. }
  242. .dotNormal {
  243. position: relative;
  244. width: 5px;
  245. height: 5px;
  246. background: #6DC1FF;
  247. background-size: 50px 50px;
  248. border-radius: 250px;
  249. transform: scale(0.5);
  250. animation: bulge 2s infinite ease-in-out;
  251. }
  252. .dotNormal::after {
  253. z-index: -1;
  254. transform: scale(1);
  255. animation: blow 2s infinite ease-in-out;
  256. }
  257. .animete-1 {
  258. position: absolute;
  259. left: 30px;
  260. top: 120px;
  261. z-index: 3;
  262. }
  263. .animete-2 {
  264. width: 5px;
  265. height: 5px;
  266. position: absolute;
  267. left: 100px;
  268. top: 160px;
  269. z-index: 3;
  270. }
  271. .animete-3 {
  272. width: 15px;
  273. height: 15px;
  274. position: absolute;
  275. left: 110px;
  276. top: 90px;
  277. z-index: 3;
  278. }
  279. .animete-4 {
  280. width: 10px;
  281. height: 10px;
  282. position: absolute;
  283. left: 120px;
  284. top: 110px;
  285. z-index: 3;
  286. }
  287. @keyframes heartBeat {
  288. 0% {
  289. -webkit-transform: scale(1);
  290. transform: scale(1);
  291. }
  292. 14% {
  293. -webkit-transform: scale(1.5);
  294. transform: scale(1.5);
  295. }
  296. 22% {
  297. -webkit-transform: scale(1.2);
  298. transform: scale(1.2);
  299. }
  300. 28% {
  301. -webkit-transform: scale(1);
  302. transform: scale(1);
  303. }
  304. 42% {
  305. -webkit-transform: scale(1.2);
  306. transform: scale(1.2);
  307. }
  308. 54% {
  309. -webkit-transform: scale(1.0);
  310. transform: scale(1.0);
  311. }
  312. 60% {
  313. -webkit-transform: scale(1.1);
  314. transform: scale(1.1);
  315. }
  316. 80% {
  317. -webkit-transform: scale(1);
  318. transform: scale(1);
  319. }
  320. }
  321. .heartBeat {
  322. -webkit-animation-name: heartBeat;
  323. animation-name: heartBeat;
  324. -webkit-animation-duration: 3s;
  325. animation-duration: 3s;
  326. -webkit-animation-timing-function: ease;
  327. animation-timing-function: ease;
  328. }
  329. .animated {
  330. -webkit-animation-duration: 1s;
  331. animation-duration: 1s;
  332. -webkit-animation-fill-mode: both;
  333. animation-fill-mode: both;
  334. }
  335. @keyframes warn {
  336. 0% {
  337. transform: scale(0);
  338. opacity: 0.0;
  339. }
  340. 25% {
  341. transform: scale(0.25);
  342. opacity: 0.1;
  343. }
  344. 50% {
  345. transform: scale(0.5);
  346. opacity: 0.3;
  347. }
  348. 75% {
  349. transform: scale(0.75);
  350. opacity: 0.5;
  351. }
  352. 100% {
  353. transform: scale(1);
  354. opacity: 0.0;
  355. }
  356. }
  357. /* 保持大小不变的小圆圈 */
  358. .dot {
  359. position: absolute;
  360. width: 5px;
  361. height: 5px;
  362. left: 50%;
  363. top: 50%;
  364. border-radius: 10px;
  365. z-index: 2;
  366. }
  367. /* 产生动画(向外扩散变大)的圆圈 */
  368. .pulse {
  369. position: absolute;
  370. width: 200px;
  371. height: 200px;
  372. left: 50%;
  373. top: 50%;
  374. margin-top: -100px;
  375. margin-left: -100px;
  376. border: 3px solid #6DC1FF;
  377. box-shadow: 0px 0px 20px #6DC1FF inset;
  378. border-radius: 150px;
  379. z-index: 1;
  380. opacity: 0;
  381. animation: warn 1.8s linear;
  382. animation-iteration-count: infinite !important;
  383. }
  384. .pulse2 {
  385. position: absolute;
  386. width: 200px;
  387. height: 200px;
  388. left: 50%;
  389. top: 50%;
  390. margin-top: -100px;
  391. margin-left: -100px;
  392. border: 3px solid #6DC1FF;
  393. box-shadow: 0px 0px 20px #6DC1FF inset;
  394. border-radius: 150px;
  395. z-index: 1;
  396. opacity: 0;
  397. animation: warn 1.8s linear;
  398. animation-delay: 0.6s;
  399. animation-iteration-count: infinite !important;
  400. }
  401. .pulse3 {
  402. position: absolute;
  403. width: 200px;
  404. height: 200px;
  405. left: 50%;
  406. top: 50%;
  407. margin-top: -100px;
  408. margin-left: -100px;
  409. border: 3px solid #6DC1FF;
  410. box-shadow: 0px 0px 20px #6DC1FF inset;
  411. border-radius: 150px;
  412. z-index: 1;
  413. opacity: 0;
  414. animation: warn 1.8s linear;
  415. animation-delay: 0.3s;
  416. animation-iteration-count: infinite !important;
  417. }
  418. @font-face {
  419. font-family: UnidreamLED;
  420. src: url('../assets/font/UnidreamLED.ttf');
  421. }
  422. .timeShow {
  423. position: relative;
  424. bottom: -10px;
  425. width: 100%;
  426. overflow: hidden;
  427. display: block;
  428. margin: 0 auto;
  429. height: 40px;
  430. line-height: 40px;
  431. font-size: 33px;
  432. color: #6DC1FF;
  433. text-align: center;
  434. font-family: UnidreamLED;
  435. }
  436. .state {
  437. position: relative;
  438. top: 40px;
  439. height: 48px;
  440. line-height: 48px;
  441. margin: 0 auto;
  442. display: block;
  443. color: #CFEBFF;
  444. font-size: 24px;
  445. background: rgba(27, 86, 200, 0.51);
  446. z-index: 6666;
  447. }
  448. .warning {
  449. position: relative;
  450. top: 40px;
  451. left: 5px;
  452. width: 100px;
  453. overflow: hidden;
  454. display: block;
  455. margin: 0 auto;
  456. color: #FFDD00;
  457. text-align: center;
  458. font-size: 16px;
  459. }
  460. .warning img {
  461. display: block;
  462. margin: 0 auto;
  463. }
  464. </style>