File tree Expand file tree Collapse file tree 7 files changed +58
-16
lines changed
app/[locale]/10years/_components
public/images/10-year-anniversary Expand file tree Collapse file tree 7 files changed +58
-16
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const AdoptionSwiper = ({
24
24
return (
25
25
< div className = "flex flex-1 flex-col gap-6 md:hidden" >
26
26
< SwiperContainer className = "mx-auto w-full max-w-[550px]" >
27
- < Swiper >
27
+ < Swiper spaceBetween = { 32 } >
28
28
{ adoptionCards . map ( ( card , index ) => (
29
29
< SwiperSlide key = { card . title } >
30
30
< div
Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ export default function InnovationSwiper() {
14
14
return (
15
15
< div className = "w-[100%]" >
16
16
< SwiperContainer className = "mx-auto w-full max-w-[550px] xl:max-w-[700px]" >
17
- < Swiper className = "mx-auto w-full max-w-[550px] xl:max-w-[700px]" >
17
+ < Swiper
18
+ className = "mx-auto w-full max-w-[550px] xl:max-w-[700px]"
19
+ spaceBetween = { 32 }
20
+ >
18
21
{ innovationCards . map ( ( card , index ) => (
19
22
< SwiperSlide
20
23
key = { index }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const TenYearGlobe = ({ events }: { events: EventData[] }) => {
48
48
const atmosphereColor = resolvedTheme === "dark" ? "#B38DF0" : "#945AF4"
49
49
50
50
const width = useBreakpointValue ( {
51
- base : 260 ,
51
+ base : window ?. innerWidth - 64 || 260 , // Full width on mobile with padding
52
52
sm : 400 ,
53
53
md : 500 ,
54
54
lg : 600 ,
@@ -237,8 +237,8 @@ const TenYearGlobe = ({ events }: { events: EventData[] }) => {
237
237
return (
238
238
< div
239
239
ref = { globeContainerRef }
240
- className = "relative cursor-grab active:cursor-grabbing"
241
- style = { { width : width , height : width } }
240
+ className = "relative w-full max-w-full cursor-grab active:cursor-grabbing"
241
+ style = { { height : width } }
242
242
>
243
243
{ MemoizedGlobe }
244
244
{ hoveredEvent && tooltipPos && (
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ const TenYearHomeBanner = () => {
15
15
< ParallaxImage
16
16
src = { TenYearGraphicImage }
17
17
alt = ""
18
- className = "mx-auto -mb-2 -mt-16 max-w-[500px] object-contain sm:-mt-24 md:-mt-32"
18
+ className = "mx-auto -mb-2 -mt-16 max-w-[min(100%, 500px) ] object-contain sm:-mt-24 md:-mt-32"
19
19
/>
20
- < div className = "flex justify-center" >
20
+ < div className = "mt-4 flex justify-center" >
21
21
< TenYearDesktopText className = "mb-4 hidden object-contain text-body md:block" />
22
- < TenYearMobileText className = "mb-4 block object-contain text-body md:hidden" />
22
+ < TenYearMobileText className = "mb-4 block object-contain text-5xl text- body md:hidden" />
23
23
</ div >
24
24
< div className = "mb-4 flex flex-col gap-2" >
25
25
< p >
Original file line number Diff line number Diff line change 189
189
}
190
190
]
191
191
},
192
- "central & south ameirca " : {
193
- "label" : " Central & South Ameirca " ,
192
+ "central & south america " : {
193
+ "label" : " Central & South America " ,
194
194
"events" : [
195
195
{
196
196
"host" : " Nodo Serrano" ,
201
201
"city" : " Tandil" ,
202
202
"country" : " Argentina" ,
203
203
"region" : " Central & South America" ,
204
- "continent" : " Central & South Ameirca " ,
204
+ "continent" : " Central & South America " ,
205
205
"lat" : " -37.3288" ,
206
206
"lng" : " -59.1367" ,
207
207
"readyToShow" : " TRUE" ,
216
216
"city" : " Monterrey" ,
217
217
"country" : " Mexico" ,
218
218
"region" : " Central & South America" ,
219
- "continent" : " Central & South Ameirca " ,
219
+ "continent" : " Central & South America " ,
220
220
"lat" : " 25.6866" ,
221
221
"lng" : " -100.3161" ,
222
222
"readyToShow" : " TRUE" ,
231
231
"city" : " Cochabamba" ,
232
232
"country" : " Bolivia" ,
233
233
"region" : " Central & South America" ,
234
- "continent" : " Central & South Ameirca " ,
234
+ "continent" : " Central & South America " ,
235
235
"lat" : " -17.382" ,
236
236
"lng" : " -66.1596" ,
237
237
"readyToShow" : " TRUE" ,
246
246
"city" : " Florianópolis" ,
247
247
"country" : " Brazil" ,
248
248
"region" : " Central & South America" ,
249
- "continent" : " Central & South Ameirca " ,
249
+ "continent" : " Central & South America " ,
250
250
"lat" : " -27.5969" ,
251
251
"lng" : " -48.5468" ,
252
252
"readyToShow" : " TRUE" ,
389
389
}
390
390
]
391
391
}
392
- }
392
+ }
Original file line number Diff line number Diff line change
1
+ "use client"
2
+
3
+ import { type RefObject , useEffect , useState } from "react"
4
+
5
+ import { useEventListener } from "./useEventListener"
6
+
7
+ export const useRefWidth = (
8
+ ref : RefObject < HTMLElement > ,
9
+ padding : number = 0
10
+ ) : number => {
11
+ const [ width , setWidth ] = useState ( 0 )
12
+
13
+ const updateWidth = ( ) => {
14
+ if ( ref . current ) {
15
+ const rect = ref . current . getBoundingClientRect ( )
16
+ setWidth ( Math . max ( 0 , rect . width - padding ) )
17
+ }
18
+ }
19
+
20
+ // Use the internal useEventListener for window resize
21
+ useEventListener ( "resize" , updateWidth )
22
+
23
+ useEffect ( ( ) => {
24
+ // Initial measurement
25
+ updateWidth ( )
26
+
27
+ // Create ResizeObserver for more accurate monitoring
28
+ const resizeObserver = new ResizeObserver ( updateWidth )
29
+ if ( ref . current ) {
30
+ resizeObserver . observe ( ref . current )
31
+ }
32
+
33
+ return ( ) => {
34
+ resizeObserver . disconnect ( )
35
+ }
36
+ } , [ ref , padding ] )
37
+
38
+ return width
39
+ }
You can’t perform that action at this time.
0 commit comments