diff --git a/app/components/tournament/FancyStageBanner.tsx b/app/components/tournament/FancyStageBanner.tsx index 90004547a..0ac7a74ef 100644 --- a/app/components/tournament/FancyStageBanner.tsx +++ b/app/components/tournament/FancyStageBanner.tsx @@ -1,7 +1,11 @@ import * as React from "react"; import type { Mode } from "@prisma/client"; import { modesShortToLong } from "~/constants"; -import { modeToImageUrl } from "~/utils"; +import { + modeToImageUrl, + MyCSSProperties, + stageNameToBannerImageUrl, +} from "~/utils"; import clsx from "clsx"; export function FancyStageBanner({ @@ -15,12 +19,17 @@ export function FancyStageBanner({ infos?: JSX.Element[]; children?: React.ReactNode; }) { + const style: MyCSSProperties = { + "--_tournament-bg-url": `url("${stageNameToBannerImageUrl(stage.name)}")`, + }; + return ( <>

diff --git a/app/routes/to/$organization.$tournament.tsx b/app/routes/to/$organization.$tournament.tsx index 1c697e09e..f22c20c39 100644 --- a/app/routes/to/$organization.$tournament.tsx +++ b/app/routes/to/$organization.$tournament.tsx @@ -130,7 +130,6 @@ export default function TournamentPage() { "--tournaments-bg": data.bannerBackground, "--tournaments-text": data.CSSProperties.text, "--tournaments-text-transparent": data.CSSProperties.textTransparent, - // todo: could make a TS helper type for this that checks for leading -- }; const linksContainerStyle: MyCSSProperties = { diff --git a/app/styles/tournament-bracket.css b/app/styles/tournament-bracket.css index 185b4f8d7..4d20c6107 100644 --- a/app/styles/tournament-bracket.css +++ b/app/styles/tournament-bracket.css @@ -19,9 +19,7 @@ height: 10rem; flex-direction: column; justify-content: space-between; - - /* TODO: */ - background-image: url("https://pbs.twimg.com/media/DoAV42MXsAAtHCh?format=jpg&name=large"); + background-image: var(--_tournament-bg-url); background-position: center; border-start-end-radius: var(--rounded); border-start-start-radius: var(--rounded); diff --git a/app/utils/index.ts b/app/utils/index.ts index a40b5087c..c675161f8 100644 --- a/app/utils/index.ts +++ b/app/utils/index.ts @@ -59,6 +59,11 @@ export function stageNameToImageUrl(name: string) { return `/img/stages/${name.replaceAll(" ", "-").toLowerCase()}.webp`; } +export function stageNameToBannerImageUrl(name: string) { + // TODO: webp + return `/img/stage-banners/${name.replaceAll(" ", "-").toLowerCase()}.png`; +} + export function modeToImageUrl(mode: Mode) { return `/img/modes/${mode}.webp`; } @@ -124,10 +129,12 @@ export type MyReducerAction< } : { type: K }; +// TODO: make everything start with _ like _tournament-bg-url to avoid collision with global css vars export interface MyCSSProperties extends CSSProperties { "--tournaments-bg"?: string; "--tournaments-text"?: string; "--tournaments-text-transparent"?: string; + "--_tournament-bg-url"?: string; "--action-section-icon-color"?: string; "--brackets-columns"?: number; "--brackets-max-matches"?: number; diff --git a/public/img/stage-banners/ancho-v-games.png b/public/img/stage-banners/ancho-v-games.png new file mode 100644 index 000000000..29ec514fd Binary files /dev/null and b/public/img/stage-banners/ancho-v-games.png differ diff --git a/public/img/stage-banners/arowana-mall.png b/public/img/stage-banners/arowana-mall.png new file mode 100644 index 000000000..953ce9131 Binary files /dev/null and b/public/img/stage-banners/arowana-mall.png differ diff --git a/public/img/stage-banners/blackbelly-skatepark.png b/public/img/stage-banners/blackbelly-skatepark.png new file mode 100644 index 000000000..c23a0f20c Binary files /dev/null and b/public/img/stage-banners/blackbelly-skatepark.png differ diff --git a/public/img/stage-banners/camp-triggerfish.png b/public/img/stage-banners/camp-triggerfish.png new file mode 100644 index 000000000..c218c53c0 Binary files /dev/null and b/public/img/stage-banners/camp-triggerfish.png differ diff --git a/public/img/stage-banners/goby-arena.png b/public/img/stage-banners/goby-arena.png new file mode 100644 index 000000000..b2e7f1bc9 Binary files /dev/null and b/public/img/stage-banners/goby-arena.png differ diff --git a/public/img/stage-banners/humpback-pump-track.png b/public/img/stage-banners/humpback-pump-track.png new file mode 100644 index 000000000..098fdc553 Binary files /dev/null and b/public/img/stage-banners/humpback-pump-track.png differ diff --git a/public/img/stage-banners/inkblot-art-academy.png b/public/img/stage-banners/inkblot-art-academy.png new file mode 100644 index 000000000..c18d6f311 Binary files /dev/null and b/public/img/stage-banners/inkblot-art-academy.png differ diff --git a/public/img/stage-banners/kelp-dome.png b/public/img/stage-banners/kelp-dome.png new file mode 100644 index 000000000..a10a45f16 Binary files /dev/null and b/public/img/stage-banners/kelp-dome.png differ diff --git a/public/img/stage-banners/makomart.png b/public/img/stage-banners/makomart.png new file mode 100644 index 000000000..3816c304d Binary files /dev/null and b/public/img/stage-banners/makomart.png differ diff --git a/public/img/stage-banners/manta-maria.png b/public/img/stage-banners/manta-maria.png new file mode 100644 index 000000000..cc4817cac Binary files /dev/null and b/public/img/stage-banners/manta-maria.png differ diff --git a/public/img/stage-banners/moray-towers.png b/public/img/stage-banners/moray-towers.png new file mode 100644 index 000000000..185651d8d Binary files /dev/null and b/public/img/stage-banners/moray-towers.png differ diff --git a/public/img/stage-banners/musselforge-fitness.png b/public/img/stage-banners/musselforge-fitness.png new file mode 100644 index 000000000..2b706fb07 Binary files /dev/null and b/public/img/stage-banners/musselforge-fitness.png differ diff --git a/public/img/stage-banners/new-albacore-hotel.png b/public/img/stage-banners/new-albacore-hotel.png new file mode 100644 index 000000000..4c304c41d Binary files /dev/null and b/public/img/stage-banners/new-albacore-hotel.png differ diff --git a/public/img/stage-banners/piranha-pit.png b/public/img/stage-banners/piranha-pit.png new file mode 100644 index 000000000..a430facb5 Binary files /dev/null and b/public/img/stage-banners/piranha-pit.png differ diff --git a/public/img/stage-banners/port-mackerel.png b/public/img/stage-banners/port-mackerel.png new file mode 100644 index 000000000..87d6e6584 Binary files /dev/null and b/public/img/stage-banners/port-mackerel.png differ diff --git a/public/img/stage-banners/shellendorf-institute.png b/public/img/stage-banners/shellendorf-institute.png new file mode 100644 index 000000000..b0a26cfd6 Binary files /dev/null and b/public/img/stage-banners/shellendorf-institute.png differ diff --git a/public/img/stage-banners/skipper-pavilion.png b/public/img/stage-banners/skipper-pavilion.png new file mode 100644 index 000000000..49e0e2ecc Binary files /dev/null and b/public/img/stage-banners/skipper-pavilion.png differ diff --git a/public/img/stage-banners/snapper-canal.png b/public/img/stage-banners/snapper-canal.png new file mode 100644 index 000000000..259526e16 Binary files /dev/null and b/public/img/stage-banners/snapper-canal.png differ diff --git a/public/img/stage-banners/starfish-mainstage.png b/public/img/stage-banners/starfish-mainstage.png new file mode 100644 index 000000000..c4a1e6755 Binary files /dev/null and b/public/img/stage-banners/starfish-mainstage.png differ diff --git a/public/img/stage-banners/sturgeon-shipyard.png b/public/img/stage-banners/sturgeon-shipyard.png new file mode 100644 index 000000000..b47d5eb3b Binary files /dev/null and b/public/img/stage-banners/sturgeon-shipyard.png differ diff --git a/public/img/stage-banners/the-reef.png b/public/img/stage-banners/the-reef.png new file mode 100644 index 000000000..2d7f18870 Binary files /dev/null and b/public/img/stage-banners/the-reef.png differ diff --git a/public/img/stage-banners/wahoo-world.png b/public/img/stage-banners/wahoo-world.png new file mode 100644 index 000000000..823e2339b Binary files /dev/null and b/public/img/stage-banners/wahoo-world.png differ diff --git a/public/img/stage-banners/walleye-warehouse.png b/public/img/stage-banners/walleye-warehouse.png new file mode 100644 index 000000000..497154abc Binary files /dev/null and b/public/img/stage-banners/walleye-warehouse.png differ