@@ -99,26 +99,21 @@ export function SwipeCardSection({ content }: SwipeCardSectionProps) {
9999 </ p >
100100 </ motion . div >
101101
102- < motion . div className = "relative w-full" variants = { carouselVariants } >
103- < div className = "relative flex items-center justify-center gap-4 px-2 md:gap-8 md:px-16" >
104- < Button
105- onClick = { handlePrevious }
106- variant = "filled"
107- className = "absolute left-0 z-20 shrink-0 size-12! rounded-full! p-0!"
108- aria-label = "Previous card"
109- >
110- < IconChevronLeft className = "size-6 mr-0.5" />
111- </ Button >
102+ < motion . div className = "relative w-full overflow-hidden" variants = { carouselVariants } >
103+ < div aria-hidden = "true" className = "pointer-events-none absolute -inset-y-6 left-0 z-30 w-0 bg-linear-to-r from-primary via-primary/80 to-transparent lg:w-40" />
104+ < div aria-hidden = "true" className = "pointer-events-none absolute -inset-y-6 right-0 z-30 w-0 bg-linear-to-l from-primary via-primary/80 to-transparent lg:w-40" />
105+
106+ < div className = "relative flex items-center justify-center gap-4 px-2 md:gap-8" >
112107
113108 < motion . div
114- className = "relative flex w-full items-center justify-center px-0 md:px-2 touch-pan-y"
109+ className = "relative flex w-full items-center justify-center px-0 touch-pan-y"
115110 drag = "x"
116111 dragConstraints = { { left : 0 , right : 0 } }
117112 dragElastic = { 0.08 }
118113 onDragEnd = { handleDragEnd }
119114 >
120115 < div className = "relative flex w-full items-stretch justify-center" >
121- < div className = "w -full max-w-full md: max-w-md opacity-0 pointer-events-none" >
116+ < div className = "h -full w-[64vw] max-w-4xl opacity-0 pointer-events-none" >
122117 < EditionUseCaseCard
123118 title = { cards [ focusedIndex ] ?. title ?? "" }
124119 description = { cards [ focusedIndex ] ?. description ?? "" }
@@ -136,13 +131,13 @@ export function SwipeCardSection({ content }: SwipeCardSectionProps) {
136131 < div
137132 key = { card . id || index }
138133 className = { cn (
139- "absolute top-0 w-full transition-all duration-500 ease-out" ,
140- "max-w-full md: max-w-md " ,
134+ "absolute inset-y-0 h-full w-full transition-all duration-500 ease-out" ,
135+ "left-1/2 w-[64vw] max-w-4xl " ,
141136 ! isVisibleMobile && "lg:opacity-100 lg:pointer-events-auto opacity-0 pointer-events-none" ,
142137 ! isVisibleDesktop && "lg:opacity-0 lg:pointer-events-none" ,
143138 ) }
144139 style = { {
145- transform : `translateX(${ offset * 110 } % )` ,
140+ transform : `translateX(calc(-50% + ${ offset * 104 } %) )` ,
146141 } }
147142 >
148143 < EditionUseCaseCard
@@ -157,17 +152,28 @@ export function SwipeCardSection({ content }: SwipeCardSectionProps) {
157152 } ) }
158153 </ div >
159154 </ motion . div >
160-
161- < Button
162- onClick = { handleNext }
163- variant = "filled"
164- className = "absolute right-0 z-20 shrink-0 size-12! rounded-full! p-0!"
165- aria-label = "Next card"
166- >
167- < IconChevronRight className = "size-6 ml-0.5" />
168- </ Button >
169155 </ div >
170156 </ motion . div >
157+
158+ < motion . div className = "z-30 flex items-center justify-center gap-4" variants = { staggerItem } >
159+ < Button
160+ onClick = { handlePrevious }
161+ variant = "filled"
162+ className = "shrink-0 size-12! rounded-full! p-0!"
163+ aria-label = "Previous card"
164+ >
165+ < IconChevronLeft className = "size-6 mr-0.5" />
166+ </ Button >
167+
168+ < Button
169+ onClick = { handleNext }
170+ variant = "filled"
171+ className = "shrink-0 size-12! rounded-full! p-0!"
172+ aria-label = "Next card"
173+ >
174+ < IconChevronRight className = "size-6 ml-0.5" />
175+ </ Button >
176+ </ motion . div >
171177 </ motion . div >
172178 </ Section >
173179 )
0 commit comments