diff --git a/src/lib/components/docs/pages/ScrollVelocityDemo.svelte b/src/lib/components/docs/pages/ScrollVelocityDemo.svelte new file mode 100644 index 0000000..7519114 --- /dev/null +++ b/src/lib/components/docs/pages/ScrollVelocityDemo.svelte @@ -0,0 +1,201 @@ + + +Scroll Velocity - svelte-bits + +

Scroll Velocity

+ + + {#snippet preview()} +
+ replay++} /> + {#key replay} +
+ +
+ {/key} +
+ {/snippet} + {#snippet code()} + + {/snippet} + {#snippet customize()} + + { + velocity = v; + replay++; + }} + /> + { + numCopies = v; + replay++; + }} + /> + { + damping = v; + replay++; + }} + /> + { + stiffness = v; + replay++; + }} + /> + + {/snippet} + {#snippet propTable()} + + {/snippet} +
diff --git a/src/lib/components/docs/pages/demoRegistry.ts b/src/lib/components/docs/pages/demoRegistry.ts index 8fde416..b69d810 100644 --- a/src/lib/components/docs/pages/demoRegistry.ts +++ b/src/lib/components/docs/pages/demoRegistry.ts @@ -136,4 +136,5 @@ export const DOC_PAGE_REGISTRY: Record = { 'rotating-text': () => import('./RotatingTextDemo.svelte'), 'scroll-reveal': () => import('./ScrollRevealDemo.svelte'), 'ascii-text': () => import('./ASCIITextDemo.svelte'), + 'scroll-velocity': () => import('./ScrollVelocityDemo.svelte'), }; diff --git a/src/lib/components/library/TextAnimations/ScrollVelocity/ScrollVelocity.svelte b/src/lib/components/library/TextAnimations/ScrollVelocity/ScrollVelocity.svelte new file mode 100644 index 0000000..e0a1160 --- /dev/null +++ b/src/lib/components/library/TextAnimations/ScrollVelocity/ScrollVelocity.svelte @@ -0,0 +1,157 @@ + + + +
+ {#each texts as text, i (i)} +
+
+ {#each Array.from({ length: Math.max(numCopies, 1) }, (_, j) => j) as j (j)} + {#if j === 0} + {text}  + {:else} + {text}  + {/if} + {/each} +
+
+ {/each} +
+ + diff --git a/src/lib/constants/categories.ts b/src/lib/constants/categories.ts index ac60360..ac38359 100644 --- a/src/lib/constants/categories.ts +++ b/src/lib/constants/categories.ts @@ -307,6 +307,7 @@ export const IMPLEMENTED_DEMOS = new Set([ 'rotating-text', 'scroll-reveal', 'ascii-text', + 'scroll-velocity', ]); // Helper: is this subcategory label fully ported? diff --git a/static/r/curved-loop.json b/static/r/curved-loop.json index df352cf..1a74257 100644 --- a/static/r/curved-loop.json +++ b/static/r/curved-loop.json @@ -9,7 +9,7 @@ "type": "registry:component", "path": "CurvedLoop.svelte", "target": "$lib/components/svelte-bits/CurvedLoop.svelte", - "content": "\n\n\n\t\n\t\t{text}\n\t\t\n\t\t\t\n\t\t\n\t\t{#if ready}\n\t\t\t\n\t\t\t\t{totalText}\n\t\t\t\n\t\t{/if}\n\t\n\n\n\n" + "content": "\n\n\n\n\t\n\t\t{text}\n\t\t\n\t\t\t\n\t\t\n\t\t{#if ready}\n\t\t\t\n\t\t\t\t{totalText}\n\t\t\t\n\t\t{/if}\n\t\n\n\n\n" } ], "registryDependencies": [], diff --git a/static/r/registry.json b/static/r/registry.json index e450096..87c0032 100644 --- a/static/r/registry.json +++ b/static/r/registry.json @@ -1906,6 +1906,21 @@ } ] }, + { + "name": "decrypted-text", + "title": "Decrypted Text", + "description": "Scrambled-character reveal effect that decrypts a string on hover, click, or scroll-into-view, with sequential or random iteration modes.", + "type": "registry:component", + "dependencies": [], + "registryDependencies": [], + "files": [ + { + "type": "registry:component", + "path": "DecryptedText.svelte", + "target": "$lib/components/svelte-bits/DecryptedText.svelte" + } + ] + }, { "name": "falling-text", "title": "Falling Text", @@ -2044,6 +2059,21 @@ } ] }, + { + "name": "scroll-velocity", + "title": "Scroll Velocity", + "description": "Multi-row marquee that scrolls horizontally at a base velocity and accelerates with spring-smoothed page-scroll movement.", + "type": "registry:component", + "dependencies": [], + "registryDependencies": [], + "files": [ + { + "type": "registry:component", + "path": "ScrollVelocity.svelte", + "target": "$lib/components/svelte-bits/ScrollVelocity.svelte" + } + ] + }, { "name": "shiny-text", "title": "Shiny Text", diff --git a/static/r/scroll-velocity.json b/static/r/scroll-velocity.json new file mode 100644 index 0000000..4b5aa89 --- /dev/null +++ b/static/r/scroll-velocity.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://ui.shadcn.com/schema/registry-item.json", + "name": "scroll-velocity", + "title": "Scroll Velocity", + "description": "Multi-row marquee that scrolls horizontally at a base velocity and accelerates with spring-smoothed page-scroll movement.", + "type": "registry:component", + "files": [ + { + "type": "registry:component", + "path": "ScrollVelocity.svelte", + "target": "$lib/components/svelte-bits/ScrollVelocity.svelte", + "content": "\n\n
\n\t{#each texts as text, i (i)}\n\t\t
\n\t\t\t
\n\t\t\t\t{#each Array.from({ length: Math.max(numCopies, 1) }, (_, j) => j) as j (j)}\n\t\t\t\t\t{#if j === 0}\n\t\t\t\t\t\t{text} \n\t\t\t\t\t{:else}\n\t\t\t\t\t\t{text} \n\t\t\t\t\t{/if}\n\t\t\t\t{/each}\n\t\t\t
\n\t\t
\n\t{/each}\n
\n\n\n" + } + ], + "registryDependencies": [], + "dependencies": [] +} \ No newline at end of file diff --git a/static/r/text-pressure.json b/static/r/text-pressure.json index 065a2f3..ae813b4 100644 --- a/static/r/text-pressure.json +++ b/static/r/text-pressure.json @@ -9,7 +9,7 @@ "type": "registry:component", "path": "TextPressure.svelte", "target": "$lib/components/svelte-bits/TextPressure.svelte", - "content": "\n\n
\n\t\n\t\t{#each chars as char, i (i)}\n\t\t\t\n\t\t\t\t{char}\n\t\t\t\n\t\t{/each}\n\t\n
\n\n\n" + "content": "\n\n
\n\t\n\t\t{#each chars as char, i (i)}\n\t\t\t\n\t\t\t\t{char}\n\t\t\t\n\t\t{/each}\n\t\n
\n\n\n" } ], "registryDependencies": [],