Skip to content

Commit 8440773

Browse files
committed
fix(website): improve TUI preview readability
1 parent 992382e commit 8440773

2 files changed

Lines changed: 127 additions & 76 deletions

File tree

website/theme/components/HomeLayout.tsx

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,55 @@ const tuiMascot = [
320320
' | |___| \\#/',
321321
' / \\',
322322
].join('\n');
323-
const tuiWordmark = String.raw` █████╗ ██████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
324-
██╔══██╗╚════██╗██╔════╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝
325-
███████║ █████╔╝███████╗ ██║ ██║ ██║██║ ██║█████╗
326-
██╔══██║ ╚═══██╗╚════██║ ██║ ██║ ██║██║ ██║██╔══╝
327-
██║ ██║██████╔╝███████║ ╚██████╗╚██████╔╝██████╔╝███████╗
328-
╚═╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝`;
323+
const tuiWordmarkGlyphs = {
324+
A: ['01110', '10001', '10001', '11111', '10001', '10001', '10001'],
325+
'3': ['11110', '00001', '00001', '01110', '00001', '00001', '11110'],
326+
S: ['01111', '10000', '10000', '01110', '00001', '00001', '11110'],
327+
C: ['01111', '10000', '10000', '10000', '10000', '10000', '01111'],
328+
O: ['01110', '10001', '10001', '10001', '10001', '10001', '01110'],
329+
D: ['11110', '10001', '10001', '10001', '10001', '10001', '11110'],
330+
E: ['11111', '10000', '10000', '11110', '10000', '10000', '11111'],
331+
} as const;
332+
333+
const tuiWordmarkVector = (() => {
334+
const commands: string[] = [];
335+
let offset = 0;
336+
337+
for (const character of 'A3S CODE') {
338+
if (character === ' ') {
339+
offset += 3;
340+
continue;
341+
}
342+
343+
const glyph =
344+
tuiWordmarkGlyphs[character as keyof typeof tuiWordmarkGlyphs];
345+
glyph.forEach((row, y) => {
346+
[...row].forEach((cell, x) => {
347+
if (cell === '1') commands.push(`M${offset + x} ${y}h1v1h-1z`);
348+
});
349+
});
350+
offset += 6;
351+
}
352+
353+
return {
354+
path: commands.join(''),
355+
width: Math.max(offset - 1, 1),
356+
};
357+
})();
358+
359+
function TuiWordmark() {
360+
return (
361+
<svg
362+
aria-hidden="true"
363+
className="a3s-tui-wordmark"
364+
focusable="false"
365+
preserveAspectRatio="xMinYMid meet"
366+
viewBox={`0 0 ${tuiWordmarkVector.width} 7`}
367+
>
368+
<path d={tuiWordmarkVector.path} />
369+
</svg>
370+
);
371+
}
329372

330373
const copy = {
331374
zh: {
@@ -706,9 +749,7 @@ function RuntimeExecutionFlow({ labels }: { labels: (typeof copy)[Locale] }) {
706749
<pre aria-hidden="true" className="a3s-tui-mascot">
707750
{tuiMascot}
708751
</pre>
709-
<pre aria-hidden="true" className="a3s-tui-wordmark">
710-
{tuiWordmark}
711-
</pre>
752+
<TuiWordmark />
712753
</div>
713754
<p className="a3s-tui-meta">
714755
<span>a3s-code v0.10.9</span>

0 commit comments

Comments
 (0)