Use real images for FancyStageBanner
@@ -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 (
|
||||
<>
|
||||
<div
|
||||
className={clsx("tournament-bracket__stage-banner", {
|
||||
rounded: !infos,
|
||||
})}
|
||||
style={style}
|
||||
>
|
||||
<div className="tournament-bracket__stage-banner__top-bar">
|
||||
<h4 className="tournament-bracket__stage-banner__top-bar__header">
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
BIN
public/img/stage-banners/ancho-v-games.png
Normal file
|
After Width: | Height: | Size: 434 KiB |
BIN
public/img/stage-banners/arowana-mall.png
Normal file
|
After Width: | Height: | Size: 414 KiB |
BIN
public/img/stage-banners/blackbelly-skatepark.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
public/img/stage-banners/camp-triggerfish.png
Normal file
|
After Width: | Height: | Size: 486 KiB |
BIN
public/img/stage-banners/goby-arena.png
Normal file
|
After Width: | Height: | Size: 454 KiB |
BIN
public/img/stage-banners/humpback-pump-track.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
public/img/stage-banners/inkblot-art-academy.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
public/img/stage-banners/kelp-dome.png
Normal file
|
After Width: | Height: | Size: 522 KiB |
BIN
public/img/stage-banners/makomart.png
Normal file
|
After Width: | Height: | Size: 404 KiB |
BIN
public/img/stage-banners/manta-maria.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
public/img/stage-banners/moray-towers.png
Normal file
|
After Width: | Height: | Size: 416 KiB |
BIN
public/img/stage-banners/musselforge-fitness.png
Normal file
|
After Width: | Height: | Size: 543 KiB |
BIN
public/img/stage-banners/new-albacore-hotel.png
Normal file
|
After Width: | Height: | Size: 490 KiB |
BIN
public/img/stage-banners/piranha-pit.png
Normal file
|
After Width: | Height: | Size: 461 KiB |
BIN
public/img/stage-banners/port-mackerel.png
Normal file
|
After Width: | Height: | Size: 461 KiB |
BIN
public/img/stage-banners/shellendorf-institute.png
Normal file
|
After Width: | Height: | Size: 457 KiB |
BIN
public/img/stage-banners/skipper-pavilion.png
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
public/img/stage-banners/snapper-canal.png
Normal file
|
After Width: | Height: | Size: 447 KiB |
BIN
public/img/stage-banners/starfish-mainstage.png
Normal file
|
After Width: | Height: | Size: 442 KiB |
BIN
public/img/stage-banners/sturgeon-shipyard.png
Normal file
|
After Width: | Height: | Size: 375 KiB |
BIN
public/img/stage-banners/the-reef.png
Normal file
|
After Width: | Height: | Size: 484 KiB |
BIN
public/img/stage-banners/wahoo-world.png
Normal file
|
After Width: | Height: | Size: 570 KiB |
BIN
public/img/stage-banners/walleye-warehouse.png
Normal file
|
After Width: | Height: | Size: 546 KiB |