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,328 +1,315 @@
|
|
|
1
|
-
/* eslint-disable @next/next/no-img-element */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import React, { useRef, useState } from
|
|
5
|
-
import Image from
|
|
6
|
-
import { BarChart2, ExternalLink } from
|
|
7
|
-
import { motion, type Variants } from
|
|
8
|
-
|
|
9
|
-
import { cn } from
|
|
10
|
-
export type DDWorkProps = Record<string, any
|
|
11
|
-
type Media = { url?: string | null; alt?: string | null; [key: string]: any }
|
|
12
|
-
type CategoryItem = { id?: string | null; label?: string | null }
|
|
13
|
-
type TagItem = { id?: string | null; tag?: string | null }
|
|
14
|
-
type ProjectItem = {
|
|
15
|
-
id?: string | null
|
|
16
|
-
title?: string | null
|
|
17
|
-
category?: string | null
|
|
18
|
-
description?: string | null
|
|
19
|
-
highlight?: string | null
|
|
20
|
-
year?: string | null
|
|
21
|
-
image?: Media | string | null
|
|
22
|
-
imageFallbackUrl?: string | null
|
|
23
|
-
tags?: TagItem[] | null
|
|
24
|
-
link?: string | null
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function isLocalImageSrc(src?: string | null): src is string {
|
|
28
|
-
return typeof src ===
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ─── SpotlightCard ────────────────────────────────────────────────────────────
|
|
32
|
-
interface SpotlightCardProps {
|
|
33
|
-
children: React.ReactNode
|
|
34
|
-
className?: string
|
|
35
|
-
spotlightColor?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function SpotlightCard({
|
|
39
|
-
children,
|
|
40
|
-
className,
|
|
41
|
-
spotlightColor =
|
|
42
|
-
}: SpotlightCardProps) {
|
|
43
|
-
const cardRef = useRef<HTMLDivElement>(null)
|
|
44
|
-
const [pos, setPos] = useState<{ x: number; y: number } | null>(null)
|
|
45
|
-
|
|
46
|
-
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
47
|
-
if (!cardRef.current) return
|
|
48
|
-
|
|
49
|
-
const rect = cardRef.current.getBoundingClientRect()
|
|
50
|
-
|
|
51
|
-
setPos({
|
|
52
|
-
x: e.clientX - rect.left,
|
|
53
|
-
y: e.clientY - rect.top,
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const handleMouseLeave = () => setPos(null)
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
ref={cardRef}
|
|
62
|
-
className={cn(
|
|
63
|
-
onMouseMove={handleMouseMove}
|
|
64
|
-
onMouseLeave={handleMouseLeave}
|
|
65
|
-
>
|
|
66
|
-
{pos && (
|
|
67
|
-
<div
|
|
68
|
-
className="pointer-events-none absolute inset-0 z-0 transition-opacity duration-300"
|
|
69
|
-
style={{
|
|
70
|
-
background: `radial-gradient(400px circle at ${pos.x}px ${pos.y}px, ${spotlightColor}, transparent 60%)`,
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
)}
|
|
74
|
-
|
|
75
|
-
<div className="relative z-10">{children}</div>
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ─── Animation variants ───────────────────────────────────────────────────────
|
|
81
|
-
const containerVariants: Variants = {
|
|
82
|
-
hidden: {},
|
|
83
|
-
show: {
|
|
84
|
-
transition: {
|
|
85
|
-
staggerChildren: 0.1,
|
|
86
|
-
delayChildren: 0.05,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const itemVariants: Variants = {
|
|
92
|
-
hidden: {
|
|
93
|
-
opacity: 0,
|
|
94
|
-
y: 24,
|
|
95
|
-
},
|
|
96
|
-
show: {
|
|
97
|
-
opacity: 1,
|
|
98
|
-
y: 0,
|
|
99
|
-
transition: {
|
|
100
|
-
duration: 0.45,
|
|
101
|
-
ease:
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ─── Component ────────────────────────────────────────────────────────────────
|
|
107
|
-
export const DDWork: React.FC<DDWorkProps> = ({
|
|
108
|
-
eyebrow,
|
|
109
|
-
headlineMain,
|
|
110
|
-
headlineAccent,
|
|
111
|
-
categories,
|
|
112
|
-
projects,
|
|
113
|
-
sectionId,
|
|
114
|
-
customCSS,
|
|
115
|
-
}) => {
|
|
116
|
-
const categoryItems = (categories ?? []) as CategoryItem[]
|
|
117
|
-
const projectItems = (projects ?? []) as ProjectItem[]
|
|
118
|
-
const allLabel = categoryItems[0]?.label ??
|
|
119
|
-
const [activeCategory, setActiveCategory] = useState(allLabel)
|
|
120
|
-
|
|
121
|
-
const filtered =
|
|
122
|
-
activeCategory === allLabel
|
|
123
|
-
? projectItems
|
|
124
|
-
: projectItems.filter((p) => p.category === activeCategory)
|
|
125
|
-
|
|
126
|
-
return (
|
|
127
|
-
<>
|
|
128
|
-
{customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
|
|
129
|
-
|
|
130
|
-
<div id={sectionId ??
|
|
131
|
-
<div className="mx-auto max-w-6xl lg:max-w-7xl px-6">
|
|
132
|
-
{/* Header */}
|
|
133
|
-
<motion.div
|
|
134
|
-
variants={containerVariants}
|
|
135
|
-
initial="hidden"
|
|
136
|
-
whileInView="show"
|
|
137
|
-
viewport={{ once: false, amount: 0.2 }}
|
|
138
|
-
className="mb-12 flex flex-col gap-6 overflow-hidden md:flex-row md:items-end md:justify-between px-0 md:px-4"
|
|
139
|
-
>
|
|
140
|
-
<motion.div variants={itemVariants}>
|
|
141
|
-
{eyebrow && (
|
|
142
|
-
<p className="top-caption mb-3 text-sm font-semibold uppercase tracking-widest text-stone-500 dark:text-stone-400">
|
|
143
|
-
{eyebrow}
|
|
144
|
-
</p>
|
|
145
|
-
)}
|
|
146
|
-
|
|
147
|
-
<h2 className="text-4xl font-bold leading-tight text-stone-900 dark:text-stone-50 md:text-5xl">
|
|
148
|
-
{headlineMain}
|
|
149
|
-
{headlineAccent && (
|
|
150
|
-
<>
|
|
151
|
-
<br />
|
|
152
|
-
<span className="text-stone-600 dark:text-stone-400">
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
>
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
CardInner
|
|
317
|
-
)}
|
|
318
|
-
</motion.div>
|
|
319
|
-
);
|
|
320
|
-
})}
|
|
321
|
-
</motion.div>
|
|
322
|
-
</div>
|
|
323
|
-
</div>
|
|
324
|
-
</>
|
|
325
|
-
);
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
export default DDWork;
|
|
1
|
+
/* eslint-disable @next/next/no-img-element */
|
|
2
|
+
'use client'
|
|
3
|
+
|
|
4
|
+
import React, { useRef, useState } from 'react'
|
|
5
|
+
import Image from 'next/image'
|
|
6
|
+
import { BarChart2, ExternalLink } from 'lucide-react'
|
|
7
|
+
import { motion, type Variants } from 'framer-motion'
|
|
8
|
+
|
|
9
|
+
import { cn } from '@/utilities/ui'
|
|
10
|
+
export type DDWorkProps = Record<string, any>
|
|
11
|
+
type Media = { url?: string | null; alt?: string | null; [key: string]: any }
|
|
12
|
+
type CategoryItem = { id?: string | null; label?: string | null }
|
|
13
|
+
type TagItem = { id?: string | null; tag?: string | null }
|
|
14
|
+
type ProjectItem = {
|
|
15
|
+
id?: string | null
|
|
16
|
+
title?: string | null
|
|
17
|
+
category?: string | null
|
|
18
|
+
description?: string | null
|
|
19
|
+
highlight?: string | null
|
|
20
|
+
year?: string | null
|
|
21
|
+
image?: Media | string | null
|
|
22
|
+
imageFallbackUrl?: string | null
|
|
23
|
+
tags?: TagItem[] | null
|
|
24
|
+
link?: string | null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function isLocalImageSrc(src?: string | null): src is string {
|
|
28
|
+
return typeof src === 'string' && src.startsWith('/api/media/file/')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ─── SpotlightCard ────────────────────────────────────────────────────────────
|
|
32
|
+
interface SpotlightCardProps {
|
|
33
|
+
children: React.ReactNode
|
|
34
|
+
className?: string
|
|
35
|
+
spotlightColor?: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function SpotlightCard({
|
|
39
|
+
children,
|
|
40
|
+
className,
|
|
41
|
+
spotlightColor = 'rgba(214,211,209,0.08)',
|
|
42
|
+
}: SpotlightCardProps) {
|
|
43
|
+
const cardRef = useRef<HTMLDivElement>(null)
|
|
44
|
+
const [pos, setPos] = useState<{ x: number; y: number } | null>(null)
|
|
45
|
+
|
|
46
|
+
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
47
|
+
if (!cardRef.current) return
|
|
48
|
+
|
|
49
|
+
const rect = cardRef.current.getBoundingClientRect()
|
|
50
|
+
|
|
51
|
+
setPos({
|
|
52
|
+
x: e.clientX - rect.left,
|
|
53
|
+
y: e.clientY - rect.top,
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const handleMouseLeave = () => setPos(null)
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
ref={cardRef}
|
|
62
|
+
className={cn('relative overflow-hidden', className)}
|
|
63
|
+
onMouseMove={handleMouseMove}
|
|
64
|
+
onMouseLeave={handleMouseLeave}
|
|
65
|
+
>
|
|
66
|
+
{pos && (
|
|
67
|
+
<div
|
|
68
|
+
className="pointer-events-none absolute inset-0 z-0 transition-opacity duration-300"
|
|
69
|
+
style={{
|
|
70
|
+
background: `radial-gradient(400px circle at ${pos.x}px ${pos.y}px, ${spotlightColor}, transparent 60%)`,
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
<div className="relative z-10">{children}</div>
|
|
76
|
+
</div>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ─── Animation variants ───────────────────────────────────────────────────────
|
|
81
|
+
const containerVariants: Variants = {
|
|
82
|
+
hidden: {},
|
|
83
|
+
show: {
|
|
84
|
+
transition: {
|
|
85
|
+
staggerChildren: 0.1,
|
|
86
|
+
delayChildren: 0.05,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const itemVariants: Variants = {
|
|
92
|
+
hidden: {
|
|
93
|
+
opacity: 0,
|
|
94
|
+
y: 24,
|
|
95
|
+
},
|
|
96
|
+
show: {
|
|
97
|
+
opacity: 1,
|
|
98
|
+
y: 0,
|
|
99
|
+
transition: {
|
|
100
|
+
duration: 0.45,
|
|
101
|
+
ease: 'easeOut',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ─── Component ────────────────────────────────────────────────────────────────
|
|
107
|
+
export const DDWork: React.FC<DDWorkProps> = ({
|
|
108
|
+
eyebrow,
|
|
109
|
+
headlineMain,
|
|
110
|
+
headlineAccent,
|
|
111
|
+
categories,
|
|
112
|
+
projects,
|
|
113
|
+
sectionId,
|
|
114
|
+
customCSS,
|
|
115
|
+
}) => {
|
|
116
|
+
const categoryItems = (categories ?? []) as CategoryItem[]
|
|
117
|
+
const projectItems = (projects ?? []) as ProjectItem[]
|
|
118
|
+
const allLabel = categoryItems[0]?.label ?? 'All'
|
|
119
|
+
const [activeCategory, setActiveCategory] = useState(allLabel)
|
|
120
|
+
|
|
121
|
+
const filtered =
|
|
122
|
+
activeCategory === allLabel
|
|
123
|
+
? projectItems
|
|
124
|
+
: projectItems.filter((p) => p.category === activeCategory)
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<>
|
|
128
|
+
{customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
|
|
129
|
+
|
|
130
|
+
<div id={sectionId ?? 'work'} className="py-24">
|
|
131
|
+
<div className="mx-auto max-w-6xl lg:max-w-7xl px-6">
|
|
132
|
+
{/* Header */}#BlockName-DDWork
|
|
133
|
+
<motion.div
|
|
134
|
+
variants={containerVariants}
|
|
135
|
+
initial="hidden"
|
|
136
|
+
whileInView="show"
|
|
137
|
+
viewport={{ once: false, amount: 0.2 }}
|
|
138
|
+
className="mb-12 flex flex-col gap-6 overflow-hidden md:flex-row md:items-end md:justify-between px-0 md:px-4"
|
|
139
|
+
>
|
|
140
|
+
<motion.div variants={itemVariants}>
|
|
141
|
+
{eyebrow && (
|
|
142
|
+
<p className="top-caption mb-3 text-sm font-semibold uppercase tracking-widest text-stone-500 dark:text-stone-400">
|
|
143
|
+
{eyebrow}
|
|
144
|
+
</p>
|
|
145
|
+
)}
|
|
146
|
+
|
|
147
|
+
<h2 className="text-4xl font-bold leading-tight text-stone-900 dark:text-stone-50 md:text-5xl">
|
|
148
|
+
{headlineMain}
|
|
149
|
+
{headlineAccent && (
|
|
150
|
+
<>
|
|
151
|
+
<br />
|
|
152
|
+
<span className="text-stone-600 dark:text-stone-400">{headlineAccent}</span>
|
|
153
|
+
</>
|
|
154
|
+
)}
|
|
155
|
+
</h2>
|
|
156
|
+
</motion.div>
|
|
157
|
+
|
|
158
|
+
{/* Filter tabs */}
|
|
159
|
+
{categoryItems.length > 1 && (
|
|
160
|
+
<motion.div variants={itemVariants} className="flex flex-wrap gap-2 py-4">
|
|
161
|
+
{categoryItems.map((cat, i) => {
|
|
162
|
+
const categoryLabel = cat.label ?? ''
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<button
|
|
166
|
+
key={cat.id ?? i}
|
|
167
|
+
onClick={() => setActiveCategory(categoryLabel)}
|
|
168
|
+
className={cn(
|
|
169
|
+
'cursor-pointer whitespace-nowrap rounded-full px-4 py-1.5 text-xs font-medium transition-all duration-300',
|
|
170
|
+
activeCategory === categoryLabel
|
|
171
|
+
? 'border-indigo-500 bg-indigo-800 text-stone-200 shadow-lg shadow-blue-500/20'
|
|
172
|
+
: 'border-stone-300 dark:border-stone-700 bg-stone-50/80 dark:bg-stone-900/80 text-stone-600 dark:text-stone-400 hover:border-stone-400 dark:hover:border-stone-500 hover:bg-stone-100 dark:hover:bg-stone-800 hover:text-stone-900 dark:hover:text-stone-50',
|
|
173
|
+
)}
|
|
174
|
+
>
|
|
175
|
+
{categoryLabel}
|
|
176
|
+
</button>
|
|
177
|
+
)
|
|
178
|
+
})}
|
|
179
|
+
</motion.div>
|
|
180
|
+
)}
|
|
181
|
+
</motion.div>
|
|
182
|
+
|
|
183
|
+
{/* Projects Grid */}
|
|
184
|
+
<motion.div
|
|
185
|
+
variants={containerVariants}
|
|
186
|
+
initial="hidden"
|
|
187
|
+
whileInView="show"
|
|
188
|
+
viewport={{ once: false, amount: 0.1 }}
|
|
189
|
+
className="grid grid-cols-1 gap-5 py-4 md:grid-cols-2 lg:grid-cols-3"
|
|
190
|
+
>
|
|
191
|
+
{filtered.map((project, i) => {
|
|
192
|
+
const projectTitle = project.title ?? ''
|
|
193
|
+
const projectDescription = project.description ?? ''
|
|
194
|
+
const projectCategory = project.category ?? ''
|
|
195
|
+
const projectYear = project.year ?? ''
|
|
196
|
+
const projectHighlight = project.highlight ?? ''
|
|
197
|
+
const projectLink = project.link ?? ''
|
|
198
|
+
const imgSrc =
|
|
199
|
+
project.image && typeof project.image === 'object'
|
|
200
|
+
? ((project.image as Media).url ?? project.imageFallbackUrl ?? undefined)
|
|
201
|
+
: (project.imageFallbackUrl ?? undefined)
|
|
202
|
+
const safeImgSrc = isLocalImageSrc(imgSrc) ? imgSrc : null
|
|
203
|
+
|
|
204
|
+
const CardInner = (
|
|
205
|
+
<SpotlightCard
|
|
206
|
+
spotlightColor="rgba(214,211,209,0.08)"
|
|
207
|
+
className="group h-full overflow-hidden rounded-3xl border border-stone-200 dark:border-stone-800 bg-stone-50 dark:bg-stone-900 shadow-md outline-none transition-colors duration-300 hover:border-indigo-500 hover:shadow-2xl hover:outline-4 hover:outline-stone-200/10 dark:hover:outline-stone-200/10"
|
|
208
|
+
style={{ cornerShape: 'squircle' } as React.CSSProperties}
|
|
209
|
+
>
|
|
210
|
+
{/* Image */}
|
|
211
|
+
<div className="relative h-52 w-full overflow-hidden rounded-t-2xl">
|
|
212
|
+
{safeImgSrc ? (
|
|
213
|
+
<Image
|
|
214
|
+
src={safeImgSrc}
|
|
215
|
+
alt={projectTitle}
|
|
216
|
+
fill
|
|
217
|
+
className="studio-card-image corner-squircle scale-105 rounded-[2.5rem] object-cover object-top transition-transform duration-500 group-hover:scale-110"
|
|
218
|
+
sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
|
219
|
+
priority={false}
|
|
220
|
+
style={{ cornerShape: 'squircle' } as React.CSSProperties}
|
|
221
|
+
/>
|
|
222
|
+
) : (
|
|
223
|
+
<div className="h-full w-full bg-stone-200 dark:bg-stone-800" />
|
|
224
|
+
)}
|
|
225
|
+
|
|
226
|
+
<div className="absolute inset-0 bg-linear-to-t from-black/60 via-black/20 to-transparent dark:from-stone-950/80 dark:via-stone-950/20 dark:to-transparent" />
|
|
227
|
+
|
|
228
|
+
{projectCategory && (
|
|
229
|
+
<span className="absolute top-2 left-2 z-20 border bg-lime-500/50 border-lime-500 text-stone-50 text-xs font-semibold px-2.5 py-1 rounded-full">
|
|
230
|
+
{projectCategory}
|
|
231
|
+
</span>
|
|
232
|
+
)}
|
|
233
|
+
|
|
234
|
+
{projectYear && (
|
|
235
|
+
<span className="absolute top-2 right-2 z-20 border bg-stone-900/70 border-stone-700 text-stone-300 text-xs font-mono px-2.5 py-1 rounded-full">
|
|
236
|
+
{projectYear}
|
|
237
|
+
</span>
|
|
238
|
+
)}
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
{/* Content */}
|
|
242
|
+
<div className="card-content relative z-5 mx-2 mb-2 -mt-6 rounded-2xl bg-stone-50/90 dark:bg-stone-950/50 p-4 backdrop-blur-md drop-shadow-md transition-all duration-300 group-hover:-translate-y-1 group-hover:brightness-110 group-hover:shadow-2xl hover:duration-300 corner-squircle">
|
|
243
|
+
<div className="mb-4 flex items-start justify-between gap-4">
|
|
244
|
+
<div>
|
|
245
|
+
<h3 className="mb-2 text-lg font-bold text-stone-900 dark:text-stone-50">
|
|
246
|
+
{projectTitle}
|
|
247
|
+
</h3>
|
|
248
|
+
|
|
249
|
+
{projectDescription && (
|
|
250
|
+
<p className="text-md mb-5 leading-relaxed text-stone-800 dark:text-stone-400">
|
|
251
|
+
{projectDescription}
|
|
252
|
+
</p>
|
|
253
|
+
)}
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
{projectLink && (
|
|
257
|
+
<ExternalLink className="mt-1 h-4 w-4 shrink-0 text-stone-400 dark:text-stone-400 transition-colors duration-300 group-hover:text-indigo-800" />
|
|
258
|
+
)}
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
{/* Highlight */}
|
|
262
|
+
{projectHighlight && (
|
|
263
|
+
<div className="mb-4 flex items-center gap-2 rounded-lg border border-stone-200 dark:border-stone-800 bg-stone-100/60 group-hover:bg-stone-300 group-hover:shadow-xl dark:bg-stone-800/60 p-2.5">
|
|
264
|
+
<BarChart2
|
|
265
|
+
size={14}
|
|
266
|
+
className="shrink-0 text-indigo-800 dark:text-indigo-400"
|
|
267
|
+
/>
|
|
268
|
+
<span className="text-xs font-medium text-indigo-800 dark:text-indigo-400">
|
|
269
|
+
{projectHighlight}
|
|
270
|
+
</span>
|
|
271
|
+
</div>
|
|
272
|
+
)}
|
|
273
|
+
|
|
274
|
+
{/* Tags */}
|
|
275
|
+
{project.tags && project.tags.length > 0 && (
|
|
276
|
+
<div className="flex flex-wrap gap-1.5">
|
|
277
|
+
{project.tags.map((t, ti) => (
|
|
278
|
+
<span
|
|
279
|
+
key={t.id ?? ti}
|
|
280
|
+
className="rounded-full border border-stone-200 dark:border-indigo-700 bg-stone-100 dark:bg-indigo-900/50 px-2 py-0.5 text-[11.5px] text-stone-700 dark:text-stone-300 transition-all duration-300"
|
|
281
|
+
>
|
|
282
|
+
{t.tag}
|
|
283
|
+
</span>
|
|
284
|
+
))}
|
|
285
|
+
</div>
|
|
286
|
+
)}
|
|
287
|
+
</div>
|
|
288
|
+
</SpotlightCard>
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<motion.div key={project.id ?? i} variants={itemVariants} className="h-full">
|
|
293
|
+
{projectLink ? (
|
|
294
|
+
<a
|
|
295
|
+
href={projectLink}
|
|
296
|
+
target="_blank"
|
|
297
|
+
rel="noopener noreferrer"
|
|
298
|
+
className="block h-full"
|
|
299
|
+
>
|
|
300
|
+
{CardInner}
|
|
301
|
+
</a>
|
|
302
|
+
) : (
|
|
303
|
+
CardInner
|
|
304
|
+
)}
|
|
305
|
+
</motion.div>
|
|
306
|
+
)
|
|
307
|
+
})}
|
|
308
|
+
</motion.div>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</>
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export default DDWork
|