welcome.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="wrapper">
  3. <view class="circle"></view>
  4. <view class="circle"></view>
  5. <view class="circle"></view>
  6. <view class="shadow"></view>
  7. <view class="shadow"></view>
  8. <view class="shadow"></view>
  9. <text>加载中...</text>
  10. </view>
  11. </template>
  12. <script setup>
  13. import { useUserStore } from '@/stores/user'
  14. const user = useUserStore()
  15. onLoad(() => {
  16. // 静默登录
  17. // user.loginByCode().finally(() => {
  18. // uni.switchTab({
  19. // url: '/pages/index/index'
  20. // })
  21. // })
  22. uni.switchTab({
  23. url: '/pages/index/index'
  24. })
  25. })
  26. </script>
  27. <style>
  28. page {
  29. background-color: #fff;
  30. }
  31. </style>
  32. <style lang="scss" scoped>
  33. .wrapper {
  34. width: 200px;
  35. height: 60px;
  36. position: absolute;
  37. left: 50%;
  38. top: 50%;
  39. transform: translate(-50%, -50%);
  40. }
  41. .circle {
  42. width: 20px;
  43. height: 20px;
  44. position: absolute;
  45. border-radius: 50%;
  46. background-color: var(--primary);
  47. left: 15%;
  48. transform-origin: 50%;
  49. animation: circle 0.5s alternate infinite ease;
  50. }
  51. @keyframes circle {
  52. 0% {
  53. top: 60px;
  54. height: 5px;
  55. border-radius: 50px 50px 25px 25px;
  56. transform: scaleX(1.7);
  57. }
  58. 40% {
  59. height: 20px;
  60. border-radius: 50%;
  61. transform: scaleX(1);
  62. }
  63. 100% {
  64. top: 0%;
  65. }
  66. }
  67. .circle:nth-child(2) {
  68. left: 45%;
  69. animation-delay: 0.2s;
  70. }
  71. .circle:nth-child(3) {
  72. left: auto;
  73. right: 15%;
  74. animation-delay: 0.3s;
  75. }
  76. .shadow {
  77. width: 20px;
  78. height: 4px;
  79. border-radius: 50%;
  80. background-color: rgba(0, 0, 0, 0.5);
  81. position: absolute;
  82. top: 62px;
  83. transform-origin: 50%;
  84. z-index: -1;
  85. left: 15%;
  86. filter: blur(1px);
  87. animation: shadow 0.5s alternate infinite ease;
  88. }
  89. @keyframes shadow {
  90. 0% {
  91. transform: scaleX(1.5);
  92. }
  93. 40% {
  94. transform: scaleX(1);
  95. opacity: 0.7;
  96. }
  97. 100% {
  98. transform: scaleX(0.2);
  99. opacity: 0.4;
  100. }
  101. }
  102. .shadow:nth-child(4) {
  103. left: 45%;
  104. animation-delay: 0.2s;
  105. }
  106. .shadow:nth-child(5) {
  107. left: auto;
  108. right: 15%;
  109. animation-delay: 0.3s;
  110. }
  111. text {
  112. position: absolute;
  113. top: 75px;
  114. font-family: 'Lato';
  115. font-size: 18px;
  116. letter-spacing: 12px;
  117. color: var(--primary);
  118. left: 15%;
  119. }
  120. </style>