@@ -1,288 +1,343 @@
11 <!doctype html>
2-<html lang="en">
2+<html lang="en" class="scroll-smooth">
33 <head>
44 <meta charset="utf-8" />
55 <meta name="viewport" content="width=device-width, initial-scale=1" />
66 <title>cel-tui — TypeScript TUI Framework</title>
7- <style>
8- :root {
9- --bg: #0d1117;
10- --fg: #c9d1d9;
11- --accent: #58a6ff;
12- --muted: #8b949e;
13- --surface: #161b22;
14- --border: #30363d;
15- --green: #3fb950;
16- }
17- * {
18- margin: 0;
19- padding: 0;
20- box-sizing: border-box;
21- }
22- body {
23- font-family:
24- -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
25- sans-serif;
26- background: var(--bg);
27- color: var(--fg);
28- line-height: 1.6;
29- padding: 2rem;
30- max-width: 720px;
31- margin: 0 auto;
32- }
33- h1 {
34- font-size: 2rem;
35- margin-bottom: 0.25rem;
36- }
37- h1 span {
38- color: var(--accent);
39- }
40- .tagline {
41- color: var(--muted);
42- font-size: 1.1rem;
43- margin-bottom: 2rem;
44- }
45- h2 {
46- font-size: 1.25rem;
47- margin-top: 2rem;
48- margin-bottom: 0.75rem;
49- color: var(--fg);
50- }
51- p {
52- margin-bottom: 1rem;
53- color: var(--muted);
54- }
55- a {
56- color: var(--accent);
57- text-decoration: none;
58- }
59- a:hover {
60- text-decoration: underline;
61- }
62- pre {
63- background: var(--surface);
64- border: 1px solid var(--border);
65- border-radius: 6px;
66- padding: 1rem;
67- overflow-x: auto;
68- font-size: 0.875rem;
69- line-height: 1.5;
70- margin-bottom: 1.5rem;
71- }
72- code {
73- font-family:
74- "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
75- color: var(--fg);
76- }
77- .keyword {
78- color: #ff7b72;
79- }
80- .string {
81- color: #a5d6ff;
82- }
83- .func {
84- color: #d2a8ff;
85- }
86- .comment {
87- color: var(--muted);
88- }
89- .cards {
90- display: grid;
91- grid-template-columns: 1fr 1fr;
92- gap: 0.75rem;
93- margin-bottom: 1.5rem;
94- }
95- .card {
96- background: var(--surface);
97- border: 1px solid var(--border);
98- border-radius: 6px;
99- padding: 1rem;
100- }
101- .card h3 {
102- font-size: 0.95rem;
103- margin-bottom: 0.25rem;
104- }
105- .card p {
106- font-size: 0.85rem;
107- margin-bottom: 0;
108- }
109- .links {
110- list-style: none;
111- margin-bottom: 1.5rem;
112- }
113- .links li {
114- padding: 0.5rem 0;
115- border-bottom: 1px solid var(--border);
116- }
117- .links li:last-child {
118- border-bottom: none;
119- }
120- .links a {
121- font-weight: 500;
122- }
123- .links .desc {
124- color: var(--muted);
125- font-size: 0.85rem;
126- }
127- .badge {
128- display: inline-block;
129- background: var(--green);
130- color: var(--bg);
131- font-size: 0.75rem;
132- font-weight: 600;
133- padding: 0.15rem 0.5rem;
7+ <meta
8+ name="description"
9+ content="A TypeScript TUI framework built around a declarative functional API and ultra-fast rendering."
10+ />
11+ <link rel="preconnect" href="https://fonts.googleapis.com" />
12+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
13+ <link
14+ href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap"
15+ rel="stylesheet"
16+ />
17+ <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
18+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
19+ <style type="text/tailwindcss">
20+ @theme {
21+ --color-term-bg: #0a0e14;
22+ --color-term-surface: #0d1117;
23+ --color-term-panel: #161b22;
24+ --color-term-border: #21262d;
25+ --color-term-fg: #b2b9c2;
26+ --color-term-bright: #e6edf3;
27+ --color-term-muted: #545d68;
28+ --color-term-green: #3fb950;
29+ --color-term-cyan: #58d1db;
30+ --color-term-yellow: #d29922;
31+ --color-term-red: #f85149;
32+ --color-term-magenta: #bc8cff;
33+ --color-term-blue: #58a6ff;
34+ --font-mono:
35+ "JetBrains Mono", ui-monospace, "Cascadia Code", "Source Code Pro",
36+ Menlo, Consolas, "DejaVu Sans Mono", monospace;
37+ }
38+
39+ ::selection {
40+ background: color-mix(in srgb, var(--color-term-cyan) 30%, transparent);
41+ color: var(--color-term-bright);
42+ }
43+
44+ /* scrollbar */
45+ ::-webkit-scrollbar {
46+ width: 6px;
47+ }
48+ ::-webkit-scrollbar-track {
49+ background: var(--color-term-bg);
50+ }
51+ ::-webkit-scrollbar-thumb {
52+ background: var(--color-term-border);
13453 border-radius: 3px;
135- margin-left: 0.5rem;
136- vertical-align: middle;
13754 }
138- footer {
139- margin-top: 3rem;
140- padding-top: 1rem;
141- border-top: 1px solid var(--border);
142- color: var(--muted);
143- font-size: 0.85rem;
55+ ::-webkit-scrollbar-thumb:hover {
56+ background: var(--color-term-muted);
14457 }
145- </style>
146- </head>
147- <body>
148- <h1><span>cel</span>-tui</h1>
149- <p class="tagline">
150- A TypeScript TUI framework built around a declarative functional API and
151- ultra-fast rendering.
152- </p>
15358
154- <p>
155- A <strong>cel</strong> is the smallest unit of a terminal display — a
156- single character cell. Start from the smallest meaningful unit and build
157- up, with nothing wasted.
158- </p>
59+ /* blinking cursor */
60+ @keyframes blink {
61+ 0%,
62+ 100% {
63+ opacity: 1;
64+ }
65+ 50% {
66+ opacity: 0;
67+ }
68+ }
69+ .cursor-blink {
70+ animation: blink 1s step-end infinite;
71+ }
15972
160- <h2>Quick Example</h2>
161- <pre><code><span class="keyword">import</span> { cel, VStack, Text, TextInput, ProcessTerminal } <span class="keyword">from</span> <span class="string">"@cel-tui/core"</span>;
73+ /* subtle glow for accents */
74+ .glow-green {
75+ text-shadow: 0 0 8px
76+ color-mix(in srgb, var(--color-term-green) 40%, transparent);
77+ }
78+ .glow-cyan {
79+ text-shadow: 0 0 8px
80+ color-mix(in srgb, var(--color-term-cyan) 40%, transparent);
81+ }
16282
163-<span class="keyword">let</span> input = <span class="string">""</span>;
83+ /* scanline overlay */
84+ .scanlines::after {
85+ content: "";
86+ position: fixed;
87+ inset: 0;
88+ background: repeating-linear-gradient(
89+ 0deg,
90+ transparent,
91+ transparent 2px,
92+ rgba(0, 0, 0, 0.03) 2px,
93+ rgba(0, 0, 0, 0.03) 4px
94+ );
95+ pointer-events: none;
96+ z-index: 50;
97+ }
16498
165-cel.<span class="func">init</span>(<span class="keyword">new</span> <span class="func">ProcessTerminal</span>());
166-cel.<span class="func">viewport</span>(() =>
167- <span class="func">VStack</span>({ height: <span class="string">"100%"</span> }, [
168- <span class="func">Text</span>(<span class="string">"Hello, cel-tui!"</span>, { bold: <span class="keyword">true</span>, fgColor: <span class="string">"cyan"</span> }),
169- <span class="func">Text</span>(<span class="string">"─"</span>, { repeat: <span class="string">"fill"</span> }),
170- <span class="func">TextInput</span>({
171- flex: 1,
172- value: input,
173- focused: <span class="keyword">true</span>,
174- onChange: (v) => { input = v; cel.<span class="func">render</span>(); },
175- }),
176- ])
177-);</code></pre>
99+ /* markdown prose styling */
100+ .prose-terminal h1 {
101+ @apply text-2xl font-bold text-term-bright mb-2 mt-8 pb-2 border-b border-term-border;
102+ }
103+ .prose-terminal h2 {
104+ @apply text-lg font-semibold text-term-cyan mt-8 mb-4 flex items-center gap-2;
105+ }
106+ .prose-terminal h2::before {
107+ content: "##";
108+ @apply text-term-muted text-sm font-normal;
109+ }
110+ .prose-terminal h3 {
111+ @apply text-base font-semibold text-term-bright mt-6 mb-2;
112+ }
113+ .prose-terminal p {
114+ @apply text-term-fg mb-4 leading-relaxed;
115+ }
116+ .prose-terminal a {
117+ @apply text-term-blue underline decoration-term-blue/30 underline-offset-2
118+ hover:decoration-term-blue/80 transition-colors;
119+ }
120+ .prose-terminal strong {
121+ @apply text-term-bright font-semibold;
122+ }
123+ .prose-terminal ul,
124+ .prose-terminal ol {
125+ @apply mb-4 pl-6;
126+ }
127+ .prose-terminal li {
128+ @apply text-term-fg mb-1;
129+ }
130+ .prose-terminal ul li::marker {
131+ @apply text-term-muted;
132+ }
133+ .prose-terminal code {
134+ @apply font-mono text-term-magenta bg-term-panel px-1.5 py-0.5 rounded text-sm;
135+ }
136+ .prose-terminal pre {
137+ @apply bg-term-bg border border-term-border rounded-lg p-4 mb-4 overflow-x-auto;
138+ }
139+ .prose-terminal pre code {
140+ @apply bg-transparent p-0 text-term-fg text-[13px] leading-relaxed;
141+ }
142+ .prose-terminal hr {
143+ @apply border-term-border my-8;
144+ }
145+ .prose-terminal table {
146+ @apply w-full mb-4 text-sm;
147+ }
148+ .prose-terminal thead {
149+ @apply border-b border-term-border;
150+ }
151+ .prose-terminal th {
152+ @apply text-left text-term-muted font-medium py-2 px-3;
153+ }
154+ .prose-terminal td {
155+ @apply py-2 px-3 text-term-fg border-b border-term-border/50;
156+ }
157+ .prose-terminal td code {
158+ @apply text-term-cyan bg-transparent p-0;
159+ }
160+ .prose-terminal img {
161+ @apply rounded-lg my-4;
162+ }
163+ .prose-terminal blockquote {
164+ @apply border-l-2 border-term-cyan/50 pl-4 my-4 text-term-muted italic;
165+ }
178166
179- <h2>4 Primitives, That's It</h2>
180- <div class="cards">
181- <div class="card">
182- <h3><code>VStack</code></h3>
183- <p>Vertical stack — children top to bottom</p>
184- </div>
185- <div class="card">
186- <h3><code>HStack</code></h3>
187- <p>Horizontal stack — children left to right</p>
188- </div>
189- <div class="card">
190- <h3><code>Text</code></h3>
191- <p>Styled text leaf node</p>
192- </div>
193- <div class="card">
194- <h3><code>TextInput</code></h3>
195- <p>Multi-line editable text container</p>
167+ /* hide the first h1 and its subtitle since the hero covers them */
168+ .prose-terminal > h1:first-child {
169+ @apply hidden;
170+ }
171+ .prose-terminal > h1:first-child + p {
172+ @apply hidden;
173+ }
174+ </style>
175+ </head>
176+
177+ <body class="bg-term-bg font-mono text-term-fg antialiased scanlines">
178+ <!-- top bar -->
179+ <nav
180+ class="sticky top-0 z-40 bg-term-bg/90 backdrop-blur-sm border-b border-term-border"
181+ >
182+ <div
183+ class="max-w-4xl mx-auto px-4 sm:px-6 h-10 flex items-center justify-between"
184+ >
185+ <div class="flex items-center gap-3">
186+ <span class="text-term-green font-bold glow-green">cel</span
187+ ><span class="text-term-muted">-tui</span>
188+ <span class="text-term-muted text-xs hidden sm:inline">·</span>
189+ <span class="text-term-muted text-xs hidden sm:inline"
190+ >TypeScript TUI Framework</span
191+ >
192+ </div>
193+ <div class="flex items-center gap-4 text-xs">
194+ <a
195+ href="docs/html/index.html"
196+ class="text-term-muted hover:text-term-cyan transition-colors"
197+ >api docs</a
198+ >
199+ <a
200+ href="https://www.npmjs.com/org/cel-tui"
201+ class="text-term-muted hover:text-term-cyan transition-colors"
202+ >npm</a
203+ >
204+ <a
205+ href="https://github.com/sacenox/cel-tui"
206+ class="text-term-muted hover:text-term-cyan transition-colors"
207+ >github</a
208+ >
209+ </div>
196210 </div>
197- </div>
211+ </nav>
198212
199- <h2>Documentation</h2>
200- <ul class="links">
201- <li>
202- <a href="docs/html/index.html">API Reference</a>
203- <span class="desc">
204- — Full TypeDoc-generated documentation for all packages</span
205- >
206- </li>
207- <li>
208- <a href="spec.md">Specification</a>
209- <span class="desc">
210- — Complete framework spec: layout, input, rendering, and
211- decisions</span
212- >
213- </li>
214- <li>
215- <a href="AGENTS.md">Agent Guide</a>
216- <span class="desc">
217- — Project structure, design decisions, testing strategy, and
218- conventions</span
219- >
220- </li>
221- <li>
222- <a href="docs/md/modules.md">API Reference (Markdown)</a>
223- <span class="desc"> — Markdown version of the API docs</span>
224- </li>
225- </ul>
213+ <!-- hero -->
214+ <header class="max-w-4xl mx-auto px-4 sm:px-6 pt-16 pb-12">
215+ <div class="flex items-start gap-4 mb-6">
216+ <div>
217+ <h1 class="text-4xl sm:text-5xl font-bold tracking-tight">
218+ <span class="text-term-green glow-green">cel</span
219+ ><span class="text-term-bright">-tui</span>
220+ </h1>
221+ <p class="text-term-muted mt-2 text-sm sm:text-base">
222+ A TypeScript TUI framework built around a declarative functional API
223+ and ultra-fast rendering.
224+ </p>
225+ </div>
226+ </div>
226227
227- <h2>Packages</h2>
228- <ul class="links">
229- <li>
230- <a href="docs/html/types/src/modules.html">@cel-tui/types</a>
231- <span class="desc"> — Shared type definitions</span>
232- </li>
233- <li>
234- <a href="docs/html/core/src/modules.html">@cel-tui/core</a>
235- <span class="desc"> — Framework engine and primitives</span>
236- </li>
237- <li>
238- <a href="docs/html/components/src/modules.html">@cel-tui/components</a>
239- <span class="desc">
240- — Pre-made components (Button, Spacer, Divider)</span
228+ <!-- terminal prompt -->
229+ <div
230+ class="bg-term-surface border border-term-border rounded-lg overflow-hidden"
231+ >
232+ <div
233+ class="flex items-center gap-2 px-4 py-2 bg-term-panel border-b border-term-border"
241234 >
242- </li>
243- </ul>
235+ <span class="w-3 h-3 rounded-full bg-term-red/80"></span>
236+ <span class="w-3 h-3 rounded-full bg-term-yellow/80"></span>
237+ <span class="w-3 h-3 rounded-full bg-term-green/80"></span>
238+ <span class="text-term-muted text-xs ml-2">~</span>
239+ </div>
240+ <div class="p-4 text-sm">
241+ <div class="flex gap-2">
242+ <span class="text-term-green select-none">$</span>
243+ <span class="text-term-bright">bun add @cel-tui/core</span>
244+ <span
245+ class="w-2 h-[1.2em] bg-term-green/70 inline-block cursor-blink self-center"
246+ ></span>
247+ </div>
248+ </div>
249+ </div>
244250
245- <h2>Key Concepts</h2>
246- <ul class="links">
247- <li>
248- <strong>State is external</strong>
249- <span class="desc">
250- — The framework renders what you give it. Use any state
251- approach.</span
251+ <!-- quick links -->
252+ <div class="flex flex-wrap gap-3 mt-6 text-xs">
253+ <a
254+ href="docs/html/index.html"
255+ class="px-3 py-1.5 rounded-md bg-term-panel border border-term-border text-term-fg hover:border-term-cyan/50 hover:text-term-cyan transition-all"
256+ >API Reference →</a
252257 >
253- </li>
254- <li>
255- <strong>Flexbox layout</strong>
256- <span class="desc">
257- — Fixed, flex, percentage, intrinsic sizing with gap, padding,
258- alignment.</span
258+ <a
259+ href="spec.md"
260+ class="px-3 py-1.5 rounded-md bg-term-panel border border-term-border text-term-fg hover:border-term-cyan/50 hover:text-term-cyan transition-all"
261+ >Specification →</a
259262 >
260- </li>
261- <li>
262- <strong>Layers</strong>
263- <span class="desc">
264- — Return an array from the render function for modals and
265- overlays.</span
263+ <a
264+ href="docs/skill/cel-tui/SKILL.md"
265+ class="px-3 py-1.5 rounded-md bg-term-panel border border-term-border text-term-fg hover:border-term-cyan/50 hover:text-term-cyan transition-all"
266+ >Agent Skill →</a
266267 >
267- </li>
268- <li>
269- <strong>Cell buffer rendering</strong>
270- <span class="desc">
271- — Styled cells, differential updates, synchronized output.</span
268+ <a
269+ href="docs/md/modules.md"
270+ class="px-3 py-1.5 rounded-md bg-term-panel border border-term-border text-term-fg hover:border-term-cyan/50 hover:text-term-cyan transition-all"
271+ >API (Markdown) →</a
272272 >
273- </li>
274- <li>
275- <strong>170+ tests</strong><span class="badge">passing</span>
276- <span class="desc">
277- — TDD across layout, painting, input, compositing, and editing.</span
278- >
279- </li>
280- </ul>
273+ </div>
274+ </header>
275+
276+ <!-- readme content -->
277+ <main class="max-w-4xl mx-auto px-4 sm:px-6 pb-16">
278+ <div id="readme" class="prose-terminal">
279+ <div class="text-term-muted text-sm animate-pulse">Loading README…</div>
280+ </div>
281+ </main>
281282
282- <footer>
283- MIT License · Built with
284- <a href="https://bun.sh">Bun</a> ·
285- <a href="https://github.com/xonecas/cel-tui">GitHub</a>
283+ <!-- footer -->
284+ <footer
285+ class="max-w-4xl mx-auto px-4 sm:px-6 pb-8 border-t border-term-border pt-6"
286+ >
287+ <div
288+ class="flex flex-col sm:flex-row items-center justify-between gap-2 text-xs text-term-muted"
289+ >
290+ <span
291+ >MIT License · Built with
292+ <a href="https://bun.sh" class="text-term-blue hover:underline"
293+ >Bun</a
294+ ></span
295+ >
296+ <div class="flex items-center gap-4">
297+ <a
298+ href="https://github.com/sacenox/cel-tui"
299+ class="hover:text-term-cyan transition-colors"
300+ >GitHub</a
301+ >
302+ <a
303+ href="https://www.npmjs.com/org/cel-tui"
304+ class="hover:text-term-cyan transition-colors"
305+ >npm</a
306+ >
307+ <a
308+ href="docs/html/index.html"
309+ class="hover:text-term-cyan transition-colors"
310+ >API Docs</a
311+ >
312+ </div>
313+ </div>
286314 </footer>
315+
316+ <script>
317+ async function loadReadme() {
318+ const container = document.getElementById("readme");
319+ try {
320+ const res = await fetch("README.md");
321+ if (!res.ok) throw new Error(`${res.status}`);
322+ let md = await res.text();
323+
324+ // Remove the centered image HTML block (we show the gif differently)
325+ // and the first heading since the hero covers it
326+ md = md.replace(/<p align="center">[\s\S]*?<\/p>\s*/, "");
327+
328+ const html = marked.parse(md, {
329+ gfm: true,
330+ breaks: false,
331+ });
332+ container.innerHTML = html;
333+ } catch (e) {
334+ container.innerHTML = `
335+ <p class="text-term-red">
336+ Failed to load README.md — <a href="README.md" class="text-term-blue underline">view it directly</a>.
337+ </p>`;
338+ }
339+ }
340+ loadReadme();
341+ </script>
287342 </body>
288343 </html>