diff --git a/frontend/components/home/Preview.vue b/frontend/components/home/Preview.vue index 897ac08..8622cf5 100644 --- a/frontend/components/home/Preview.vue +++ b/frontend/components/home/Preview.vue @@ -15,6 +15,13 @@ const activeSlideVideo = ref<"left" | "right" | "none">("none"); const draggableEl = ref(null); const previewContainerEl = ref(null); +const heymlzElement = useTemplateRef("heymlzElement"); +const heymlzElementIsVisible = useElementVisibility(heymlzElement, { + rootMargin: "0px 0px -40% 0px" +}); + +const showHeymlzAnimation = ref(false); + const { x: dragAxisX } = useDraggable(draggableEl, { initialValue: { x: 0, y: 0 }, axis: "x" @@ -22,6 +29,17 @@ const { x: dragAxisX } = useDraggable(draggableEl, { // watch +watch(heymlzElementIsVisible, (newValue) => { + if (newValue) { + showHeymlzAnimation.value = true; + setTimeout(() => { + showHeymlzAnimation.value = false; + }, 3200); + } +}, { + once: true +}); + watch(() => clipPathPercent.value, (newValue) => { if (newValue > 80) { activeSlideVideo.value = "right"; @@ -62,7 +80,8 @@ watch(