blocks-dusted 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +967 -3
- package/package.json +2 -2
- package/src/commands/add.js +143 -45
- package/src/commands/list.js +2 -2
- package/src/installers/checkRequirements.js +1 -0
- package/src/installers/copyTemplateFiles.js +23 -2
- package/src/installers/patchPayloadConfigCollections.js +92 -0
- package/src/installers/writeInstalledBlockReadme.js +17 -4
- package/src/registry/listTemplates.js +16 -7
- package/src/registry/loadTemplateManifest.js +20 -11
- package/src/registry/validateTemplateManifest.js +6 -5
- package/src/utils/paths.js +7 -0
- package/templates/blocks/DD-BookCall/Component.tsx +535 -573
- package/templates/blocks/DD-CardTemplate01/Component.tsx +45 -49
- package/templates/blocks/DD-Carousel-A/Component.tsx +249 -266
- package/templates/blocks/DD-Carousel-B/Component.tsx +403 -432
- package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -272
- package/templates/blocks/DD-Contact/Component.tsx +434 -439
- package/templates/blocks/DD-Contact/config.ts +8 -3
- package/templates/blocks/DD-FeatCat/Component.tsx +302 -361
- package/templates/blocks/DD-FeatCat/config.ts +201 -204
- package/templates/blocks/DD-FeatStrip/Component.tsx +171 -201
- package/templates/blocks/DD-Hero/Component.tsx +297 -317
- package/templates/blocks/DD-HorizontalScroll/Component.tsx +244 -303
- package/templates/blocks/DD-MasonaryMedia/Component.tsx +202 -228
- package/templates/blocks/DD-MasonaryMedia/config.ts +13 -14
- package/templates/blocks/DD-Pricing/Component.tsx +372 -380
- package/templates/blocks/DD-Process/Component.tsx +149 -155
- package/templates/blocks/DD-Section/Component.tsx +266 -327
- package/templates/blocks/DD-Services/Component.tsx +176 -188
- package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -317
- package/templates/blocks/DD-Slider-A/Component.tsx +237 -252
- package/templates/blocks/DD-StackCards/Component.tsx +137 -160
- package/templates/blocks/DD-Team/Component.tsx +247 -265
- package/templates/blocks/DD-TechStack/Component.tsx +57 -72
- package/templates/blocks/DD-Testimonials/Component.tsx +147 -147
- package/templates/blocks/DD-Testimonials/config.ts +66 -66
- package/templates/blocks/DD-Work/Component.tsx +315 -328
- package/templates/blocks/DD-Work-B/Component.tsx +294 -320
- package/templates/collections/Testimonials/README.md +11 -0
- package/templates/collections/Testimonials/Testimonials.ts +161 -0
- package/templates/collections/Testimonials/manifest.json +55 -0
- package/templates/components/HeaderDD02/MobileBottomNav/index.tsx +545 -0
- package/templates/components/HeaderDD02/README.md +45 -0
- package/templates/components/HeaderDD02/RowLabel.tsx +33 -0
- package/templates/components/HeaderDD02/config.ts +302 -0
- package/templates/components/HeaderDD02/index.tsx +517 -0
- package/templates/components/HeaderDD02/manifest.json +123 -0
- package/templates/components/RichText/README.md +13 -0
- package/templates/components/RichText/converter/componentConverter/blocks.tsx +43 -0
- package/templates/components/RichText/converter/componentConverter/types.ts +11 -0
- package/templates/components/RichText/converter/index.tsx +18 -0
- package/templates/components/RichText/converter/internalLinks.tsx +45 -0
- package/templates/components/RichText/converter/textConverter.tsx +27 -0
- package/templates/components/RichText/index.tsx +35 -0
- package/templates/components/RichText/manifest.json +80 -0
|
@@ -1,94 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import React, { useLayoutEffect, useRef, useState } from
|
|
4
|
-
import Image from
|
|
5
|
-
import * as LucideIcons from
|
|
6
|
-
import { ArrowRight } from
|
|
7
|
-
import gsap from
|
|
8
|
-
import { ScrollTrigger } from
|
|
9
|
-
type Media = { url?: string | null; alt?: string | null; [key: string]: any }
|
|
3
|
+
import React, { useLayoutEffect, useRef, useState } from 'react'
|
|
4
|
+
import Image from 'next/image'
|
|
5
|
+
import * as LucideIcons from 'lucide-react'
|
|
6
|
+
import { ArrowRight } from 'lucide-react'
|
|
7
|
+
import gsap from 'gsap'
|
|
8
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
|
9
|
+
type Media = { url?: string | null; alt?: string | null; [key: string]: any }
|
|
10
10
|
|
|
11
|
-
import RichText from
|
|
11
|
+
import RichText from '@/components/RichText'
|
|
12
12
|
|
|
13
|
-
if (typeof window !==
|
|
14
|
-
gsap.registerPlugin(ScrollTrigger)
|
|
13
|
+
if (typeof window !== 'undefined') {
|
|
14
|
+
gsap.registerPlugin(ScrollTrigger)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const ACCENTS = {
|
|
18
|
-
lime: { hex:
|
|
19
|
-
purple: { hex:
|
|
20
|
-
} as const
|
|
18
|
+
lime: { hex: '#84cc16', rgb: '132,204,22' },
|
|
19
|
+
purple: { hex: '#9803e2', rgb: '152,3,226' },
|
|
20
|
+
} as const
|
|
21
21
|
|
|
22
|
-
type AccentVariant = keyof typeof ACCENTS
|
|
22
|
+
type AccentVariant = keyof typeof ACCENTS
|
|
23
23
|
|
|
24
24
|
function isLocalImageSrc(src?: string | null): src is string {
|
|
25
|
-
return typeof src ===
|
|
25
|
+
return typeof src === 'string' && src.startsWith('/api/media/file/')
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function DynamicIcon({
|
|
29
29
|
name,
|
|
30
30
|
size = 22,
|
|
31
31
|
...props
|
|
32
|
-
}: { name?: string | null } & Omit<LucideIcons.LucideProps,
|
|
33
|
-
if (!name) return null
|
|
32
|
+
}: { name?: string | null } & Omit<LucideIcons.LucideProps, 'name'>) {
|
|
33
|
+
if (!name) return null
|
|
34
34
|
|
|
35
|
-
const Icon = (
|
|
36
|
-
LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>
|
|
37
|
-
)[name];
|
|
35
|
+
const Icon = (LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>)[name]
|
|
38
36
|
|
|
39
|
-
if (!Icon) return null
|
|
37
|
+
if (!Icon) return null
|
|
40
38
|
|
|
41
|
-
return <Icon size={size} {...props}
|
|
39
|
+
return <Icon size={size} {...props} />
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
interface TagItem {
|
|
45
|
-
id?: string | null
|
|
46
|
-
tag: string
|
|
43
|
+
id?: string | null
|
|
44
|
+
tag: string
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
interface CardItem {
|
|
50
|
-
id?: string | null
|
|
51
|
-
iconName?: string | null
|
|
52
|
-
number?: string | null
|
|
53
|
-
title?: string | null
|
|
54
|
-
content?: unknown
|
|
55
|
-
statValue?: string | null
|
|
56
|
-
statLabel?: string | null
|
|
57
|
-
tags?: TagItem[] | null
|
|
58
|
-
ctaLabel?: string | null
|
|
59
|
-
ctaHref?: string | null
|
|
60
|
-
accentVariant?: AccentVariant | null
|
|
61
|
-
image?: Media | string | null
|
|
48
|
+
id?: string | null
|
|
49
|
+
iconName?: string | null
|
|
50
|
+
number?: string | null
|
|
51
|
+
title?: string | null
|
|
52
|
+
content?: unknown
|
|
53
|
+
statValue?: string | null
|
|
54
|
+
statLabel?: string | null
|
|
55
|
+
tags?: TagItem[] | null
|
|
56
|
+
ctaLabel?: string | null
|
|
57
|
+
ctaHref?: string | null
|
|
58
|
+
accentVariant?: AccentVariant | null
|
|
59
|
+
image?: Media | string | null
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
interface DDStackCardsProps {
|
|
65
|
-
cards?: CardItem[] | null
|
|
63
|
+
cards?: CardItem[] | null
|
|
66
64
|
|
|
67
|
-
cardOffset?: number | null
|
|
68
|
-
initialStickyTop?: number | null
|
|
69
|
-
depthZ?: number | null
|
|
70
|
-
scaleStep?: number | null
|
|
65
|
+
cardOffset?: number | null
|
|
66
|
+
initialStickyTop?: number | null
|
|
67
|
+
depthZ?: number | null
|
|
68
|
+
scaleStep?: number | null
|
|
71
69
|
|
|
72
|
-
cardOffsetTablet?: number | null
|
|
73
|
-
initialStickyTopTablet?: number | null
|
|
74
|
-
depthZTablet?: number | null
|
|
75
|
-
scaleStepTablet?: number | null
|
|
70
|
+
cardOffsetTablet?: number | null
|
|
71
|
+
initialStickyTopTablet?: number | null
|
|
72
|
+
depthZTablet?: number | null
|
|
73
|
+
scaleStepTablet?: number | null
|
|
76
74
|
|
|
77
|
-
cardOffsetMobile?: number | null
|
|
78
|
-
initialStickyTopMobile?: number | null
|
|
79
|
-
depthZMobile?: number | null
|
|
80
|
-
scaleStepMobile?: number | null
|
|
75
|
+
cardOffsetMobile?: number | null
|
|
76
|
+
initialStickyTopMobile?: number | null
|
|
77
|
+
depthZMobile?: number | null
|
|
78
|
+
scaleStepMobile?: number | null
|
|
81
79
|
|
|
82
|
-
sectionId?: string | null
|
|
83
|
-
[key: string]: unknown
|
|
80
|
+
sectionId?: string | null
|
|
81
|
+
[key: string]: unknown
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
type ResponsiveStackValues = {
|
|
87
|
-
cardOffset: number
|
|
88
|
-
initialStickyTop: number
|
|
89
|
-
depthZ: number
|
|
90
|
-
scaleStep: number
|
|
91
|
-
}
|
|
85
|
+
cardOffset: number
|
|
86
|
+
initialStickyTop: number
|
|
87
|
+
depthZ: number
|
|
88
|
+
scaleStep: number
|
|
89
|
+
}
|
|
92
90
|
|
|
93
91
|
function getResponsiveStackValues({
|
|
94
92
|
cardOffset,
|
|
@@ -105,86 +103,78 @@ function getResponsiveStackValues({
|
|
|
105
103
|
scaleStepMobile,
|
|
106
104
|
}: DDStackCardsProps): ResponsiveStackValues {
|
|
107
105
|
const desktopValues = {
|
|
108
|
-
cardOffset: typeof cardOffset ===
|
|
109
|
-
initialStickyTop:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
};
|
|
106
|
+
cardOffset: typeof cardOffset === 'number' ? cardOffset : 14,
|
|
107
|
+
initialStickyTop: typeof initialStickyTop === 'number' ? initialStickyTop : 0,
|
|
108
|
+
depthZ: typeof depthZ === 'number' ? depthZ : 40,
|
|
109
|
+
scaleStep: typeof scaleStep === 'number' ? scaleStep : 0.18,
|
|
110
|
+
}
|
|
114
111
|
|
|
115
|
-
if (typeof window ===
|
|
112
|
+
if (typeof window === 'undefined') return desktopValues
|
|
116
113
|
|
|
117
114
|
const tabletValues = {
|
|
118
115
|
cardOffset:
|
|
119
|
-
typeof cardOffsetTablet ===
|
|
116
|
+
typeof cardOffsetTablet === 'number'
|
|
120
117
|
? cardOffsetTablet
|
|
121
118
|
: Math.max(8, desktopValues.cardOffset * 0.75),
|
|
122
119
|
initialStickyTop:
|
|
123
|
-
typeof initialStickyTopTablet ===
|
|
120
|
+
typeof initialStickyTopTablet === 'number'
|
|
124
121
|
? initialStickyTopTablet
|
|
125
122
|
: desktopValues.initialStickyTop,
|
|
126
123
|
depthZ:
|
|
127
|
-
typeof depthZTablet ===
|
|
128
|
-
? depthZTablet
|
|
129
|
-
: Math.max(16, desktopValues.depthZ * 0.65),
|
|
124
|
+
typeof depthZTablet === 'number' ? depthZTablet : Math.max(16, desktopValues.depthZ * 0.65),
|
|
130
125
|
scaleStep:
|
|
131
|
-
typeof scaleStepTablet ===
|
|
126
|
+
typeof scaleStepTablet === 'number'
|
|
132
127
|
? scaleStepTablet
|
|
133
128
|
: Math.min(desktopValues.scaleStep, 0.08),
|
|
134
|
-
}
|
|
129
|
+
}
|
|
135
130
|
|
|
136
131
|
const mobileValues = {
|
|
137
132
|
cardOffset:
|
|
138
|
-
typeof cardOffsetMobile ===
|
|
133
|
+
typeof cardOffsetMobile === 'number'
|
|
139
134
|
? cardOffsetMobile
|
|
140
135
|
: Math.max(6, desktopValues.cardOffset * 0.5),
|
|
141
136
|
initialStickyTop:
|
|
142
|
-
typeof initialStickyTopMobile ===
|
|
137
|
+
typeof initialStickyTopMobile === 'number'
|
|
143
138
|
? initialStickyTopMobile
|
|
144
139
|
: desktopValues.initialStickyTop,
|
|
145
140
|
depthZ:
|
|
146
|
-
typeof depthZMobile ===
|
|
147
|
-
? depthZMobile
|
|
148
|
-
: Math.max(8, desktopValues.depthZ * 0.35),
|
|
141
|
+
typeof depthZMobile === 'number' ? depthZMobile : Math.max(8, desktopValues.depthZ * 0.35),
|
|
149
142
|
scaleStep:
|
|
150
|
-
typeof scaleStepMobile ===
|
|
143
|
+
typeof scaleStepMobile === 'number'
|
|
151
144
|
? scaleStepMobile
|
|
152
145
|
: Math.min(desktopValues.scaleStep, 0.045),
|
|
153
|
-
}
|
|
146
|
+
}
|
|
154
147
|
|
|
155
|
-
if (window.matchMedia(
|
|
156
|
-
if (window.matchMedia(
|
|
148
|
+
if (window.matchMedia('(max-width: 767px)').matches) return mobileValues
|
|
149
|
+
if (window.matchMedia('(max-width: 1023px)').matches) return tabletValues
|
|
157
150
|
|
|
158
|
-
return desktopValues
|
|
151
|
+
return desktopValues
|
|
159
152
|
}
|
|
160
153
|
|
|
161
154
|
export function DDStackCards(props: DDStackCardsProps) {
|
|
162
|
-
const { cards, sectionId } = props
|
|
163
|
-
|
|
164
|
-
const wrapperRef = useRef<HTMLDivElement | null>(null)
|
|
165
|
-
const cardRefs = useRef<(HTMLElement | null)[]>([])
|
|
166
|
-
const [layoutValues, setLayoutValues] = useState<ResponsiveStackValues>(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
scaleStep: typeof props.scaleStep === "number" ? props.scaleStep : 0.18,
|
|
173
|
-
}),
|
|
174
|
-
);
|
|
155
|
+
const { cards, sectionId } = props
|
|
156
|
+
|
|
157
|
+
const wrapperRef = useRef<HTMLDivElement | null>(null)
|
|
158
|
+
const cardRefs = useRef<(HTMLElement | null)[]>([])
|
|
159
|
+
const [layoutValues, setLayoutValues] = useState<ResponsiveStackValues>(() => ({
|
|
160
|
+
cardOffset: typeof props.cardOffset === 'number' ? props.cardOffset : 14,
|
|
161
|
+
initialStickyTop: typeof props.initialStickyTop === 'number' ? props.initialStickyTop : 0,
|
|
162
|
+
depthZ: typeof props.depthZ === 'number' ? props.depthZ : 40,
|
|
163
|
+
scaleStep: typeof props.scaleStep === 'number' ? props.scaleStep : 0.18,
|
|
164
|
+
}))
|
|
175
165
|
|
|
176
166
|
useLayoutEffect(() => {
|
|
177
167
|
const updateValues = () => {
|
|
178
|
-
setLayoutValues(getResponsiveStackValues(props))
|
|
179
|
-
}
|
|
168
|
+
setLayoutValues(getResponsiveStackValues(props))
|
|
169
|
+
}
|
|
180
170
|
|
|
181
|
-
updateValues()
|
|
171
|
+
updateValues()
|
|
182
172
|
|
|
183
|
-
window.addEventListener(
|
|
173
|
+
window.addEventListener('resize', updateValues)
|
|
184
174
|
|
|
185
175
|
return () => {
|
|
186
|
-
window.removeEventListener(
|
|
187
|
-
}
|
|
176
|
+
window.removeEventListener('resize', updateValues)
|
|
177
|
+
}
|
|
188
178
|
}, [
|
|
189
179
|
props.cardOffset,
|
|
190
180
|
props.initialStickyTop,
|
|
@@ -198,32 +188,32 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
198
188
|
props.initialStickyTopMobile,
|
|
199
189
|
props.depthZMobile,
|
|
200
190
|
props.scaleStepMobile,
|
|
201
|
-
])
|
|
191
|
+
])
|
|
202
192
|
|
|
203
193
|
useLayoutEffect(() => {
|
|
204
194
|
const timer = window.setTimeout(() => {
|
|
205
|
-
const wrapper = wrapperRef.current
|
|
206
|
-
const cardEls = cardRefs.current.filter(Boolean) as HTMLDivElement[]
|
|
195
|
+
const wrapper = wrapperRef.current
|
|
196
|
+
const cardEls = cardRefs.current.filter(Boolean) as HTMLDivElement[]
|
|
207
197
|
|
|
208
|
-
if (!wrapper || !cardEls.length) return
|
|
198
|
+
if (!wrapper || !cardEls.length) return
|
|
209
199
|
|
|
210
200
|
const ctx = gsap.context(() => {
|
|
211
201
|
gsap.set(wrapper, {
|
|
212
202
|
autoAlpha: 1,
|
|
213
|
-
willChange:
|
|
214
|
-
})
|
|
203
|
+
willChange: 'opacity',
|
|
204
|
+
})
|
|
215
205
|
|
|
216
206
|
gsap.set(cardEls, {
|
|
217
207
|
transformPerspective: 1200,
|
|
218
|
-
transformOrigin:
|
|
219
|
-
})
|
|
208
|
+
transformOrigin: 'top center',
|
|
209
|
+
})
|
|
220
210
|
|
|
221
211
|
cardEls.forEach((card, i) => {
|
|
222
212
|
for (let j = i + 1; j < cardEls.length; j++) {
|
|
223
|
-
const step = j - i
|
|
224
|
-
const prevStep = step - 1
|
|
213
|
+
const step = j - i
|
|
214
|
+
const prevStep = step - 1
|
|
225
215
|
const triggerStickyTop =
|
|
226
|
-
layoutValues.initialStickyTop + (j - 1) * layoutValues.cardOffset
|
|
216
|
+
layoutValues.initialStickyTop + (j - 1) * layoutValues.cardOffset
|
|
227
217
|
|
|
228
218
|
gsap.fromTo(
|
|
229
219
|
card,
|
|
@@ -236,7 +226,7 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
236
226
|
z: -step * layoutValues.depthZ,
|
|
237
227
|
force3D: true,
|
|
238
228
|
filter: `brightness(${Math.max(0.65, 1 - step * 0.06)})`,
|
|
239
|
-
borderRadius:
|
|
229
|
+
borderRadius: '20px',
|
|
240
230
|
immediateRender: false,
|
|
241
231
|
scrollTrigger: {
|
|
242
232
|
trigger: cardEls[j],
|
|
@@ -246,45 +236,45 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
246
236
|
invalidateOnRefresh: true,
|
|
247
237
|
},
|
|
248
238
|
},
|
|
249
|
-
)
|
|
239
|
+
)
|
|
250
240
|
}
|
|
251
|
-
})
|
|
241
|
+
})
|
|
252
242
|
|
|
253
|
-
const lastCard = cardEls[cardEls.length - 1]
|
|
243
|
+
const lastCard = cardEls[cardEls.length - 1]
|
|
254
244
|
|
|
255
245
|
gsap.to(wrapper, {
|
|
256
246
|
autoAlpha: 0,
|
|
257
|
-
ease:
|
|
247
|
+
ease: 'none',
|
|
258
248
|
scrollTrigger: {
|
|
259
249
|
trigger: lastCard,
|
|
260
|
-
start:
|
|
250
|
+
start: 'top top',
|
|
261
251
|
end: () => `+=${window.innerHeight * 0.3}`,
|
|
262
252
|
scrub: true,
|
|
263
253
|
invalidateOnRefresh: true,
|
|
264
254
|
},
|
|
265
|
-
})
|
|
255
|
+
})
|
|
266
256
|
|
|
267
257
|
requestAnimationFrame(() => {
|
|
268
|
-
ScrollTrigger.refresh()
|
|
269
|
-
})
|
|
270
|
-
}, wrapper)
|
|
258
|
+
ScrollTrigger.refresh()
|
|
259
|
+
})
|
|
260
|
+
}, wrapper)
|
|
271
261
|
|
|
272
|
-
return () => ctx.revert()
|
|
273
|
-
}, 120)
|
|
262
|
+
return () => ctx.revert()
|
|
263
|
+
}, 120)
|
|
274
264
|
|
|
275
265
|
return () => {
|
|
276
|
-
window.clearTimeout(timer)
|
|
277
|
-
}
|
|
266
|
+
window.clearTimeout(timer)
|
|
267
|
+
}
|
|
278
268
|
}, [
|
|
279
269
|
layoutValues.cardOffset,
|
|
280
270
|
layoutValues.initialStickyTop,
|
|
281
271
|
layoutValues.depthZ,
|
|
282
272
|
layoutValues.scaleStep,
|
|
283
|
-
])
|
|
273
|
+
])
|
|
284
274
|
|
|
285
|
-
if (!cards?.length) return null
|
|
275
|
+
if (!cards?.length) return null
|
|
286
276
|
|
|
287
|
-
const totalCards = cards.length
|
|
277
|
+
const totalCards = cards.length
|
|
288
278
|
|
|
289
279
|
return (
|
|
290
280
|
<section
|
|
@@ -292,32 +282,31 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
292
282
|
className="stack-cards-block relative w-full invert-[0.95] brightness-110 contrast-125 dark:brightness-100 dark:contrast-100 dark:invert-[0]"
|
|
293
283
|
>
|
|
294
284
|
{cards.map((card, i) => {
|
|
295
|
-
const accent = ACCENTS[card.accentVariant ??
|
|
285
|
+
const accent = ACCENTS[card.accentVariant ?? 'lime']
|
|
296
286
|
const cardMedia =
|
|
297
|
-
card.image && typeof card.image ===
|
|
298
|
-
? (card.image as Media)
|
|
299
|
-
: null;
|
|
287
|
+
card.image && typeof card.image === 'object' ? (card.image as Media) : null
|
|
300
288
|
|
|
301
289
|
return (
|
|
302
290
|
<section
|
|
303
291
|
key={card.id ?? i}
|
|
304
292
|
id={i === 0 ? (sectionId ?? undefined) : undefined}
|
|
305
293
|
ref={(el) => {
|
|
306
|
-
cardRefs.current[i] = el
|
|
294
|
+
cardRefs.current[i] = el
|
|
307
295
|
}}
|
|
308
296
|
className="stack-card renderblock-container sticky! w-full overflow-hidden px-4 py-16 sm:px-6 lg:py-32"
|
|
309
297
|
style={{
|
|
310
298
|
top: `${layoutValues.initialStickyTop + i * layoutValues.cardOffset}px`,
|
|
311
299
|
zIndex: i + 1,
|
|
312
|
-
willChange:
|
|
300
|
+
willChange: 'transform',
|
|
313
301
|
}}
|
|
314
302
|
>
|
|
303
|
+
{i === 0 ? '#BlockName-DDStackCards' : null}
|
|
315
304
|
<div
|
|
316
305
|
className="relative mx-auto w-full max-w-5xl overflow-hidden rounded-2xl"
|
|
317
306
|
style={{
|
|
318
|
-
background:
|
|
319
|
-
border:
|
|
320
|
-
backdropFilter:
|
|
307
|
+
background: 'rgb(8 8 10 / 90%)',
|
|
308
|
+
border: '1px solid rgba(255,255,255,0.07)',
|
|
309
|
+
backdropFilter: 'blur(8px)',
|
|
321
310
|
}}
|
|
322
311
|
>
|
|
323
312
|
<div
|
|
@@ -340,11 +329,7 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
340
329
|
}}
|
|
341
330
|
>
|
|
342
331
|
<span style={{ color: accent.hex }}>
|
|
343
|
-
<DynamicIcon
|
|
344
|
-
className="shrink-0"
|
|
345
|
-
name={card.iconName}
|
|
346
|
-
size={20}
|
|
347
|
-
/>
|
|
332
|
+
<DynamicIcon className="shrink-0" name={card.iconName} size={20} />
|
|
348
333
|
</span>
|
|
349
334
|
</div>
|
|
350
335
|
|
|
@@ -354,8 +339,7 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
354
339
|
className="mb-0.5 text-[10px] font-black uppercase tracking-widest md:text-xs"
|
|
355
340
|
style={{ color: `rgba(${accent.rgb},0.6)` }}
|
|
356
341
|
>
|
|
357
|
-
{card.number} /{
|
|
358
|
-
{String(totalCards).padStart(2, "0")}
|
|
342
|
+
{card.number} / {String(totalCards).padStart(2, '0')}
|
|
359
343
|
</div>
|
|
360
344
|
)}
|
|
361
345
|
|
|
@@ -381,7 +365,7 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
381
365
|
{card.statLabel && (
|
|
382
366
|
<span
|
|
383
367
|
className="mt-1 text-xs"
|
|
384
|
-
style={{ color:
|
|
368
|
+
style={{ color: 'rgba(255,255,255,0.3)' }}
|
|
385
369
|
>
|
|
386
370
|
{card.statLabel}
|
|
387
371
|
</span>
|
|
@@ -396,7 +380,7 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
396
380
|
enableProse={false}
|
|
397
381
|
enableGutter={false}
|
|
398
382
|
className="max-w-xl text-sm leading-relaxed text-stone-200 dark:text-stone-200 md:text-base"
|
|
399
|
-
style={{ color:
|
|
383
|
+
style={{ color: 'rgba(255,255,255,0.45)' }}
|
|
400
384
|
/>
|
|
401
385
|
) : null}
|
|
402
386
|
</div>
|
|
@@ -422,7 +406,7 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
422
406
|
|
|
423
407
|
{card.ctaLabel && (
|
|
424
408
|
<a
|
|
425
|
-
href={card.ctaHref ??
|
|
409
|
+
href={card.ctaHref ?? '#'}
|
|
426
410
|
className="group flex cursor-pointer items-center gap-2 whitespace-nowrap text-xs font-black uppercase tracking-widest"
|
|
427
411
|
style={{ color: accent.hex }}
|
|
428
412
|
>
|
|
@@ -454,29 +438,22 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
454
438
|
{isLocalImageSrc(cardMedia?.url) ? (
|
|
455
439
|
<Image
|
|
456
440
|
src={cardMedia.url}
|
|
457
|
-
alt={cardMedia.alt ?? card.title ??
|
|
441
|
+
alt={cardMedia.alt ?? card.title ?? ''}
|
|
458
442
|
fill
|
|
459
443
|
className="relative z-10 object-cover opacity-80"
|
|
460
444
|
sizes="(max-width: 640px) 88px, (max-width: 768px) 128px, (max-width: 1280px) 192px, 320px"
|
|
461
445
|
/>
|
|
462
446
|
) : (
|
|
463
447
|
<>
|
|
464
|
-
<span
|
|
465
|
-
className="
|
|
466
|
-
style={{ color: `rgba(${accent.rgb},1)` }}
|
|
467
|
-
>
|
|
468
|
-
<DynamicIcon
|
|
469
|
-
className="shrink-0"
|
|
470
|
-
name={card.iconName}
|
|
471
|
-
size={96}
|
|
472
|
-
/>
|
|
448
|
+
<span className="relative z-10" style={{ color: `rgba(${accent.rgb},1)` }}>
|
|
449
|
+
<DynamicIcon className="shrink-0" name={card.iconName} size={96} />
|
|
473
450
|
</span>
|
|
474
451
|
|
|
475
452
|
{card.number && (
|
|
476
453
|
<div
|
|
477
454
|
className="absolute bottom-4 right-6 select-none font-black leading-none"
|
|
478
455
|
style={{
|
|
479
|
-
fontSize:
|
|
456
|
+
fontSize: '80px',
|
|
480
457
|
color: `rgba(${accent.rgb},0.2)`,
|
|
481
458
|
}}
|
|
482
459
|
>
|
|
@@ -489,8 +466,8 @@ export function DDStackCards(props: DDStackCardsProps) {
|
|
|
489
466
|
</div>
|
|
490
467
|
</div>
|
|
491
468
|
</section>
|
|
492
|
-
)
|
|
469
|
+
)
|
|
493
470
|
})}
|
|
494
471
|
</section>
|
|
495
|
-
)
|
|
472
|
+
)
|
|
496
473
|
}
|