import Image from "next/image"; import { StatusBadge } from "../ui/StatusBadge"; import { ButtonLink } from "../ui/ButtonLink"; import { Parallax } from "../ui/Parallax"; import type { Game } from "@/lib/games"; type Props = { game: Game }; /** * Game page hero: the capture as a background, the title on top of it. * * The previous version showed the artwork in a bare band and put the title on * a solid block underneath, on the grounds that the in-game captures are too * bright to carry cream text. That is true of a raw capture — but the fix is a * scrim, not a separate block. A flat tint plus a bottom-up gradient give the * type a dark bed while the capture still reads, exactly as the home hero does * over the video. Without it the page opened on an image that said nothing: * no title, no status, no call to action above the fold. */ export function GameHero({ game }: Props) { const artwork = game.banner ?? game.keyArt; /** * The spec line. Phrased so it needs no labels: "1-6 players" says what * "PLAYERS / 1-6" said in two words and a column. As its own band under the * hero this was a lonely row of text floating in a dark gap; belonging to * the title block, it reads as part of the pitch. */ const meta = [ game.players && `${game.players} players`, game.platform, game.releaseWindow && `Release ${game.releaseWindow}`, ].filter((entry): entry is string => Boolean(entry)); return (
{/* The capture drifts slower than the copy on top of it. Overscanned by 8% at each end so the drift never exposes the edge of the frame. */} {artwork && ( )} {/* Scrim: dark bed under the copy, lighter over the artwork, plus a top band so the transparent navbar stays legible. */}

{game.title.toUpperCase()}

{game.tagline}

{/* Genres carry their own non-breaking spans: a line may only break between them, never inside one ("CO-" / "OP" was a real thing). */}
{game.genres.map((genre, index) => ( {index > 0 && ( · )} {genre} ))} {meta.length > 0 && ( )} {meta.map((entry, index) => ( {index > 0 && ( · )} {entry} ))}
{game.steamUrl && ( WISHLIST ON STEAM )} SEE THE SCREENSHOTS
); }