当前位置:   article > 正文

uniApp 很帅很帅的纯css加载动画,文字可滚动_uniapp h5 动态加载css

uniapp h5 动态加载css

 

 

  1. <template>
  2. <view>
  3. <div class="spinnerContainer">
  4. <div class="spinner"></div>
  5. <div class="loader">
  6. <p>loading</p>
  7. <div class="words">
  8. <span class="word">posts</span>
  9. <span class="word">images</span>
  10. <span class="word">followers</span>
  11. <span class="word">hashtags</span>
  12. <span class="word">posts</span>
  13. </div>
  14. </div>
  15. </div>
  16. </view>
  17. </template>
  18. <script>
  19. </script>
  20. <style scoped lang="scss">
  21. .spinnerContainer {
  22. display: -webkit-box;
  23. display: -ms-flexbox;
  24. display: flex;
  25. -webkit-box-orient: vertical;
  26. -webkit-box-direction: normal;
  27. -ms-flex-direction: column;
  28. flex-direction: column;
  29. -webkit-box-align: center;
  30. -ms-flex-align: center;
  31. align-items: center;
  32. }
  33. .spinner {
  34. width: 56px;
  35. height: 56px;
  36. display: grid;
  37. border: 4px solid #0000;
  38. border-radius: 50%;
  39. border-right-color: #ff6600;
  40. -webkit-animation: tri-spinner 1s infinite linear;
  41. animation: tri-spinner 1s infinite linear;
  42. }
  43. .spinner::before,
  44. .spinner::after {
  45. content: "";
  46. grid-area: 1/1;
  47. margin: 2px;
  48. border: inherit;
  49. border-radius: 50%;
  50. -webkit-animation: tri-spinner 2s infinite;
  51. animation: tri-spinner 2s infinite;
  52. }
  53. .spinner::after {
  54. margin: 8px;
  55. -webkit-animation-duration: 3s;
  56. animation-duration: 3s;
  57. }
  58. @-webkit-keyframes tri-spinner {
  59. 100% {
  60. -webkit-transform: rotate(1turn);
  61. transform: rotate(1turn);
  62. }
  63. }
  64. @keyframes tri-spinner {
  65. 100% {
  66. -webkit-transform: rotate(1turn);
  67. transform: rotate(1turn);
  68. }
  69. }
  70. .loader {
  71. color: #4a4a4a;
  72. font-family: "Poppins",sans-serif;
  73. font-weight: 500;
  74. font-size: 25px;
  75. -webkit-box-sizing: content-box;
  76. box-sizing: content-box;
  77. height: 40px;
  78. padding: 10px 10px;
  79. display: -webkit-box;
  80. display: -ms-flexbox;
  81. display: flex;
  82. border-radius: 8px;
  83. }
  84. .words {
  85. overflow: hidden;
  86. }
  87. .word {
  88. display: block;
  89. height: 100%;
  90. padding-left: 6px;
  91. color: #299fff;
  92. -webkit-animation: cycle-words 5s infinite;
  93. animation: cycle-words 5s infinite;
  94. }
  95. @-webkit-keyframes cycle-words {
  96. 10% {
  97. -webkit-transform: translateY(-105%);
  98. transform: translateY(-105%);
  99. }
  100. 25% {
  101. -webkit-transform: translateY(-100%);
  102. transform: translateY(-100%);
  103. }
  104. 35% {
  105. -webkit-transform: translateY(-205%);
  106. transform: translateY(-205%);
  107. }
  108. 50% {
  109. -webkit-transform: translateY(-200%);
  110. transform: translateY(-200%);
  111. }
  112. 60% {
  113. -webkit-transform: translateY(-305%);
  114. transform: translateY(-305%);
  115. }
  116. 75% {
  117. -webkit-transform: translateY(-300%);
  118. transform: translateY(-300%);
  119. }
  120. 85% {
  121. -webkit-transform: translateY(-405%);
  122. transform: translateY(-405%);
  123. }
  124. 100% {
  125. -webkit-transform: translateY(-400%);
  126. transform: translateY(-400%);
  127. }
  128. }
  129. @keyframes cycle-words {
  130. 10% {
  131. -webkit-transform: translateY(-105%);
  132. transform: translateY(-105%);
  133. }
  134. 25% {
  135. -webkit-transform: translateY(-100%);
  136. transform: translateY(-100%);
  137. }
  138. 35% {
  139. -webkit-transform: translateY(-205%);
  140. transform: translateY(-205%);
  141. }
  142. 50% {
  143. -webkit-transform: translateY(-200%);
  144. transform: translateY(-200%);
  145. }
  146. 60% {
  147. -webkit-transform: translateY(-305%);
  148. transform: translateY(-305%);
  149. }
  150. 75% {
  151. -webkit-transform: translateY(-300%);
  152. transform: translateY(-300%);
  153. }
  154. 85% {
  155. -webkit-transform: translateY(-405%);
  156. transform: translateY(-405%);
  157. }
  158. 100% {
  159. -webkit-transform: translateY(-400%);
  160. transform: translateY(-400%);
  161. }
  162. }
  163. </style>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/652073
推荐阅读
相关标签
  

闽ICP备14008679号