start.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <template>
  2. <view class="app-page bg-gradient-blue-lighten-b" :style="pageStyle">
  3. <view class="tn-satr">
  4. <view class="sky"></view>
  5. <view class="stars">
  6. <view class="falling-stars">
  7. <view class="star-fall"></view>
  8. <view class="star-fall"></view>
  9. <view class="star-fall"></view>
  10. <view class="star-fall"></view>
  11. </view>
  12. <view class="small-stars">
  13. <view class="star"></view>
  14. <view class="star"></view>
  15. <view class="star"></view>
  16. <view class="star"></view>
  17. <view class="star"></view>
  18. <view class="star"></view>
  19. <view class="star"></view>
  20. <view class="star"></view>
  21. <view class="star"></view>
  22. <view class="star"></view>
  23. <view class="star"></view>
  24. <view class="star"></view>
  25. </view>
  26. <view class="medium-stars">
  27. <view class="star"></view>
  28. <view class="star"></view>
  29. <view class="star"></view>
  30. <view class="star"></view>
  31. <view class="star"></view>
  32. <view class="star"></view>
  33. <view class="star"></view>
  34. <view class="star"></view>
  35. <view class="star"></view>
  36. <view class="star"></view>
  37. <view class="star"></view>
  38. <view class="star"></view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="user-info__container flex flex-col flex-center">
  43. <image class="user-info__avatar" :src="startInfo.logo" mode="aspectFill"></image>
  44. <view class="user-info__nick-name">「 {{ startInfo.title }} 」</view>
  45. </view>
  46. <view class="text-align-center text-white" style="padding: 60vh 0 0 0;">
  47. <view class="" style="font-size: 44rpx;" v-if="startInfo.desc1">{{ startInfo.desc1 }}</view>
  48. <view class="mt-30 text-size-m" v-if="startInfo.desc2">{{ startInfo.desc2 }}</view>
  49. </view>
  50. <view class="" style="padding: 120rpx 200rpx;z-index: 999;position: relative;">
  51. <view class="start-btn" @click="fnStart()">{{ startInfo.btnText || '开始体验' }}</view>
  52. </view>
  53. <!-- 波浪效果 -->
  54. <wave></wave>
  55. </view>
  56. </template>
  57. <script>
  58. import wave from '@/components/wave/wave.vue';
  59. export default {
  60. components: { wave },
  61. computed: {
  62. startInfo() {
  63. return getApp().globalData.start;
  64. },
  65. pageStyle() {
  66. if (this.startInfo.bg) {
  67. const _bg = this.$utils.checkIsUrl(this.startInfo.bg) ? `url(${this.startInfo.bg})` : this.startInfo.bg;
  68. return {
  69. background: _bg + '!important'
  70. };
  71. }
  72. return {};
  73. }
  74. },
  75. methods: {
  76. fnStart() {
  77. uni.switchTab({
  78. url: '/pages/tabbar/home/home',
  79. success: () => {
  80. uni.setStorageSync('APP_HAS_STARTED', true);
  81. }
  82. });
  83. }
  84. }
  85. };
  86. </script>
  87. <style lang="scss" scoped>
  88. .app-page {
  89. width: 100vw;
  90. height: 100vh;
  91. }
  92. .start-btn {
  93. box-sizing: border-box;
  94. background-color: transparent;
  95. padding: 16rpx 50rpx;
  96. border-radius: 50rpx;
  97. border: 2rpx solid #ffffff;
  98. color: #ffffff;
  99. text-align: center;
  100. font-size: 28rpx;
  101. }
  102. /* 用户信息 start */
  103. .user-info {
  104. &__container {
  105. position: absolute;
  106. top: 25vh;
  107. left: 50%;
  108. -webkit-transform: translate(-50%, -50%);
  109. transform: translate(-50%, -50%);
  110. }
  111. &__avatar {
  112. width: 200rpx;
  113. height: 200rpx;
  114. border: 8rpx solid rgba(255, 255, 255, 0.05);
  115. border-radius: 50%;
  116. overflow: hidden;
  117. box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
  118. }
  119. &__nick-name {
  120. color: #ffffff;
  121. margin-top: 26rpx;
  122. font-size: 36rpx;
  123. font-weight: 600;
  124. text-align: center;
  125. }
  126. }
  127. /* 用户信息 end */
  128. /* 流星*/
  129. .tn-satr {
  130. position: fixed;
  131. width: 100%;
  132. height: 600px;
  133. overflow: hidden;
  134. flex-shrink: 0;
  135. z-index: 998;
  136. }
  137. .stars {
  138. position: absolute;
  139. z-index: 1;
  140. width: 100%;
  141. height: 400px;
  142. }
  143. .star {
  144. border-radius: 50%;
  145. background: #ffffff;
  146. box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
  147. }
  148. .small-stars .star {
  149. position: absolute;
  150. width: 3px;
  151. height: 3px;
  152. }
  153. .small-stars .star:nth-child(2n) {
  154. opacity: 0;
  155. -webkit-animation: star-blink 1.2s linear infinite alternate;
  156. animation: star-blink 1.2s linear infinite alternate;
  157. }
  158. .small-stars .star:nth-child(1) {
  159. left: 40px;
  160. bottom: 50px;
  161. }
  162. .small-stars .star:nth-child(2) {
  163. left: 200px;
  164. bottom: 40px;
  165. }
  166. .small-stars .star:nth-child(3) {
  167. left: 60px;
  168. bottom: 120px;
  169. }
  170. .small-stars .star:nth-child(4) {
  171. left: 140px;
  172. bottom: 250px;
  173. }
  174. .small-stars .star:nth-child(5) {
  175. left: 400px;
  176. bottom: 300px;
  177. }
  178. .small-stars .star:nth-child(6) {
  179. left: 170px;
  180. bottom: 80px;
  181. }
  182. .small-stars .star:nth-child(7) {
  183. left: 200px;
  184. bottom: 360px;
  185. -webkit-animation-delay: 0.2s;
  186. animation-delay: 0.2s;
  187. }
  188. .small-stars .star:nth-child(8) {
  189. left: 250px;
  190. bottom: 320px;
  191. }
  192. .small-stars .star:nth-child(9) {
  193. left: 300px;
  194. bottom: 340px;
  195. }
  196. .small-stars .star:nth-child(10) {
  197. left: 130px;
  198. bottom: 320px;
  199. -webkit-animation-delay: 0.5s;
  200. animation-delay: 0.5s;
  201. }
  202. .small-stars .star:nth-child(11) {
  203. left: 230px;
  204. bottom: 330px;
  205. -webkit-animation-delay: 7s;
  206. animation-delay: 7s;
  207. }
  208. .small-stars .star:nth-child(12) {
  209. left: 300px;
  210. bottom: 360px;
  211. -webkit-animation-delay: 0.3s;
  212. animation-delay: 0.3s;
  213. }
  214. @-webkit-keyframes star-blink {
  215. 50% {
  216. width: 3px;
  217. height: 3px;
  218. opacity: 1;
  219. }
  220. }
  221. @keyframes star-blink {
  222. 50% {
  223. width: 3px;
  224. height: 3px;
  225. opacity: 1;
  226. }
  227. }
  228. .medium-stars .star {
  229. position: absolute;
  230. width: 3px;
  231. height: 3px;
  232. opacity: 0;
  233. -webkit-animation: star-blink 1.2s ease-in infinite alternate;
  234. animation: star-blink 1.2s ease-in infinite alternate;
  235. }
  236. .medium-stars .star:nth-child(1) {
  237. left: 300px;
  238. bottom: 50px;
  239. }
  240. .medium-stars .star:nth-child(2) {
  241. left: 400px;
  242. bottom: 40px;
  243. -webkit-animation-delay: 0.4s;
  244. animation-delay: 0.4s;
  245. }
  246. .medium-stars .star:nth-child(3) {
  247. left: 330px;
  248. bottom: 300px;
  249. -webkit-animation-delay: 0.2s;
  250. animation-delay: 0.2s;
  251. }
  252. .medium-stars .star:nth-child(4) {
  253. left: 460px;
  254. bottom: 300px;
  255. -webkit-animation-delay: 0.9s;
  256. animation-delay: 0.9s;
  257. }
  258. .medium-stars .star:nth-child(5) {
  259. left: 300px;
  260. bottom: 150px;
  261. -webkit-animation-delay: 1.2s;
  262. animation-delay: 1.2s;
  263. }
  264. .medium-stars .star:nth-child(6) {
  265. left: 440px;
  266. bottom: 120px;
  267. -webkit-animation-delay: 1s;
  268. animation-delay: 1s;
  269. }
  270. .medium-stars .star:nth-child(7) {
  271. left: 200px;
  272. bottom: 140px;
  273. -webkit-animation-delay: 0.8s;
  274. animation-delay: 0.8s;
  275. }
  276. .medium-stars .star:nth-child(8) {
  277. left: 30px;
  278. bottom: 480px;
  279. -webkit-animation-delay: 0.3s;
  280. animation-delay: 0.3s;
  281. }
  282. .medium-stars .star:nth-child(9) {
  283. left: 460px;
  284. bottom: 400px;
  285. -webkit-animation-delay: 1.2s;
  286. animation-delay: 1.2s;
  287. }
  288. .medium-stars .star:nth-child(10) {
  289. left: 150px;
  290. bottom: 10px;
  291. -webkit-animation-delay: 1s;
  292. animation-delay: 1s;
  293. }
  294. .medium-stars .star:nth-child(11) {
  295. left: 420px;
  296. bottom: 450px;
  297. -webkit-animation-delay: 1.2s;
  298. animation-delay: 1.2s;
  299. }
  300. .medium-stars .star:nth-child(12) {
  301. left: 340px;
  302. bottom: 180px;
  303. -webkit-animation-delay: 1.1s;
  304. animation-delay: 1.1s;
  305. }
  306. @keyframes star-blink {
  307. 50% {
  308. width: 4px;
  309. height: 4px;
  310. opacity: 1;
  311. }
  312. }
  313. .star-fall {
  314. position: relative;
  315. border-radius: 2px;
  316. width: 80px;
  317. height: 2px;
  318. overflow: hidden;
  319. -webkit-transform: rotate(-20deg);
  320. transform: rotate(-20deg);
  321. }
  322. .star-fall:after {
  323. content: '';
  324. position: absolute;
  325. width: 50px;
  326. height: 2px;
  327. background: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0)), to(rgba(255, 255, 255, 0.4)));
  328. background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.4) 100%);
  329. left: 100%;
  330. -webkit-animation: star-fall 3.6s linear infinite;
  331. animation: star-fall 3.6s linear infinite;
  332. }
  333. .star-fall:nth-child(1) {
  334. left: 80px;
  335. bottom: -100px;
  336. }
  337. .star-fall:nth-child(1):after {
  338. -webkit-animation-delay: 2.4s;
  339. animation-delay: 2.4s;
  340. }
  341. .star-fall:nth-child(2) {
  342. left: 200px;
  343. bottom: -200px;
  344. }
  345. .star-fall:nth-child(2):after {
  346. -webkit-animation-delay: 2s;
  347. animation-delay: 2s;
  348. }
  349. .star-fall:nth-child(3) {
  350. left: 430px;
  351. bottom: -50px;
  352. }
  353. .star-fall:nth-child(3):after {
  354. -webkit-animation-delay: 3.6s;
  355. animation-delay: 3.6s;
  356. }
  357. .star-fall:nth-child(4) {
  358. left: 400px;
  359. bottom: 100px;
  360. }
  361. .star-fall:nth-child(4):after {
  362. -webkit-animation-delay: 0.2s;
  363. animation-delay: 0.2s;
  364. }
  365. @-webkit-keyframes star-fall {
  366. 20% {
  367. left: -100%;
  368. }
  369. 100% {
  370. left: -100%;
  371. }
  372. }
  373. @keyframes star-fall {
  374. 20% {
  375. left: -100%;
  376. }
  377. 100% {
  378. left: -100%;
  379. }
  380. }
  381. </style>