index.less 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .@{wux-prefix}-spin {
  4. position: relative;
  5. display: inline-block;
  6. &__spinning {
  7. opacity: 1;
  8. position: static;
  9. display: inline-block;
  10. vertical-align: middle;
  11. text-align: center;
  12. font-size: @spin-font-size;
  13. line-height: @spin-line-height;
  14. color: @spin-color;
  15. &--nested {
  16. vertical-align: middle;
  17. text-align: center;
  18. font-size: @spin-font-size;
  19. line-height: @spin-line-height;
  20. color: @spin-color;
  21. display: block;
  22. position: absolute;
  23. height: 100%;
  24. max-height: 320px;
  25. width: 100%;
  26. z-index: 4;
  27. }
  28. }
  29. &--nested {
  30. display: block;
  31. }
  32. &--nested &__tip {
  33. position: absolute;
  34. top: 50%;
  35. width: 100%;
  36. padding-top: 6px;
  37. text-shadow: 0 1px 2px #fff;
  38. }
  39. &__dots {
  40. .square(@spin-dot-size-base);
  41. overflow: hidden;
  42. display: inline-block;
  43. transform: rotate(45deg);
  44. animation: rotate 1.2s infinite linear;
  45. }
  46. &--nested &__dots {
  47. position: absolute;
  48. top: 50%;
  49. left: 50%;
  50. margin: -@spin-dot-size-base / 2;
  51. }
  52. &__dot {
  53. width: 9px;
  54. height: 9px;
  55. border-radius: 100%;
  56. background-color: @spin-color;
  57. transform: scale(.75);
  58. display: block;
  59. position: absolute;
  60. opacity: @disabled-opacity;
  61. animation: spinMove 1s infinite linear alternate;
  62. transform-origin: 50% 50%;
  63. text-indent: -999em;
  64. &:first-child {
  65. left: 0;
  66. top: 0;
  67. }
  68. &:nth-child(2) {
  69. right: 0;
  70. top: 0;
  71. animation-delay: .4s;
  72. }
  73. &:nth-child(3) {
  74. right: 0;
  75. bottom: 0;
  76. animation-delay: .8s;
  77. }
  78. &:nth-child(4) {
  79. left: 0;
  80. bottom: 0;
  81. animation-delay: 1.2s;
  82. }
  83. }
  84. &--show-text&--nested &__dots {
  85. margin-top: -@spin-dot-size-base / 2 - 10px;
  86. }
  87. &__container {
  88. position: relative;
  89. transition: opacity .3s;
  90. zoom: 1;
  91. &--blur {
  92. overflow: hidden;
  93. opacity: .5;
  94. filter: blur(.5px);
  95. transform: translateZ(0);
  96. /* &:after {
  97. content: "";
  98. position: absolute;
  99. left: 0;
  100. right: 0;
  101. top: 0;
  102. bottom: 0;
  103. background: #fff;
  104. opacity: @disabled-opacity;
  105. transition: all .3s;
  106. z-index: 10;
  107. } */
  108. }
  109. }
  110. &--small &__tip {
  111. padding-top: 3px;
  112. }
  113. &--small &__dots {
  114. .square(@spin-dot-size-sm);
  115. }
  116. &--small&--nested &__dots {
  117. margin: -@spin-dot-size-sm / 2;
  118. }
  119. &--small &__dot {
  120. width: 6px;
  121. height: 6px;
  122. }
  123. &--small&--show-text&--nested &__dots {
  124. margin-top: -@spin-dot-size-sm / 2 - 10px;
  125. }
  126. &--large &__tip {
  127. padding-top: 12px;
  128. }
  129. &--large &__dots {
  130. .square(@spin-dot-size-lg);
  131. }
  132. &--large&--nested &__dots {
  133. margin: -@spin-dot-size-lg / 2;
  134. }
  135. &--large &__dot {
  136. width: 14px;
  137. height: 14px;
  138. }
  139. &--large&--show-text&--nested &__dots {
  140. margin-top: -@spin-dot-size-lg / 2 - 10px;
  141. }
  142. }
  143. @keyframes rotate {
  144. to {
  145. transform: rotate(405deg);
  146. }
  147. }
  148. @keyframes spinMove {
  149. to {
  150. opacity: 1;
  151. }
  152. }