feat(settings): block interactions while animating
This commit is contained in:
@@ -104,6 +104,7 @@ const animateNotification = (
|
||||
if (prev !== null && curr === null) {
|
||||
// slide down
|
||||
visibleRef.value = prev;
|
||||
store.animatingNotification = true;
|
||||
gsap.fromTo(
|
||||
offsetRef,
|
||||
{ value: 0 },
|
||||
@@ -113,16 +114,29 @@ const animateNotification = (
|
||||
ease: "none",
|
||||
onComplete: () => {
|
||||
visibleRef.value = null;
|
||||
setTimeout(() => {
|
||||
store.animatingNotification = false;
|
||||
}, 50);
|
||||
},
|
||||
},
|
||||
);
|
||||
} else if (prev === null && curr !== null) {
|
||||
// slide up
|
||||
store.animatingNotification = true;
|
||||
visibleRef.value = curr;
|
||||
gsap.fromTo(
|
||||
offsetRef,
|
||||
{ value: 48 },
|
||||
{ value: 0, duration: 0.2, ease: "none" },
|
||||
{
|
||||
value: 0,
|
||||
duration: 0.2,
|
||||
ease: "none",
|
||||
onComplete: () => {
|
||||
setTimeout(() => {
|
||||
store.animatingNotification = false;
|
||||
}, 50);
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user