Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions src/components/Carousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ const Carousel = () => {
}}`}
>
<div
className={`relative mx-auto overflow-hidden hardcodedForceBlack carousel w-full ${
window.innerWidth < 500
? "h-48 rounded-none"
: "h-[20rem] md:h-[20rem] rounded-2xl"
}`}
className={`relative mx-auto overflow-hidden hardcodedForceBlack carousel w-full ${window.innerWidth < 500
? "h-48 rounded-none"
: "h-[20rem] md:h-[20rem] rounded-2xl"
}`}
style={{
transformStyle: "preserve-3d",
transformOrigin: "center left",
Expand All @@ -71,25 +70,33 @@ const Carousel = () => {
if (pos === 0) style = "z-20 scale-100 opacity-100 translate-x-0";
else style = "z-0 scale-100 opacity-0 translate-x-0";
} else {
if (pos === 0) style = "z-20 scale-100 opacity-100 translate-x-0";
else if (pos === 1)
if (pos === 0) {
style = "z-20 scale-100 opacity-100 translate-x-0";
} else if (pos === 1) {
style = "z-10 scale-90 opacity-85 translate-x-16";
else style = "z-10 scale-90 opacity-85 -translate-x-16";
} else if (pos === n - 1) {
style = "z-10 scale-90 opacity-85 -translate-x-16";
} else {
style = "z-0 scale-90 opacity-0 translate-x-32";
}
}

return (
<img
<div
key={src}
src={src}
alt={title}
className={`ring-glow${
pos !== 0 ? "-priorityLow" : ""
} transition-all duration-500 ease-out ${
window.innerWidth < 500
? "absolute inset-0 m-auto h-full w-full object-contain"
: "absolute inset-0 m-auto h-full w-full object-contain"
} ${style}`}
/>
className={`hardcodedForceBlack
${pos === 0 ? "ring-glow" : ""}
${pos === 1 || pos === n - 1 ? "ring-glow" : ""}
transition-all duration-500 ease-out absolute inset-0 m-auto h-full w-full
${style}
`}
>
<img
src={src}
alt={title}
className="h-full w-full object-contain"
/>
</div>
);
})}

Expand All @@ -112,9 +119,8 @@ const Carousel = () => {
{images.map((_, i) => (
<span
key={i}
className={`h-1.5 w-1.5 rounded-full transition-colors ${
i === currentIndex ? "bg-white" : "bg-white/40"
}`}
className={`h-1.5 w-1.5 rounded-full transition-colors ${i === currentIndex ? "bg-white" : "bg-white/40"
}`}
/>
))}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,5 @@ body.modal-open {

.hardcodedForceBlack {
background-color: black !important;
border-radius: 28px !important;
}
Loading