Skip to content

Commit 8cfdd55

Browse files
committed
refactor(carousel): improvements to carousel animations and usability
1 parent 7f1bd06 commit 8cfdd55

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

components/features/ScholarshipCarousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function ScholarshipCarousel({ scholarships }: ScholarshipCarouselProps)
3737

3838
return (
3939
<div
40-
className={`bg-white/85 backdrop-blur-md border border-white/70 rounded-[1.4rem] p-4 transition-all duration-300 ${
40+
className={`glass rounded-[1.4rem] p-4 transition-all duration-300 ${
4141
isActive
4242
? "shadow-[0_20px_35px_-28px_rgba(15,23,42,0.55)] ring-1 ring-primary/10"
4343
: "shadow-[0_14px_30px_-28px_rgba(15,23,42,0.45)]"

components/ui/MobilePeekDeck.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ export function MobilePeekDeck<T>({
127127
slideRefs.current[index] = node;
128128
}}
129129
className={cn(
130-
"snap-start shrink-0 w-[min(22rem,calc(100%-3.75rem))] scroll-ml-6 pb-4 md:scroll-ml-0 md:pb-0",
130+
"snap-start snap-always shrink-0 w-[min(22rem,calc(100%-3.75rem))] scroll-ml-6 pb-4 md:scroll-ml-0 md:pb-0 transform-gpu transition duration-60 ease-out will-change-transform",
131+
index === normalizedActiveIndex ? "scale-100 opacity-100" : "scale-[0.995] opacity-98",
131132
slideClassName
132133
)}
133134
>
@@ -143,7 +144,7 @@ export function MobilePeekDeck<T>({
143144
key={index}
144145
type="button"
145146
className={cn(
146-
"h-2 rounded-full transition-all duration-300",
147+
"h-2 rounded-full transition-all duration-60 ease-out",
147148
normalizedActiveIndex === index ? "w-5 bg-primary" : "w-2 bg-primary/30"
148149
)}
149150
aria-label={getIndicatorAriaLabel?.(index + 1) ?? `Go to card ${index + 1}`}

0 commit comments

Comments
 (0)