import {useId} from 'react'; import {BODY, CHECKLIST, DPAD, OUTLINE, PROGRESS_BAR} from './logoPaths.js'; /** * The three logo colors as [CSS variable, hex as designed]; style.css sets the variables per accent. */ export const LOGO_COLORS = [['--logo-violet', '#7467f9'], ['--logo-blue', '#0192ef'], ['--logo-teal', '#17c7a4']]; // Each color is [themed CSS, fixed hex]. The hex also stands in where a browser cannot read color-mix, which // would otherwise make that stop black. const [violet, blue, teal] = LOGO_COLORS.map(([name, hex]) => [`var(${name}, ${hex})`, hex]); const mix = ([a], [b], percentOfB, hex) => [`color-mix(in oklch, ${a}, ${b} ${percentOfB}%)`, hex]; function Gradient({id, from, to, stops}) { return ( {stops.map(([offset, [color, hex]]) => )} ); } /** * The ToBePlayed logo. Its three colors come from --logo-violet, --logo-blue and --logo-teal, which style.css sets * per accent color. */ export default function Logo({className, title}) { // Every copy on the page needs its own ids, or a hidden copy can take the gradients of a visible one with it. const id = useId().replace(/[^a-zA-Z0-9_-]/g, ''); const ref = (name) => `${name}-${id}`; const url = (name) => `url(#${ref(name)})`; return ( ); }