loading.scss 2.0 KB

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