loading.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="loading">
  3. <figure>
  4. <div class="dot white" />
  5. <div class="dot" />
  6. <div class="dot" />
  7. <div class="dot" />
  8. <div class="dot" />
  9. </figure>
  10. </div>
  11. </template>
  12. <style scoped>
  13. .loading{
  14. position: fixed;
  15. width: 100%;
  16. height: 100%;
  17. top: 0;
  18. left: 0;
  19. z-index: 9;
  20. background: rgba(0, 0, 0, 0.7);
  21. font-size: 12px;
  22. }
  23. figure {
  24. position: absolute;
  25. margin: auto;
  26. top: 0;
  27. bottom: 0;
  28. left: 0;
  29. right: 0;
  30. width: 6.25em;
  31. height: 6.25em;
  32. animation: rotate 2.4s linear infinite;
  33. }
  34. .white {
  35. top: 0;
  36. bottom: 0;
  37. left: 0;
  38. right: 0;
  39. background: white;
  40. animation: flash 2.4s linear infinite;
  41. opacity: 0;
  42. }
  43. .dot {
  44. position: absolute;
  45. margin: auto;
  46. width: 2.4em;
  47. height: 2.4em;
  48. border-radius: 100%;
  49. transition: all 1s ease;
  50. }
  51. .dot:nth-child(2) {
  52. top: 0;
  53. bottom: 0;
  54. left: 0;
  55. background: #ff4444;
  56. animation: dotsY 2.4s linear infinite;
  57. }
  58. .dot:nth-child(3) {
  59. left: 0;
  60. right: 0;
  61. top: 0;
  62. background: #ffbb33;
  63. animation: dotsX 2.4s linear infinite;
  64. }
  65. .dot:nth-child(4) {
  66. top: 0;
  67. bottom: 0;
  68. right: 0;
  69. background: #99cc00;
  70. animation: dotsY 2.4s linear infinite;
  71. }
  72. .dot:nth-child(5) {
  73. left: 0;
  74. right: 0;
  75. bottom: 0;
  76. background: #33b5e5;
  77. animation: dotsX 2.4s linear infinite;
  78. }
  79. @keyframes rotate {
  80. 0% {
  81. transform: rotate(0);
  82. }
  83. 10% {
  84. width: 6.25em;
  85. height: 6.25em;
  86. }
  87. 66% {
  88. width: 2.4em;
  89. height: 2.4em;
  90. }
  91. 100% {
  92. transform: rotate(360deg);
  93. width: 6.25em;
  94. height: 6.25em;
  95. }
  96. }
  97. @keyframes dotsY {
  98. 66% {
  99. opacity: 0.1;
  100. width: 2.4em;
  101. }
  102. 77% {
  103. opacity: 1;
  104. width: 0;
  105. }
  106. }
  107. @keyframes dotsX {
  108. 66% {
  109. opacity: 0.1;
  110. height: 2.4em;
  111. }
  112. 77% {
  113. opacity: 1;
  114. height: 0;
  115. }
  116. }
  117. @keyframes flash {
  118. 33% {
  119. opacity: 0;
  120. border-radius: 0%;
  121. }
  122. 55% {
  123. opacity: 0.6;
  124. border-radius: 100%;
  125. }
  126. 66% {
  127. opacity: 0;
  128. }
  129. }
  130. </style>