@@ -15,6 +15,7 @@ export const useFaucetDetail = defineStore('faucetDetail', {
15
15
} ,
16
16
isOpen : false ,
17
17
isVisible : false ,
18
+ animationPending : false ,
18
19
contentStep : 0 ,
19
20
status : 'null' as RequestStatus ,
20
21
selectedFaucet : { } as Faucet ,
@@ -50,6 +51,8 @@ export const useFaucetDetail = defineStore('faucetDetail', {
50
51
} ,
51
52
52
53
popupToggle ( ) {
54
+ if ( this . animationPending || this . status === 'pending' ) return
55
+ this . animationPending = true
53
56
this . isOpen = ! this . isOpen
54
57
if ( this . isOpen ) this . isVisible = true
55
58
@@ -69,19 +72,24 @@ export const useFaucetDetail = defineStore('faucetDetail', {
69
72
} ,
70
73
} )
71
74
72
- gsap . to ( this . DOM . bg , { autoAlpha : this . isOpen ? 1 : 0 , duration : 1 , delay : this . isOpen ? 0 : 0.4 } )
73
75
gsap . to ( this . DOM . popup , {
74
76
top : this . isOpen ? '50%' : '45%' ,
75
77
autoAlpha : this . isOpen ? 1 : 0 ,
76
78
'clip-path' : this . isOpen ? 'polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)' : 'polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)' ,
77
79
duration : 0.6 ,
78
80
delay : this . isOpen ? 0.4 : 0 ,
81
+ } )
82
+ gsap . to ( this . DOM . bg , {
83
+ autoAlpha : this . isOpen ? 1 : 0 ,
84
+ duration : 1 ,
85
+ delay : this . isOpen ? 0 : 0.4 ,
79
86
onComplete : ( ) => {
80
87
if ( ! this . isOpen ) {
81
88
this . contentStep = 0
82
89
this . isVisible = false
83
90
}
84
91
this . status = 'null'
92
+ this . animationPending = false
85
93
} ,
86
94
} )
87
95
} ,
0 commit comments