loading.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!-- 加载动画组件 -->
  2. <template>
  3. <view class="flex">
  4. <view class="sk-folding-cube">
  5. <view class="sk-cube1 sk-cube"></view>
  6. <view class="sk-cube2 sk-cube"></view>
  7. <view class="sk-cube4 sk-cube"></view>
  8. <view class="sk-cube3 sk-cube"></view>
  9. </view>
  10. <view class="YS-title loading">正在加载中...</view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: "loading",
  16. data() {
  17. return {
  18. };
  19. }
  20. }
  21. </script>
  22. <style lang="scss">
  23. .flex {
  24. width: 100vw;
  25. height: 100vh;
  26. display: flex;
  27. flex-direction: column;
  28. align-items: center;
  29. justify-content: center;
  30. }
  31. .loading{
  32. margin-top: 20rpx;color: #555555;
  33. }
  34. .sk-folding-cube {
  35. margin: 20px auto;
  36. width: 40px;
  37. height: 40px;
  38. position: relative;
  39. -webkit-transform: rotateZ(45deg);
  40. transform: rotateZ(45deg);
  41. }
  42. .sk-folding-cube .sk-cube {
  43. float: left;
  44. width: 50%;
  45. height: 50%;
  46. position: relative;
  47. -webkit-transform: scale(1.1);
  48. -ms-transform: scale(1.1);
  49. transform: scale(1.1);
  50. }
  51. .sk-folding-cube .sk-cube:before {
  52. content: '';
  53. position: absolute;
  54. top: 0;
  55. left: 0;
  56. width: 100%;
  57. height: 100%;
  58. background-color: #555555;
  59. -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;
  60. animation: sk-foldCubeAngle 2.4s infinite linear both;
  61. -webkit-transform-origin: 100% 100%;
  62. -ms-transform-origin: 100% 100%;
  63. transform-origin: 100% 100%;
  64. }
  65. .sk-folding-cube .sk-cube2 {
  66. -webkit-transform: scale(1.1) rotateZ(90deg);
  67. transform: scale(1.1) rotateZ(90deg);
  68. }
  69. .sk-folding-cube .sk-cube3 {
  70. -webkit-transform: scale(1.1) rotateZ(180deg);
  71. transform: scale(1.1) rotateZ(180deg);
  72. }
  73. .sk-folding-cube .sk-cube4 {
  74. -webkit-transform: scale(1.1) rotateZ(270deg);
  75. transform: scale(1.1) rotateZ(270deg);
  76. }
  77. .sk-folding-cube .sk-cube2:before {
  78. -webkit-animation-delay: 0.3s;
  79. animation-delay: 0.3s;
  80. }
  81. .sk-folding-cube .sk-cube3:before {
  82. -webkit-animation-delay: 0.6s;
  83. animation-delay: 0.6s;
  84. }
  85. .sk-folding-cube .sk-cube4:before {
  86. -webkit-animation-delay: 0.9s;
  87. animation-delay: 0.9s;
  88. }
  89. @-webkit-keyframes sk-foldCubeAngle {
  90. 0%,
  91. 10% {
  92. -webkit-transform: perspective(140px) rotateX(-180deg);
  93. transform: perspective(140px) rotateX(-180deg);
  94. opacity: 0;
  95. }
  96. 25%,
  97. 75% {
  98. -webkit-transform: perspective(140px) rotateX(0deg);
  99. transform: perspective(140px) rotateX(0deg);
  100. opacity: 1;
  101. }
  102. 90%,
  103. 100% {
  104. -webkit-transform: perspective(140px) rotateY(180deg);
  105. transform: perspective(140px) rotateY(180deg);
  106. opacity: 0;
  107. }
  108. }
  109. @keyframes sk-foldCubeAngle {
  110. 0%,
  111. 10% {
  112. -webkit-transform: perspective(140px) rotateX(-180deg);
  113. transform: perspective(140px) rotateX(-180deg);
  114. opacity: 0;
  115. }
  116. 25%,
  117. 75% {
  118. -webkit-transform: perspective(140px) rotateX(0deg);
  119. transform: perspective(140px) rotateX(0deg);
  120. opacity: 1;
  121. }
  122. 90%,
  123. 100% {
  124. -webkit-transform: perspective(140px) rotateY(180deg);
  125. transform: perspective(140px) rotateY(180deg);
  126. opacity: 0;
  127. }
  128. }
  129. </style>