From d3dee2841263fc5e95fbff46c05e4a4c79e9e95e Mon Sep 17 00:00:00 2001 From: Alezander9 Date: Tue, 16 Jun 2026 14:42:52 -0700 Subject: [PATCH] fix(ui): use BrowserCode v2 wordmark --- packages/ui/src/v2/components/wordmark-v2.tsx | 116 +++++++++++------- 1 file changed, 70 insertions(+), 46 deletions(-) diff --git a/packages/ui/src/v2/components/wordmark-v2.tsx b/packages/ui/src/v2/components/wordmark-v2.tsx index 182762f82..1bea1f056 100644 --- a/packages/ui/src/v2/components/wordmark-v2.tsx +++ b/packages/ui/src/v2/components/wordmark-v2.tsx @@ -1,65 +1,89 @@ import { createUniqueId, type ComponentProps } from "solid-js" +const CELL = 12 +const HALF = CELL / 2 +const LEFT = [ + "▄ ", + "█▀▀█ █▀▀▄ █▀▀█ █ █ █▀▀▀ █▀▀█ █▀▀▄", + "█__█ █___ █__█ █▐▌█ ^^^█ █^^^ █___", + "▀▀▀▀ ▀~~~ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀~~~", +] +const RIGHT = [" ▄ ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", "█___ █__█ █__█ █^^^", "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"] +const GAP = 1 + +type Rect = { + x: number + y: number + width: number + height: number + fill: "fill" | "weak" | "shadow" +} + +function rects(rows: string[], offset: number): Rect[] { + return rows.flatMap((row, y) => + [...row].flatMap((char, x): Rect[] => { + const cell = { x: (offset + x) * CELL, y: y * CELL } + if (char === "█") return [{ ...cell, width: CELL, height: CELL, fill: "fill" as const }] + if (char === "▀") return [{ ...cell, width: CELL, height: HALF, fill: "fill" as const }] + if (char === "▄") return [{ ...cell, y: cell.y + HALF, width: CELL, height: HALF, fill: "fill" as const }] + if (char === "▐") return [{ ...cell, x: cell.x + HALF, width: HALF, height: CELL, fill: "fill" as const }] + if (char === "_") return [{ ...cell, width: CELL, height: CELL, fill: "weak" as const }] + if (char === "^") { + return [ + { ...cell, width: CELL, height: CELL, fill: "weak" as const }, + { ...cell, width: CELL, height: HALF, fill: "fill" as const }, + ] + } + if (char === "~") return [{ ...cell, width: CELL, height: HALF, fill: "shadow" as const }] + return [] + }), + ) +} + export function WordmarkV2(props: Pick, "class">) { const filter = createUniqueId() const mask = createUniqueId() const maskGradient = createUniqueId() + const left = rects(LEFT, 0) + const right = rects(RIGHT, LEFT[1].length + GAP) + const width = (LEFT[1].length + GAP + RIGHT[1].length) * CELL + const height = LEFT.length * CELL return ( - - - - - - - - + {left.map((rect) => ( + + ))} + {right.map((rect) => ( + + ))} - - + + - + @@ -67,8 +91,8 @@ export function WordmarkV2(props: Pick, "class">) { id={filter} x="0" y="0" - width="720.002" - height="130.001" + width={width} + height={height} filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB" >