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

Layout.astro

485 lines10.9 KB

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