From 9f56d0c23ea3fde8bfc9d7ca8aec7881dbe23b46 Mon Sep 17 00:00:00 2001 From: freakdaniel Date: Wed, 3 Dec 2025 10:07:02 +0300 Subject: [PATCH 1/4] Enhance animation components with disappear functionality --- src/constants/Categories.ts | 2 +- .../AnimatedContent/AnimatedContent.vue | 120 ++++++++---------- .../Animations/FadeContent/FadeContent.vue | 105 ++++++++++----- src/demo/Animations/AnimatedContentDemo.vue | 43 +++++++ src/demo/Animations/FadeContentDemo.vue | 78 ++++++++++-- 5 files changed, 239 insertions(+), 109 deletions(-) diff --git a/src/constants/Categories.ts b/src/constants/Categories.ts index c286951..21f4397 100644 --- a/src/constants/Categories.ts +++ b/src/constants/Categories.ts @@ -1,6 +1,6 @@ // Highlighted sidebar items export const NEW = ['Color Bends', 'Ghost Cursor', 'Laser Flow', 'Liquid Ether', 'Pixel Blast', 'Floating Lines']; -export const UPDATED = []; +export const UPDATED = ['Animated Content', 'Fade Content']; // Used for main sidebar navigation export const CATEGORIES = [ diff --git a/src/content/Animations/AnimatedContent/AnimatedContent.vue b/src/content/Animations/AnimatedContent/AnimatedContent.vue index e6b3f76..8f26d52 100644 --- a/src/content/Animations/AnimatedContent/AnimatedContent.vue +++ b/src/content/Animations/AnimatedContent/AnimatedContent.vue @@ -1,11 +1,12 @@ diff --git a/src/content/Animations/FadeContent/FadeContent.vue b/src/content/Animations/FadeContent/FadeContent.vue index 93f9c7a..1047c71 100644 --- a/src/content/Animations/FadeContent/FadeContent.vue +++ b/src/content/Animations/FadeContent/FadeContent.vue @@ -1,66 +1,111 @@ diff --git a/src/demo/Animations/AnimatedContentDemo.vue b/src/demo/Animations/AnimatedContentDemo.vue index feb71ee..3a204fe 100644 --- a/src/demo/Animations/AnimatedContentDemo.vue +++ b/src/demo/Animations/AnimatedContentDemo.vue @@ -14,8 +14,12 @@ :animate-opacity="animateOpacity" :scale="scale" :threshold="threshold" + :disappear-after="disappearAfter" + :disappear-duration="disappearDuration" + :disappear-ease="disappearEase" :key="key" @complete="() => console.log('✅ Animation Complete!')" + @disappearance-complete="() => console.log('👋 Disappearance Complete!')" >

Animated Content

@@ -44,6 +48,12 @@ + + + + + + @@ -89,6 +99,9 @@ const initialOpacity = ref(0); const animateOpacity = ref(true); const scale = ref(1); const threshold = ref(0.1); +const disappearAfter = ref(0); +const disappearDuration = ref(0.5); +const disappearEase = ref('power3.in'); const directionOptions = [ { label: 'Vertical', value: 'vertical' }, @@ -101,6 +114,12 @@ const easeOptions = [ { label: 'Elastic Out', value: 'elastic.out(1, 0.3)' } ]; +const disappearEaseOptions = [ + { label: 'Power3 In', value: 'power3.in' }, + { label: 'Power2 In', value: 'power2.in' }, + { label: 'Bounce In', value: 'bounce.in' } +]; + const propData = [ { name: 'distance', @@ -167,6 +186,30 @@ const propData = [ type: 'string', default: '""', description: 'Additional CSS classes for styling.' + }, + { + name: 'container', + type: 'string | HTMLElement | null', + default: 'null', + description: 'Custom scroll container element or selector.' + }, + { + name: 'disappearAfter', + type: 'number', + default: '0', + description: 'Delay before disappear animation starts (in seconds). Set to 0 to disable.' + }, + { + name: 'disappearDuration', + type: 'number', + default: '0.5', + description: 'Duration of the disappear animation in seconds.' + }, + { + name: 'disappearEase', + type: 'string | function', + default: '"power3.in"', + description: 'GSAP easing function for the disappear animation.' } ]; diff --git a/src/demo/Animations/FadeContentDemo.vue b/src/demo/Animations/FadeContentDemo.vue index e1e53fb..fd28e04 100644 --- a/src/demo/Animations/FadeContentDemo.vue +++ b/src/demo/Animations/FadeContentDemo.vue @@ -11,8 +11,13 @@ :delay="delay" :threshold="threshold" :initial-opacity="initialOpacity" - :easing="easing" + :ease="ease" + :disappear-after="disappearAfter" + :disappear-duration="disappearDuration" + :disappear-ease="disappearEase" class="fade-content-demo-content" + @complete="() => console.log('✅ Fade Complete!')" + @disappearance-complete="() => console.log('👋 Disappearance Complete!')" >

Fade Content

@@ -25,16 +30,26 @@ - + - + + + + + + + + + + +