An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(site): the light edition of chapter 13 as a sample inside the science book
yzr52526db2452a
diff --git a/engine/contents.js b/engine/contents.jsindex a3694c8..0afe424 100644--- a/engine/contents.js+++ b/engine/contents.js@@ -12,7 +12,7 @@ const Contents = (() => {en: {open: 'Open the book', toCover: 'Back to the cover', resume: 'Continue · Chapter {n}', unit: 'Unit {n}', minutes: '{n} min',meta: '{chapters}{samples} · {units} · with sound', metaChapters: { one: '{n} chapter', other: '{n} chapters' },- metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: ' + {n} sample', sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -77,15 +77,18 @@ const Contents = (() => {}// The chapter cards, unit by unit, with progress, the header count, the cover's meta line and its resume button.- // A unit's optional third entry { unit, chapter, sample } numbers it from elsewhere in the book; a sample chapter,- // made to show another look, is not counted with the book's chapters.+ // A unit's optional third entry { unit, chapter, sample, href } numbers it from elsewhere in the book; a sample chapter,+ // made to show another look, is not counted with the book's chapters. With href, the sample lives in another book+ // folder (its own progress): its card links there and leaves this book's numbering and progress alone.function contents(units, start, hues, P) {- let n = start.chapter - 1, total = 0, i = 0; // i staggers the entrance, in reading order+ let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading orderconst samples = new Set();$('units').innerHTML = units.map(([name, chs, o = {}], u) => {- if (o.chapter) n = o.chapter - 1;+ if (o.chapter && !o.href) n = o.chapter - 1;return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, translate('unit', { n: o.unit ?? u + start.unit }) + (o.sample ? translate('sampleUnit') : ''), name)}<div class="grid">` +- chs.map(([t, min]) => { n++; if (o.sample) samples.add(n); else total++;+ chs.map(([t, min], k) => {+ if (o.href) { away++; return `<a class="ch" href="${o.href}" style="--i:${i++}"><b>${(o.chapter ?? 1) + k}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`; }+ n++; if (o.sample) samples.add(n); else total++;const cls = 'ch' + (P.done.has(n) ? ' done' : '') + (P.last === n ? ' last' : '');return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${n}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';@@ -96,7 +99,7 @@ const Contents = (() => {$('prog').innerHTML = finished ? translate('finished', { done: `<b>${finished}</b>`, n: total }) : translate('chapterCount', { n: total });$('meta').textContent = translate('meta', {chapters: translate('metaChapters', { n: total }),- samples: samples.size ? translate('metaSamples', { n: samples.size }) : '',+ samples: samples.size + away ? translate('metaSamples', { n: samples.size + away }) : '',units: translate('metaUnits', { n: units.filter(x => !x[2]?.sample).length }) });const last = Number.isInteger(P.last) && $(id(P.last));if (last) {@@ -171,7 +174,7 @@ const Contents = (() => {});}- // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?], ...]. Chapters are numbered in+ // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample, href }?], ...]. Chapters are numbered in// order from start (a book whose scope starts mid-way keeps the original numbers). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();diff --git a/site/elementary-algebra/lib/contents.js b/site/elementary-algebra/lib/contents.jsindex a3694c8..0afe424 100644--- a/site/elementary-algebra/lib/contents.js+++ b/site/elementary-algebra/lib/contents.js@@ -12,7 +12,7 @@ const Contents = (() => {en: {open: 'Open the book', toCover: 'Back to the cover', resume: 'Continue · Chapter {n}', unit: 'Unit {n}', minutes: '{n} min',meta: '{chapters}{samples} · {units} · with sound', metaChapters: { one: '{n} chapter', other: '{n} chapters' },- metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: ' + {n} sample', sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -77,15 +77,18 @@ const Contents = (() => {}// The chapter cards, unit by unit, with progress, the header count, the cover's meta line and its resume button.- // A unit's optional third entry { unit, chapter, sample } numbers it from elsewhere in the book; a sample chapter,- // made to show another look, is not counted with the book's chapters.+ // A unit's optional third entry { unit, chapter, sample, href } numbers it from elsewhere in the book; a sample chapter,+ // made to show another look, is not counted with the book's chapters. With href, the sample lives in another book+ // folder (its own progress): its card links there and leaves this book's numbering and progress alone.function contents(units, start, hues, P) {- let n = start.chapter - 1, total = 0, i = 0; // i staggers the entrance, in reading order+ let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading orderconst samples = new Set();$('units').innerHTML = units.map(([name, chs, o = {}], u) => {- if (o.chapter) n = o.chapter - 1;+ if (o.chapter && !o.href) n = o.chapter - 1;return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, translate('unit', { n: o.unit ?? u + start.unit }) + (o.sample ? translate('sampleUnit') : ''), name)}<div class="grid">` +- chs.map(([t, min]) => { n++; if (o.sample) samples.add(n); else total++;+ chs.map(([t, min], k) => {+ if (o.href) { away++; return `<a class="ch" href="${o.href}" style="--i:${i++}"><b>${(o.chapter ?? 1) + k}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`; }+ n++; if (o.sample) samples.add(n); else total++;const cls = 'ch' + (P.done.has(n) ? ' done' : '') + (P.last === n ? ' last' : '');return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${n}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';@@ -96,7 +99,7 @@ const Contents = (() => {$('prog').innerHTML = finished ? translate('finished', { done: `<b>${finished}</b>`, n: total }) : translate('chapterCount', { n: total });$('meta').textContent = translate('meta', {chapters: translate('metaChapters', { n: total }),- samples: samples.size ? translate('metaSamples', { n: samples.size }) : '',+ samples: samples.size + away ? translate('metaSamples', { n: samples.size + away }) : '',units: translate('metaUnits', { n: units.filter(x => !x[2]?.sample).length }) });const last = Number.isInteger(P.last) && $(id(P.last));if (last) {@@ -171,7 +174,7 @@ const Contents = (() => {});}- // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?], ...]. Chapters are numbered in+ // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample, href }?], ...]. Chapters are numbered in// order from start (a book whose scope starts mid-way keeps the original numbers). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();diff --git a/site/index.html b/site/index.htmlindex c8e0ec9..68e988a 100644--- a/site/index.html+++ b/site/index.html@@ -26,10 +26,9 @@<a class="book-hotspot math-book" data-book="math-notebook" href="math-notebook/" aria-label="Open Elementary Mathematics, 23 narrated chapters"><span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>23 narrated chapters</small></span></a>- <a class="book-hotspot physics-book" data-book="science" href="science/" aria-label="Open Elementary Physics, 6 narrated chapters and a sample chapter">- <span class="book-caption"><strong>Elementary Physics <span aria-hidden="true">↗</span></strong><small>6 narrated chapters · 1 sample</small></span>+ <a class="book-hotspot physics-book" data-book="science" href="science/" aria-label="Open Elementary Physics, 6 narrated chapters and 2 sample chapters">+ <span class="book-caption"><strong>Elementary Physics <span aria-hidden="true">↗</span></strong><small>6 narrated chapters · 2 samples</small></span></a>- <a class="also-label" href="physics-notebook/" aria-label="Also: Energy and Change, the physics book's energy chapter in a light notebook edition">Also: <b>Energy & Change</b> · light notebook edition ↗</a></section><section class="shelf-tier" aria-labelledby="picture-title"><h2 class="visually-hidden" id="picture-title">Picture books for children · Coming soon</h2>diff --git a/site/lib/bookshelf.css b/site/lib/bookshelf.cssindex dee9c07..09019d6 100644--- a/site/lib/bookshelf.css+++ b/site/lib/bookshelf.css@@ -33,10 +33,7 @@ a { color: inherit; }.book-caption strong > span { position: absolute; right: 1.2cqw; top: 1.1cqw; color: #e8c68b; }.book-caption small { color: #e2dbca; font-size: 1.03cqw; letter-spacing: .03em; }.resume-label { position: absolute; padding: .46cqw .74cqw; background: #fcf4df; color: #3c4336; box-shadow: 1px 2px 5px #0003; font: 1.03cqw var(--ui); transform: rotate(-3deg); }-.also-label { position: absolute; left: 70.5%; top: 28.75%; padding: .4cqw .8cqw; background: #fcf9ef; color: #2e2a24; box-shadow: 1px 2px 5px #0003;font: 1.03cqw var(--ui); text-decoration: none; white-space: nowrap; transform: rotate(-1.5deg); border-left: .3cqw solid #f2a7b5; }-.also-label b { font-weight: 600; color: #e0457b; }-.also-label:hover { box-shadow: 1px 3px 9px #0005; }.github-drawer { position: absolute; left: 9%; top: 87.5%; width: 68%; height: 8.5%; text-decoration: none; }.shelf-noscript { position: absolute; bottom: 0; left: 24px; margin: 0; font: 11px var(--ui); color: #352c21; }.shelf-footer { position: absolute; inset: auto 0 0; display: flex; justify-content: center; align-items: center; gap: 3%; height: 3%; padding: 0 3%; color: #594129; font: 500 clamp(10px, .85vw, 14px)/1.4 var(--ui); text-shadow: 0 1px #ffe6bd66; }diff --git a/site/math-notebook/lib/contents.js b/site/math-notebook/lib/contents.jsindex a3694c8..0afe424 100644--- a/site/math-notebook/lib/contents.js+++ b/site/math-notebook/lib/contents.js@@ -12,7 +12,7 @@ const Contents = (() => {en: {open: 'Open the book', toCover: 'Back to the cover', resume: 'Continue · Chapter {n}', unit: 'Unit {n}', minutes: '{n} min',meta: '{chapters}{samples} · {units} · with sound', metaChapters: { one: '{n} chapter', other: '{n} chapters' },- metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: ' + {n} sample', sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -77,15 +77,18 @@ const Contents = (() => {}// The chapter cards, unit by unit, with progress, the header count, the cover's meta line and its resume button.- // A unit's optional third entry { unit, chapter, sample } numbers it from elsewhere in the book; a sample chapter,- // made to show another look, is not counted with the book's chapters.+ // A unit's optional third entry { unit, chapter, sample, href } numbers it from elsewhere in the book; a sample chapter,+ // made to show another look, is not counted with the book's chapters. With href, the sample lives in another book+ // folder (its own progress): its card links there and leaves this book's numbering and progress alone.function contents(units, start, hues, P) {- let n = start.chapter - 1, total = 0, i = 0; // i staggers the entrance, in reading order+ let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading orderconst samples = new Set();$('units').innerHTML = units.map(([name, chs, o = {}], u) => {- if (o.chapter) n = o.chapter - 1;+ if (o.chapter && !o.href) n = o.chapter - 1;return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, translate('unit', { n: o.unit ?? u + start.unit }) + (o.sample ? translate('sampleUnit') : ''), name)}<div class="grid">` +- chs.map(([t, min]) => { n++; if (o.sample) samples.add(n); else total++;+ chs.map(([t, min], k) => {+ if (o.href) { away++; return `<a class="ch" href="${o.href}" style="--i:${i++}"><b>${(o.chapter ?? 1) + k}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`; }+ n++; if (o.sample) samples.add(n); else total++;const cls = 'ch' + (P.done.has(n) ? ' done' : '') + (P.last === n ? ' last' : '');return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${n}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';@@ -96,7 +99,7 @@ const Contents = (() => {$('prog').innerHTML = finished ? translate('finished', { done: `<b>${finished}</b>`, n: total }) : translate('chapterCount', { n: total });$('meta').textContent = translate('meta', {chapters: translate('metaChapters', { n: total }),- samples: samples.size ? translate('metaSamples', { n: samples.size }) : '',+ samples: samples.size + away ? translate('metaSamples', { n: samples.size + away }) : '',units: translate('metaUnits', { n: units.filter(x => !x[2]?.sample).length }) });const last = Number.isInteger(P.last) && $(id(P.last));if (last) {@@ -171,7 +174,7 @@ const Contents = (() => {});}- // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?], ...]. Chapters are numbered in+ // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample, href }?], ...]. Chapters are numbered in// order from start (a book whose scope starts mid-way keeps the original numbers). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();diff --git a/site/physics-notebook/lib/contents.js b/site/physics-notebook/lib/contents.jsindex a3694c8..0afe424 100644--- a/site/physics-notebook/lib/contents.js+++ b/site/physics-notebook/lib/contents.js@@ -12,7 +12,7 @@ const Contents = (() => {en: {open: 'Open the book', toCover: 'Back to the cover', resume: 'Continue · Chapter {n}', unit: 'Unit {n}', minutes: '{n} min',meta: '{chapters}{samples} · {units} · with sound', metaChapters: { one: '{n} chapter', other: '{n} chapters' },- metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: ' + {n} sample', sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -77,15 +77,18 @@ const Contents = (() => {}// The chapter cards, unit by unit, with progress, the header count, the cover's meta line and its resume button.- // A unit's optional third entry { unit, chapter, sample } numbers it from elsewhere in the book; a sample chapter,- // made to show another look, is not counted with the book's chapters.+ // A unit's optional third entry { unit, chapter, sample, href } numbers it from elsewhere in the book; a sample chapter,+ // made to show another look, is not counted with the book's chapters. With href, the sample lives in another book+ // folder (its own progress): its card links there and leaves this book's numbering and progress alone.function contents(units, start, hues, P) {- let n = start.chapter - 1, total = 0, i = 0; // i staggers the entrance, in reading order+ let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading orderconst samples = new Set();$('units').innerHTML = units.map(([name, chs, o = {}], u) => {- if (o.chapter) n = o.chapter - 1;+ if (o.chapter && !o.href) n = o.chapter - 1;return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, translate('unit', { n: o.unit ?? u + start.unit }) + (o.sample ? translate('sampleUnit') : ''), name)}<div class="grid">` +- chs.map(([t, min]) => { n++; if (o.sample) samples.add(n); else total++;+ chs.map(([t, min], k) => {+ if (o.href) { away++; return `<a class="ch" href="${o.href}" style="--i:${i++}"><b>${(o.chapter ?? 1) + k}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`; }+ n++; if (o.sample) samples.add(n); else total++;const cls = 'ch' + (P.done.has(n) ? ' done' : '') + (P.last === n ? ' last' : '');return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${n}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';@@ -96,7 +99,7 @@ const Contents = (() => {$('prog').innerHTML = finished ? translate('finished', { done: `<b>${finished}</b>`, n: total }) : translate('chapterCount', { n: total });$('meta').textContent = translate('meta', {chapters: translate('metaChapters', { n: total }),- samples: samples.size ? translate('metaSamples', { n: samples.size }) : '',+ samples: samples.size + away ? translate('metaSamples', { n: samples.size + away }) : '',units: translate('metaUnits', { n: units.filter(x => !x[2]?.sample).length }) });const last = Number.isInteger(P.last) && $(id(P.last));if (last) {@@ -171,7 +174,7 @@ const Contents = (() => {});}- // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?], ...]. Chapters are numbered in+ // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample, href }?], ...]. Chapters are numbered in// order from start (a book whose scope starts mid-way keeps the original numbers). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();diff --git a/site/science/index.html b/site/science/index.htmlindex 160162b..1598d45 100644--- a/site/science/index.html+++ b/site/science/index.html@@ -51,8 +51,9 @@ Contents.book({['Motion, Forces, and Work', [['Motion', 18], ['Force and Newton’s Laws of Motion', 13], ['Gravity, Friction, and More Forces in Everyday Life', 15], ['Work and Machines', 14]]],['Energy', [['Forms of Energy', 11], ['Thermal Energy', 11]]],['Outer Space: the Sun, Earth and Moon', [['The Sun-Earth-Moon System', 14]], { unit: 5, chapter: 19, sample: true }],+ ['Energy, light notebook edition', [['Forms of Energy', 9]], { unit: 4, chapter: 13, sample: true, href: '../physics-notebook/ch13/' }],],- hues: ['#f4a48c', '#8fd6b0', '#86c9e8', '#f3c95c', '#e8a0c8', '#bba8ee', '#f0b45a'], // unit 4 (energy) green; the sample keeps its blue+ hues: ['#f4a48c', '#8fd6b0', '#86c9e8', '#e8a0c8', '#e8a0c8', '#bba8ee', '#f0b45a'], // unit 4 (energy) green; the samples keep blue and pink});</script></body>diff --git a/site/science/lib/contents.js b/site/science/lib/contents.jsindex a3694c8..0afe424 100644--- a/site/science/lib/contents.js+++ b/site/science/lib/contents.js@@ -12,7 +12,7 @@ const Contents = (() => {en: {open: 'Open the book', toCover: 'Back to the cover', resume: 'Continue · Chapter {n}', unit: 'Unit {n}', minutes: '{n} min',meta: '{chapters}{samples} · {units} · with sound', metaChapters: { one: '{n} chapter', other: '{n} chapters' },- metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: ' + {n} sample', sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -77,15 +77,18 @@ const Contents = (() => {}// The chapter cards, unit by unit, with progress, the header count, the cover's meta line and its resume button.- // A unit's optional third entry { unit, chapter, sample } numbers it from elsewhere in the book; a sample chapter,- // made to show another look, is not counted with the book's chapters.+ // A unit's optional third entry { unit, chapter, sample, href } numbers it from elsewhere in the book; a sample chapter,+ // made to show another look, is not counted with the book's chapters. With href, the sample lives in another book+ // folder (its own progress): its card links there and leaves this book's numbering and progress alone.function contents(units, start, hues, P) {- let n = start.chapter - 1, total = 0, i = 0; // i staggers the entrance, in reading order+ let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading orderconst samples = new Set();$('units').innerHTML = units.map(([name, chs, o = {}], u) => {- if (o.chapter) n = o.chapter - 1;+ if (o.chapter && !o.href) n = o.chapter - 1;return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, translate('unit', { n: o.unit ?? u + start.unit }) + (o.sample ? translate('sampleUnit') : ''), name)}<div class="grid">` +- chs.map(([t, min]) => { n++; if (o.sample) samples.add(n); else total++;+ chs.map(([t, min], k) => {+ if (o.href) { away++; return `<a class="ch" href="${o.href}" style="--i:${i++}"><b>${(o.chapter ?? 1) + k}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`; }+ n++; if (o.sample) samples.add(n); else total++;const cls = 'ch' + (P.done.has(n) ? ' done' : '') + (P.last === n ? ' last' : '');return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${n}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';@@ -96,7 +99,7 @@ const Contents = (() => {$('prog').innerHTML = finished ? translate('finished', { done: `<b>${finished}</b>`, n: total }) : translate('chapterCount', { n: total });$('meta').textContent = translate('meta', {chapters: translate('metaChapters', { n: total }),- samples: samples.size ? translate('metaSamples', { n: samples.size }) : '',+ samples: samples.size + away ? translate('metaSamples', { n: samples.size + away }) : '',units: translate('metaUnits', { n: units.filter(x => !x[2]?.sample).length }) });const last = Number.isInteger(P.last) && $(id(P.last));if (last) {@@ -171,7 +174,7 @@ const Contents = (() => {});}- // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?], ...]. Chapters are numbered in+ // units: [[unit title, [[chapter title, minutes], ...], { unit, chapter, sample, href }?], ...]. Chapters are numbered in// order from start (a book whose scope starts mid-way keeps the original numbers). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();diff --git a/site/science/unit-art.js b/site/science/unit-art.jsindex 465454d..ae7cf88 100644--- a/site/science/unit-art.js+++ b/site/science/unit-art.js@@ -28,5 +28,8 @@P('M560 92A140 46 0 1 1 280 92A140 46 0 1 1 560 92', 'a') +`<g class="t orbit" style="--k:${k++};offset-path:path('M560 92A140 46 0 1 0 280 92A140 46 0 1 0 560 92')"><circle r="11" fill="currentColor" stroke="none"/><circle cx="20" cy="-6" r="4" fill="currentColor" stroke="none" opacity=".7"/></g>` +Tx(420, 30, 'sun · earth · moon', 22, 'a', 'middle')),+ // Unit 4 sample (the light notebook edition of chapter 13): a ruled page with a margin and a doodled lightning bolt.+ reset([60, 100, 140].map(y => P(`M228 ${y}H572`, 'faint')).join('') + P('M262 30V170', 'a') ++ P('M430 34L398 98H428L404 160L470 82H438L462 34Z') + Tx(500, 60, 'notebook', 22, 'a', 'middle')),];})();