loading.vue 3.0 KB

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