From 73833f18230f2dbdbb39cd5674172cc3cdfe8863 Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Tue, 7 Jan 2025 22:34:01 +0330 Subject: [PATCH] added side modal --- frontend/components/global/SideModal.vue | 90 ++++++++++-------------- 1 file changed, 39 insertions(+), 51 deletions(-) diff --git a/frontend/components/global/SideModal.vue b/frontend/components/global/SideModal.vue index eaa40a0..516e074 100644 --- a/frontend/components/global/SideModal.vue +++ b/frontend/components/global/SideModal.vue @@ -9,38 +9,18 @@ defineProps(); // state -const { $gsap: gsap } = useNuxtApp(); - const isSideShow = ref(false); -const tl = gsap.timeline(); -// methods - -const enterAnimation = () => { - tl.to("#side-overlay", { opacity: 1 }).fromTo( - "#side-content", - { - right: "-100%", - opacity: 0, - }, - { - right: 0, - opacity: 1, - }, - "<" - ); -}; - -const closeAnimation = () => { - tl.reverse().then(() => (isSideShow.value = false)); -}; +const isLocked = useScrollLock(window); // watch watch( () => isSideShow.value, (newValue) => { - newValue ? enterAnimation() : null; + if (newValue) { + isLocked.value = true; + } } ); @@ -51,38 +31,46 @@ watch(
-
- -
+