warning.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div class="container">
  3. <div class="dot"></div>
  4. <div class="pulse"></div>
  5. <div class="content" v-for="(item , index) in worn" :key="index">{{item}}</div>
  6. </div>
  7. </template>
  8. <script>
  9. export default {
  10. props: {
  11. worn: Array,
  12. },
  13. }
  14. </script>
  15. <style scoped>
  16. @keyframes warn {
  17. 0% {
  18. transform: scale(0.3);
  19. -webkit-transform: scale(0.3);
  20. opacity: 0.0;
  21. }
  22. 25% {
  23. transform: scale(0.3);
  24. -webkit-transform: scale(0.3);
  25. opacity: 0.1;
  26. }
  27. 50% {
  28. transform: scale(0.5);
  29. -webkit-transform: scale(0.5);
  30. opacity: 0.3;
  31. }
  32. 75% {
  33. transform: scale(0.8);
  34. -webkit-transform: scale(0.8);
  35. opacity: 0.5;
  36. }
  37. 100% {
  38. transform: scale(1);
  39. -webkit-transform: scale(1);
  40. opacity: 0.0;
  41. }
  42. }
  43. @keyframes warn1 {
  44. 0% {
  45. transform: scale(0.3);
  46. -webkit-transform: scale(0.3);
  47. opacity: 0.0;
  48. }
  49. 25% {
  50. transform: scale(0.3);
  51. -webkit-transform: scale(0.3);
  52. opacity: 0.1;
  53. }
  54. 50% {
  55. transform: scale(0.3);
  56. -webkit-transform: scale(0.3);
  57. opacity: 0.3;
  58. }
  59. 75% {
  60. transform: scale(0.5);
  61. -webkit-transform: scale(0.5);
  62. opacity: 0.5;
  63. }
  64. 100% {
  65. transform: scale(0.8);
  66. -webkit-transform: scale(0.8);
  67. opacity: 0.0;
  68. }
  69. }
  70. .container {
  71. position: absolute;
  72. width: 40px;
  73. height: 40px;
  74. z-index: 99;
  75. /*border: 1px solid #000; hovertree.com */
  76. }
  77. .content{
  78. position: relative;
  79. display: none;
  80. z-index: 9999;
  81. }
  82. .container:hover .content{
  83. /* position: absolute; */
  84. padding: 10px;
  85. width: 200px;
  86. color: #000000;
  87. background-color: #ffffff;
  88. display: block;
  89. min-height: 20px;
  90. z-index: 9999;
  91. margin-left: 40px;
  92. }
  93. /* 保持大小不变的小圆圈 何问起 */
  94. .dot {
  95. position: absolute;
  96. width: 8px;
  97. height: 8px;
  98. left: 42px;
  99. top: 42px;
  100. -webkit-border-radius: 50%;
  101. -moz-border-radius: 50%;
  102. border: 2px solid red;
  103. border-radius: 50%;
  104. z-index: 2;
  105. background-color: red;
  106. }
  107. /* 产生动画(向外扩散变大)的圆圈 */
  108. .pulse {
  109. position: absolute;
  110. width: 80px;
  111. height: 80px;
  112. left: 2px;
  113. top: 2px;
  114. border: 6px solid red;
  115. -webkit-border-radius: 50%;
  116. -moz-border-radius: 50%;
  117. border-radius: 50%;
  118. z-index: 1;
  119. opacity: 0;
  120. -webkit-animation: warn 1.5s linear;
  121. -moz-animation: warn 1.5s linear;
  122. animation: warn 1.5s linear;
  123. -webkit-animation-iteration-count: infinite;
  124. -moz-animation-iteration-count: infinite;
  125. animation-iteration-count: infinite;
  126. box-shadow: 1px 1px 30px red;
  127. }
  128. </style>