Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

Layout.astro

438 lines9.6 KB

1---
2import { GITHUB_REPOSITORY_URL, MARKETING_STATS } from "../lib/site";
3​
4interface Props {
5 title?: string;
6 description?: string;
7}
8​
9const {
10 title = "T3 Code",
11 description = "T3 Code — The open-source control plane for coding agents.",
12} = Astro.props;
13---
14​
15<html lang="en">
16 <head>
17 <meta charset="UTF-8" />
18 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19 <meta name="description" content={description} />
20 <link rel="preconnect" href="https://fonts.googleapis.com" />
21 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
22 <link
23 href="https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&family=JetBrains+Mono:wght@400;500&display=swap"
24 rel="stylesheet"
25 />
26 <link rel="icon" href="/favicon.ico" sizes="48x48" />
27 <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32" />
28 <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16" />
29 <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
30 <title>{title}</title>
31 </head>
32 <body>
33 <div class="page">
34 <nav class="nav">
35 <div class="nav-inner">
36 <a href="/" class="nav-brand" aria-label="T3 Code home">
37 <span class="nav-brand-name">T3 Code</span>
38 </a>
39 <div class="nav-right">
40 <a
41 class="nav-stars"
42 href={GITHUB_REPOSITORY_URL}
43 target="_blank"
44 rel="noopener noreferrer"
45 aria-label={`Star T3 Code on GitHub — ${MARKETING_STATS.githubStars} stars`}
46 >
47 <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
48 <path d="M12 2.3l2.9 5.88 6.49.94-4.7 4.58 1.11 6.47L12 17.12l-5.8 3.05 1.11-6.47-4.7-4.58 6.49-.94L12 2.3z"/>
49 </svg>
50 <span><strong>{MARKETING_STATS.githubStars}</strong> GitHub stars</span>
51 </a>
52 </div>
53 </div>
54 </nav>
55​
56 <main class="main">
57 <slot />
58 </main>
59​
60 <footer class="footer">
61 <div class="footer-inner">
62 <div class="footer-brand">
63 <img src="/icon.webp" alt="" />
64 <span>&copy; {new Date().getFullYear()} T3 Tools Inc · MIT licensed</span>
65 </div>
66 <div class="footer-links">
67 <a href={GITHUB_REPOSITORY_URL} target="_blank" rel="noopener noreferrer">GitHub</a>
68 <a href="https://discord.gg/jn4EGJjrvv" target="_blank" rel="noopener noreferrer">Discord</a>
69 <a href="/download">Download</a>
70 </div>
71 </div>
72 </footer>
73 </div>
74​
75 <script>
76 const nav = document.querySelector(".nav");
77 const onScroll = () => {
78 if (!nav) return;
79 if (window.scrollY > 12) nav.classList.add("is-scrolled");
80 else nav.classList.remove("is-scrolled");
81 };
82 window.addEventListener("scroll", onScroll, { passive: true });
83 onScroll();
84 </script>
85 </body>
86</html>
87​
88<style is:global>
89 :root {
90 --bg: #09090b;
91 --bg-elev: #0c0c0e;
92 --bg-card: #111113;
93 --fg: #fafafa;
94 --fg-muted: #a1a1aa;
95 --fg-dim: #71717a;
96 --fg-faint: #52525b;
97 --border: rgba(255, 255, 255, 0.08);
98 --border-strong: rgba(255, 255, 255, 0.14);
99 --accent-h: 250;
100 --accent: oklch(0.68 0.17 var(--accent-h));
101 --accent-dim: oklch(0.68 0.17 var(--accent-h) / 0.15);
102 --ok: oklch(0.72 0.16 150);
103 --warn: oklch(0.76 0.15 75);
104 --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
105 --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
106 --radius: 12px;
107 --radius-sm: 8px;
108 --radius-lg: 16px;
109 }
110​
111 * {
112 box-sizing: border-box;
113 margin: 0;
114 padding: 0;
115 }
116​
117 html {
118 color-scheme: dark;
119 scroll-behavior: smooth;
120 }
121​
122 body {
123 background: var(--bg);
124 color: var(--fg);
125 font-family: var(--font-sans);
126 font-feature-settings: "ss01", "ss02";
127 -webkit-font-smoothing: antialiased;
128 -moz-osx-font-smoothing: grayscale;
129 min-height: 100vh;
130 overflow-x: hidden;
131 line-height: 1.5;
132 }
133​
134 body::after {
135 content: "";
136 position: fixed;
137 inset: 0;
138 pointer-events: none;
139 opacity: 0.035;
140 background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
141 background-repeat: repeat;
142 background-size: 256px 256px;
143 z-index: 9999;
144 }
145​
146 a {
147 color: inherit;
148 text-decoration: none;
149 }
150​
151 button {
152 font-family: inherit;
153 cursor: pointer;
154 border: 0;
155 background: none;
156 color: inherit;
157 }
158​
159 img,
160 svg {
161 display: block;
162 max-width: 100%;
163 }
164​
165 .eyebrow {
166 font-family: var(--font-mono);
167 font-size: 11px;
168 letter-spacing: 0.14em;
169 text-transform: uppercase;
170 color: var(--fg-dim);
171 font-weight: 500;
172 }
173​
174 .display {
175 font-weight: 500;
176 letter-spacing: -0.035em;
177 line-height: 1.05;
178 }
179​
180 .container {
181 width: 100%;
182 max-width: 1240px;
183 margin: 0 auto;
184 padding: 0 32px;
185 }
186​
187 .btn {
188 display: inline-flex;
189 align-items: center;
190 justify-content: center;
191 gap: 8px;
192 font-weight: 500;
193 font-size: 14px;
194 padding: 10px 18px;
195 border-radius: 8px;
196 transition: transform 0.18s ease, background 0.18s ease,
197 border-color 0.18s ease, color 0.18s ease;
198 white-space: nowrap;
199 }
200​
201 .btn-primary {
202 background: var(--fg);
203 color: #09090b;
204 font-weight: 600;
205 }
206​
207 .btn-primary:hover {
208 transform: translateY(-1px);
209 background: #fff;
210 }
211​
212 .btn-primary:active {
213 transform: translateY(0);
214 }
215​
216 .btn-ghost {
217 color: var(--fg-muted);
218 border: 1px solid var(--border);
219 background: transparent;
220 }
221​
222 .btn-ghost:hover {
223 color: var(--fg);
224 border-color: var(--border-strong);
225 background: rgba(255, 255, 255, 0.02);
226 }
227​
228 .btn-lg {
229 padding: 14px 22px;
230 font-size: 15px;
231 border-radius: 10px;
232 }
233​
234 .tile {
235 position: relative;
236 border: 1px solid var(--border);
237 border-radius: var(--radius);
238 background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
239 overflow: hidden;
240 }
241​
242 :focus-visible {
243 outline: 2px solid var(--accent);
244 outline-offset: 2px;
245 border-radius: 4px;
246 }
247​
248 @keyframes fade-in {
249 from {
250 opacity: 0;
251 transform: translateY(8px);
252 }
253 to {
254 opacity: 1;
255 transform: translateY(0);
256 }
257 }
258​
259 @keyframes pulse {
260 50% { opacity: 0.4; }
261 }
262​
263 @keyframes spin {
264 to { transform: rotate(360deg); }
265 }
266​
267 @keyframes floatDrift {
268 0%, 100% { translate: 0 0; }
269 50% { translate: 0 -10px; }
270 }
271​
272 @keyframes blink {
273 50% { opacity: 0; }
274 }
275</style>
276​
277<style>
278 .page {
279 min-height: 100vh;
280 display: flex;
281 flex-direction: column;
282 overflow-x: hidden;
283 }
284​
285 .nav {
286 position: sticky;
287 top: 0;
288 z-index: 50;
289 backdrop-filter: blur(18px);
290 -webkit-backdrop-filter: blur(18px);
291 background: color-mix(in srgb, var(--bg) 75%, transparent);
292 border-bottom: 1px solid transparent;
293 transition: border-color 0.3s ease;
294 }
295​
296 .nav.is-scrolled {
297 border-bottom-color: var(--border);
298 }
299​
300 .nav-inner {
301 max-width: 1240px;
302 margin: 0 auto;
303 padding: 12px 32px;
304 display: flex;
305 align-items: center;
306 justify-content: space-between;
307 gap: 24px;
308 }
309​
310 .nav-brand {
311 display: inline-flex;
312 align-items: center;
313 color: var(--fg);
314 transition: color 0.2s ease;
315 }
316​
317 .nav-brand:hover {
318 color: #fff;
319 }
320​
321 .nav-brand-name {
322 font-size: 16px;
323 font-weight: 650;
324 letter-spacing: -0.025em;
325 line-height: 1;
326 }
327​
328 .nav-right {
329 display: inline-flex;
330 align-items: center;
331 gap: 8px;
332 }
333​
334 .nav-stars {
335 display: inline-flex;
336 align-items: center;
337 gap: 7px;
338 height: 36px;
339 padding: 0 14px;
340 border: 1px solid var(--border);
341 border-radius: 999px;
342 background: rgba(255, 255, 255, 0.02);
343 color: var(--fg-muted);
344 font-size: 13px;
345 letter-spacing: -0.01em;
346 white-space: nowrap;
347 transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
348 }
349​
350 .nav-stars:hover {
351 color: var(--fg);
352 border-color: var(--border-strong);
353 background: rgba(255, 255, 255, 0.04);
354 }
355​
356 .nav-stars strong {
357 color: var(--fg);
358 font-weight: 600;
359 }
360​
361 .nav-stars svg {
362 color: var(--warn);
363 flex-shrink: 0;
364 }
365​
366 .main {
367 flex: 1;
368 display: flex;
369 flex-direction: column;
370 }
371​
372 .footer {
373 margin-top: auto;
374 border-top: 1px solid var(--border);
375 padding: 40px 0 32px;
376 }
377​
378 .footer-inner {
379 max-width: 1240px;
380 margin: 0 auto;
381 padding: 0 32px;
382 display: flex;
383 flex-wrap: wrap;
384 gap: 24px;
385 align-items: center;
386 justify-content: space-between;
387 }
388​
389 .footer-brand {
390 display: flex;
391 align-items: center;
392 gap: 10px;
393 font-size: 13px;
394 color: var(--fg-dim);
395 }
396​
397 .footer-brand img {
398 width: 20px;
399 height: 20px;
400 border-radius: 4px;
401 }
402​
403 .footer-links {
404 display: flex;
405 gap: 20px;
406 }
407​
408 .footer-links a {
409 font-size: 13px;
410 color: var(--fg-dim);
411 transition: color 0.2s ease;
412 }
413​
414 .footer-links a:hover {
415 color: var(--fg);
416 }
417​
418 @media (max-width: 820px) {
419 .nav-inner,
420 .footer-inner {
421 padding-left: 20px;
422 padding-right: 20px;
423 }
424 }
425​
426 @media (max-width: 420px) {
427 .nav-inner {
428 gap: 12px;
429 }
430​
431 .nav-stars {
432 height: 34px;
433 gap: 6px;
434 padding: 0 12px;
435 font-size: 12px;
436 }
437 }
438</style>