-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Sponsor Styling #154
base: main
Are you sure you want to change the base?
Changes from 3 commits
d1be77e
f59d243
6f29fb7
de0ad61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,72 @@ | ||
@use "zothacks-theme" as theme; | ||
@use "bootstrap-utils" as utils; | ||
|
||
.container { | ||
padding-top: 6rem; | ||
padding-bottom: 6rem; | ||
} | ||
// .container { | ||
// padding-top: 6rem; | ||
// padding-bottom: 6rem; | ||
// } | ||
|
||
.title { | ||
text-align: center; | ||
} | ||
color: theme.$white; | ||
font-size: 2rem; | ||
font-weight: bold; | ||
margin-bottom: 3rem; | ||
|
||
.clipboard { | ||
position: relative; | ||
padding: 64px 32px 48px 32px; | ||
min-height: 512px; | ||
width: 80%; | ||
margin: 0 auto; | ||
border: 20px solid #aa703c; | ||
border-radius: 100px; | ||
background: #ffffff; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
|
||
@include utils.media-breakpoint-up(sm) { | ||
padding: 32px 32px 48px 32px; | ||
@include utils.media-breakpoint-up(md) { | ||
font-size: 3rem; | ||
} | ||
} | ||
|
||
.clip { | ||
height: 192px; | ||
position: absolute; | ||
left: 50%; | ||
transform: translateX(-50%) rotate(90deg); | ||
top: -105px; | ||
|
||
@include utils.media-breakpoint-up(sm) { | ||
height: 256px; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
left: -85px; | ||
} | ||
.logos { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
gap: 1.5rem; | ||
max-width: 1200px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: rather than manually constraining the inner elements, we can use Bootstrap's native container sizing (unfortunately not done last year) by changing the main |
||
margin: 0 auto; | ||
} | ||
|
||
.logos { | ||
flex-grow: 1; | ||
display: grid; | ||
.logo { | ||
width: calc(50% - 1.5rem); | ||
aspect-ratio: 16 / 9; | ||
background-color: theme.$white; | ||
border-radius: 8px; | ||
display: flex; | ||
align-items: center; | ||
align-content: center; | ||
justify-content: center; | ||
grid-template-columns: repeat(auto-fill, 192px); | ||
gap: 32px; | ||
transition: transform 0.3s ease; | ||
|
||
&:hover { | ||
transform: scale(1.05); | ||
} | ||
|
||
@include utils.media-breakpoint-up(sm) { | ||
padding-left: 24px; | ||
grid-template-columns: repeat(auto-fill, 256px); | ||
width: calc(33.333% - 1.5rem); | ||
} | ||
|
||
@include utils.media-breakpoint-up(md) { | ||
grid-template-columns: repeat(auto-fill, 384px); | ||
padding-left: 48px; | ||
@include utils.media-breakpoint-up(lg) { | ||
width: calc(25% - 1.5rem); | ||
} | ||
|
||
img { | ||
max-width: 80%; | ||
max-height: 80%; | ||
object-fit: contain; | ||
} | ||
} | ||
|
||
.logo { | ||
.placeholderLogo { | ||
width: 100%; | ||
height: 100%; | ||
font-weight: bold; | ||
color: theme.$black; | ||
text-align: center; | ||
padding: 0.5rem; | ||
font-size: 0.8rem; | ||
|
||
@include utils.media-breakpoint-up(md) { | ||
font-size: 1rem; | ||
padding: 1rem; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,31 +3,58 @@ import { getSponsors } from "./getSponsors"; | |
import styles from "./Sponsors.module.scss"; | ||
import { client } from "@/lib/sanity/client"; | ||
import imageUrlBuilder from "@sanity/image-url"; | ||
import clip from "./clip.svg"; | ||
import { Container } from "react-bootstrap"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chore: I forget if Next.js handles this well, but to be safe, we'll want to import just the individual component, i.e.
|
||
|
||
const builder = imageUrlBuilder(client); | ||
|
||
const Sponsors = async () => { | ||
const sponsors = await getSponsors(); | ||
|
||
// placeholder sponsors (replace this section) | ||
const fakeSponsorNames = [ | ||
"Ryan Yang", | ||
"Ryan Yang", | ||
"Ryan Yang", | ||
"Ryan Yang", | ||
"Ryan Yang", | ||
]; | ||
const fakeSponsorLogos = fakeSponsorNames.map((name, index) => ({ | ||
_key: `fake-sponsor-${index}`, | ||
name, | ||
url: "#", | ||
logo: { | ||
asset: { | ||
_ref: "image-placeholder", | ||
}, | ||
}, | ||
})); | ||
|
||
const allSponsors = [...sponsors.sponsors, ...fakeSponsorLogos]; | ||
|
||
return ( | ||
<section className={styles.container}> | ||
<div className={styles.clipboard}> | ||
<img className={styles.clip} src={clip.src} alt="" /> | ||
<h2 className={styles.title}>Sponsors</h2> | ||
<div className={styles.logos}> | ||
{sponsors.sponsors.map(({ _key, name, url, logo }) => ( | ||
<a key={_key} href={url} target="_blank" rel="noopener noreferrer"> | ||
<Container as="section"> | ||
<h2 className={styles.title}>SPONSORS</h2> | ||
<div className={styles.logos}> | ||
{allSponsors.map(({ _key, name, url, logo }) => ( | ||
<a | ||
key={_key} | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className={styles.logo} | ||
> | ||
{logo.asset._ref === "image-placeholder" ? ( | ||
<div className={styles.placeholderLogo}>{name}</div> | ||
) : ( | ||
<img | ||
className={styles.logo} | ||
src={builder.image(logo).format("webp").url()} | ||
alt={name + " logo"} | ||
/> | ||
</a> | ||
))} | ||
</div> | ||
)} | ||
</a> | ||
))} | ||
</div> | ||
</section> | ||
</Container> | ||
); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chore: little value in keeping around old commented code, better to just remove it