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

Layout.astro

531 lines12.7 KB

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