From f18199079f296c8415aef0dc5b055eac1d8d0920 Mon Sep 17 00:00:00 2001 From: David Haz Date: Fri, 18 Jul 2025 20:55:58 +0300 Subject: [PATCH] refactor BlurText with better handling, best practices, fix animation complete handler --- .../TextAnimations/BlurText/BlurText.vue | 132 ++++++++++-------- 1 file changed, 77 insertions(+), 55 deletions(-) diff --git a/src/content/TextAnimations/BlurText/BlurText.vue b/src/content/TextAnimations/BlurText/BlurText.vue index 6017bd1..d21d1b0 100644 --- a/src/content/TextAnimations/BlurText/BlurText.vue +++ b/src/content/TextAnimations/BlurText/BlurText.vue @@ -1,17 +1,42 @@ + + - +onMounted(() => { + setupObserver(); +}); + +onUnmounted(() => { + observer?.disconnect(); +}); + +watch([() => props.threshold, () => props.rootMargin], () => { + observer?.disconnect(); + setupObserver(); +}); + +watch([() => props.delay, () => props.stepDuration, () => props.animateBy, () => props.direction], () => { + animationKey.value++; + completionFired.value = false; +}); +