From a6013535d58fb00576c97ba4a805494a4c5936a2 Mon Sep 17 00:00:00 2001 From: Jian Qi Date: Wed, 25 Feb 2026 16:58:23 +0800 Subject: [PATCH] feat(TrueFocus): add defaultBlur prop for manualMode mouse leave behavior --- src/content/TextAnimations/TrueFocus/TrueFocus.vue | 11 +++++++++-- src/demo/TextAnimations/TrueFocusDemo.vue | 9 +++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/content/TextAnimations/TrueFocus/TrueFocus.vue b/src/content/TextAnimations/TrueFocus/TrueFocus.vue index 46e737f..d7bfa70 100644 --- a/src/content/TextAnimations/TrueFocus/TrueFocus.vue +++ b/src/content/TextAnimations/TrueFocus/TrueFocus.vue @@ -12,6 +12,7 @@ interface TrueFocusProps { pauseBetweenAnimations?: number; index?: Array; syncGroup?: string; + defaultBlur?: boolean; } const props = withDefaults(defineProps(), { @@ -21,7 +22,8 @@ const props = withDefaults(defineProps(), { borderColor: 'green', glowColor: 'rgba(0, 255, 0, 0.6)', animationDuration: 0.5, - pauseBetweenAnimations: 1 + pauseBetweenAnimations: 1, + defaultBlur: true }); const words = computed(() => props.sentence.split(' ')); @@ -72,7 +74,11 @@ const handleMouseEnter = (index: number) => { const handleMouseLeave = () => { if (props.manualMode) { - currentIndex.value = lastActiveIndex.value || 0; + if (props.defaultBlur) { + currentIndex.value = lastActiveIndex.value || 0; + return; + } + currentIndex.value = -1; } }; @@ -128,6 +134,7 @@ onUnmounted(() => { if (props.syncGroup) unregisterSyncGroup(props.syncGroup); }); +