From 05714a6febda935f9d68f5fd4045a7a85cc8f8eb Mon Sep 17 00:00:00 2001 From: Utkarsh-Singhal-26 Date: Tue, 22 Jul 2025 08:49:39 +0530 Subject: [PATCH 01/13] feat: added component --- package.json | 1 + src/constants/Categories.ts | 5 +- src/constants/Components.ts | 1 + .../code/Components/scrollStackCode.ts | 26 ++ .../Components/ScrollStack/ScrollStack.vue | 317 ++++++++++++++++++ src/css/category.css | 87 +++++ src/demo/Components/ScrollStackDemo.vue | 216 ++++++++++++ 7 files changed, 651 insertions(+), 2 deletions(-) create mode 100644 src/constants/code/Components/scrollStackCode.ts create mode 100644 src/content/Components/ScrollStack/ScrollStack.vue create mode 100644 src/demo/Components/ScrollStackDemo.vue diff --git a/package.json b/package.json index a02c2e3..9071027 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@vueuse/motion": "^3.0.3", "@wdns/vue-code-block": "^2.3.5", "gsap": "^3.13.0", + "lenis": "^1.3.8", "matter-js": "^0.20.0", "motion-v": "^1.5.0", "ogl": "^1.0.11", diff --git a/src/constants/Categories.ts b/src/constants/Categories.ts index 025fd7c..e467001 100644 --- a/src/constants/Categories.ts +++ b/src/constants/Categories.ts @@ -1,5 +1,5 @@ // Highlighted sidebar items -export const NEW = ['Target Cursor', 'Ripple Grid', 'Magic Bento', 'Galaxy', 'Text Type', 'Glass Surface']; +export const NEW = ['Target Cursor', 'Ripple Grid', 'Magic Bento', 'Galaxy', 'Text Type', 'Glass Surface', 'Scroll Stack']; export const UPDATED = []; // Used for main sidebar navigation @@ -62,6 +62,7 @@ export const CATEGORIES = [ 'Masonry', 'Glass Surface', 'Magic Bento', + 'Scroll Stack', 'Profile Card', 'Dock', 'Gooey Nav', @@ -79,7 +80,7 @@ export const CATEGORIES = [ 'Flowing Menu', 'Elastic Slider', 'Stack', - 'Chroma Grid' + 'Chroma Grid', ] }, { diff --git a/src/constants/Components.ts b/src/constants/Components.ts index b196e9e..d2e0a77 100644 --- a/src/constants/Components.ts +++ b/src/constants/Components.ts @@ -68,6 +68,7 @@ const components = { 'tilted-card': () => import('../demo/Components/TiltedCardDemo.vue'), 'stack': () => import('../demo/Components/StackDemo.vue'), 'chroma-grid': () => import('../demo/Components/ChromaGridDemo.vue'), + 'scroll-stack': () => import('../demo/Components/ScrollStackDemo.vue'), }; const backgrounds = { diff --git a/src/constants/code/Components/scrollStackCode.ts b/src/constants/code/Components/scrollStackCode.ts new file mode 100644 index 0000000..ea78710 --- /dev/null +++ b/src/constants/code/Components/scrollStackCode.ts @@ -0,0 +1,26 @@ +import code from '@content/Components/ScrollStack/ScrollStack.vue?raw'; +import { createCodeObject } from '../../../types/code'; + +export const scrollStack = createCodeObject(code, 'Components/ScrollStack', { + installation: `npm install lenis`, + usage: ` + +` +}); diff --git a/src/content/Components/ScrollStack/ScrollStack.vue b/src/content/Components/ScrollStack/ScrollStack.vue new file mode 100644 index 0000000..1f9814d --- /dev/null +++ b/src/content/Components/ScrollStack/ScrollStack.vue @@ -0,0 +1,317 @@ + + + + + diff --git a/src/css/category.css b/src/css/category.css index ecbd9f9..c85fec5 100644 --- a/src/css/category.css +++ b/src/css/category.css @@ -566,3 +566,90 @@ div:has(> .props-table) { order: 2; } } + +.scroll-stack-card-demo { + font-size: clamp(1.5rem, 4vw, 3rem); + font-weight: 900; + color: #fff; + display: flex; + justify-content: space-between; + flex-direction: column; + gap: 1rem; + white-space: nowrap; + text-align: center; +} + +.scroll-stack-card-demo .stack-img-container { + width: 100%; + height: 100%; + min-height: 150px; + border-radius: 1.5rem; + border: 10px solid #fff; + display: flex; + align-items: center; + justify-content: center; + font-size: clamp(4rem, 8vw, 8rem); +} + +.scroll-stack-demo-container .scroll-stack-inner { + padding: 20vh 2rem 50rem; +} + +.ssc-demo-1 { + background-color: #5227ff; +} + +.ssc-demo-2 { + background-color: #f01e9c; +} + +.ssc-demo-3 { + background-color: #5227ff; +} + +.ssc-demo-4 { + background-color: #f01e9c; +} + +.ssc-demo-5 { + background-color: #5227ff; + text-align: center; + justify-content: center; + align-items: center; +} + +@media only screen and (min-width: 1240px) { + .scroll-stack-card-demo { + flex-direction: row; + gap: 2rem; + text-align: left; + } + + .scroll-stack-demo-container .scroll-stack-inner { + padding: 20vh 5rem 50rem; + } + + .scroll-stack-card-demo .stack-img-container { + width: 50%; + min-height: auto; + } + + .scroll-stack-card-demo h3 { + margin-bottom: 1em; + } +} + +@media only screen and (max-width: 480px) { + .scroll-stack-card-demo { + font-size: 1rem; + padding: 0.2rem; + gap: 0.5rem; + } + + .scroll-stack-card-demo .stack-img-container { + border-width: 5px; + border-radius: 1rem; + min-height: 120px; + font-size: 3rem; + } +} diff --git a/src/demo/Components/ScrollStackDemo.vue b/src/demo/Components/ScrollStackDemo.vue new file mode 100644 index 0000000..bf6e135 --- /dev/null +++ b/src/demo/Components/ScrollStackDemo.vue @@ -0,0 +1,216 @@ + + + + + From f00395cc1bd31e5b09075bf4bad4aadb389e3aa3 Mon Sep 17 00:00:00 2001 From: Utkarsh-Singhal-26 Date: Tue, 22 Jul 2025 08:51:44 +0530 Subject: [PATCH 02/13] minor fix --- .../Components/ScrollStack/ScrollStack.vue | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/src/content/Components/ScrollStack/ScrollStack.vue b/src/content/Components/ScrollStack/ScrollStack.vue index 1f9814d..24f505a 100644 --- a/src/content/Components/ScrollStack/ScrollStack.vue +++ b/src/content/Components/ScrollStack/ScrollStack.vue @@ -241,31 +241,6 @@ watch( }, { deep: true } ); - -// export const ScrollStackItem = defineComponent({ -// name: 'ScrollStackItem', -// props: { -// itemClassName: { -// type: String, -// default: '' -// } -// }, -// setup(props, { slots }) { -// return () => -// h( -// 'div', -// { -// class: -// `scroll-stack-card relative w-full h-80 my-8 p-12 rounded-[40px] shadow-[0_0_30px_rgba(0,0,0,0.1)] box-border origin-top will-change-transform ${props.itemClassName}`.trim(), -// style: { -// backfaceVisibility: 'hidden', -// transformStyle: 'preserve-3d' -// } -// }, -// slots.default?.() -// ); -// } -// }); ` +}); diff --git a/src/content/Components/RollingGallery/RollingGallery.vue b/src/content/Components/RollingGallery/RollingGallery.vue new file mode 100644 index 0000000..33fef45 --- /dev/null +++ b/src/content/Components/RollingGallery/RollingGallery.vue @@ -0,0 +1,392 @@ + + + + + diff --git a/src/demo/Components/RollingGalleryDemo.vue b/src/demo/Components/RollingGalleryDemo.vue new file mode 100644 index 0000000..60a27d1 --- /dev/null +++ b/src/demo/Components/RollingGalleryDemo.vue @@ -0,0 +1,94 @@ + + + + + From 82f1a6fcbd9a14288b6eb47613b0885527075e03 Mon Sep 17 00:00:00 2001 From: Alfarish Fizikri Date: Wed, 23 Jul 2025 09:16:28 +0700 Subject: [PATCH 04/13] Create component --- src/constants/Categories.ts | 3 +- src/constants/Components.ts | 1 + src/constants/code/Components/counterCode.ts | 17 ++ src/content/Components/Counter/Counter.vue | 219 +++++++++++++++++++ src/demo/Components/CounterDemo.vue | 195 +++++++++++++++++ 5 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 src/constants/code/Components/counterCode.ts create mode 100644 src/content/Components/Counter/Counter.vue create mode 100644 src/demo/Components/CounterDemo.vue diff --git a/src/constants/Categories.ts b/src/constants/Categories.ts index ac41eb1..a33f44a 100644 --- a/src/constants/Categories.ts +++ b/src/constants/Categories.ts @@ -80,7 +80,8 @@ export const CATEGORIES = [ 'Flowing Menu', 'Elastic Slider', 'Stack', - 'Chroma Grid' + 'Chroma Grid', + 'Counter' ] }, { diff --git a/src/constants/Components.ts b/src/constants/Components.ts index d543dc2..5f9b341 100644 --- a/src/constants/Components.ts +++ b/src/constants/Components.ts @@ -69,6 +69,7 @@ const components = { 'tilted-card': () => import('../demo/Components/TiltedCardDemo.vue'), 'stack': () => import('../demo/Components/StackDemo.vue'), 'chroma-grid': () => import('../demo/Components/ChromaGridDemo.vue'), + 'counter': () => import('../demo/Components/CounterDemo.vue'), }; const backgrounds = { diff --git a/src/constants/code/Components/counterCode.ts b/src/constants/code/Components/counterCode.ts new file mode 100644 index 0000000..8f1fe16 --- /dev/null +++ b/src/constants/code/Components/counterCode.ts @@ -0,0 +1,17 @@ +import code from '@content/Components/Counter/Counter.vue?raw' +import { createCodeObject } from '../../../types/code' + +export const counter = createCodeObject(code, 'Components/Counter', { + installation: `npm i motion-v`, + usage: `import Counter from './Counter.vue' + +`, +}) \ No newline at end of file diff --git a/src/content/Components/Counter/Counter.vue b/src/content/Components/Counter/Counter.vue new file mode 100644 index 0000000..451e9cb --- /dev/null +++ b/src/content/Components/Counter/Counter.vue @@ -0,0 +1,219 @@ + + + + + diff --git a/src/demo/Components/CounterDemo.vue b/src/demo/Components/CounterDemo.vue new file mode 100644 index 0000000..02c624d --- /dev/null +++ b/src/demo/Components/CounterDemo.vue @@ -0,0 +1,195 @@ + + + From a0d85e88d963dc40a86a634c9e51fd26c91f02d1 Mon Sep 17 00:00:00 2001 From: David Haz Date: Wed, 23 Jul 2025 22:13:58 +0300 Subject: [PATCH 05/13] Update background colors in SSC demos --- src/css/category.css | 10 +++++----- src/demo/Components/ScrollStackDemo.vue | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/css/category.css b/src/css/category.css index c85fec5..f9267e8 100644 --- a/src/css/category.css +++ b/src/css/category.css @@ -596,23 +596,23 @@ div:has(> .props-table) { } .ssc-demo-1 { - background-color: #5227ff; + background-color: #35724d; } .ssc-demo-2 { - background-color: #f01e9c; + background-color: #333; } .ssc-demo-3 { - background-color: #5227ff; + background-color: #35724d; } .ssc-demo-4 { - background-color: #f01e9c; + background-color: #333; } .ssc-demo-5 { - background-color: #5227ff; + background-color: #35724d; text-align: center; justify-content: center; align-items: center; diff --git a/src/demo/Components/ScrollStackDemo.vue b/src/demo/Components/ScrollStackDemo.vue index bf6e135..680c165 100644 --- a/src/demo/Components/ScrollStackDemo.vue +++ b/src/demo/Components/ScrollStackDemo.vue @@ -11,7 +11,7 @@ " />

{{ isCompleted ? 'Stack Completed!' : 'Scroll Down' }}

From 71c0503e24c96d46cade0fd714784a409a8b9a55 Mon Sep 17 00:00:00 2001 From: Alfarish Fizikri Date: Thu, 24 Jul 2025 04:29:23 +0700 Subject: [PATCH 06/13] refactor(style): utilize tailwind instead of CSS --- src/content/Components/Counter/Counter.vue | 96 +++++----------------- 1 file changed, 19 insertions(+), 77 deletions(-) diff --git a/src/content/Components/Counter/Counter.vue b/src/content/Components/Counter/Counter.vue index 451e9cb..4ffca9e 100644 --- a/src/content/Components/Counter/Counter.vue +++ b/src/content/Components/Counter/Counter.vue @@ -1,29 +1,21 @@ @@ -90,15 +82,19 @@ const digitStyles = computed(() => ({ ...props.digitStyle })); -const topGradientStyles = computed((): CSSProperties => ({ - height: `${props.gradientHeight}px`, - background: `linear-gradient(to bottom, ${props.gradientFrom}, ${props.gradientTo})` -})); +const topGradientStyles = computed( + (): CSSProperties => ({ + height: `${props.gradientHeight}px`, + background: `linear-gradient(to bottom, ${props.gradientFrom}, ${props.gradientTo})` + }) +); -const bottomGradientStyles = computed((): CSSProperties => ({ - height: `${props.gradientHeight}px`, - background: `linear-gradient(to top, ${props.gradientFrom}, ${props.gradientTo})` -})); +const bottomGradientStyles = computed( + (): CSSProperties => ({ + height: `${props.gradientHeight}px`, + background: `linear-gradient(to top, ${props.gradientFrom}, ${props.gradientTo})` + }) +); const springValues = ref>({}); @@ -163,57 +159,3 @@ const getDigitPosition = (place: number, digit: number): number => { return position; }; - - From 39c9820182b40d054ef15f197de28e3f8a89240f Mon Sep 17 00:00:00 2001 From: Alfarish Fizikri Date: Thu, 24 Jul 2025 05:07:27 +0700 Subject: [PATCH 07/13] refactor(style): utilize tailwind instead of CSS --- .../RollingGallery/RollingGallery.vue | 117 +++--------------- src/demo/Components/RollingGalleryDemo.vue | 83 ++++++------- 2 files changed, 54 insertions(+), 146 deletions(-) diff --git a/src/content/Components/RollingGallery/RollingGallery.vue b/src/content/Components/RollingGallery/RollingGallery.vue index 33fef45..b19d145 100644 --- a/src/content/Components/RollingGallery/RollingGallery.vue +++ b/src/content/Components/RollingGallery/RollingGallery.vue @@ -1,11 +1,12 @@ diff --git a/src/demo/Components/RollingGalleryDemo.vue b/src/demo/Components/RollingGalleryDemo.vue index 93e2d11..b3690a6 100644 --- a/src/demo/Components/RollingGalleryDemo.vue +++ b/src/demo/Components/RollingGalleryDemo.vue @@ -17,15 +17,9 @@ - + - + @@ -43,39 +37,39 @@ From f126758606daf64e639e6ed17978d2f2bc0593f3 Mon Sep 17 00:00:00 2001 From: David Haz Date: Thu, 24 Jul 2025 16:33:49 +0300 Subject: [PATCH 12/13] update gradient color in CounterDemo component --- src/demo/Components/CounterDemo.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/demo/Components/CounterDemo.vue b/src/demo/Components/CounterDemo.vue index 4942cbc..ee4834b 100644 --- a/src/demo/Components/CounterDemo.vue +++ b/src/demo/Components/CounterDemo.vue @@ -5,7 +5,7 @@ Date: Thu, 24 Jul 2025 15:45:33 -0300 Subject: [PATCH 13/13] fix: support null and callback refs for gridRef warn - GlobalSpotlight: allow gridRef prop to be HTMLDivElement|null (default: null) - BentoCardGrid: change gridRef prop to Function callback type - MagicBento.vue: pass gridRef via callback to child and guard GlobalSpotlight render until gridRef is set - Updated type annotations and prop validations accordingly" --- src/content/Components/MagicBento/MagicBento.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/content/Components/MagicBento/MagicBento.vue b/src/content/Components/MagicBento/MagicBento.vue index 3281abe..17be7cb 100644 --- a/src/content/Components/MagicBento/MagicBento.vue +++ b/src/content/Components/MagicBento/MagicBento.vue @@ -378,7 +378,7 @@ const ParticleCard = defineComponent({ const GlobalSpotlight = defineComponent({ name: 'GlobalSpotlight', props: { - gridRef: { type: Object as PropType, required: true }, + gridRef: {type: [Object, null] as PropType, required: true}, disableAnimations: { type: Boolean, default: false }, enabled: { type: Boolean, default: true }, spotlightRadius: { type: Number, default: DEFAULT_SPOTLIGHT_RADIUS }, @@ -539,7 +539,10 @@ const GlobalSpotlight = defineComponent({ const BentoCardGrid = defineComponent({ name: 'BentoCardGrid', props: { - gridRef: { type: Object } + gridRef: { + type: Function as PropType<(el: HTMLDivElement | null) => void>, + required: true + } }, template: `