From dbe11acf9b1f6f16692569b383b0ee5eb22cc686 Mon Sep 17 00:00:00 2001 From: snepsnepy Date: Tue, 15 Jul 2025 14:46:30 +0300 Subject: [PATCH 1/8] Added defineModel support for PreviewColor component. Updated watch in TrueFocus component. --- src/components/common/PreviewColor.vue | 16 ++++------------ .../TextAnimations/TrueFocus/TrueFocus.vue | 4 ++-- src/demo/Animations/BlobCursorDemo.vue | 9 +++------ src/demo/Animations/ClickSparkDemo.vue | 2 +- src/demo/Animations/MetaBallsDemo.vue | 2 +- src/demo/Animations/PixelTransitionDemo.vue | 2 +- src/demo/Backgrounds/AuroraDemo.vue | 7 +------ src/demo/Backgrounds/BalatroDemo.vue | 9 ++------- src/demo/Backgrounds/BeamsDemo.vue | 2 +- src/demo/Backgrounds/DotGridDemo.vue | 4 ++-- src/demo/Backgrounds/ParticlesDemo.vue | 9 ++------- src/demo/Backgrounds/SilkDemo.vue | 2 +- src/demo/Backgrounds/WavesDemo.vue | 2 +- src/demo/Components/CircularGalleryDemo.vue | 2 +- src/demo/TextAnimations/TextPressureDemo.vue | 4 ++-- src/demo/TextAnimations/TrueFocusDemo.vue | 2 +- 16 files changed, 26 insertions(+), 52 deletions(-) diff --git a/src/components/common/PreviewColor.vue b/src/components/common/PreviewColor.vue index 20a8e60..a715f71 100644 --- a/src/components/common/PreviewColor.vue +++ b/src/components/common/PreviewColor.vue @@ -1,24 +1,16 @@ diff --git a/src/content/TextAnimations/TrueFocus/TrueFocus.vue b/src/content/TextAnimations/TrueFocus/TrueFocus.vue index 6e1acfd..d03d667 100644 --- a/src/content/TextAnimations/TrueFocus/TrueFocus.vue +++ b/src/content/TextAnimations/TrueFocus/TrueFocus.vue @@ -32,7 +32,7 @@ const focusRect = ref({ x: 0, y: 0, width: 0, height: 0 }); let interval: number | null = null; watch( - [() => props.manualMode, () => props.animationDuration, () => props.pauseBetweenAnimations, words], + [() => props.manualMode, () => props.animationDuration, () => props.pauseBetweenAnimations, () => words.value], () => { if (interval) { clearInterval(interval); @@ -52,7 +52,7 @@ watch( ); watch( - [currentIndex, words.value.length], + [currentIndex, () => words.value.length], async () => { if (currentIndex.value === null || currentIndex.value === -1) return; if (!wordRefs.value[currentIndex.value] || !containerRef.value) return; diff --git a/src/demo/Animations/BlobCursorDemo.vue b/src/demo/Animations/BlobCursorDemo.vue index a051f78..9862a93 100644 --- a/src/demo/Animations/BlobCursorDemo.vue +++ b/src/demo/Animations/BlobCursorDemo.vue @@ -33,9 +33,9 @@ {{ blobType }} - - - + + + ('circle'); const fillColor = ref('#27FF64'); diff --git a/src/demo/Animations/ClickSparkDemo.vue b/src/demo/Animations/ClickSparkDemo.vue index 4990dde..429d355 100644 --- a/src/demo/Animations/ClickSparkDemo.vue +++ b/src/demo/Animations/ClickSparkDemo.vue @@ -22,7 +22,7 @@ - + - + - + diff --git a/src/demo/Backgrounds/AuroraDemo.vue b/src/demo/Backgrounds/AuroraDemo.vue index 1473adb..341b3ec 100644 --- a/src/demo/Backgrounds/AuroraDemo.vue +++ b/src/demo/Backgrounds/AuroraDemo.vue @@ -22,8 +22,7 @@ v-for="(color, index) in colorStops" :key="index" :title="`Color ${index + 1}`" - :model-value="color" - @update:model-value="value => updateColorStop(index, value)" + v-model="colorStops[index]" /> @@ -100,10 +99,6 @@ const blend = ref(0.5); const speed = ref(1.0); const intensity = ref(1.0); -const updateColorStop = (index: number, color: string) => { - colorStops.value[index] = color; -}; - const propData = [ { name: 'colorStops', diff --git a/src/demo/Backgrounds/BalatroDemo.vue b/src/demo/Backgrounds/BalatroDemo.vue index b0de718..905029d 100644 --- a/src/demo/Backgrounds/BalatroDemo.vue +++ b/src/demo/Backgrounds/BalatroDemo.vue @@ -16,11 +16,10 @@
@@ -64,10 +63,6 @@ const pixelation = ref(745); const mouseInteractionEnabled = ref(true); const rotate = ref(false); -const updateColorStop = (index: number, color: string) => { - colorStops.value[index] = color; -}; - const propData = [ { name: 'spinRotation', diff --git a/src/demo/Backgrounds/BeamsDemo.vue b/src/demo/Backgrounds/BeamsDemo.vue index 02d65be..7c4d40f 100644 --- a/src/demo/Backgrounds/BeamsDemo.vue +++ b/src/demo/Backgrounds/BeamsDemo.vue @@ -16,7 +16,7 @@ - +
- + - +
- +
{ - color.value = value; - forceRerender(); -}; +const { rerenderKey } = useForceRerender(); const propData = [ { name: 'particleCount', type: 'number', default: '200', description: 'The number of particles to generate.' }, diff --git a/src/demo/Backgrounds/SilkDemo.vue b/src/demo/Backgrounds/SilkDemo.vue index e37a294..9b0d1e2 100644 --- a/src/demo/Backgrounds/SilkDemo.vue +++ b/src/demo/Backgrounds/SilkDemo.vue @@ -50,7 +50,7 @@ :step="0.1" /> - +
diff --git a/src/demo/Backgrounds/WavesDemo.vue b/src/demo/Backgrounds/WavesDemo.vue index 02cb723..e15f4ff 100644 --- a/src/demo/Backgrounds/WavesDemo.vue +++ b/src/demo/Backgrounds/WavesDemo.vue @@ -17,7 +17,7 @@ />
- +
diff --git a/src/demo/Components/CircularGalleryDemo.vue b/src/demo/Components/CircularGalleryDemo.vue index a4d9245..6dde412 100644 --- a/src/demo/Components/CircularGalleryDemo.vue +++ b/src/demo/Components/CircularGalleryDemo.vue @@ -50,7 +50,7 @@ @update:model-value="forceRerender" /> - +
diff --git a/src/demo/TextAnimations/TextPressureDemo.vue b/src/demo/TextAnimations/TextPressureDemo.vue index 441eb52..909c147 100644 --- a/src/demo/TextAnimations/TextPressureDemo.vue +++ b/src/demo/TextAnimations/TextPressureDemo.vue @@ -31,9 +31,9 @@
- + - +

Animation Settings

diff --git a/src/demo/TextAnimations/TrueFocusDemo.vue b/src/demo/TextAnimations/TrueFocusDemo.vue index 2e6aeec..466d03a 100644 --- a/src/demo/TextAnimations/TrueFocusDemo.vue +++ b/src/demo/TextAnimations/TrueFocusDemo.vue @@ -8,7 +8,7 @@ - + From 183a81ae884d6c0ecd66061875390eb3dae42b5b Mon Sep 17 00:00:00 2001 From: snepsnepy Date: Tue, 15 Jul 2025 16:07:55 +0300 Subject: [PATCH 2/8] Added defineModel support for PreviewSelect component --- src/components/common/PreviewSelect.vue | 12 ++------ src/demo/Animations/AnimatedContentDemo.vue | 30 +++++-------------- src/demo/Components/CircularGalleryDemo.vue | 2 +- src/demo/Components/MasonryDemo.vue | 1 - src/demo/Components/PixelCardDemo.vue | 9 ++---- src/demo/TextAnimations/DecryptedTextDemo.vue | 24 ++------------- src/demo/TextAnimations/FallingTextDemo.vue | 7 +---- 7 files changed, 15 insertions(+), 70 deletions(-) diff --git a/src/components/common/PreviewSelect.vue b/src/components/common/PreviewSelect.vue index b28d086..506a704 100644 --- a/src/components/common/PreviewSelect.vue +++ b/src/components/common/PreviewSelect.vue @@ -3,8 +3,7 @@ {{ title }}