Skip to content

Commit b97aaa4

Browse files
committed
feat: add page loader
1 parent 751647d commit b97aaa4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/App.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { ref, onMounted } from 'vue'
3+
import { gsap } from 'gsap'
34
45
import Header from '@/components/layout/Header.vue'
56
import Footer from '@/components/layout/Footer.vue'
@@ -12,6 +13,7 @@ import { useFaucetDetail } from '@/stores/faucetDetail'
1213
const store = useFaucetDetail()
1314
1415
const DOMTitle = ref<null | HTMLElement>(null)
16+
const DOMSiteloader = ref<null | HTMLElement>(null)
1517
1618
onMounted(() => {
1719
if (DOMTitle.value) {
@@ -31,10 +33,13 @@ onMounted(() => {
3133
store.DOM.title = DOMTitle.value
3234
store.titleToggle()
3335
}
36+
37+
gsap.to(DOMSiteloader.value, { autoAlpha: 0, duration: 0.4 })
3438
})
3539
</script>
3640

3741
<template>
42+
<div ref="DOMSiteloader" class="fixed top-0 left-0 right-0 bottom-0 z-max bg-dark"></div>
3843
<main class="js-main flex flex-col justify-between min-h-screen">
3944
<Header />
4045
<section class="px-20 w-full grid grid-cols-12">

src/components/faucet/FaucetDetail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const requestFaucet = async (address: string, amount: number) => {
7878
console.log(address)
7979
console.log(amount)
8080
81-
const res = await req()
81+
const res = await req('success')
8282
store.status = res.code
8383
8484
if (store.status === 'error') {

0 commit comments

Comments
 (0)