|
1 | | -import { HeartIcon } from "lucide-react"; |
2 | | -import Link from "next/link"; |
| 1 | +import { ArrowUpRightIcon } from "lucide-react"; |
3 | 2 | import { FEATURED_SPONSORS } from "@/shared/data/sponsors"; |
4 | 3 | import { cn } from "@/shared/lib/utils"; |
5 | 4 | import { CarbonAdCard } from "@/shared/ui/carbon-ad-card"; |
6 | 5 |
|
| 6 | +const SQUARE_LOGO_SPONSORS = new Set(["SSD Nodes"]); |
| 7 | + |
7 | 8 | export function SponsorsSection() { |
8 | 9 | return ( |
9 | | - <section className="bg-transparent py-14 sm:py-18 lg:py-20"> |
| 10 | + <section className="bg-stone-50/70 py-10 dark:bg-zinc-900/35 lg:py-12"> |
10 | 11 | <div className="site-container"> |
11 | | - <div className="grid gap-10 border-t border-stone-300/60 pt-10 dark:border-white/10 lg:grid-cols-[minmax(0,21rem)_minmax(0,1fr)] lg:gap-14 lg:pt-14"> |
12 | | - <div className="lg:sticky lg:top-24 lg:self-start"> |
13 | | - <div className="mb-4 inline-flex items-center gap-3 text-sm font-medium text-stone-600 dark:text-stone-300"> |
14 | | - <span className="inline-flex h-5 w-5 items-center justify-center text-stone-700 dark:text-stone-200"> |
15 | | - <HeartIcon className="h-4 w-4" /> |
16 | | - </span> |
17 | | - <span className="tracking-[0.18em] uppercase text-stone-500 dark:text-stone-400">Community</span> |
18 | | - </div> |
19 | | - <h2 className="max-w-[12ch] text-balance font-serif text-3xl font-semibold tracking-[-0.03em] text-stone-950 dark:text-stone-100 sm:text-4xl lg:text-[3.15rem]"> |
20 | | - Supported by people who want Memos to last. |
| 12 | + <div className="grid gap-7 lg:grid-cols-[minmax(0,17rem)_minmax(0,1fr)] lg:items-center lg:gap-10"> |
| 13 | + <div> |
| 14 | + <p className="text-xs font-semibold tracking-[0.18em] text-brand-700 uppercase dark:text-brand-300">Sponsors</p> |
| 15 | + <h2 className="mt-4 max-w-[14ch] text-balance font-serif text-3xl font-semibold tracking-tight text-zinc-950 dark:text-zinc-100 sm:text-4xl"> |
| 16 | + These teams support Memos. |
21 | 17 | </h2> |
22 | | - <p className="mt-4 max-w-md text-balance text-base leading-7 text-stone-600 dark:text-stone-300 sm:text-lg"> |
23 | | - A small group of sponsors helps keep the project shipping, documented, and available to everyone. |
24 | | - </p> |
| 18 | + <a |
| 19 | + href="https://github.com/sponsors/usememos" |
| 20 | + target="_blank" |
| 21 | + rel="noopener noreferrer" |
| 22 | + className="group mt-4 inline-flex items-center gap-2 text-sm font-semibold text-zinc-950 transition-colors hover:text-brand-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-4 focus-visible:ring-offset-stone-50 dark:text-zinc-100 dark:hover:text-brand-300 dark:focus-visible:ring-offset-zinc-900" |
| 23 | + > |
| 24 | + Become a sponsor |
| 25 | + <ArrowUpRightIcon |
| 26 | + aria-hidden="true" |
| 27 | + className="size-4 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5 motion-reduce:transition-none" |
| 28 | + /> |
| 29 | + </a> |
25 | 30 | </div> |
26 | 31 |
|
27 | | - <div> |
28 | | - <div className="grid lg:grid-cols-2"> |
29 | | - {FEATURED_SPONSORS.map((sponsor) => ( |
30 | | - <a |
31 | | - key={sponsor.name} |
32 | | - href={sponsor.url} |
33 | | - target="_blank" |
34 | | - rel="noopener noreferrer" |
35 | | - className="group flex min-h-[12rem] flex-col justify-between gap-6 border-b border-stone-300/60 px-6 py-6 transition-colors dark:border-white/10 sm:px-8 sm:py-8 lg:[&:nth-last-child(-n+2)]:border-b-0 lg:[&:nth-child(odd)]:border-r lg:[&:nth-child(odd)]:border-stone-300/60 dark:lg:[&:nth-child(odd)]:border-white/10" |
36 | | - > |
37 | | - <div className="flex items-center justify-start"> |
| 32 | + <div className="grid min-w-0 gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(18rem,22rem)] lg:items-center lg:gap-8"> |
| 33 | + <div className="grid grid-cols-2 gap-x-6 gap-y-4 min-[360px]:grid-cols-3 min-[360px]:gap-x-4 sm:gap-x-8"> |
| 34 | + {FEATURED_SPONSORS.map((sponsor) => { |
| 35 | + const logoClassName = cn( |
| 36 | + "h-auto w-auto max-w-[88%] object-contain transition-opacity duration-200 group-hover:opacity-100 motion-reduce:transition-none", |
| 37 | + SQUARE_LOGO_SPONSORS.has(sponsor.name) ? "max-h-12 opacity-90 sm:max-h-14 lg:max-h-16" : "max-h-7 opacity-80 sm:max-h-8", |
| 38 | + ); |
| 39 | + |
| 40 | + return ( |
| 41 | + <a |
| 42 | + key={sponsor.name} |
| 43 | + href={sponsor.url} |
| 44 | + target="_blank" |
| 45 | + rel="noopener noreferrer" |
| 46 | + className="group flex min-h-16 items-center justify-center rounded-lg last:col-span-2 last:mx-auto last:w-1/2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-4 focus-visible:ring-offset-stone-50 min-[360px]:last:col-span-1 min-[360px]:last:mx-0 min-[360px]:last:w-auto dark:focus-visible:ring-offset-zinc-900" |
| 47 | + > |
38 | 48 | <img |
39 | 49 | src={sponsor.logo} |
40 | 50 | alt={`${sponsor.name} logo`} |
41 | | - className={cn("h-10 w-auto max-w-full object-contain sm:h-12", sponsor.logoDark && "dark:hidden")} |
| 51 | + loading="lazy" |
| 52 | + decoding="async" |
| 53 | + className={cn(logoClassName, sponsor.logoDark && "dark:hidden")} |
42 | 54 | /> |
43 | 55 | {sponsor.logoDark && ( |
44 | 56 | <img |
45 | 57 | src={sponsor.logoDark} |
46 | 58 | alt={`${sponsor.name} logo`} |
47 | | - className="hidden h-10 w-auto max-w-full object-contain dark:block sm:h-12" |
| 59 | + loading="lazy" |
| 60 | + decoding="async" |
| 61 | + className={cn(logoClassName, "hidden dark:block")} |
48 | 62 | /> |
49 | 63 | )} |
50 | | - </div> |
51 | | - {sponsor.description && ( |
52 | | - <p className="max-w-sm border-t border-stone-300/60 pt-4 text-balance text-sm leading-7 text-stone-600 dark:border-white/10 dark:text-stone-300 sm:text-base"> |
53 | | - {sponsor.description} |
54 | | - </p> |
55 | | - )} |
56 | | - </a> |
57 | | - ))} |
58 | | - <div className="border-b border-stone-300/60 px-6 py-6 dark:border-white/10 sm:px-8 sm:py-8 lg:col-span-2 lg:border-b-0 lg:border-t lg:border-stone-300/60 dark:lg:border-white/10"> |
59 | | - <CarbonAdCard variant="sponsor" /> |
60 | | - </div> |
| 64 | + </a> |
| 65 | + ); |
| 66 | + })} |
61 | 67 | </div> |
62 | 68 |
|
63 | | - <div className="mt-6"> |
64 | | - <Link |
65 | | - href="/sponsors" |
66 | | - className="inline-flex items-center gap-2 text-sm font-medium text-stone-900 transition-colors hover:text-stone-700 dark:text-stone-100 dark:hover:text-stone-200 sm:text-base" |
67 | | - > |
68 | | - View all sponsors and backers |
69 | | - <span aria-hidden="true">→</span> |
70 | | - </Link> |
| 69 | + <div className="border-t border-zinc-200 pt-5 dark:border-white/10 lg:border-t-0 lg:border-l lg:pt-0 lg:pl-8"> |
| 70 | + <p className="hidden text-[0.6875rem] font-semibold tracking-[0.16em] text-zinc-500 uppercase dark:text-zinc-400 lg:block"> |
| 71 | + Sponsored |
| 72 | + </p> |
| 73 | + <div className="lg:mt-3"> |
| 74 | + <CarbonAdCard desktopOnly variant="sponsor" /> |
| 75 | + </div> |
71 | 76 | </div> |
72 | 77 | </div> |
73 | 78 | </div> |
|
0 commit comments