Skip to content

Guides and resources for AI engineers: an agents course, five handbooks, a hands-on second-brain project and a vetted reading list.

site: a dark theme on every page

undefined-uidb1f005f02b4
diff --git a/assets/site/app.css b/assets/site/app.css
index 8f3b697..1a72874 100644
--- a/assets/site/app.css
+++ b/assets/site/app.css
@@ -5,15 +5,40 @@
/* one hue per layer of the graph, in the same muted register */
--c-root:#15201B; --c-guide:#1F6B52; --c-course:#8A6B23; --c-handbook:#3F5F86;
--c-term:#A24E36; --c-tool:#6B4C80; --c-res:#7D6B5D;
+ /* the same colours as channels, for the translucent layers */
+ --paper-rgb:234,238,233; --card-rgb:247,249,246; --shadow-rgb:21,32,27;
+ --stage-glow:#F2F5F1; --grid-dot:rgba(21,32,27,.075); --accent-strong:#18563F;
+ --fig-bg:transparent; --fig-pad:0; color-scheme:light;
--serif:Charter,"Bitstream Charter",Georgia,"Iowan Old Style",serif;
--mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"DejaVu Sans Mono",monospace;
- --glass:rgba(247,249,246,.88);
+ --glass:rgba(var(--card-rgb),.88);
--edge:1px solid var(--rule);
- --lift:0 1px 0 rgba(21,32,27,.03),0 18px 40px -18px rgba(21,32,27,.28);
+ --lift:0 1px 0 rgba(var(--shadow-rgb),.03),0 18px 40px -18px rgba(var(--shadow-rgb),.28);
--info-w:400px; --reader-w:min(760px,58vw); --hero-w:440px;
--ease:cubic-bezier(.2,.8,.2,1);
--w:68ch;
}
+/* dark: follows the system unless the visitor picked a theme */
+@media (prefers-color-scheme:dark){
+ :root:not([data-theme="light"]){
+ --paper:#0F1513; --card:#171F1B; --ink:#E2E8E3; --soft:#A7B4AC; --faint:#7B8981;
+ --rule:#29342F; --accent:#5DBB94; --accent-bg:#1B2C24; --num:#D4AC52;
+ --c-root:#E2E8E3; --c-guide:#5DBB94; --c-course:#D4AC52; --c-handbook:#82A6D6;
+ --c-term:#E2826A; --c-tool:#B293D4; --c-res:#BBA591;
+ --paper-rgb:15,21,19; --card-rgb:23,31,27; --shadow-rgb:0,0,0;
+ --stage-glow:#16201C; --grid-dot:rgba(226,232,227,.06); --accent-strong:#7FD0AC;
+ --fig-bg:#E4EAE5; --fig-pad:14px 12px; color-scheme:dark;
+ }
+}
+:root[data-theme="dark"]{
+ --paper:#0F1513; --card:#171F1B; --ink:#E2E8E3; --soft:#A7B4AC; --faint:#7B8981;
+ --rule:#29342F; --accent:#5DBB94; --accent-bg:#1B2C24; --num:#D4AC52;
+ --c-root:#E2E8E3; --c-guide:#5DBB94; --c-course:#D4AC52; --c-handbook:#82A6D6;
+ --c-term:#E2826A; --c-tool:#B293D4; --c-res:#BBA591;
+ --paper-rgb:15,21,19; --card-rgb:23,31,27; --shadow-rgb:0,0,0;
+ --stage-glow:#16201C; --grid-dot:rgba(226,232,227,.06); --accent-strong:#7FD0AC;
+ --fig-bg:#E4EAE5; --fig-pad:14px 12px; color-scheme:dark;
+}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body{background:var(--paper);color:var(--ink);font:17px/1.62 var(--serif);
@@ -28,8 +53,8 @@ kbd{font:11px/1 var(--mono);color:var(--faint);border:var(--edge);border-bottom-
/* ------------------------------------------------------------ stage */
#stage{position:fixed;inset:0;z-index:0;
background:
- radial-gradient(ellipse 70% 60% at 55% 45%,#F2F5F1 0%,rgba(242,245,241,0) 70%),
- radial-gradient(circle at 1px 1px,rgba(21,32,27,.075) 1px,transparent 1.2px) 0 0/26px 26px,
+ radial-gradient(ellipse 70% 60% at 55% 45%,var(--stage-glow) 0%,transparent 70%),
+ radial-gradient(circle at 1px 1px,var(--grid-dot) 1px,transparent 1.2px) 0 0/26px 26px,
var(--paper)}
#stage canvas{display:block;outline:none}
#stage .scene-container{cursor:grab}
@@ -42,7 +67,7 @@ kbd{font:11px/1 var(--mono);color:var(--faint);border:var(--edge);border-bottom-
transform-origin:50% 0;will-change:transform,opacity;transition:color .2s;
font:11px/1.2 var(--mono);color:var(--soft);padding:2px 5px;border-radius:3px;
text-shadow:0 0 3px var(--paper),0 0 6px var(--paper),0 0 10px var(--paper)}
-.lb:hover{color:var(--ink);background:rgba(247,249,246,.9);text-shadow:none}
+.lb:hover{color:var(--ink);background:rgba(var(--card-rgb),.9);text-shadow:none}
.lb.t-root{font:600 17px/1 var(--mono);color:var(--ink);letter-spacing:-.01em}
.lb.t-collection{font:600 16px/1.1 var(--serif);color:var(--ink);letter-spacing:-.01em}
.lb.t-collection::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;
@@ -88,6 +113,7 @@ kbd{font:11px/1 var(--mono);color:var(--faint);border:var(--edge);border-bottom-
font:13px/1 var(--mono);color:var(--soft);transition:border-color .15s,color .15s}
.tbtn:hover,.tbtn[aria-expanded="true"]{border-color:var(--accent);color:var(--ink)}
.tbtn .ico{font-size:17px;line-height:1}
+.tbtn.tico{width:38px;justify-content:center;padding:0;font-size:16px}
.search{position:relative;margin-left:auto;width:min(360px,34vw)}
.search input{width:100%;height:38px;font:13.5px/1 var(--mono);color:var(--ink);
background:var(--glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
@@ -120,7 +146,7 @@ kbd{font:11px/1 var(--mono);color:var(--faint);border:var(--edge);border-bottom-
body:not(.m-overview) #hero{opacity:0;transform:translateX(-24px);pointer-events:none}
/* a paper veil behind the hero, so the graph never runs through the text */
#veil{position:fixed;z-index:3;left:0;top:0;bottom:0;width:calc(var(--hero-w) + 110px);pointer-events:none;
- background:linear-gradient(90deg,rgba(234,238,233,.97) 0%,rgba(234,238,233,.9) 60%,rgba(234,238,233,0) 100%);
+ background:linear-gradient(90deg,rgba(var(--paper-rgb),.97) 0%,rgba(var(--paper-rgb),.9) 60%,rgba(var(--paper-rgb),0) 100%);
transition:opacity .6s var(--ease)}
body:not(.m-overview) #veil{opacity:0}
#hero .kick{font:11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--faint);margin-bottom:14px}
@@ -172,7 +198,7 @@ body.m-focus #info{transform:none}
transition:background .15s,color .15s}
.btn:hover{background:var(--accent-bg);text-decoration:none}
.btn.primary{background:var(--accent);color:var(--card)}
-.btn.primary:hover{background:#18563F}
+.btn.primary:hover{background:var(--accent-strong)}
.grp{margin-top:18px}
.grp h3{display:flex;justify-content:space-between;font:600 10.5px/1 var(--mono);letter-spacing:.12em;
text-transform:uppercase;color:var(--faint);padding-bottom:8px;border-bottom:var(--edge);margin-bottom:4px}
@@ -201,7 +227,7 @@ body.m-focus #info{transform:none}
/* ------------------------------------------------------------ reader */
#reader{position:fixed;z-index:20;top:0;right:0;bottom:0;width:var(--reader-w);background:var(--card);
- border-left:var(--edge);box-shadow:-30px 0 60px -40px rgba(21,32,27,.35);display:flex;flex-direction:column;
+ border-left:var(--edge);box-shadow:-30px 0 60px -40px rgba(var(--shadow-rgb),.35);display:flex;flex-direction:column;
transform:translateX(105%);transition:transform .6s var(--ease)}
body.m-read #reader{transform:none}
/* the top bar makes room for the reader instead of sitting on it */
@@ -209,7 +235,7 @@ body.m-read #reader{transform:none}
body.m-read .top{right:calc(var(--reader-w) + 16px)}
body.m-read .links{display:none}
body.m-read .search{width:auto;flex:1;max-width:300px;min-width:110px}
-@media (max-width:1100px){body.m-read .tbtn .lbl{display:none}body.m-read .search kbd{display:none}}
+@media (max-width:1100px){body.m-read .tbtn .lbl{display:none}body.m-read .search kbd{display:none}body.m-read .tbtn.tico{display:none}}
.rbar{display:flex;align-items:center;gap:12px;padding:14px 20px 12px 24px;border-bottom:var(--edge);background:var(--card)}
.rback{display:none;font:13px var(--mono);color:var(--accent);white-space:nowrap}
.rcrumb{flex:1;min-width:0;font:12px/1.4 var(--mono);color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@@ -237,6 +263,8 @@ body.m-read .search{width:auto;flex:1;max-width:300px;min-width:110px}
.prose th{text-align:left;font-weight:600;padding:7px 10px 7px 0;border-bottom:1px solid var(--ink)}
.prose td{padding:8px 10px 8px 0;border-bottom:var(--edge);vertical-align:top}
.prose img{max-width:100%;height:auto;display:block;margin:20px auto}
+/* the figures are drawn for paper; on a dark page each sits on its own paper plate */
+.prose img[src$=".svg"]{background:var(--fig-bg);padding:var(--fig-pad);border-radius:8px}
.prose a.wiki{color:var(--accent);border-radius:2px;transition:background .15s}
.prose a.wiki::before{content:"[[";color:var(--faint)}
.prose a.wiki::after{content:"]]";color:var(--faint)}
@@ -313,7 +341,7 @@ body:not(.booting) #boot{opacity:0;pointer-events:none}
.search{width:auto;flex:1}
.search kbd{display:none}
#hero{left:16px;right:16px;top:auto;bottom:118px;width:auto;max-height:46vh}
- #veil{top:auto;width:auto;right:0;height:62vh;background:linear-gradient(0deg,var(--paper) 0%,rgba(234,238,233,.94) 60%,rgba(234,238,233,0) 100%)}
+ #veil{top:auto;width:auto;right:0;height:62vh;background:linear-gradient(0deg,var(--paper) 0%,rgba(var(--paper-rgb),.94) 60%,rgba(var(--paper-rgb),0) 100%)}
#hero h1{font-size:28px}
#hero .lede{font-size:15.5px}
#hero .lede2,#hero .hint,#hero .stats{display:none}
diff --git a/assets/site/app.js b/assets/site/app.js
index 3052ad0..4d48dad 100644
--- a/assets/site/app.js
+++ b/assets/site/app.js
@@ -32,6 +32,11 @@ const COLOR = {
term: tok('--c-term'), tool: tok('--c-tool'), res: tok('--c-res'),
};
const PAPER = new THREE.Color(tok('--paper'));
+function readColors() {
+ const r = getComputedStyle(document.documentElement);
+ for (const k of Object.keys(COLOR)) COLOR[k] = r.getPropertyValue('--c-' + k).trim();
+ PAPER.set(r.getPropertyValue('--paper').trim());
+}
const LAYERS = [
{ key: 'course', label: 'Course' },
{ key: 'handbook', label: 'Handbooks' },
@@ -58,6 +63,8 @@ for (const l of links) {
const FLAT = G.order.flatMap(s => byId.get(s).pages);
const sectionsOf = col => G.order.filter(s => byId.get(s).group === col);
const dotOf = n => COLOR[n.group] || COLOR.root;
+// for HTML: a CSS variable, so labels and panels follow a theme switch on their own
+const cssDot = n => `var(--c-${COLOR[n.group] ? n.group : 'root'})`;
const layerOn = Object.assign(Object.fromEntries(LAYERS.map(l => [l.key, !l.off])), store.get('layers', {}));
const visible = n => n.group === 'root' || !!layerOn[n.group];
@@ -148,7 +155,7 @@ function makeNode(n) {
const tooltip = n => {
const sec = n.sec ? byId.get(n.sec) : null;
const ctx = sec ? ` · ${sec.badge} ${sec.label}` : n.sub ? ` · ${n.sub}` : '';
- return `<span class="tt-k" style="--dot:${dotOf(n)}">${TYPE[n.type]}${esc(ctx)}</span>` +
+ return `<span class="tt-k" style="--dot:${cssDot(n)}">${TYPE[n.type]}${esc(ctx)}</span>` +
`<span class="tt-t">${esc(n.label)}</span>` +
(n.desc && n.type !== 'root' ? `<span class="tt-d">${esc(clip(n.desc, 120))}</span>` : '');
};
@@ -378,7 +385,7 @@ function refreshLabels() {
if (!el) {
el = document.createElement('div');
el.className = `lb t-${TOOLISH.has(n.type) ? 'tool' : n.type}`;
- el.style.setProperty('--dot', dotOf(n));
+ el.style.setProperty('--dot', cssDot(n));
el.dataset.id = n.id;
el.style.opacity = '0';
labelBox.appendChild(el);
@@ -643,9 +650,9 @@ addEventListener('hashchange', route);
const info = $('#info');
const li = (id, meta = '', extra = '') => {
const n = byId.get(id); if (!n) return '';
- return `<button class="li${extra}" data-go="${esc(id)}" style="--dot:${dotOf(n)}"><span class="d"></span><span>${n.type === 'command' || n.type === 'skill' || n.type === 'script' ? `<code>${esc(n.label)}</code>` : esc(n.label)}</span>${meta ? `<span class="m">${meta}</span>` : ''}</button>`;
+ return `<button class="li${extra}" data-go="${esc(id)}" style="--dot:${cssDot(n)}"><span class="d"></span><span>${n.type === 'command' || n.type === 'skill' || n.type === 'script' ? `<code>${esc(n.label)}</code>` : esc(n.label)}</span>${meta ? `<span class="m">${meta}</span>` : ''}</button>`;
};
-const chip = id => { const n = byId.get(id); return n ? `<button class="chip${n.type === 'term' ? ' term' : ''}" data-go="${esc(id)}" style="--dot:${dotOf(n)}"><span class="d"></span>${esc(n.label)}</button>` : ''; };
+const chip = id => { const n = byId.get(id); return n ? `<button class="chip${n.type === 'term' ? ' term' : ''}" data-go="${esc(id)}" style="--dot:${cssDot(n)}"><span class="d"></span>${esc(n.label)}</button>` : ''; };
const group = (title, body, count) => body ? `<div class="grp"><h3>${title}${count != null ? `<span>${count}</span>` : ''}</h3>${body}</div>` : '';
const listOf = (ids, meta, max = 14) => {
if (!ids.length) return '';
@@ -656,7 +663,7 @@ const listOf = (ids, meta, max = 14) => {
const edgeIds = (n, kind, dir) => linksOf.get(n.id).filter(l => l.kind === kind && (dir === 'out' ? l.s === n.id : dir === 'in' ? l.t === n.id : true)).map(l => l.s === n.id ? l.t : l.s);
const words = n => n.words ? `${n.words.toLocaleString('en')} words` : '';
const mins = w => Math.max(1, Math.round(w / 230));
-const kicker = (n, ctx) => `<div class="ik" style="--dot:${dotOf(n)}"><span class="sw"></span>${TYPE[n.type]}${ctx ? `<i>· ${ctx}</i>` : ''}</div>`;
+const kicker = (n, ctx) => `<div class="ik" style="--dot:${cssDot(n)}"><span class="sw"></span>${TYPE[n.type]}${ctx ? `<i>· ${ctx}</i>` : ''}</div>`;
const ghBtn = (url, label = 'GitHub') => url ? `<a class="btn" href="${esc(url)}" target="_blank" rel="noopener">${label} &#8599;</a>` : '';
function renderInfo(n) {
@@ -693,7 +700,7 @@ function renderInfo(n) {
h += kicker(n, `${esc(col.label)} · ${esc(n.badge)}`) + `<h2>${esc(n.label)}</h2><p class="desc">${esc(n.desc)}</p>` +
`<div class="meta"><span><b>${n.pages.length}</b> pages</span><span><b>${w.toLocaleString('en')}</b> words</span><span>~${mins(w)} min</span></div>` +
`<div class="acts"><button class="btn primary" data-read="${esc(n.pages[0])}">Start reading &rarr;</button></div>` +
- group('Pages', n.pages.map((id, k) => `<button class="li" data-go="${esc(id)}" style="--dot:${dotOf(n)}"><span class="n">${k + 1}</span><span>${esc(byId.get(id).label)}</span><span class="m">${mins(byId.get(id).words || 0)}m</span></button>`).join(''), n.pages.length) +
+ group('Pages', n.pages.map((id, k) => `<button class="li" data-go="${esc(id)}" style="--dot:${cssDot(n)}"><span class="n">${k + 1}</span><span>${esc(byId.get(id).label)}</span><span class="m">${mins(byId.get(id).words || 0)}m</span></button>`).join(''), n.pages.length) +
group(n.group === 'handbook' ? 'The module it deepens' : 'Its handbook', hb.map(id => li(id, esc(byId.get(id).badge))).join('')) +
group('Leans on', bars(lean)) + group('Leaned on by', bars(leanedBy));
} else if (T === 'collection') {
@@ -726,7 +733,7 @@ function renderInfo(n) {
const rel = Object.entries(co).sort((a, b) => b[1] - a[1]).slice(0, 8).map(x => x[0]);
const pagesHtml = byCount.slice(0, 14).map(([id, c]) => {
const p = byId.get(id);
- return `<button class="li" data-go="${esc(id)}" style="--dot:${dotOf(p)}"><span class="d"></span><span>${esc(p.label)}</span><span class="bar" style="width:${Math.max(6, c / mx * 54)}px"></span><span class="m">${c}</span></button>`;
+ return `<button class="li" data-go="${esc(id)}" style="--dot:${cssDot(p)}"><span class="d"></span><span>${esc(p.label)}</span><span class="bar" style="width:${Math.max(6, c / mx * 54)}px"></span><span class="m">${c}</span></button>`;
}).join('');
const rest = byCount.slice(14).map(x => x[0]);
h += kicker(n, 'glossary') + `<h2>${esc(n.label)}</h2><p class="desc">${esc(n.desc)}</p>` +
@@ -779,7 +786,7 @@ let pendingAnchor = null;
function renderReader(n) {
const P = PAGES[n.id], sec = byId.get(n.sec);
const i = FLAT.indexOf(n.id), prev = FLAT[i - 1], next = FLAT[i + 1];
- rCrumb.innerHTML = `<b style="color:${dotOf(n)}">${esc(sec.badge)}</b><button data-go="${esc(sec.id)}">${esc(sec.label)}</button> · page ${n.pos} of ${n.of}`;
+ rCrumb.innerHTML = `<b style="color:${cssDot(n)}">${esc(sec.badge)}</b><button data-go="${esc(sec.id)}">${esc(sec.label)}</button> · page ${n.pos} of ${n.of}`;
rBody.innerHTML = !P ? '<p>This page did not load. Try reloading.</p>' :
`<h1>${esc(n.label)}</h1>${P.html}` +
((n.terms || []).length ? `<div class="rterms"><h4>terms on this page</h4><div class="chips">${n.terms.slice(0, 18).map(chip).join('')}</div></div>` : '') +
@@ -807,7 +814,7 @@ $('#paths').innerHTML = [
['guide', '01–10', 'Second brain', 'A hands-on project: a knowledge base an agent builds and maintains for you.'],
].map(([k, badge, label, p]) => {
const pages = sectionsOf(k).reduce((a, s) => a + byId.get(s).pages.length, 0);
- return `<button class="path" data-go="col:${k}" style="--dot:${COLOR[k]}"><span class="pk">${badge}</span><b>${label}</b><span class="pn">${pages} pages</span><p>${p}</p></button>`;
+ return `<button class="path" data-go="col:${k}" style="--dot:var(--c-${k})"><span class="pk">${badge}</span><b>${label}</b><span class="pn">${pages} pages</span><p>${p}</p></button>`;
}).join('');
$('#paths').addEventListener('click', e => { const t = e.target.closest('[data-go]'); if (t) go(t.dataset.go); });
const st = G.stats;
@@ -819,7 +826,7 @@ const layersBox = $('#layers');
function renderLayers() {
layersBox.innerHTML = LAYERS.map(L => {
const c = nodes.filter(n => n.group === L.key && n.type !== 'collection' && n.type !== 'hub' && n.type !== 'section').length;
- return `<button class="lyr" data-layer="${L.key}" aria-pressed="${!!layerOn[L.key]}" style="--dot:${COLOR[L.key]}" title="Show or hide: ${L.label}"><span class="d"></span>${L.label}<span class="n">${c}</span></button>`;
+ return `<button class="lyr" data-layer="${L.key}" aria-pressed="${!!layerOn[L.key]}" style="--dot:var(--c-${L.key})" title="Show or hide: ${L.label}"><span class="d"></span>${L.label}<span class="n">${c}</span></button>`;
}).join('');
}
renderLayers();
@@ -848,10 +855,10 @@ $('#btn-home').onclick = () => go('root');
const contents = $('#contents'), cBtn = $('#btn-contents');
function renderContents() {
const cur = S.sel?.id;
- const block = (col, title) => `<div class="cg" style="--dot:${COLOR[col]}"><h4><span class="d"></span>${title}</h4>` +
+ const block = (col, title) => `<div class="cg" style="--dot:var(--c-${col})"><h4><span class="d"></span>${title}</h4>` +
sectionsOf(col).map(sid => {
const s = byId.get(sid), open = cur && (cur === sid || s.pages.includes(cur));
- return `<div class="cs${open ? ' open' : ''}" style="--dot:${COLOR[col]}"><button data-sec="${esc(sid)}"><span class="k">${esc(s.badge)}</span>${esc(s.label)}<span class="n">${s.pages.length}</span></button><ol>` +
+ return `<div class="cs${open ? ' open' : ''}" style="--dot:var(--c-${col})"><button data-sec="${esc(sid)}"><span class="k">${esc(s.badge)}</span>${esc(s.label)}<span class="n">${s.pages.length}</span></button><ol>` +
s.pages.map(pid => `<li><button data-page="${esc(pid)}" data-node="${esc(pid)}" class="${pid === cur ? 'cur' : ''}">${esc(byId.get(pid).label)}</button></li>`).join('') + '</ol></div>';
}).join('') + '</div>';
$('#c-body').innerHTML = block('course', 'the agents course') + block('handbook', 'handbooks') + block('guide', 'second brain');
@@ -894,7 +901,7 @@ function paintHits() {
hits.innerHTML = hitList.length ? hitList.map((h, i) => {
const n = h.n, sec = n.sec ? byId.get(n.sec) : null;
const ctx = sec ? `${sec.badge} ${sec.label}` : n.sub || '';
- return `<button class="hit${i === hitIdx ? ' on' : ''}" data-i="${i}" style="--dot:${dotOf(n)}"><span class="d"></span><span><b>${esc(n.label)}</b><i>${TYPE[n.type]}${ctx ? ' · ' + esc(ctx) : ''}</i>${h.snip ? `<em>${h.snip}</em>` : ''}</span></button>`;
+ return `<button class="hit${i === hitIdx ? ' on' : ''}" data-i="${i}" style="--dot:${cssDot(n)}"><span class="d"></span><span><b>${esc(n.label)}</b><i>${TYPE[n.type]}${ctx ? ' · ' + esc(ctx) : ''}</i>${h.snip ? `<em>${h.snip}</em>` : ''}</span></button>`;
}).join('') : '<div class="none">nothing on the site matches that</div>';
hits.classList.add('open');
}
@@ -937,6 +944,44 @@ document.addEventListener('keydown', e => {
}
});
+// ------------------------------------------------------------------ theme
+// The page follows the system theme until the visitor picks one; the pick is
+// shared with the resources and tree pages through the same storage key.
+const themeBtn = $('#btn-theme');
+const sysDark = matchMedia('(prefers-color-scheme: dark)');
+const isDark = () => (document.documentElement.dataset.theme || (sysDark.matches ? 'dark' : 'light')) === 'dark';
+function paintThemeBtn() {
+ const d = isDark();
+ themeBtn.textContent = d ? '\u2600' : '\u263E';
+ themeBtn.title = d ? 'Light theme' : 'Dark theme';
+ themeBtn.setAttribute('aria-pressed', String(d));
+}
+function recolor() {
+ readColors();
+ scene.fog.color.copy(PAPER);
+ for (const n of nodes) {
+ if (!n._core) continue;
+ n._core.material.color.set(dotOf(n));
+ if (n._shell) n._shell.material.uniforms.color.value.set(dotOf(n));
+ }
+ VL.forEach((l, i) => {
+ const a = new THREE.Color(dotOf(l._S)), b = new THREE.Color(dotOf(l._T)), o = i * 8;
+ lcol[o] = a.r; lcol[o + 1] = a.g; lcol[o + 2] = a.b;
+ lcol[o + 4] = b.r; lcol[o + 5] = b.g; lcol[o + 6] = b.b;
+ });
+ lgeo.attributes.color.needsUpdate = true;
+ if (hl.list.length) buildHL(hl.list);
+ document.querySelectorAll('meta[name="theme-color"]').forEach(m => { m.content = '#' + PAPER.getHexString(); });
+}
+themeBtn.onclick = () => {
+ const next = isDark() ? 'light' : 'dark';
+ document.documentElement.dataset.theme = next;
+ store.set('theme', next);
+ paintThemeBtn(); recolor();
+};
+sysDark.addEventListener('change', () => { if (!document.documentElement.dataset.theme) { paintThemeBtn(); recolor(); } });
+paintThemeBtn();
+
// ------------------------------------------------------------------ resize
addEventListener('resize', () => {
graph.width(innerWidth).height(innerHeight);
diff --git a/index.html b/index.html
index 93b4959..b07789a 100644
--- a/index.html
+++ b/index.html
@@ -2,7 +2,9 @@
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>Second Brain OS - guides and resources for AI engineers</title>
<meta name="description" content="Guides and resources for AI engineers: a course on building agents, five handbooks, a hands-on second-brain project and a vetted reading list, all on one explorable graph.">
-<meta name="theme-color" content="#EAEEE9">
+<meta name="theme-color" content="#EAEEE9" media="(prefers-color-scheme: light)">
+<meta name="theme-color" content="#0F1513" media="(prefers-color-scheme: dark)">
+<script>try{var t=JSON.parse(localStorage.getItem('sbos:theme'));if(t==='dark'||t==='light')document.documentElement.dataset.theme=t}catch(e){}</script>
<meta name="author" content="@undefinedKi">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23F7F9F6'/%3E%3Crect x='.5' y='.5' width='31' height='31' rx='6.5' fill='none' stroke='%23D2DACF'/%3E%3Cpath d='M10 21 L16 11 L22 19 M16 11 L23 9' stroke='%231F6B52' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='10' cy='21' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='16' cy='11' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='22' cy='19' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='24' cy='8' r='2' fill='%231F6B52'/%3E%3C/svg%3E">
<link rel="stylesheet" href="assets/site/app.css">
@@ -23,6 +25,7 @@
<kbd>/</kbd>
<div class="hits" id="hits" role="listbox"></div>
</div>
+ <button class="tbtn tico" id="btn-theme" aria-label="Switch between light and dark theme" aria-pressed="false">&#9790;</button>
<nav class="links">
<a href="resources.html">Resources</a>
<a href="tree.html">Tree</a>
diff --git a/resources.html b/resources.html
index 185b54c..2bef4e4 100644
--- a/resources.html
+++ b/resources.html
@@ -1,13 +1,19 @@
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
-<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23F7F9F6'/%3E%3Crect x='.5' y='.5' width='31' height='31' rx='6.5' fill='none' stroke='%23D2DACF'/%3E%3Cpath d='M10 21 L16 11 L22 19 M16 11 L23 9' stroke='%231F6B52' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='10' cy='21' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='16' cy='11' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='22' cy='19' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='24' cy='8' r='2' fill='%231F6B52'/%3E%3C/svg%3E"><title>Second Brain OS - resources</title>
+<script>try{var t=JSON.parse(localStorage.getItem('sbos:theme'));if(t==='dark'||t==='light')document.documentElement.dataset.theme=t}catch(e){}</script><link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23F7F9F6'/%3E%3Crect x='.5' y='.5' width='31' height='31' rx='6.5' fill='none' stroke='%23D2DACF'/%3E%3Cpath d='M10 21 L16 11 L22 19 M16 11 L23 9' stroke='%231F6B52' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='10' cy='21' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='16' cy='11' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='22' cy='19' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='24' cy='8' r='2' fill='%231F6B52'/%3E%3C/svg%3E"><title>Second Brain OS - resources</title>
<meta name="description" content="114 checked links: Obsidian plugins by installs, repositories by stars, papers, tools and reading.">
<style>
:root{
--paper:#EAEEE9; --card:#F7F9F6; --ink:#15201B; --soft:#4B5A52; --faint:#7C8A82;
--rule:#D2DACF; --accent:#1F6B52; --accent-bg:#E1EDE5; --num:#8A6B23;
+ --paper-rgb:234,238,233; --on-accent:#F7F9F6; color-scheme:light;
--w:68ch;
}
+/* dark: follows the system unless the visitor picked a theme */
+@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}}
+:root[data-theme="dark"]{--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}
+.theme{font:15px/1 ui-monospace,Menlo,monospace;color:var(--soft);background:none;border:1px solid var(--rule);border-radius:6px;width:32px;height:30px;cursor:pointer;flex:none}
+.theme:hover{color:var(--ink);border-color:var(--accent)}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{background:var(--paper);color:var(--ink);
@@ -18,7 +24,7 @@ a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}
-header{position:sticky;top:0;z-index:40;background:rgba(234,238,233,.94);
+header{position:sticky;top:0;z-index:40;background:rgba(var(--paper-rgb),.94);
backdrop-filter:blur(8px);border-bottom:1px solid var(--rule)}
.bar{max-width:1500px;margin:0 auto;padding:13px 22px;display:flex;gap:20px;align-items:center}
.brand{font:600 15px/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ink);letter-spacing:-.01em}
@@ -147,7 +153,7 @@ article.page a.wiki::after{content:"]]";color:var(--faint)}
padding-bottom:18px;border-bottom:1px solid var(--rule)}
.chip{font:13px/1 ui-monospace,Menlo,monospace;background:var(--card);color:var(--soft);
border:1px solid var(--rule);border-radius:20px;padding:7px 13px;cursor:pointer}
-.chip.on{background:var(--accent);border-color:var(--accent);color:#F7F9F6}
+.chip.on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.controls input{margin-left:auto;font:14px ui-monospace,Menlo,monospace;
background:var(--card);border:1px solid var(--rule);border-radius:3px;padding:8px 11px;width:230px}
.count{font:12px ui-monospace,Menlo,monospace;color:var(--faint);padding:14px 0 4px}
@@ -173,6 +179,7 @@ footer{border-top:1px solid var(--rule);padding:22px;text-align:center;
<a href="tree.html">Tree</a>
<a href="https://github.com/undefined-ui/second-brain-os">Repo</a>
</nav>
+ <button class="theme" id="theme" aria-label="Switch between light and dark theme">&#9790;</button>
</div></header>
@@ -214,4 +221,4 @@ document.getElementById('ctl').addEventListener('click',e=>{
});
document.getElementById('rq').addEventListener('input',e=>{term=e.target.value.trim().toLowerCase();draw();});
draw();
-</script></body></html>
\ No newline at end of file
+</script><script>(function(){var b=document.getElementById('theme'),r=document.documentElement,m=matchMedia('(prefers-color-scheme: dark)');function d(){return (r.dataset.theme||(m.matches?'dark':'light'))==='dark'}function p(){b.textContent=d()?'☀':'☾';b.title=d()?'Light theme':'Dark theme'}b.onclick=function(){var t=d()?'light':'dark';r.dataset.theme=t;try{localStorage.setItem('sbos:theme',JSON.stringify(t))}catch(e){}p()};m.addEventListener('change',p);p()})()</script></body></html>
\ No newline at end of file
diff --git a/scripts/build_tree.py b/scripts/build_tree.py
index 0db6daf..b03919c 100644
--- a/scripts/build_tree.py
+++ b/scripts/build_tree.py
@@ -290,12 +290,17 @@ def main():
TEMPLATE = """<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
-<title>The full component tree - Second Brain OS</title>
+<script>try{var t=JSON.parse(localStorage.getItem('sbos:theme'));if(t==='dark'||t==='light')document.documentElement.dataset.theme=t}catch(e){}</script><title>The full component tree - Second Brain OS</title>
<meta name="description" content="Every component in second-brain-os on one page: the agents course, five handbooks, the second-brain project, skills, commands, agents, scripts and resources, each line a link.">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23F7F9F6'/%3E%3Crect x='.5' y='.5' width='31' height='31' rx='6.5' fill='none' stroke='%23D2DACF'/%3E%3Cpath d='M10 21 L16 11 L22 19 M16 11 L23 9' stroke='%231F6B52' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='10' cy='21' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='16' cy='11' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='22' cy='19' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='24' cy='8' r='2' fill='%231F6B52'/%3E%3C/svg%3E">
<style>
:root{--paper:#EAEEE9;--card:#F7F9F6;--ink:#15201B;--soft:#4B5A52;--faint:#7C8A82;
- --rule:#D2DACF;--accent:#1F6B52;--accent-bg:#E1EDE5}
+ --rule:#D2DACF;--accent:#1F6B52;--accent-bg:#E1EDE5;color-scheme:light}
+/* dark: follows the system unless the visitor picked a theme */
+@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}}
+:root[data-theme="dark"]{--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}
+.theme{font:15px/1 ui-monospace,Menlo,monospace;color:var(--soft);background:none;border:1px solid var(--rule);border-radius:6px;width:32px;height:30px;cursor:pointer;flex:none}
+.theme:hover{color:var(--ink);border-color:var(--accent)}
*{box-sizing:border-box;margin:0;padding:0}
body{background:var(--paper);color:var(--ink);
font:13px/1.7 ui-monospace,Menlo,Consolas,monospace}
@@ -343,6 +348,7 @@ footer{border-top:1px solid var(--rule);padding:22px;text-align:center;color:var
<a href="tree.html" class="on">Tree</a>
<a href="https://github.com/undefined-ui/second-brain-os">Repo</a>
</nav>
+ <button class="theme" id="theme" aria-label="Switch between light and dark theme">&#9790;</button>
</div></header>
<div class="wrap">
<h1>The full component tree</h1>
@@ -355,7 +361,7 @@ footer{border-top:1px solid var(--rule);padding:22px;text-align:center;color:var
<div class="counts"><b>{{COUNTS}}</b><span>generated from the repo</span></div>
</div>
<footer>Generated from the repository. <a href="https://github.com/undefined-ui/second-brain-os">github.com/undefined-ui/second-brain-os</a> · by <a href="https://x.com/undefinedKi" rel="noopener">@undefinedKi</a></footer>
-</body></html>"""
+<script>(function(){var b=document.getElementById('theme'),r=document.documentElement,m=matchMedia('(prefers-color-scheme: dark)');function d(){return (r.dataset.theme||(m.matches?'dark':'light'))==='dark'}function p(){b.textContent=d()?'\u2600':'\u263E';b.title=d()?'Light theme':'Dark theme'}b.onclick=function(){var t=d()?'light':'dark';r.dataset.theme=t;try{localStorage.setItem('sbos:theme',JSON.stringify(t))}catch(e){}p()};m.addEventListener('change',p);p()})()</script></body></html>"""
if __name__ == "__main__":
diff --git a/tools/build_site.py b/tools/build_site.py
index 831fbb4..728b052 100644
--- a/tools/build_site.py
+++ b/tools/build_site.py
@@ -20,8 +20,14 @@ CSS = """
:root{
--paper:#EAEEE9; --card:#F7F9F6; --ink:#15201B; --soft:#4B5A52; --faint:#7C8A82;
--rule:#D2DACF; --accent:#1F6B52; --accent-bg:#E1EDE5; --num:#8A6B23;
+ --paper-rgb:234,238,233; --on-accent:#F7F9F6; color-scheme:light;
--w:68ch;
}
+/* dark: follows the system unless the visitor picked a theme */
+@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}}
+:root[data-theme="dark"]{--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}
+.theme{font:15px/1 ui-monospace,Menlo,monospace;color:var(--soft);background:none;border:1px solid var(--rule);border-radius:6px;width:32px;height:30px;cursor:pointer;flex:none}
+.theme:hover{color:var(--ink);border-color:var(--accent)}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{background:var(--paper);color:var(--ink);
@@ -32,7 +38,7 @@ a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}
-header{position:sticky;top:0;z-index:40;background:rgba(234,238,233,.94);
+header{position:sticky;top:0;z-index:40;background:rgba(var(--paper-rgb),.94);
backdrop-filter:blur(8px);border-bottom:1px solid var(--rule)}
.bar{max-width:1500px;margin:0 auto;padding:13px 22px;display:flex;gap:20px;align-items:center}
.brand{font:600 15px/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ink);letter-spacing:-.01em}
@@ -161,7 +167,7 @@ article.page a.wiki::after{content:"]]";color:var(--faint)}
padding-bottom:18px;border-bottom:1px solid var(--rule)}
.chip{font:13px/1 ui-monospace,Menlo,monospace;background:var(--card);color:var(--soft);
border:1px solid var(--rule);border-radius:20px;padding:7px 13px;cursor:pointer}
-.chip.on{background:var(--accent);border-color:var(--accent);color:#F7F9F6}
+.chip.on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.controls input{margin-left:auto;font:14px ui-monospace,Menlo,monospace;
background:var(--card);border:1px solid var(--rule);border-radius:3px;padding:8px 11px;width:230px}
.count{font:12px ui-monospace,Menlo,monospace;color:var(--faint);padding:14px 0 4px}
@@ -192,6 +198,7 @@ def header(active):
<a href="tree.html">Tree</a>
<a href="{REPO}">Repo</a>
</nav>
+ <button class="theme" id="theme" aria-label="Switch between light and dark theme">&#9790;</button>
{'<button class="toc-btn" id="toc">Index</button>' if active=='guide' else ''}
{SEARCHBOX if active=='guide' else ''}
</div></header>"""
@@ -391,7 +398,7 @@ for r in R:
RES = f"""<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
-{ICON}<title>Second Brain OS - resources</title>
+<script>try{{var t=JSON.parse(localStorage.getItem('sbos:theme'));if(t==='dark'||t==='light')document.documentElement.dataset.theme=t}}catch(e){{}}</script>{ICON}<title>Second Brain OS - resources</title>
<meta name="description" content="{len(R)} checked links: Obsidian plugins by installs, repositories by stars, papers, tools and reading.">
<style>{CSS}</style>{BEACON}
</head><body>
@@ -434,7 +441,7 @@ document.getElementById('ctl').addEventListener('click',e=>{{
}});
document.getElementById('rq').addEventListener('input',e=>{{term=e.target.value.trim().toLowerCase();draw();}});
draw();
-</script></body></html>"""
+</script><script>(function(){{var b=document.getElementById('theme'),r=document.documentElement,m=matchMedia('(prefers-color-scheme: dark)');function d(){{return (r.dataset.theme||(m.matches?'dark':'light'))==='dark'}}function p(){{b.textContent=d()?'\u2600':'\u263E';b.title=d()?'Light theme':'Dark theme'}}b.onclick=function(){{var t=d()?'light':'dark';r.dataset.theme=t;try{{localStorage.setItem('sbos:theme',JSON.stringify(t))}}catch(e){{}}p()}};m.addEventListener('change',p);p()}})()</script></body></html>"""
open(f"{OUT}/resources.html","w").write(RES)
print("resources.html", os.path.getsize(f"{OUT}/resources.html")//1024, "KB")
diff --git a/tree.html b/tree.html
index 312495f..9a4c57b 100644
--- a/tree.html
+++ b/tree.html
@@ -1,11 +1,16 @@
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
-<title>The full component tree - Second Brain OS</title>
+<script>try{var t=JSON.parse(localStorage.getItem('sbos:theme'));if(t==='dark'||t==='light')document.documentElement.dataset.theme=t}catch(e){}</script><title>The full component tree - Second Brain OS</title>
<meta name="description" content="Every component in second-brain-os on one page: the agents course, five handbooks, the second-brain project, skills, commands, agents, scripts and resources, each line a link.">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23F7F9F6'/%3E%3Crect x='.5' y='.5' width='31' height='31' rx='6.5' fill='none' stroke='%23D2DACF'/%3E%3Cpath d='M10 21 L16 11 L22 19 M16 11 L23 9' stroke='%231F6B52' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='10' cy='21' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='16' cy='11' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='22' cy='19' r='3' fill='%23F7F9F6' stroke='%231F6B52' stroke-width='1.6'/%3E%3Ccircle cx='24' cy='8' r='2' fill='%231F6B52'/%3E%3C/svg%3E">
<style>
:root{--paper:#EAEEE9;--card:#F7F9F6;--ink:#15201B;--soft:#4B5A52;--faint:#7C8A82;
- --rule:#D2DACF;--accent:#1F6B52;--accent-bg:#E1EDE5}
+ --rule:#D2DACF;--accent:#1F6B52;--accent-bg:#E1EDE5;color-scheme:light}
+/* dark: follows the system unless the visitor picked a theme */
+@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}}
+:root[data-theme="dark"]{--paper:#0F1513;--card:#171F1B;--ink:#E2E8E3;--soft:#A7B4AC;--faint:#7B8981;--rule:#29342F;--accent:#5DBB94;--accent-bg:#1B2C24;--num:#D4AC52;--paper-rgb:15,21,19;--on-accent:#0F1513;color-scheme:dark}
+.theme{font:15px/1 ui-monospace,Menlo,monospace;color:var(--soft);background:none;border:1px solid var(--rule);border-radius:6px;width:32px;height:30px;cursor:pointer;flex:none}
+.theme:hover{color:var(--ink);border-color:var(--accent)}
*{box-sizing:border-box;margin:0;padding:0}
body{background:var(--paper);color:var(--ink);
font:13px/1.7 ui-monospace,Menlo,Consolas,monospace}
@@ -53,6 +58,7 @@ footer{border-top:1px solid var(--rule);padding:22px;text-align:center;color:var
<a href="tree.html" class="on">Tree</a>
<a href="https://github.com/undefined-ui/second-brain-os">Repo</a>
</nav>
+ <button class="theme" id="theme" aria-label="Switch between light and dark theme">&#9790;</button>
</div></header>
<div class="wrap">
<h1>The full component tree</h1>
@@ -65,4 +71,4 @@ footer{border-top:1px solid var(--rule);padding:22px;text-align:center;color:var
<div class="counts"><b>18 skills · 72 commands · 6 subagents · 6 plugin tools · 6 scripts · 21 course pages · 44 handbook pages · 65 second-brain pages · 118 vetted links</b><span>generated from the repo</span></div>
</div>
<footer>Generated from the repository. <a href="https://github.com/undefined-ui/second-brain-os">github.com/undefined-ui/second-brain-os</a> · by <a href="https://x.com/undefinedKi" rel="noopener">@undefinedKi</a></footer>
-</body></html>
\ No newline at end of file
+<script>(function(){var b=document.getElementById('theme'),r=document.documentElement,m=matchMedia('(prefers-color-scheme: dark)');function d(){return (r.dataset.theme||(m.matches?'dark':'light'))==='dark'}function p(){b.textContent=d()?'☀':'☾';b.title=d()?'Light theme':'Dark theme'}b.onclick=function(){var t=d()?'light':'dark';r.dataset.theme=t;try{localStorage.setItem('sbos:theme',JSON.stringify(t))}catch(e){}p()};m.addEventListener('change',p);p()})()</script></body></html>
\ No newline at end of file