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

Layout.astro

528 lines13.1 KB

1---
2import { getImage, Image } from "astro:assets";
3import appIcon from "../assets/icon.webp";
4import socialCard from "../assets/social-card.webp";
5import "@fontsource-variable/inter";
6import {
7 ANDROID_PLAY_STORE_URL,
8 GITHUB_REPOSITORY_URL,
9 IOS_APP_STORE_URL,
10 MARKETING_STATS,
11} from "../lib/site";
12import { type JsonLd, jsonLdGraph, organizationJsonLd, websiteJsonLd } from "../lib/seo";
13​
14interface Props {
15 title?: string;
16 description?: string;
17 pageClass?: string;
18 /** Page-specific schema.org nodes. Organization and WebSite are always included. */
19 jsonLd?: ReadonlyArray<JsonLd>;
20 noindex?: boolean;
22​
23const {
24 title = "T3 Code",
25 description = "T3 Code. The open-source control plane for coding agents.",
26 pageClass,
27 jsonLd = [],
28 noindex = false,
29} = Astro.props;
30const structuredData = jsonLdGraph([organizationJsonLd(), websiteJsonLd(), ...jsonLd]);
31​
32// Link unfurlers require a 1200x630 JPG/PNG at an absolute URL.
33const socialImage = await getImage({
34 src: socialCard,
35 width: 1200,
36 height: 630,
37 format: "jpg",
38 quality: 90,
39});
40const socialImageUrl = new URL(socialImage.src, Astro.site);
41const socialImageAlt =
42 "T3 Code: the open-source control plane for coding agents, with Claude Code, Codex, Cursor, OpenCode, Grok and Antigravity.";
43const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
44---
45​
46<html lang="en">
47 <head>
48 <meta charset="UTF-8" />
49 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
50 <meta name="description" content={description} />
51 {noindex ? <meta name="robots" content="noindex" /> : <link rel="canonical" href={canonicalUrl} />}
52 <meta property="og:type" content="website" />
53 <meta property="og:site_name" content="T3 Code" />
54 <meta property="og:url" content={canonicalUrl} />
55 <meta property="og:title" content={title} />
56 <meta property="og:description" content={description} />
57 <meta property="og:image" content={socialImageUrl} />
58 <meta property="og:image:width" content="1200" />
59 <meta property="og:image:height" content="630" />
60 <meta property="og:image:alt" content={socialImageAlt} />
61 <meta name="twitter:card" content="summary_large_image" />
62 <meta name="twitter:site" content="@t3dotgg" />
63 <meta name="twitter:title" content={title} />
64 <meta name="twitter:description" content={description} />
65 <meta name="twitter:image" content={socialImageUrl} />
66 <meta name="twitter:image:alt" content={socialImageAlt} />
67 <link rel="icon" href="/favicon.ico" sizes="48x48" />
68 <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32" />
69 <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16" />
70 <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
71 <link rel="sitemap" type="application/xml" href="/sitemap.xml" />
72 <title>{title}</title>
73 <script is:inline type="application/ld+json" set:html={structuredData} />
74 </head>
75 <body>
76 <div class:list={["page", pageClass]}>
77 <nav class="nav">
78 <div class="nav-inner">
79 <a href="/" class="nav-brand" aria-label="T3 Code home">
80 <svg
81 class="nav-brand-mark"
82 viewBox="15.5309 37 94.3941 56.96"
83 fill="currentColor"
84 aria-hidden="true"
85 >
86 <path d="M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z" />
87 </svg>
88 <span class="nav-brand-name">Code</span>
89 </a>
90 <div class="nav-right">
91 <a class="nav-link" href="/download">Download</a>
92 <a
93 class="nav-stars"
94 href={GITHUB_REPOSITORY_URL}
95 target="_blank"
96 rel="noopener noreferrer"
97 aria-label={`Star T3 Code on GitHub, ${MARKETING_STATS.githubStars} stars`}
98 >
99 <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
100 <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"/>
101 </svg>
102 <span><strong>{MARKETING_STATS.githubStars}</strong> GitHub stars</span>
103 </a>
104 </div>
105 </div>
106 </nav>
107​
108 <main class="main">
109 <slot />
110 </main>
111​
112 <footer class="footer">
113 <div class="footer-inner">
114 <div class="footer-brand">
115 <Image
116 src={appIcon}
117 alt=""
118 width={20}
119 height={20}
120 densities={[1, 2, 3]}
121 format="webp"
122 quality={90}
123 loading="lazy"
124 decoding="async"
125 />
126 <span>&copy; {new Date().getFullYear()} T3 Tools Inc · MIT licensed</span>
127 </div>
128 <div class="footer-links">
129 <a href={GITHUB_REPOSITORY_URL} target="_blank" rel="noopener noreferrer">GitHub</a>
130 <a href="https://discord.gg/jn4EGJjrvv" target="_blank" rel="noopener noreferrer">Discord</a>
131 <a href="/download">Download</a>
132 <a href={IOS_APP_STORE_URL} target="_blank" rel="noopener noreferrer">iOS app</a>
133 <a href={ANDROID_PLAY_STORE_URL} target="_blank" rel="noopener noreferrer">Android app</a>
134 <a href="/terms-of-service">Terms</a>
135 <a href="/privacy-policy">Privacy</a>
136 <a href="/security-policy">Security</a>
137 </div>
138 </div>
139 </footer>
140 </div>
141​
142 <script>
143 const nav = document.querySelector(".nav");
144 const onScroll = () => {
145 if (!nav) return;
146 if (window.scrollY > 12) nav.classList.add("is-scrolled");
147 else nav.classList.remove("is-scrolled");
148 };
149 window.addEventListener("scroll", onScroll, { passive: true });
150 onScroll();
151 </script>
152 </body>
153</html>
154​
155<style is:global>
156 :root {
157 --bg: #000;
158 --bg-elev: #0a0a0a;
159 --bg-card: #0d0d0d;
160 --fg: #f5f5f5;
161 --fg-muted: #a3a3a3;
162 --fg-dim: #737373;
163 --fg-faint: #525252;
164 --border: rgba(255, 255, 255, 0.08);
165 --border-strong: rgba(255, 255, 255, 0.14);
166 --accent-h: 264;
167 --accent: oklch(0.68 0.17 var(--accent-h));
168 --ok: oklch(0.72 0.16 150);
169 --warn: oklch(0.76 0.15 75);
170 --font-sans: -apple-system, BlinkMacSystemFont, "Inter Variable", "Segoe UI", system-ui, sans-serif;
171 --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
172 --radius: 12px;
173 --radius-sm: 8px;
174 --radius-lg: 16px;
175 }
176​
177 * {
178 box-sizing: border-box;
179 margin: 0;
180 padding: 0;
181 }
182​
183 html {
184 color-scheme: dark;
185 scroll-behavior: smooth;
186 }
187​
188 body {
189 background: var(--bg);
190 color: var(--fg);
191 font-family: var(--font-sans);
192 -webkit-font-smoothing: antialiased;
193 -moz-osx-font-smoothing: grayscale;
194 min-height: 100vh;
195 overflow-x: hidden;
196 line-height: 1.5;
197 }
198​
199​
200 a {
201 color: inherit;
202 text-decoration: none;
203 }
204​
205 button {
206 font-family: inherit;
207 cursor: pointer;
208 border: 0;
209 background: none;
210 color: inherit;
211 }
212​
213 img,
214 svg {
215 display: block;
216 max-width: 100%;
217 }
218​
219 .eyebrow {
220 font-family: var(--font-mono);
221 font-size: 11px;
222 letter-spacing: 0.14em;
223 text-transform: uppercase;
224 color: var(--fg-dim);
225 font-weight: 500;
226 }
227​
228 .display {
229 font-weight: 600;
230 letter-spacing: -0.03em;
231 line-height: 1.05;
232 }
233​
234 .container {
235 width: 100%;
236 max-width: 1240px;
237 margin: 0 auto;
238 padding: 0 32px;
239 }
240​
241 .btn {
242 display: inline-flex;
243 align-items: center;
244 justify-content: center;
245 gap: 8px;
246 font-weight: 500;
247 font-size: 14px;
248 padding: 10px 18px;
249 border-radius: 8px;
250 transition: transform 0.18s ease, background 0.18s ease,
251 border-color 0.18s ease, color 0.18s ease;
252 white-space: nowrap;
253 }
254​
255 .btn-primary {
256 background: oklch(0.571 0.21 264);
257 color: #fff;
258 font-weight: 600;
259 }
260​
261 .btn-primary:hover {
262 transform: translateY(-1px);
263 background: oklch(0.62 0.2 264);
264 }
265​
266 .btn-primary:active {
267 transform: translateY(0);
268 }
269​
270 .btn-ghost {
271 color: var(--fg-muted);
272 border: 1px solid var(--border);
273 background: transparent;
274 }
275​
276 .btn-ghost:hover {
277 color: var(--fg);
278 border-color: var(--border-strong);
279 background: rgba(255, 255, 255, 0.02);
280 }
281​
282 .btn-lg {
283 padding: 14px 22px;
284 font-size: 15px;
285 border-radius: 10px;
286 }
287​
288 .tile {
289 position: relative;
290 border: 1px solid var(--border);
291 border-radius: var(--radius);
292 background: var(--bg-card);
293 overflow: hidden;
294 }
295​
296 :focus-visible {
297 outline: 2px solid var(--accent);
298 outline-offset: 2px;
299 border-radius: 4px;
300 }
301​
302 @keyframes fade-in {
303 from {
304 opacity: 0;
305 transform: translateY(8px);
306 }
307 to {
308 opacity: 1;
309 transform: translateY(0);
310 }
311 }
312​
313 /* Page-load sequence: [data-rise] plays once with delay --d. */
314 @keyframes rise {
315 from { opacity: 0; transform: translateY(16px); }
316 to { opacity: 1; transform: none; }
317 }
318 [data-rise] {
319 animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
320 animation-delay: var(--d, 0ms);
321 }
322 @media (prefers-reduced-motion: reduce) {
323 [data-rise] { animation: none; }
324 }
325</style>
326​
327<style>
328 .page {
329 min-height: 100vh;
330 display: flex;
331 flex-direction: column;
332 overflow-x: clip;
333 }
334​
335 .nav {
336 position: sticky;
337 top: 0;
338 z-index: 50;
339 backdrop-filter: blur(18px);
340 -webkit-backdrop-filter: blur(18px);
341 background: color-mix(in srgb, var(--bg) 75%, transparent);
342 border-bottom: 1px solid transparent;
343 transition: border-color 0.3s ease;
344 }
345​
346 .nav.is-scrolled {
347 border-bottom-color: var(--border);
348 }
349​
350 .nav-inner {
351 max-width: 1240px;
352 margin: 0 auto;
353 padding: 12px 32px;
354 display: flex;
355 align-items: center;
356 justify-content: space-between;
357 gap: 24px;
358 }
359​
360 .nav-brand {
361 display: inline-flex;
362 align-items: baseline;
363 gap: 4px;
364 color: var(--fg);
365 transition: color 0.2s ease;
366 }
367​
368 .nav-brand:hover {
369 color: #fff;
370 }
371​
372 .nav-brand-mark {
373 height: 1cap;
374 width: auto;
375 flex: none;
376 }
377​
378 .nav-brand-name {
379 font-size: 16px;
380 font-weight: 500;
381 letter-spacing: -0.025em;
382 line-height: 1;
383 color: var(--fg-muted);
384 }
385​
386 .nav-right {
387 display: inline-flex;
388 align-items: center;
389 gap: 8px;
390 }
391​
392 .nav-link {
393 padding: 0 10px;
394 color: var(--fg-muted);
395 font-size: 13px;
396 letter-spacing: -0.01em;
397 white-space: nowrap;
398 transition: color 0.18s ease;
399 }
400​
401 .nav-link:hover {
402 color: var(--fg);
403 }
404​
405 .nav-stars {
406 display: inline-flex;
407 align-items: center;
408 gap: 7px;
409 height: 36px;
410 padding: 0 10px;
411 color: var(--fg-muted);
412 font-size: 13px;
413 letter-spacing: -0.01em;
414 white-space: nowrap;
415 transition: color 0.18s ease;
416 }
417​
418 .nav-stars:hover {
419 color: var(--fg);
420 }
421​
422 .nav-stars strong {
423 color: var(--fg);
424 font-weight: 600;
425 }
426​
427 .nav-stars svg {
428 color: var(--warn);
429 flex-shrink: 0;
430 }
431​
432 .main {
433 flex: 1;
434 display: flex;
435 flex-direction: column;
436 }
437​
438 .footer {
439 margin-top: auto;
440 border-top: 1px solid var(--border);
441 padding: 40px 0 32px;
442 }
443​
444 .footer-inner {
445 max-width: 1240px;
446 margin: 0 auto;
447 padding: 0 32px;
448 display: flex;
449 flex-wrap: wrap;
450 gap: 24px;
451 align-items: center;
452 justify-content: space-between;
453 }
454​
455 .footer-brand {
456 display: flex;
457 align-items: center;
458 gap: 10px;
459 font-size: 13px;
460 color: var(--fg-dim);
461 }
462​
463 .footer-brand img {
464 width: 20px;
465 height: 20px;
466 border-radius: 4px;
467 }
468​
469 .footer-links {
470 display: flex;
471 flex-wrap: wrap;
472 justify-content: flex-end;
473 gap: 20px;
474 }
475​
476 .footer-links a {
477 font-size: 13px;
478 color: var(--fg-muted);
479 transition: color 0.2s ease;
480 }
481​
482 .footer-links a:hover {
483 color: var(--fg);
484 }
485​
486 @media (max-width: 820px) {
487 .nav-inner,
488 .footer-inner {
489 padding-left: 20px;
490 padding-right: 20px;
491 }
492​
493 .legal-document-page .nav {
494 display: none;
495 }
496​
497 .footer {
498 padding-bottom: max(32px, env(safe-area-inset-bottom));
499 }
500​
501 .footer-inner {
502 align-items: flex-start;
503 flex-direction: column;
504 gap: 28px;
505 }
506​
507 .footer-links {
508 display: grid;
509 grid-template-columns: repeat(3, minmax(0, 1fr));
510 width: 100%;
511 gap: 14px 20px;
512 justify-content: initial;
513 }
514 }
515​
516 @media (max-width: 420px) {
517 .nav-inner {
518 gap: 12px;
519 }
520​
521 .nav-stars {
522 height: 34px;
523 gap: 6px;
524 padding: 0 12px;
525 font-size: 12px;
526 }
527 }
528</style>