From 3656be81a148f9284fdabb063ab31a6bf6e4f3b8 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Fri, 21 Feb 2025 19:59:16 +0330 Subject: [PATCH] Updated --- frontend/components/home/Preview.vue | 55 ++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/frontend/components/home/Preview.vue b/frontend/components/home/Preview.vue index 231e7d8..b00650e 100644 --- a/frontend/components/home/Preview.vue +++ b/frontend/components/home/Preview.vue @@ -10,16 +10,28 @@ const { data: homeData } = useHomeData(); const clipPathPercent = ref(49); +const activeSlideVideo = ref<"left" | "right" | "none">("none"); + const draggableEl = ref(null); const previewContainerEl = ref(null); const { x: dragAxisX } = useDraggable(draggableEl, { initialValue: { x: 0, y: 0 }, - axis: "x", + axis: "x" }); // watch +watch(() => clipPathPercent.value, (newValue) => { + if (newValue > 80) { + activeSlideVideo.value = "right"; + } else if (newValue < 20) { + activeSlideVideo.value = "left"; + } else { + activeSlideVideo.value = "none"; + } +}); + watch( () => dragAxisX.value, (newValue) => { @@ -39,24 +51,45 @@ watch( مقایسه محصولات تفاوت محصلات ما را ببینید + {{ activeSlideVideo }}
- + + +
- + + +