WSpinner.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="w-spinner">
  3. <svg viewBox="25 25 50 50" class="w-circular"><circle cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10" class="w-path"></circle></svg>
  4. </div>
  5. </template>
  6. <style lang="scss" scoped>
  7. .w-spinner {
  8. display: none;
  9. position: fixed;
  10. z-index: 9999;
  11. bottom: 20px;
  12. right: 20px;
  13. margin: 0 auto;
  14. width: 30px;
  15. height: 30px;
  16. .w-circular {
  17. -webkit-animation: rotate 2s linear infinite;
  18. animation: rotate 2s linear infinite;
  19. height: 100%;
  20. -webkit-transform-origin: center center;
  21. transform-origin: center center;
  22. width: 100%;
  23. position: absolute;
  24. top: 0;
  25. bottom: 0;
  26. left: 0;
  27. right: 0;
  28. margin: auto;
  29. overflow: hidden;
  30. .w-path {
  31. stroke-dasharray: 1,200;
  32. stroke-dashoffset: 0;
  33. -webkit-animation: dash 1.5s ease-in-out infinite,color 6s ease-in-out infinite;
  34. animation: dash 1.5s ease-in-out infinite,color 6s ease-in-out infinite;
  35. stroke-linecap: round;
  36. }
  37. }
  38. @-webkit-keyframes rotate {
  39. to {
  40. -webkit-transform: rotate(1turn);
  41. transform: rotate(1turn)
  42. }
  43. }
  44. @keyframes rotate {
  45. to {
  46. -webkit-transform: rotate(1turn);
  47. transform: rotate(1turn)
  48. }
  49. }
  50. @-webkit-keyframes dash {
  51. 0% {
  52. stroke-dasharray: 1,200;
  53. stroke-dashoffset: 0
  54. }
  55. 50% {
  56. stroke-dasharray: 89,200;
  57. stroke-dashoffset: -35
  58. }
  59. to {
  60. stroke-dasharray: 89,200;
  61. stroke-dashoffset: -124
  62. }
  63. }
  64. @keyframes dash {
  65. 0% {
  66. stroke-dasharray: 1,200;
  67. stroke-dashoffset: 0
  68. }
  69. 50% {
  70. stroke-dasharray: 89,200;
  71. stroke-dashoffset: -35
  72. }
  73. to {
  74. stroke-dasharray: 89,200;
  75. stroke-dashoffset: -124
  76. }
  77. }
  78. @-webkit-keyframes color {
  79. 0%,to {
  80. stroke: #d62d20
  81. }
  82. 40% {
  83. stroke: #0057e7
  84. }
  85. 66% {
  86. stroke: #008744
  87. }
  88. 80%,90% {
  89. stroke: #ffa700
  90. }
  91. }
  92. @keyframes color {
  93. 0%,to {
  94. stroke: #d62d20
  95. }
  96. 40% {
  97. stroke: #0057e7
  98. }
  99. 66% {
  100. stroke: #008744
  101. }
  102. 80%,90% {
  103. stroke: #ffa700
  104. }
  105. }
  106. }
  107. </style>
  108. <script>
  109. export default {
  110. name: 'WSpinner',
  111. }
  112. </script>