|
| 1 | +import NotesIcon from "@/app/conf/_design-system/pixelarticons/notes.svg?svgr" |
| 2 | +import TournamentIcon from "@/app/conf/_design-system/pixelarticons/tournament.svg?svgr" |
| 3 | +import ModemIcon from "@/app/conf/_design-system/pixelarticons/modem.svg?svgr" |
| 4 | +import ZapIcon from "@/app/conf/_design-system/pixelarticons/zap.svg?svgr" |
| 5 | +import { GraphQLWordmarkLogo } from "@/icons" |
| 6 | +import { CityQuery } from "@/components/code-blocks" |
| 7 | + |
| 8 | +import { BannerFrame } from "./banner-frame" |
| 9 | +import { BlobStripes } from "./blob-stripes" |
| 10 | +import { QRPlaceholder } from "./qr-placeholder" |
| 11 | +import { BannerTrustedFooter } from "./trusted-logos" |
| 12 | + |
| 13 | +const features = [ |
| 14 | + { |
| 15 | + Icon: NotesIcon, |
| 16 | + label: "Typesafe\nschemas", |
| 17 | + iconClassName: "text-pri-base", |
| 18 | + }, |
| 19 | + { |
| 20 | + Icon: TournamentIcon, |
| 21 | + label: "Distributed\nby design", |
| 22 | + iconClassName: "text-pri-base", |
| 23 | + }, |
| 24 | + { |
| 25 | + Icon: ModemIcon, |
| 26 | + label: "Data\ncolocation", |
| 27 | + iconClassName: "text-pri-base", |
| 28 | + }, |
| 29 | + { |
| 30 | + Icon: ZapIcon, |
| 31 | + label: "Performance\nat scale", |
| 32 | + iconClassName: "text-sec-base", |
| 33 | + }, |
| 34 | +] as const |
| 35 | + |
| 36 | +export function LanguageBanner() { |
| 37 | + return ( |
| 38 | + <BannerFrame |
| 39 | + slug="language" |
| 40 | + caption="GraphQL — the query language" |
| 41 | + className="flex flex-col bg-[#0A0B08] px-9 pt-9 text-white" |
| 42 | + > |
| 43 | + <BlobStripes |
| 44 | + position="70% 30%" |
| 45 | + size="155%" |
| 46 | + stripeWidth="14px" |
| 47 | + evenClassName="bg-[linear-gradient(180deg,rgba(225,0,152,0.22)_0%,rgba(225,0,152,0.04)_100%)]" |
| 48 | + oddClassName="bg-[linear-gradient(180deg,rgba(225,0,152,0.06)_0%,rgba(132,0,89,0.18)_100%)]" |
| 49 | + /> |
| 50 | + |
| 51 | + <div className="z-10 flex items-center justify-between"> |
| 52 | + <GraphQLWordmarkLogo className="h-8 !fill-white" /> |
| 53 | + <div |
| 54 | + className="flex flex-wrap items-center gap-2.5 font-mono text-[13px] text-sec-base" |
| 55 | + style={{ letterSpacing: "0.02em" }} |
| 56 | + > |
| 57 | + <span>schema-first</span> |
| 58 | + <span className="text-pri-base">•</span> |
| 59 | + <span>typesafe</span> |
| 60 | + <span className="text-pri-base">•</span> |
| 61 | + <span>flexible</span> |
| 62 | + <span className="text-pri-base">•</span> |
| 63 | + <span>fast</span> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + |
| 67 | + <div className="absolute z-10" style={{ top: 130 }}> |
| 68 | + <h2 className="m-0 text-[60px] font-medium leading-none tracking-tight"> |
| 69 | + The query |
| 70 | + </h2> |
| 71 | + <div className="mt-0.5 text-[60px] font-medium leading-none tracking-tight text-pri-base"> |
| 72 | + language |
| 73 | + </div> |
| 74 | + <div |
| 75 | + className="mt-2 text-[54px] font-medium leading-none text-sec-base" |
| 76 | + style={{ letterSpacing: "-0.02em" }} |
| 77 | + > |
| 78 | + for your API |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + |
| 82 | + <div className="absolute z-10" style={{ top: 380 }}> |
| 83 | + <p |
| 84 | + className="typography-body-lg m-0 text-white/80" |
| 85 | + style={{ lineHeight: 1.4, textWrap: "pretty" }} |
| 86 | + > |
| 87 | + An open-standard query language and runtime that lets clients ask for |
| 88 | + exactly the data they need — and nothing more. |
| 89 | + </p> |
| 90 | + </div> |
| 91 | + |
| 92 | + <div |
| 93 | + className="absolute z-10 grid grid-cols-4 gap-2" |
| 94 | + style={{ top: 590 }} |
| 95 | + > |
| 96 | + {features.map(({ Icon, label, iconClassName }) => ( |
| 97 | + <div |
| 98 | + key={label} |
| 99 | + className="flex flex-col items-center gap-3.5 px-1 py-2" |
| 100 | + > |
| 101 | + <div className="flex size-12 items-center justify-center"> |
| 102 | + <Icon className={`block size-9 ${iconClassName}`} /> |
| 103 | + </div> |
| 104 | + <div |
| 105 | + className="whitespace-pre-line text-center text-[13px] text-white/85" |
| 106 | + style={{ lineHeight: 1.25 }} |
| 107 | + > |
| 108 | + {label} |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + ))} |
| 112 | + </div> |
| 113 | + |
| 114 | + <div className="absolute inset-x-9 z-10" style={{ top: 810 }}> |
| 115 | + <CityQuery /> |
| 116 | + </div> |
| 117 | + {/* Force shiki's dark theme tokens for this banner only — the page renders |
| 118 | + light-themed by default, but this banner is dark. */} |
| 119 | + <style>{` |
| 120 | + [data-print-banner="language"] .nextra-code span { |
| 121 | + background-color: var(--shiki-dark-bg); |
| 122 | + color: var(--shiki-dark); |
| 123 | + } |
| 124 | + `}</style> |
| 125 | + |
| 126 | + <div |
| 127 | + className="absolute z-10 grid grid-cols-2 gap-2.5" |
| 128 | + style={{ top: 1020 }} |
| 129 | + > |
| 130 | + <div className="flex h-24 items-center gap-3.5 border border-white/10 bg-white/[0.02] p-3.5"> |
| 131 | + <div className="flex size-16 shrink-0 items-center justify-center border-[1.5px] border-pri-base"> |
| 132 | + <ArrowRightLine className="size-7 text-pri-base" /> |
| 133 | + </div> |
| 134 | + <div className="min-w-0"> |
| 135 | + <div |
| 136 | + className="text-[15px] font-medium" |
| 137 | + style={{ letterSpacing: "-0.01em" }} |
| 138 | + > |
| 139 | + Read the spec |
| 140 | + </div> |
| 141 | + <div |
| 142 | + className="mt-1 text-[12px] text-white/70" |
| 143 | + style={{ lineHeight: 1.3 }} |
| 144 | + > |
| 145 | + Open standard, |
| 146 | + <br /> |
| 147 | + vendor-neutral. |
| 148 | + </div> |
| 149 | + </div> |
| 150 | + </div> |
| 151 | + |
| 152 | + <div className="flex h-24 items-center gap-3.5 border border-white/10 bg-white/[0.02] p-3.5"> |
| 153 | + <div className="flex size-[68px] shrink-0 items-center justify-center border-[1.5px] border-sec-base p-1"> |
| 154 | + <QRPlaceholder size={56} color="#FAFCF4" /> |
| 155 | + </div> |
| 156 | + <div className="min-w-0"> |
| 157 | + <div |
| 158 | + className="font-mono text-[11px] lowercase text-sec-base" |
| 159 | + style={{ letterSpacing: "0.06em" }} |
| 160 | + > |
| 161 | + Learn more |
| 162 | + </div> |
| 163 | + <div |
| 164 | + className="mt-1 text-[18px] font-medium" |
| 165 | + style={{ letterSpacing: "-0.01em" }} |
| 166 | + > |
| 167 | + graphql.org |
| 168 | + </div> |
| 169 | + </div> |
| 170 | + </div> |
| 171 | + </div> |
| 172 | + |
| 173 | + <BannerTrustedFooter /> |
| 174 | + </BannerFrame> |
| 175 | + ) |
| 176 | +} |
| 177 | + |
| 178 | +function ArrowRightLine({ className }: { className?: string }) { |
| 179 | + return ( |
| 180 | + <svg |
| 181 | + viewBox="0 0 24 24" |
| 182 | + fill="none" |
| 183 | + stroke="currentColor" |
| 184 | + strokeWidth="1.8" |
| 185 | + strokeLinecap="round" |
| 186 | + strokeLinejoin="round" |
| 187 | + className={className} |
| 188 | + aria-hidden="true" |
| 189 | + > |
| 190 | + <line x1="4" y1="12" x2="19" y2="12" /> |
| 191 | + <polyline points="13,6 19,12 13,18" /> |
| 192 | + </svg> |
| 193 | + ) |
| 194 | +} |
0 commit comments