Loading.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //loading效果组件
  2. <template>
  3. <div class="loadEffect" :style="{marginTop: marginTop? marginTop : '50%'}">
  4. <span class="ld-span"></span>
  5. <span class="ld-span"></span>
  6. <span class="ld-span"></span>
  7. <span class="ld-span"></span>
  8. <span class="ld-span"></span>
  9. <span class="ld-span"></span>
  10. <span class="ld-span"></span>
  11. <span class="ld-span"></span>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'Loading',
  17. props: ["marginTop"]
  18. }
  19. </script>
  20. <style scoped>
  21. .loadEffect{
  22. width: 100px;
  23. height: 100px;
  24. position: relative;
  25. margin: 0 auto;
  26. position: relative;
  27. top:-50px;
  28. margin-top:50%;
  29. transform: scale(.5)
  30. }
  31. .loadEffect .ld-span{
  32. display: inline-block;
  33. width: 20px;
  34. height: 20px;
  35. border-radius: 50%;
  36. background: #67e7d5;
  37. position: absolute;
  38. -webkit-animation: load 1.04s ease infinite;
  39. }
  40. @-webkit-keyframes load{
  41. 0%{
  42. -webkit-transform: scale(1.2);
  43. opacity: 1;
  44. }
  45. 100%{
  46. -webkit-transform: scale(.3);
  47. opacity: 0.5;
  48. }
  49. }
  50. .loadEffect .ld-span:nth-child(1){
  51. left: 0;
  52. top: 50%;
  53. margin-top:-10px;
  54. -webkit-animation-delay:0.13s;
  55. }
  56. .loadEffect .ld-span:nth-child(2){
  57. left: 14px;
  58. top: 14px;
  59. -webkit-animation-delay:0.26s;
  60. }
  61. .loadEffect .ld-span:nth-child(3){
  62. left: 50%;
  63. top: 0;
  64. margin-left: -10px;
  65. -webkit-animation-delay:0.39s;
  66. }
  67. .loadEffect .ld-span:nth-child(4){
  68. top: 14px;
  69. right:14px;
  70. -webkit-animation-delay:0.52s;
  71. }
  72. .loadEffect .ld-span:nth-child(5){
  73. right: 0;
  74. top: 50%;
  75. margin-top:-10px;
  76. -webkit-animation-delay:0.65s;
  77. }
  78. .loadEffect .ld-span:nth-child(6){
  79. right: 14px;
  80. bottom:14px;
  81. -webkit-animation-delay:0.78s;
  82. }
  83. .loadEffect .ld-span:nth-child(7){
  84. bottom: 0;
  85. left: 50%;
  86. margin-left: -10px;
  87. -webkit-animation-delay:0.91s;
  88. }
  89. .loadEffect .ld-span:nth-child(8){
  90. bottom: 14px;
  91. left: 14px;
  92. -webkit-animation-delay:1.04s;
  93. }
  94. </style>