@@ -15,17 +15,33 @@ import {
15
15
import Lenis from "lenis" ;
16
16
import { CodeButton } from "@/components/ui/code-button" ;
17
17
import { TinaMarkdown , TinaMarkdownContent } from "tinacms/dist/rich-text" ;
18
+ import { Icon } from "../../icon" ;
18
19
19
20
function InformationBlock ( {
20
21
title,
21
22
description,
23
+ icon,
22
24
} : {
23
25
title : string ;
24
26
description : TinaMarkdownContent ;
27
+ icon ?: string ;
25
28
} ) {
26
29
return (
27
30
< div className = "max-w-md flex flex-col gap-4 border border-white/20 rounded-md p-4 bg-[#191918]/60 shadow-lg text-left 2xl:w-lg w-sm" >
28
- < h2 className = "text-2xl font-semibold" > { title } </ h2 >
31
+ < div className = "flex items-center gap-2" >
32
+ { icon && (
33
+ < Icon
34
+ data = { {
35
+ name : icon ,
36
+ color : "primary" ,
37
+ size : "small" ,
38
+ style : "regular" ,
39
+ } }
40
+ />
41
+ ) }
42
+ < h2 className = "text-2xl font-semibold" > { title } </ h2 >
43
+ </ div >
44
+
29
45
< TinaMarkdown content = { description } />
30
46
</ div >
31
47
) ;
@@ -38,6 +54,10 @@ export default function Hero({ data }: { data?: PageBlocksHero }) {
38
54
offset : [ "start start" , "end end" ] ,
39
55
} ) ;
40
56
57
+ useMotionValueEvent ( scrollYProgress , "change" , ( latest ) => {
58
+ console . log ( "ScrollYProgress: " , latest ) ;
59
+ } ) ;
60
+
41
61
const [ screenHeight , setScreenHeight ] = useState ( 0 ) ;
42
62
const [ screenWidth , setScreenWidth ] = useState ( 0 ) ;
43
63
@@ -185,14 +205,17 @@ export default function Hero({ data }: { data?: PageBlocksHero }) {
185
205
< InformationBlock
186
206
title = { data ?. informationBlock1 ?. title || "Undefined Title" }
187
207
description = { data ?. informationBlock1 ?. desc }
208
+ icon = { data ?. informationBlock1 ?. icon || undefined }
188
209
/>
189
210
< InformationBlock
190
211
title = { data ?. informationBlock2 ?. title || "Undefined Title" }
191
212
description = { data ?. informationBlock2 ?. desc }
213
+ icon = { data ?. informationBlock2 ?. icon || undefined }
192
214
/>
193
215
< InformationBlock
194
216
title = { data ?. informationBlock3 ?. title || "Undefined Title" }
195
217
description = { data ?. informationBlock3 ?. desc }
218
+ icon = { data ?. informationBlock3 ?. icon || undefined }
196
219
/>
197
220
</ motion . div >
198
221
@@ -210,14 +233,17 @@ export default function Hero({ data }: { data?: PageBlocksHero }) {
210
233
/>
211
234
</ motion . div >
212
235
</ div >
213
- < div className = "block lg:hidden pt-16" >
214
- < Image
215
- src = { data . media }
216
- alt = { data . title || "" }
217
- width = { 1000 }
218
- height = { 1000 }
219
- className = "border-10 border-[#F6F6F513] rounded-lg shadow-xl"
220
- />
236
+
237
+ < div className = "block lg:hidden pt-16 px-10 min-h-[30vh] md:min-h-[50vh] overflow-hidden p-10" >
238
+ < div className = "absolute left-1/2 -translate-x-1/2 bg-[#252934] rounded-lg border-[0.5px] border-sand-6 shadow-xl p-2 w-[calc(100%-2rem)] max-w-2xl" >
239
+ < Image
240
+ src = { data . media }
241
+ alt = { data . title || "" }
242
+ width = { 1000 }
243
+ height = { 1000 }
244
+ className = " border-[#F6F6F513] rounded-lg shadow-xl "
245
+ />
246
+ </ div >
221
247
</ div >
222
248
</ >
223
249
) }
0 commit comments