loading.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. @use "sass:map";
  2. @use "sass:list";
  3. $loadingThemeList: (
  4. (
  5. name: "primary",
  6. textColor: var(--vxe-ui-font-primary-color),
  7. bgColor: var(--vxe-ui-font-primary-tinge-color)
  8. ),
  9. (
  10. name: "success",
  11. textColor: var(--vxe-ui-status-success-color),
  12. bgColor: var(--vxe-ui-status-success-tinge-color)
  13. ),
  14. (
  15. name: "info",
  16. textColor: var(--vxe-ui-status-info-color),
  17. bgColor: var(--vxe-ui-status-info-tinge-color)
  18. ),
  19. (
  20. name: "warning",
  21. textColor: var(--vxe-ui-status-warning-color),
  22. bgColor: var(--vxe-ui-status-warning-tinge-color)
  23. ),
  24. (
  25. name: "danger",
  26. textColor: var(--vxe-ui-status-danger-color),
  27. bgColor: var(--vxe-ui-status-danger-tinge-color)
  28. ),
  29. (
  30. name: "error",
  31. textColor: var(--vxe-ui-status-error-color),
  32. bgColor: var(--vxe-ui-status-error-tinge-color)
  33. )
  34. );
  35. .vxe-loading {
  36. display: none;
  37. position: absolute;
  38. width: 100%;
  39. height: 100%;
  40. top: 0;
  41. left: 0;
  42. z-index: 99;
  43. user-select: none;
  44. color: var(--vxe-ui-loading-color);
  45. background-color: var(--vxe-ui-loading-background-color);
  46. .vxe-loading--spinner {
  47. &:before,
  48. &:after {
  49. background-color: var(--vxe-ui-font-primary-color);
  50. }
  51. }
  52. @for $index from 0 to list.length($loadingThemeList) {
  53. $item: list.nth($loadingThemeList, $index + 1);
  54. &.theme--#{map.get($item, name)} {
  55. color: map.get($item, textColor);
  56. background-color: map.get($item, bgColor);
  57. .vxe-loading--spinner {
  58. &:before,
  59. &:after {
  60. background-color: map.get($item, bgColor);
  61. }
  62. }
  63. }
  64. }
  65. &.is--visible {
  66. display: block;
  67. }
  68. & > .vxe-loading--chunk,
  69. & > .vxe-loading--wrapper {
  70. width: 100%;
  71. position: absolute;
  72. top: 50%;
  73. left: 0;
  74. transform: translateY(-50%);
  75. text-align: center;
  76. }
  77. .vxe-loading--default-icon {
  78. font-size: 1.4em;
  79. }
  80. .vxe-loading--text {
  81. padding: 0.4em 0;
  82. }
  83. .vxe-loading--spinner {
  84. display: inline-block;
  85. position: relative;
  86. width: 56px;
  87. height: 56px;
  88. &:before,
  89. &:after {
  90. content: "";
  91. width: 100%;
  92. height: 100%;
  93. border-radius: 50%;
  94. opacity: 0.6;
  95. position: absolute;
  96. top: 0;
  97. left: 0;
  98. animation: bounce 2.0s infinite ease-in-out;
  99. }
  100. &:after {
  101. animation-delay: -1.0s;
  102. }
  103. }
  104. @keyframes bounce {
  105. 0%, 100% {
  106. transform: scale(0);
  107. } 50% {
  108. transform: scale(1);
  109. }
  110. }
  111. }
  112. .size--mini {
  113. .vxe-loading {
  114. .vxe-loading--spinner {
  115. width: 38px;
  116. height: 38px;
  117. }
  118. }
  119. }
  120. .size--small {
  121. .vxe-loading {
  122. .vxe-loading--spinner {
  123. width: 44px;
  124. height: 44px;
  125. }
  126. }
  127. }
  128. .size--medium {
  129. .vxe-loading {
  130. .vxe-loading--spinner {
  131. width: 50px;
  132. height: 50px;
  133. }
  134. }
  135. }