Skip to content

Commit 1d30e43

Browse files
authored
Fix sponsor image to fit within container; partial circle shape imple… (#171)
1 parent fb85e4b commit 1d30e43

File tree

1 file changed

+38
-15
lines changed

1 file changed

+38
-15
lines changed

src/components/LandingPage/ThanksSponsors.tsx

+38-15
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const rightSponsorSvgSmall = "/svgs/judgingCriteria/rightSponsorSvgSmall.svg";
99

1010
export default async function ThankSponsors() {
1111
const IMAGE_CLASS =
12-
"relative size-12 min-w-12 overflow-hidden rounded-full duration-300 group-hover:-translate-y-1 group-hover:shadow-2xl group-hover:transition-transform sm:size-28 sm:min-w-28";
12+
"relative duration-300 group-hover:-translate-y-1 group-hover:shadow-2xl group-hover:transition-transform ";
1313

1414
const sponsors = await fetchContent("hackathonSponsor");
1515
const sortedSponsors = sponsors.sort(
@@ -19,7 +19,7 @@ export default async function ThankSponsors() {
1919
return (
2020
<div className="relative flex flex-col items-center justify-center overflow-hidden pb-12 pt-10">
2121
<div className="flex h-48 w-full justify-center">
22-
<div className="absolute -left-12 top-24 z-20 size-44 sm:hidden">
22+
<div className="absolute -left-12 top-24 z-20 size-44 sm:hidden">
2323
<Image
2424
src={leftSponsorSvgSmall}
2525
alt="squiggly lines"
@@ -64,27 +64,50 @@ export default async function ThankSponsors() {
6464

6565
<div className="flex w-full flex-row justify-around px-8 pt-10">
6666
{sortedSponsors.map((sponsor, index) => (
67-
<div className="flex flex-row gap-2 sm:gap-3" key={index}>
67+
<div className="flex flex-row gap-2 sm:gap-3" key={index}>
6868
<div className="group flex flex-col items-center gap-3">
69-
<div className={IMAGE_CLASS}>
69+
<div
70+
className={IMAGE_CLASS}
71+
style={{
72+
maxWidth: "300px",
73+
width: "95%",
74+
height: "100%",
75+
padding: "5px",
76+
borderRadius: "20px",
77+
overflow: "hidden",
78+
display: "flex",
79+
justifyContent: "center",
80+
alignItems: "center",
81+
}}
82+
>
7083
<a
7184
href={sponsor.fields.sponsorPage}
7285
target="_blank"
7386
rel="noopener noreferrer"
7487
>
75-
<Image
76-
src={
77-
sponsor.fields.sponsorImg.fields.file?.url
78-
?.toString()
79-
.replace("//", "https://") ?? ""
80-
}
81-
alt="Sponsor Image"
82-
style={{ objectFit: "contain" }}
83-
fill
84-
/>
88+
<div
89+
style={{
90+
width: "100%",
91+
height: "100%",
92+
borderRadius: "inherit",
93+
}}
94+
>
95+
<Image
96+
src={
97+
sponsor.fields.sponsorImg.fields.file?.url
98+
?.toString()
99+
.replace("//", "https://") ?? ""
100+
}
101+
alt="Sponsor Image"
102+
layout="intrinsic"
103+
objectFit="contain"
104+
width={150}
105+
height={150}
106+
/>
107+
</div>
85108
</a>
86109
</div>
87-
<p className="inset-0 text-center opacity-0 transition-all duration-300 group-hover:opacity-100">
110+
<p className="text-center opacity-0 transition-all duration-300 group-hover:opacity-100">
88111
{sponsor.fields.sponsorName}
89112
</p>
90113
</div>

0 commit comments

Comments
 (0)