Spinner.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template lang="pug">
  2. .spinner
  3. .spinner-rect.spinner-rect-1
  4. .spinner-rect.spinner-rect-2
  5. .spinner-rect.spinner-rect-3
  6. .spinner-rect.spinner-rect-4
  7. .spinner-rect.spinner-rect-5
  8. </template>
  9. <script>
  10. export default {
  11. }
  12. </script>
  13. <style lang="sass">
  14. @import '../../assets/variables'
  15. .spinner
  16. $rect-count: 5
  17. $animation-duration: 1000ms
  18. $delay-range: 400ms
  19. width: 50px
  20. height: 40px
  21. text-align: center
  22. font-size: 10px
  23. margin: 40px auto
  24. .spinner-rect
  25. width: 5px
  26. height: 100%
  27. background: $app-main-color
  28. margin: 0 3px 0 0
  29. display: inline-block
  30. animation: spinner-wave $animation-duration infinite ease-in-out
  31. @for $i from 1 through $rect-count
  32. .spinner-rect-#{$i}
  33. animation-delay: - $animation-duration + $delay-range / ($rect-count - 1) * ($i - 1)
  34. @keyframes spinner-wave
  35. 0%, 40%, 100%
  36. transform: scaleY(0.4)
  37. 20%
  38. transform: scaleY(1.0)
  39. </style>