loading.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view>
  3. <div class="spinner">
  4. <div class="spinner-container container1">
  5. <div class="circle1"></div>
  6. <div class="circle2"></div>
  7. <div class="circle3"></div>
  8. <div class="circle4"></div>
  9. </div>
  10. <div class="spinner-container container2">
  11. <div class="circle1"></div>
  12. <div class="circle2"></div>
  13. <div class="circle3"></div>
  14. <div class="circle4"></div>
  15. </div>
  16. <div class="spinner-container container3">
  17. <div class="circle1"></div>
  18. <div class="circle2"></div>
  19. <div class="circle3"></div>
  20. <div class="circle4"></div>
  21. </div>
  22. </div>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. };
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. .spinner {
  35. margin: 100px auto;
  36. width: 20px;
  37. height: 20px;
  38. position: relative;
  39. }
  40. .container1>div,
  41. .container2>div,
  42. .container3>div {
  43. width: 6px;
  44. height: 6px;
  45. background-color: #333;
  46. border-radius: 100%;
  47. position: absolute;
  48. -webkit-animation: bouncedelay 1.2s infinite ease-in-out;
  49. animation: bouncedelay 1.2s infinite ease-in-out;
  50. -webkit-animation-fill-mode: both;
  51. animation-fill-mode: both;
  52. }
  53. .spinner .spinner-container {
  54. position: absolute;
  55. width: 100%;
  56. height: 100%;
  57. }
  58. .container2 {
  59. -webkit-transform: rotateZ(45deg);
  60. transform: rotateZ(45deg);
  61. }
  62. .container3 {
  63. -webkit-transform: rotateZ(90deg);
  64. transform: rotateZ(90deg);
  65. }
  66. .circle1 {
  67. top: 0;
  68. left: 0;
  69. }
  70. .circle2 {
  71. top: 0;
  72. right: 0;
  73. }
  74. .circle3 {
  75. right: 0;
  76. bottom: 0;
  77. }
  78. .circle4 {
  79. left: 0;
  80. bottom: 0;
  81. }
  82. .container2 .circle1 {
  83. -webkit-animation-delay: -1.1s;
  84. animation-delay: -1.1s;
  85. }
  86. .container3 .circle1 {
  87. -webkit-animation-delay: -1.0s;
  88. animation-delay: -1.0s;
  89. }
  90. .container1 .circle2 {
  91. -webkit-animation-delay: -0.9s;
  92. animation-delay: -0.9s;
  93. }
  94. .container2 .circle2 {
  95. -webkit-animation-delay: -0.8s;
  96. animation-delay: -0.8s;
  97. }
  98. .container3 .circle2 {
  99. -webkit-animation-delay: -0.7s;
  100. animation-delay: -0.7s;
  101. }
  102. .container1 .circle3 {
  103. -webkit-animation-delay: -0.6s;
  104. animation-delay: -0.6s;
  105. }
  106. .container2 .circle3 {
  107. -webkit-animation-delay: -0.5s;
  108. animation-delay: -0.5s;
  109. }
  110. .container3 .circle3 {
  111. -webkit-animation-delay: -0.4s;
  112. animation-delay: -0.4s;
  113. }
  114. .container1 .circle4 {
  115. -webkit-animation-delay: -0.3s;
  116. animation-delay: -0.3s;
  117. }
  118. .container2 .circle4 {
  119. -webkit-animation-delay: -0.2s;
  120. animation-delay: -0.2s;
  121. }
  122. .container3 .circle4 {
  123. -webkit-animation-delay: -0.1s;
  124. animation-delay: -0.1s;
  125. }
  126. @-webkit-keyframes bouncedelay {
  127. 0%,
  128. 80%,
  129. 100% {
  130. -webkit-transform: scale(0.0)
  131. }
  132. 40% {
  133. -webkit-transform: scale(1.0)
  134. }
  135. }
  136. @keyframes bouncedelay {
  137. 0%,
  138. 80%,
  139. 100% {
  140. transform: scale(0.0);
  141. -webkit-transform: scale(0.0);
  142. }
  143. 40% {
  144. transform: scale(1.0);
  145. -webkit-transform: scale(1.0);
  146. }
  147. }
  148. </style>