g1t/apps/docs/src/components/SiteTitle.astro
| 1 | --- |
| 2 | // The wordmark and "Docs": the same G1T in pixel capitals as g1t.sh, the 1 |
| 3 | // in lavender, so the two read as one product. Copied from |
| 4 | // apps/web/app/components/logo.tsx; keep the two in step. |
| 5 | const G = ['.###.', '#...#', '#....', '#.###', '#...#', '#...#', '.###.']; |
| 6 | const ONE = ['..#..', '.##..', '#.#..', '..#..', '..#..', '..#..', '#####']; |
| 7 | const T = ['#####', '..#..', '..#..', '..#..', '..#..', '..#..', '..#..']; |
| 8 | const pixels = (rows: string[], dx: number, one: boolean) => |
| 9 | rows.flatMap((row, y) => [...row].flatMap((c, x) => (c === '#' ? [{ x: dx + x, y, one }] : []))); |
| 10 | const word = [...pixels(G, 0, false), ...pixels(ONE, 6, true), ...pixels(T, 10, false)]; |
| 11 | --- |
| 12 | |
| 13 | <a href="/" class="g1t-title" aria-label="g1t docs home"> |
| 14 | <span class="g1t-title-lockup"> |
| 15 | <svg viewBox="1 1 148 68" role="img" aria-label="g1t"> |
| 16 | {word.map((p) => ( |
| 17 | <rect |
| 18 | x={p.x * 10 + 1} |
| 19 | y={p.y * 10 + 1} |
| 20 | width="8" |
| 21 | height="8" |
| 22 | fill={p.one ? 'var(--g1t-merged)' : 'currentColor'} |
| 23 | /> |
| 24 | ))} |
| 25 | </svg> |
| 26 | </span> |
| 27 | <span class="g1t-title-docs">Docs</span> |
| 28 | </a> |
| 29 | |
| 30 | <style> |
| 31 | .g1t-title { |
| 32 | display: inline-flex; |
| 33 | align-items: center; |
| 34 | gap: 0.6rem; |
| 35 | color: var(--g1t-fg); |
| 36 | text-decoration: none; |
| 37 | } |
| 38 | /* As on g1t.sh: a cell is 0.125em, the letters 0.85em tall. */ |
| 39 | .g1t-title-lockup { |
| 40 | display: inline-flex; |
| 41 | align-items: baseline; |
| 42 | font-size: 1.5rem; |
| 43 | line-height: 1; |
| 44 | } |
| 45 | svg { |
| 46 | height: 0.85em; |
| 47 | width: auto; |
| 48 | flex-shrink: 0; |
| 49 | } |
| 50 | .g1t-title-docs { |
| 51 | border-radius: 999px; |
| 52 | padding: 0.1rem 0.5rem; |
| 53 | font-size: 0.72rem; |
| 54 | font-weight: 500; |
| 55 | color: var(--g1t-muted); |
| 56 | box-shadow: inset 0 0 0 1px var(--g1t-line-strong); |
| 57 | } |
| 58 | </style> |