-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
721 lines (588 loc) · 28.1 KB
/
index.html
File metadata and controls
721 lines (588 loc) · 28.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ai.txt — Universal Standard for AI Context</title>
<meta name="description" content="ai.txt is a universal standard for describing any resource to AI assistants using plain text, preventing hallucination.">
<meta name="keywords" content="ai.txt, specification, standard, AI context, AI-readable, hallucination prevention, plain text, documentation">
<meta name="author" content="markc">
<!-- Open Graph / Social Media -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://aitxt.ing">
<meta property="og:title" content="ai.txt — Universal Standard for AI Context">
<meta property="og:description" content="ai.txt is a universal standard for describing resources to AI assistants using plain text, preventing hallucination.">
<meta property="og:image" content="https://aitxt.ing/aitxt.webp">
<meta property="og:image:type" content="image/webp">
<meta property="og:image:width" content="900">
<meta property="og:image:height" content="900">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="ai.txt — Universal Standard for AI Context">
<meta name="twitter:description" content="ai.txt is a universal standard for describing resources to AI assistants using plain text, preventing hallucination.">
<meta name="twitter:image" content="https://aitxt.ing/aitxt.webp">
<!-- Apple Touch Icon -->
<link rel="apple-touch-icon" href="/favicon.ico">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<!-- ai.txt discovery -->
<link rel="prefetch" href="/ai.txt">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--primary: #FF9500;
--secondary: #1E3A8A;
--accent: #10B981;
--warm-bg: #FFF8F0;
--text: #1F2937;
--text-light: #6B7280;
--border: #E5E7EB;
--code-bg: #F3F4F6;
--link: #2563EB;
}
/* Dark mode colors - better contrast for dark backgrounds */
html.dark-mode {
--primary: #FFA500;
--secondary: #64B5F6;
--accent: #4ADE80;
--warm-bg: #0F0C0A;
--text: #F5F5F5;
--text-light: #B0B0B0;
--border: #2D2D2D;
--code-bg: #1A1A1A;
--link: #64B5F6;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
line-height: 1.7;
max-width: 900px;
margin: 0 auto;
padding: 1rem;
background: var(--warm-bg);
color: var(--text);
}
h1, h2, h3, h4 {
font-family: 'Quicksand', sans-serif;
font-weight: 700;
color: var(--text);
}
h1 {
margin-top: 0;
margin-bottom: 0;
font-size: 5rem;
text-align: center;
color: #FF9500;
background: none;
background-clip: unset;
-webkit-background-clip: unset;
-webkit-text-fill-color: unset;
text-transform: lowercase;
}
h2 {
margin-top: 2.5rem;
margin-bottom: 1rem;
font-size: 1.75rem;
border-bottom: 1px solid var(--primary);
padding-bottom: 0.5rem;
}
h3 {
margin-top: 1.5rem;
font-size: 1.25rem;
}
p {
margin-bottom: 1rem;
color: var(--text);
}
strong {
color: var(--secondary);
font-weight: 600;
}
a {
color: var(--link);
text-decoration: none;
transition: color 0.2s;
}
a:hover {
color: var(--primary);
text-decoration: underline;
}
code {
background: var(--code-bg);
color: var(--secondary);
padding: 0.2em 0.5em;
border-radius: 4px;
font-size: 0.9em;
font-weight: 600;
font-family: 'Courier New', monospace;
}
pre {
background: var(--code-bg);
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
font-size: 0.85em;
margin: 1.5rem 0;
border-left: 4px solid var(--primary);
}
pre code {
padding: 0;
background: none;
color: var(--text);
}
nav {
display: flex;
gap: 2rem;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--primary);
justify-content: space-between;
align-items: center;
}
.nav-links {
display: flex;
gap: 2rem;
}
nav a {
font-weight: 600;
font-family: 'Quicksand', sans-serif;
color: var(--text);
transition: color 0.2s;
}
nav a:hover {
color: var(--primary);
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-toggle {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: none;
border: none;
font-family: 'Quicksand', sans-serif;
font-size: inherit;
font-weight: 600;
color: var(--text);
cursor: pointer;
padding: 0;
margin: 0;
line-height: 1;
transition: color 0.2s;
}
.dropdown-toggle:hover {
color: var(--primary);
}
.dropdown-toggle::after {
content: '▼';
font-size: 0.6em;
transition: transform 0.3s ease-out;
}
.dropdown-toggle.active::after {
transform: rotate(180deg);
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
background: var(--warm-bg);
border: 1px solid var(--border);
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
min-width: 180px;
opacity: 0;
visibility: hidden;
transform: translateY(-8px) scale(0.96);
transition: opacity 0.3s ease-out, visibility 0.3s ease-out, transform 0.3s ease-out;
z-index: 100;
margin-top: 0.5rem;
}
.dropdown.active .dropdown-menu {
opacity: 1;
visibility: visible;
transform: translateY(0) scale(1);
}
html.dark-mode .dropdown-menu {
background: #2D3748;
border-color: #444;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.dropdown-menu a {
display: block;
padding: 0.75rem 1rem;
color: var(--text);
text-decoration: none;
transition: background-color 0.2s, color 0.2s;
font-weight: 500;
}
.dropdown-menu a:first-child {
border-radius: 7px 7px 0 0;
}
.dropdown-menu a:last-child {
border-radius: 0 0 7px 7px;
}
.dropdown-menu a:hover {
background-color: var(--primary);
color: white;
}
.theme-toggle {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
padding: 0.5rem;
transition: transform 0.2s;
}
.theme-toggle:hover {
transform: scale(1.1);
}
.hero-section {
text-align: center;
margin: 2rem 0 3rem 0;
}
.hero-image {
width: 100%;
height: auto;
border-radius: 12px;
box-shadow: 0 10px 40px rgba(255, 149, 0, 0.15);
margin: 0 0 2rem 0;
}
.tagline {
font-size: 1.5rem;
color: #4ADE80;
margin-bottom: 3rem;
font-weight: 600;
font-family: 'Quicksand', sans-serif;
text-align: center;
}
ul, ol {
margin-left: 1.5rem;
margin-bottom: 1rem;
}
li {
margin-bottom: 0.5rem;
}
table {
border-collapse: collapse;
width: 100%;
margin: 1.5rem 0;
}
th, td {
text-align: left;
padding: 0.75rem;
border-bottom: 1px solid var(--border);
}
th {
background: var(--code-bg);
font-weight: 600;
color: var(--secondary);
}
.highlight {
background: linear-gradient(120deg, var(--primary), var(--accent));
color: white;
padding: 0.2em 0.4em;
border-radius: 3px;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
@media (max-width: 900px) {
.feature-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 600px) {
.feature-grid {
grid-template-columns: 1fr;
}
}
.feature-card {
background: #FFFFFF;
color: var(--text);
padding: 1.5rem;
border-radius: 8px;
border-left: 4px solid var(--primary);
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
opacity: 0;
transform: translateY(30px);
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.feature-card.visible {
opacity: 1;
transform: translateY(0);
}
.feature-card.visible:nth-child(1) { transition-delay: 0s; }
.feature-card.visible:nth-child(2) { transition-delay: 0.1s; }
.feature-card.visible:nth-child(3) { transition-delay: 0.2s; }
.feature-card.visible:nth-child(4) { transition-delay: 0.3s; }
.feature-card.visible:nth-child(5) { transition-delay: 0.4s; }
.feature-card.visible:nth-child(6) { transition-delay: 0.5s; }
html.dark-mode .feature-card {
background: #2D3748;
color: #F5F5F5;
}
.feature-card strong {
display: block;
margin-bottom: 0.5rem;
color: var(--secondary);
}
html.dark-mode .feature-card strong {
color: #64B5F6;
}
.feature-card:hover {
transform: translateY(-8px);
box-shadow: 0 12px 24px rgba(255, 149, 0, 0.2);
transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}
footer {
margin-top: 4rem;
padding-top: 1.5rem;
border-top: 1px solid var(--primary);
text-align: center;
color: var(--text-light);
font-size: 0.9rem;
}
@media (max-width: 600px) {
body {
padding: 1rem;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.5rem;
}
nav {
flex-direction: column;
gap: 0.5rem;
}
}
</style>
</head>
<body>
<nav>
<div class="nav-links">
<a href="index.html">Home</a>
<a href="ai.txt">Specification</a>
<div class="dropdown" id="sections-dropdown">
<button class="dropdown-toggle" id="sections-toggle">Sections</button>
<div class="dropdown-menu">
<a href="#what-is-it">What Is It?</a>
<a href="#why-it-matters">Why It Matters</a>
<a href="#design-principles">Design Principles</a>
<a href="#how-it-works">How It Works</a>
<a href="#distributed-context">Distributed Context</a>
<a href="#format">Format</a>
<a href="#getting-started">Getting Started</a>
<a href="#ai-developers">For AI Developers</a>
<a href="#html-discovery">HTML Discovery</a>
<a href="#adoption">Adoption</a>
<a href="#durability">Durability</a>
<a href="#implementation">Implementation</a>
<a href="#prior-art">Prior Art</a>
</div>
</div>
<a href="https://github.com/markc/aitxt">GitHub</a>
</div>
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle dark mode">☀️</button>
</nav>
<h1>the ai.txt specification</h1>
<p class="tagline">Universal context standard for any resource, told directly to AI assistants</p>
<div class="hero-section">
<img src="/aitxt.webp" alt="AI and human exchanging information through ai.txt" class="hero-image">
</div>
<h2 id="what-is-it">What Is It?</h2>
<p>✨ <strong style="color: var(--primary);">ai.txt</strong> is a universal standard for describing any resource in plain text, enabling AI agents to discover context, learn facts directly, and stop hallucinating. The format is simple with optional metadata, works everywhere through cascading directory discovery, and puts you in control of your narrative instead of letting AI systems guess.</p>
<p>Just as <code>robots.txt</code> instructs search engines how to crawl, the specification tells AI assistants what something actually is about. You can place an ai.txt file at any path—whether it's a website root, a project folder, a service documentation directory, or any resource—and AI agents will discover it, understand your complete context, and work from authoritative facts instead of hallucination or assumptions.</p>
<p><strong style="color: var(--accent);">ai.txt creates a distributed context system</strong> where each project, service, and resource publishes its own authoritative information directly to AI agents. Like hypertext links documents across the web, ai.txt distributes context through cascading discovery and markdown links. Each ai.txt file can link to other ai.txt files, documentation, and resources—using standard markdown links that work across both local filesystem paths and HTTP URLs. An AI agent navigates a distributed maze of interconnected contexts, seamlessly blending local directories with web resources to incorporate into the current context. This is hypertext for AI: you control how your context relates to and references other contexts.</p>
<p>Instead of allowing AI to guess "what does this do?" you simply tell it directly and explicitly. <span class="highlight">You control your own narrative.</span> The format combines plain text with optional markdown formatting, making it simple enough for anyone to write in five minutes while remaining powerful enough to prevent AI errors, misconceptions, and fabricated capabilities.</p>
<h2 id="why-it-matters">Why It Matters</h2>
<div class="feature-grid">
<div class="feature-card">
<strong>Service Providers</strong>
<p>Stop AI from making things up about your business. Put the truth in one place.</p>
</div>
<div class="feature-card">
<strong>Project Maintainers</strong>
<p>Describe scope, limitations, and capabilities in a way AI agents actually read and respect.</p>
</div>
<div class="feature-card">
<strong>Open Source</strong>
<p>Prevent hallucination about licensing, support, and what you actually offer.</p>
</div>
<div class="feature-card">
<strong>Everyone</strong>
<p>Simple, cacheable, offline-friendly. No databases, no JavaScript, no configuration. Just text.</p>
</div>
<div class="feature-card">
<strong>AI Developers</strong>
<p>Build better assistants that respect boundaries and work from authoritative sources instead of training data assumptions.</p>
</div>
<div class="feature-card">
<strong>Teams & Organizations</strong>
<p>Ensure consistent context and prevent hallucination across multiple projects, repositories, and teams.</p>
</div>
</div>
<h2 id="design-principles">Design Principles</h2>
<p><strong>Low barrier to entry.</strong> A small business owner, a blogger, or a researcher should be able to write an ai.txt file in minutes without learning schemas or strict metadata standards. Plain prose is the primary format. Everything else is optional.</p>
<p><strong>Designed for humans first, AI second.</strong> The file should make sense when you read it. It's not a machine-only format. That simplicity is what makes it powerful for both.</p>
<p><strong>Extensibility without pollution.</strong> If someone needs strict metadata for database imports or specialized use cases, they can layer that on top through separate profiles or domain-specific extensions. The base standard stays simple and doesn't force complexity on everyone.</p>
<p><strong>No versioning required.</strong> Unlike other standards that require version declarations, ai.txt trusts simplicity. The spec is stable at the core, and edge cases are handled by tools and extensions, not by version number declarations in every file.</p>
<h2 id="how-it-works">How It Works</h2>
<p>Discovery is cascading. When an AI agent needs information about <code>/products/widgets/</code>, it tries:</p>
<ol>
<li><code>/products/widgets/ai.txt</code></li>
<li><code>/products/ai.txt</code></li>
<li><code>/ai.txt</code></li>
</ol>
<p>The same logic works for HTTP paths or local filesystem paths. Walk up the tree, find the context, use it.</p>
<h2 id="distributed-context">Distributed Context</h2>
<p>ai.txt files can link to other ai.txt files using standard markdown, creating a distributed graph of interconnected contexts. A markdown link is recognized as a context link when its target <strong>ends in <code>ai.txt</code></strong>:</p>
<pre><code>[API documentation](./api/ai.txt) — followed
[SDK reference](https://example.com/sdk/ai.txt) — followed
[Installation guide](./docs/install.md) — not followed
[Our website](https://example.com) — not followed</code></pre>
<p>When a tool encounters an ai.txt file, it:</p>
<ol>
<li>Fetches and displays the root ai.txt content</li>
<li>Extracts context links (markdown links ending in <code>ai.txt</code>)</li>
<li>Follows direct links (depth=1) and concatenates their content</li>
<li>Records deeper links found in depth=1 files without auto-fetching</li>
<li>Presents a graph of all discovered ai.txt links</li>
</ol>
<p>This bounded approach prevents runaway recursion while revealing the full context structure. Users can manually explore deeper links as needed.</p>
<h2 id="format">Format</h2>
<p>Start with optional YAML metadata (or skip it entirely), then plain text with optional markdown formatting:</p>
<pre><code>---
updated: 2026-01-14
scope: /products/
parent: https://example.com/ai.txt
---
# Brief Title
One or two sentences describing what this is.
## Section
Prose explaining something important. Use [markdown links](https://example.com), **bold**, *italics*, lists, code blocks, images—whatever makes sense. Keep it simple.
## Another Section
More details here.</code></pre>
<p>That's it. Write what matters. Omit what doesn't. The spec is a suggestion, not a rule.</p>
<h2 id="html-discovery">HTML Discovery</h2>
<p>Websites can advertise their ai.txt file using a standard <code><link></code> tag with <code>rel="prefetch"</code>. This uses the existing <a href="https://www.w3.org/TR/resource-hints/">Resource Hints</a> specification—no custom <code>rel</code> values needed:</p>
<pre><code><link rel="prefetch" href="/ai.txt"></code></pre>
<p>Browsers fetch the file at low priority during idle time and cache it, similar to how they fetch <code>favicon.ico</code>. The cached file is then immediately available to AI features built into browsers, browser extensions, and any tool that parses <code><link></code> tags.</p>
<p>For subpages, use a relative path back to the root:</p>
<pre><code><!-- Root page -->
<link rel="prefetch" href="ai.txt">
<!-- Subpage (e.g., /products/index.html) -->
<link rel="prefetch" href="../ai.txt"></code></pre>
<p>This is optional but recommended. It costs almost nothing—ai.txt files are typically under 10KB—and makes discovery explicit rather than speculative.</p>
<h2 id="getting-started">Getting Started</h2>
<ol>
<li>Read the spec at <a href="/ai.txt">/ai.txt</a> (this site's own documentation, written in ai.txt format)</li>
<li>Create an <code>ai.txt</code> file at the root of your site or project folder</li>
<li>Write a brief title and a few sections explaining what you offer and what you don't</li>
<li>Include guidelines for how AI should handle your information</li>
</ol>
<p>That's all. No approval process, no registry, no central authority. <span class="highlight">Just write one.</span></p>
<p><strong>Real-world implementations to reference:</strong></p>
<ul>
<li><a href="https://netserva.org/ai.txt">NetServa</a> — Enterprise infrastructure management platform</li>
<li><a href="https://renta.net/ai.txt">Renta</a> — Domain registry and hosting</li>
</ul>
<h2 id="ai-developers">For AI Developers</h2>
<p>When you encounter a URL or filesystem path, try to fetch or read <code>/ai.txt</code>, walking up the tree until you find context. Parse the YAML frontmatter. Read the instructions. Follow the boundaries. Honor "We Do Not Offer"—never hallucinate capabilities. Ask questions only when the ai.txt is unclear.</p>
<p><strong>Build hypertext navigation into your agents:</strong> Parse markdown links within ai.txt files. Links ending in <code>ai.txt</code> signal related contexts that should be followed (depth=1 by default). Record deeper links for user exploration. This transforms ai.txt from static metadata into an active navigation system for distributed context.</p>
<p>The canonical reference is the <a href="/ai.txt">full specification</a>. Point your agents there to understand the spec.</p>
<h2 id="adoption">On Adoption and Implementation</h2>
<p>The ai.txt specification succeeds through intentional implementation rather than passive discovery. Rather than waiting for AI systems to spontaneously respect ai.txt files, the spec functions as an instruction manual that developers actively consult. By referencing <a href="/ai.txt">the canonical specification</a>, developers learn the pattern and incorporate it into their workflows—whether creating ai.txt files for new projects, discovering existing ones, or building tools that understand and respect the format. This active adoption strategy is more realistic and sustainable than relying on automatic crawling or universal compliance.</p>
<h2 id="durability">On Durability and Versioning</h2>
<p>The specification's strength lies in its intentional simplicity. Because the core concept—optional YAML frontmatter followed by plain prose—places no restrictions, there is no meaningful room for version evolution at the spec level itself. This durability is by design. Organizations that require stricter validation or structured profiles can build those as internal extensions without modifying the canonical spec. The simpler the standard, the longer it remains relevant.</p>
<h2 id="implementation">On Implementation Patterns</h2>
<p>Tools like Claude Code can embed ai.txt awareness into workflows—discovering local files, suggesting their creation when missing, and fetching related ai.txt files from linked projects to provide richer context. The spec becomes self-propagating through intentional tool support rather than external mandates.</p>
<h2 id="prior-art">Prior Art</h2>
<p><a href="https://spawning.ai/ai.txt">Spawning AI's ai.txt specification (2023)</a> addresses a complementary problem: AI training consent and data permissions. This spec focuses on general context and preventing hallucination. Both approaches can coexist—use them for their specific purposes, or combine them on the same site.</p>
<footer>
<p>Released into the public domain via <a href="https://github.com/markc/aitxt/blob/main/LICENSE">CC0</a>.</p>
<p style="margin-top: 0.5rem;"><a href="https://github.com/markc/aitxt">View on GitHub</a></p>
</footer>
<script>
const themeToggle = document.getElementById('theme-toggle');
const html = document.documentElement;
const THEME_KEY = 'aitxt-theme';
// Initialize theme from localStorage or system preference
function initTheme() {
const saved = localStorage.getItem(THEME_KEY);
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const isDark = saved ? saved === 'dark' : prefersDark;
if (isDark) {
html.classList.add('dark-mode');
themeToggle.textContent = '☀️';
} else {
html.classList.remove('dark-mode');
themeToggle.textContent = '🌙';
}
}
// Toggle theme
themeToggle.addEventListener('click', () => {
const isDark = html.classList.toggle('dark-mode');
localStorage.setItem(THEME_KEY, isDark ? 'dark' : 'light');
themeToggle.textContent = isDark ? '☀️' : '🌙';
});
// Initialize on page load
initTheme();
// Dropdown menu toggle
const sectionsDropdown = document.getElementById('sections-dropdown');
const sectionsToggle = document.getElementById('sections-toggle');
if (sectionsToggle) {
sectionsToggle.addEventListener('click', (e) => {
e.preventDefault();
sectionsDropdown.classList.toggle('active');
});
// Close dropdown when a link is clicked
sectionsDropdown.querySelectorAll('.dropdown-menu a').forEach(link => {
link.addEventListener('click', () => {
sectionsDropdown.classList.remove('active');
});
});
// Close dropdown when clicking outside
document.addEventListener('click', (e) => {
if (!sectionsDropdown.contains(e.target)) {
sectionsDropdown.classList.remove('active');
}
});
}
// Intersection Observer for scroll-triggered card reveals
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -100px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target);
}
});
}, observerOptions);
// Observe all feature cards
document.querySelectorAll('.feature-card').forEach(card => {
observer.observe(card);
});
</script>
</body>
</html>