Reference · Where every tie sits
BackgroundImageOptionstype
Your own picture as the background: an image address (http(s), relative or data:image/…; anything else is refused), laid under a veil so the text reads.
Import it
import type { BackgroundImageOptions } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
interface BackgroundImageOptions {
image: string;
fit?: "cover" | "contain";
dim?: number;
theme?: "light" | "dark";
}
Members
| Name | Type | Description |
|---|---|---|
image | string | |
fit (optional) | "cover" | "contain" | undefined |
|
dim (optional) | number | undefined | How dark (or, in a light look, how pale) the veil is, 0 to 1. Default 0.5. |
theme (optional) | "light" | "dark" | undefined |
Examples
import { drawBracket, type BackgroundImageOptions } from "@johnmorrisdotca/taisen-brackets";
const background: BackgroundImageOptions = { image: "./stadium.webp", fit: "cover", dim: 0.4 };
console.log(drawBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }, { sides: ["Cascade", "Delta"], score: [0, 1] }, { sides: ["Aurora", "Delta"], score: [3, 1] }], { background }).startsWith("<svg"));trueWhat it prints (run when this page was built)