From 81306ec59eb09a8fb291e5aed96bbc80cfb45cc3 Mon Sep 17 00:00:00 2001 From: Alfarish Fizikri Date: Fri, 26 Dec 2025 14:51:48 +0700 Subject: [PATCH] Create text animation --- index.html | 3 + src/constants/Categories.ts | 1 + src/constants/Components.ts | 1 + src/constants/Information.ts | 8 + .../code/TextAnimations/shuffleCode.ts | 25 ++ .../TextAnimations/Shuffle/Shuffle.vue | 412 ++++++++++++++++++ src/demo/TextAnimations/ShuffleDemo.vue | 237 ++++++++++ 7 files changed, 687 insertions(+) create mode 100644 src/constants/code/TextAnimations/shuffleCode.ts create mode 100644 src/content/TextAnimations/Shuffle/Shuffle.vue create mode 100644 src/demo/TextAnimations/ShuffleDemo.vue diff --git a/index.html b/index.html index 7709c90..d3bae1e 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,9 @@ + + + diff --git a/src/constants/Categories.ts b/src/constants/Categories.ts index 7cd715b..b8d7f8f 100644 --- a/src/constants/Categories.ts +++ b/src/constants/Categories.ts @@ -26,6 +26,7 @@ export const CATEGORIES = [ 'Scroll Velocity', 'Scramble Text', 'Shiny Text', + 'Shuffle', 'Split Text', 'Text Cursor', 'Text Pressure', diff --git a/src/constants/Components.ts b/src/constants/Components.ts index 57bf847..988595b 100644 --- a/src/constants/Components.ts +++ b/src/constants/Components.ts @@ -50,6 +50,7 @@ const textAnimations = { 'scroll-velocity': () => import("../demo/TextAnimations/ScrollVelocityDemo.vue"), 'text-type': () => import("../demo/TextAnimations/TextTypeDemo.vue"), 'variable-proximity': () => import("../demo/TextAnimations/VariableProximityDemo.vue"), + 'shuffle': () => import("../demo/TextAnimations/ShuffleDemo.vue"), }; const components = { diff --git a/src/constants/Information.ts b/src/constants/Information.ts index 4fbadc5..3e71fb5 100644 --- a/src/constants/Information.ts +++ b/src/constants/Information.ts @@ -393,6 +393,14 @@ export const componentMetadata: ComponentMetadata = { docsUrl: 'https://vue-bits.dev/text-animations/variable-proximity', tags: [] }, + 'TextAnimations/Shuffle': { + videoUrl: '/assets/videos/shuffle.webm', + description: 'GSAP-powered slot machine style text shuffle animation with scroll trigger.', + category: 'TextAnimations', + name: 'Shuffle', + docsUrl: 'https://vue-bits.dev/text-animations/shuffle', + tags: [] + }, //! Components ------------------------------------------------------------------------------------------------------------------------------- 'Components/AnimatedList': { diff --git a/src/constants/code/TextAnimations/shuffleCode.ts b/src/constants/code/TextAnimations/shuffleCode.ts new file mode 100644 index 0000000..6f4110e --- /dev/null +++ b/src/constants/code/TextAnimations/shuffleCode.ts @@ -0,0 +1,25 @@ +import code from '@/content/TextAnimations/Shuffle/Shuffle.vue?raw'; +import { createCodeObject } from '@/types/code'; + +export const shuffle = createCodeObject(code, 'TextAnimations/Shuffle', { + installation: 'npm install gsap', + usage: ` + +` +}); diff --git a/src/content/TextAnimations/Shuffle/Shuffle.vue b/src/content/TextAnimations/Shuffle/Shuffle.vue new file mode 100644 index 0000000..f55f4be --- /dev/null +++ b/src/content/TextAnimations/Shuffle/Shuffle.vue @@ -0,0 +1,412 @@ + + + diff --git a/src/demo/TextAnimations/ShuffleDemo.vue b/src/demo/TextAnimations/ShuffleDemo.vue new file mode 100644 index 0000000..e05165a --- /dev/null +++ b/src/demo/TextAnimations/ShuffleDemo.vue @@ -0,0 +1,237 @@ + + +