index.less 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .@{wux-prefix}-refresher {
  4. position: absolute;
  5. top: -60px;
  6. right: 0;
  7. left: 0;
  8. overflow: hidden;
  9. margin: auto;
  10. height: 50px;
  11. &--hidden {
  12. visibility: hidden;
  13. }
  14. &--visible {
  15. visibility: visible;
  16. }
  17. &__content {
  18. position: absolute;
  19. bottom: 5px;
  20. left: 0;
  21. width: 100%;
  22. color: @text-color;
  23. text-align: center;
  24. font-size: 30px;
  25. }
  26. &__content--text {
  27. bottom: 0;
  28. }
  29. &__text-pulling {
  30. font-size: @font-size-lg;
  31. line-height: @font-size-lg;
  32. }
  33. &__text-refreshing {
  34. font-size: @font-size-lg;
  35. line-height: @font-size-lg;
  36. display: none;
  37. }
  38. &__icon-pulling {
  39. width: 100%;
  40. backface-visibility: hidden;
  41. transform-style: preserve-3d;
  42. padding: 7px 0;
  43. animation-name: refresh-spin-back;
  44. animation-duration: .2s;
  45. animation-timing-function: linear;
  46. animation-fill-mode: none;
  47. transform: translateZ(0) rotate(0deg);
  48. }
  49. &__icon-refreshing {
  50. width: 100%;
  51. backface-visibility: hidden;
  52. transform-style: preserve-3d;
  53. padding: 7px 0;
  54. display: none;
  55. animation-duration: 1.5s;
  56. }
  57. &__icon--arrow-down {
  58. display: block;
  59. margin: 0 auto;
  60. width: 20px;
  61. height: 20px;
  62. background-repeat: no-repeat;
  63. background-position: center center;
  64. background-size: 20px 20px;
  65. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAHdElNRQfhAhQABBG6qxTZAAABVklEQVRo3u3YvUoDQRiF4ePPTZgbEGsh23sBgqWCKQe8AVvB0tJySgPah9T2CaSxkNhY6i3YaRN1J7uz+31nAmnOVJNkM++zCcyyC2hobHnslHw5HOIZA3zgJL6xa+wX8ZcAgAGW/InsFgE2MAQQQAABBBBAAAEEEEAAAQQQYOuAjtvzcIprfOImvpYEwhFucYC7OGn/PHtfH87xuJpWcZ455vt3FjPrhCFmq+lFfGo7Iv8X3P/NZmFInv1/vr6eEfBVm1OEJJ+uZwJcJa/chLX8+nr9gDjFiCc08qM49f4CiGOW0JIf547t3Ac4giffuxH5Cb68YSf0Ebx501ZsJ/jzxmuBjcDkzRejfgKXdz2sDpd4SN6oasmKyzufljcIuWHOA3sewOLl+B1nm8w7ASaCK+8G9BKceQLQSXDnKUCWQORJQCuBytOABoHMFwASAp3X0AB+AFVjfoii8X5lAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTAyLTIwVDAwOjA0OjE3KzA4OjAwenpBPAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wMi0yMFQwMDowNDoxNyswODowMAsn+YAAAAAASUVORK5CYII=");
  66. }
  67. &__icon--refresher {
  68. display: block;
  69. margin: 0 auto;
  70. width: 20px;
  71. height: 20px;
  72. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  73. background-repeat: no-repeat;
  74. background-position: 50%;
  75. background-size: 100%;
  76. transform-origin: 50%;
  77. animation: refresh-spin-rotate 1s steps(12, end) infinite;
  78. }
  79. &--active {
  80. &.@{wux-prefix}-refresher--refreshing {
  81. transition: transform .2s;
  82. transform: scale(1);
  83. .@{wux-prefix}-refresher__icon-pulling,
  84. .@{wux-prefix}-refresher__text-pulling {
  85. display: none;
  86. }
  87. .@{wux-prefix}-refresher__icon-refreshing,
  88. .@{wux-prefix}-refresher__text-refreshing {
  89. display: block;
  90. }
  91. .@{wux-prefix}-refresher--refreshing-tail {
  92. transform: scale(0);
  93. }
  94. }
  95. .@{wux-prefix}-refresher__icon-pulling:not(.@{wux-prefix}-refresher__icon-pulling--disabled) {
  96. animation-name: refresh-spin;
  97. transform: translateZ(0) rotate(-180deg);
  98. }
  99. }
  100. }
  101. .@{wux-prefix}-loader {
  102. overflow: hidden;
  103. margin: auto;
  104. height: 50px;
  105. font-size: 15px;
  106. position: relative;
  107. text-align: center;
  108. display: none;
  109. .@{wux-prefix}-refresher__icon--refresher {
  110. display: inline-block;
  111. margin: 0;
  112. }
  113. &__text-loading {
  114. margin-left: @margin-component-base;
  115. }
  116. &--hidden {
  117. visibility: hidden;
  118. display: none;
  119. }
  120. &--visible {
  121. visibility: visible;
  122. display: block;
  123. }
  124. &--end {
  125. visibility: visible;
  126. display: block;
  127. }
  128. &__content {
  129. position: absolute;
  130. width: 100%;
  131. top: 50%;
  132. transform: translateY(-50%);
  133. color: @text-color;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. }
  138. }
  139. @keyframes refresh-spin {
  140. 0% {
  141. transform: translateZ(0) rotate(0);
  142. }
  143. to {
  144. transform: translateZ(0) rotate(180deg);
  145. }
  146. }
  147. @keyframes refresh-spin-back {
  148. 0% {
  149. transform: translateZ(0) rotate(180deg);
  150. }
  151. to {
  152. transform: translateZ(0) rotate(0);
  153. }
  154. }
  155. @keyframes refresh-spin-rotate {
  156. 100% {
  157. transform: rotate(360deg);
  158. }
  159. }