|
| 1 | +import Image from "next/image" |
| 2 | +import Link from "next/link" |
| 3 | +import { ArrowRight } from "lucide-react" |
| 4 | + |
| 5 | +import sponsors from "@/data/sponsors" |
| 6 | +import { getAssetPath } from "@/lib/utils" |
| 7 | + |
| 8 | +const LOGO_ASPECT = 5754 / 548 |
| 9 | + |
| 10 | +export default function SponsorsStrip() { |
| 11 | + if (sponsors.length === 0) return null |
| 12 | + |
| 13 | + return ( |
| 14 | + <section aria-label="Sponsors and supporters" className="border-y border-border bg-muted/30"> |
| 15 | + <div className="mx-auto max-w-6xl px-4 py-5 sm:px-6 sm:py-6"> |
| 16 | + <Link |
| 17 | + href="/sponsors" |
| 18 | + className="group flex flex-col items-center gap-4 text-center sm:flex-row sm:justify-between sm:text-left" |
| 19 | + aria-label="Learn more about OpenPrinting sponsors and donations" |
| 20 | + > |
| 21 | + <div className="flex flex-col items-center gap-3 sm:flex-row sm:gap-8"> |
| 22 | + <span className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground sm:text-xs"> |
| 23 | + Supported by |
| 24 | + </span> |
| 25 | + |
| 26 | + <ul className="flex flex-wrap items-center justify-center gap-x-6 gap-y-3"> |
| 27 | + {sponsors.map((sponsor) => { |
| 28 | + const width = sponsor.width ?? 180 |
| 29 | + const height = Math.round(width / LOGO_ASPECT) |
| 30 | + return ( |
| 31 | + <li |
| 32 | + key={sponsor.name} |
| 33 | + className="flex flex-col items-center gap-2 sm:flex-row sm:gap-3" |
| 34 | + > |
| 35 | + <Image |
| 36 | + src={getAssetPath(sponsor.logo)} |
| 37 | + alt={sponsor.name} |
| 38 | + width={width} |
| 39 | + height={height} |
| 40 | + className="h-auto object-contain opacity-90 transition-opacity group-hover:opacity-100 dark:brightness-0 dark:invert" |
| 41 | + style={{ width, maxWidth: "72vw" }} |
| 42 | + /> |
| 43 | + {sponsor.level && ( |
| 44 | + <span className="rounded-full border border-border bg-background px-2.5 py-1 text-[11px] font-medium text-muted-foreground"> |
| 45 | + {sponsor.level} |
| 46 | + </span> |
| 47 | + )} |
| 48 | + </li> |
| 49 | + ) |
| 50 | + })} |
| 51 | + </ul> |
| 52 | + </div> |
| 53 | + |
| 54 | + <span className="inline-flex shrink-0 items-center gap-1 text-sm font-medium text-primary"> |
| 55 | + Sponsors & donations |
| 56 | + <ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-0.5" /> |
| 57 | + </span> |
| 58 | + </Link> |
| 59 | + </div> |
| 60 | + </section> |
| 61 | + ) |
| 62 | +} |
0 commit comments