loading.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. :root {
  5. @include set-component-css-var('loading', $loading);
  6. }
  7. @include b(loading-parent) {
  8. @include m(relative) {
  9. position: relative !important;
  10. }
  11. @include m(hidden) {
  12. overflow: hidden !important;
  13. }
  14. }
  15. @include b(loading-mask) {
  16. position: absolute;
  17. z-index: 2000;
  18. background-color: getCssVar('mask-color');
  19. margin: 0;
  20. top: 0;
  21. right: 0;
  22. bottom: 0;
  23. left: 0;
  24. transition: opacity getCssVar('transition-duration');
  25. @include when(fullscreen) {
  26. position: fixed;
  27. .#{$namespace}-loading-spinner {
  28. margin-top: calc(
  29. (0px - getCssVar('loading-fullscreen-spinner-size')) / 2
  30. );
  31. .circular {
  32. height: getCssVar('loading-fullscreen-spinner-size');
  33. width: getCssVar('loading-fullscreen-spinner-size');
  34. }
  35. }
  36. }
  37. }
  38. @include b(loading-spinner) {
  39. top: 50%;
  40. margin-top: calc((0px - getCssVar('loading-spinner-size')) / 2);
  41. width: 100%;
  42. text-align: center;
  43. position: absolute;
  44. .#{$namespace}-loading-text {
  45. color: getCssVar('color-primary');
  46. margin: 3px 0;
  47. font-size: 14px;
  48. }
  49. .circular {
  50. display: inline;
  51. height: getCssVar('loading-spinner-size');
  52. width: getCssVar('loading-spinner-size');
  53. animation: loading-rotate 2s linear infinite;
  54. }
  55. .path {
  56. animation: loading-dash 1.5s ease-in-out infinite;
  57. stroke-dasharray: 90, 150;
  58. stroke-dashoffset: 0;
  59. stroke-width: 2;
  60. stroke: getCssVar('color-primary');
  61. stroke-linecap: round;
  62. }
  63. i {
  64. color: getCssVar('color-primary');
  65. }
  66. }
  67. .#{$namespace}-loading-fade-enter-from,
  68. .#{$namespace}-loading-fade-leave-to {
  69. opacity: 0;
  70. }
  71. @keyframes loading-rotate {
  72. 100% {
  73. transform: rotate(360deg);
  74. }
  75. }
  76. @keyframes loading-dash {
  77. 0% {
  78. stroke-dasharray: 1, 200;
  79. stroke-dashoffset: 0;
  80. }
  81. 50% {
  82. stroke-dasharray: 90, 150;
  83. stroke-dashoffset: -40px;
  84. }
  85. 100% {
  86. stroke-dasharray: 90, 150;
  87. stroke-dashoffset: -120px;
  88. }
  89. }