An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(science): number the physics book from 1 and merge its samples
yzrd1d179a4f557
diff --git a/engine/contents.js b/engine/contents.jsindex 0afe424..6b3272b 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: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, samples: 'Sample chapters, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -22,21 +22,21 @@ const Contents = (() => {metaChapters: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' },metaUnits: { one: '{n} раздел', few: '{n} раздела', many: '{n} разделов', other: '{n} раздела' },metaSamples: { one: ' + {n} пробная', few: ' + {n} пробные', many: ' + {n} пробных', other: ' + {n} пробной' },- sampleUnit: ' · Пробная глава в другом стиле',+ samples: 'Пробные главы в другом стиле',chapterCount: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' }, finished: 'Пройдено {done} из {n}',doneMark: '✓ Пройдено · ', lastMark: ' · Открыта последней',},zh: {open: '打开这本书', toCover: '返回封面', resume: '继续 · 第 {n} 章', unit: '第 {n} 单元', minutes: '{n} 分钟',meta: '{chapters}{samples} · {units} · 有配音', metaChapters: '{n} 章', metaUnits: '{n} 个单元',- metaSamples: ' + {n} 个示例章', sampleUnit: ' · 示例章,另一种风格',+ metaSamples: ' + {n} 个示例章', samples: '示例章,另一种风格',chapterCount: '{n} 章', finished: '已完成 {done} / {n}',doneMark: '✓ 已完成 · ', lastMark: ' · 上次打开',},ja: {open: '本を開く', toCover: '表紙に戻る', resume: '続きから · 第{n}章', unit: '単元 {n}', minutes: '{n}分',meta: '{chapters}{samples} · {units} · 音声つき', metaChapters: '{n}章', metaUnits: '{n}単元',- metaSamples: ' + サンプル{n}章', sampleUnit: ' · サンプル章(別のスタイル)',+ metaSamples: ' + サンプル{n}章', samples: 'サンプル章(別のスタイル)',chapterCount: '{n}章', finished: '{n}章中 {done}章 完了',doneMark: '✓ 完了 · ', lastMark: ' · 最後に開いた章',},@@ -78,19 +78,23 @@ 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, 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.+ // made to show another look, is not counted with the book's chapters, and a unit of samples has no unit number.+ // 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. A chapter's own third entry { href, chapter } does the same for that chapter alone;+ // without href, its chapter is only the number shown on the card.+ // start.label is the number shown for start.chapter (folders keep the book's numbers; lessons set CHAPTER.label).function contents(units, start, hues, P) {let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading order- const samples = new Set();+ const samples = new Set(), shown = k => k - start.chapter + (start.label ?? start.chapter);$('units').innerHTML = units.map(([name, chs, o = {}], u) => {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], 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>`; }+ return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, o.sample ? translate('samples') : translate('unit', { n: o.unit ?? u + start.unit }), name)}<div class="grid">` ++ chs.map(([t, min, c = {}], k) => {+ const href = c.href ?? o.href;+ if (href) { away++; return `<a class="ch" href="${href}" style="--i:${i++}"><b>${c.chapter ?? (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>`;+ return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${c.chapter ?? shown(n)}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';}).join('');// A unit's sketch draws itself the first time the unit scrolls into view.@@ -106,7 +110,7 @@ const Contents = (() => {const r = $('resume');r.hidden = false;r.href = last.getAttribute('href');- r.textContent = translate('resume', { n: P.last });+ r.textContent = translate('resume', { n: last.querySelector('b').textContent });}}@@ -175,7 +179,8 @@ const Contents = (() => {}// 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.+ // order from start (a book whose scope starts mid-way keeps the original numbers in its folders, and may show them+ // from start.label). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();contents(units, start, hues, progress(progressKey ?? 'animebook:progress:' + new URL('.', location.href).pathname));diff --git a/engine/engine.js b/engine/engine.jsindex e732270..719a99d 100644--- a/engine/engine.js+++ b/engine/engine.js@@ -1243,7 +1243,7 @@ function finishCard() {P.keys = e => e.key === 'Enter' ? ((next ? next.onclick() : restart()), true): isShortcut(e, 'r') ? (restart(), true) : false;const guide = mascotEl(240);- c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.number })), h('p', 'prompt', CHAPTER.title),+ c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.label ?? CHAPTER.number })), h('p', 'prompt', CHAPTER.title),line(translate('quickChecks'), sum('c-')), line(translate('chapterPractice'), sum('p-')), h('div', 'acts', next ? [home, again, next] : [home, again])]));setTimeout(() => mood(guide, 'happy'), 400);}@@ -2013,7 +2013,7 @@ function progress(f) {} catch {}}function boot() {- $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.number });+ $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.label ?? CHAPTER.number });$('coverT').textContent = CHAPTER.title;$('bHome').href = `../#ch${String(CHAPTER.number).padStart(2, '0')}`;progress(p => { p.last = CHAPTER.number; });diff --git a/site/elementary-algebra/lib/contents.js b/site/elementary-algebra/lib/contents.jsindex 0afe424..6b3272b 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: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, samples: 'Sample chapters, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -22,21 +22,21 @@ const Contents = (() => {metaChapters: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' },metaUnits: { one: '{n} раздел', few: '{n} раздела', many: '{n} разделов', other: '{n} раздела' },metaSamples: { one: ' + {n} пробная', few: ' + {n} пробные', many: ' + {n} пробных', other: ' + {n} пробной' },- sampleUnit: ' · Пробная глава в другом стиле',+ samples: 'Пробные главы в другом стиле',chapterCount: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' }, finished: 'Пройдено {done} из {n}',doneMark: '✓ Пройдено · ', lastMark: ' · Открыта последней',},zh: {open: '打开这本书', toCover: '返回封面', resume: '继续 · 第 {n} 章', unit: '第 {n} 单元', minutes: '{n} 分钟',meta: '{chapters}{samples} · {units} · 有配音', metaChapters: '{n} 章', metaUnits: '{n} 个单元',- metaSamples: ' + {n} 个示例章', sampleUnit: ' · 示例章,另一种风格',+ metaSamples: ' + {n} 个示例章', samples: '示例章,另一种风格',chapterCount: '{n} 章', finished: '已完成 {done} / {n}',doneMark: '✓ 已完成 · ', lastMark: ' · 上次打开',},ja: {open: '本を開く', toCover: '表紙に戻る', resume: '続きから · 第{n}章', unit: '単元 {n}', minutes: '{n}分',meta: '{chapters}{samples} · {units} · 音声つき', metaChapters: '{n}章', metaUnits: '{n}単元',- metaSamples: ' + サンプル{n}章', sampleUnit: ' · サンプル章(別のスタイル)',+ metaSamples: ' + サンプル{n}章', samples: 'サンプル章(別のスタイル)',chapterCount: '{n}章', finished: '{n}章中 {done}章 完了',doneMark: '✓ 完了 · ', lastMark: ' · 最後に開いた章',},@@ -78,19 +78,23 @@ 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, 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.+ // made to show another look, is not counted with the book's chapters, and a unit of samples has no unit number.+ // 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. A chapter's own third entry { href, chapter } does the same for that chapter alone;+ // without href, its chapter is only the number shown on the card.+ // start.label is the number shown for start.chapter (folders keep the book's numbers; lessons set CHAPTER.label).function contents(units, start, hues, P) {let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading order- const samples = new Set();+ const samples = new Set(), shown = k => k - start.chapter + (start.label ?? start.chapter);$('units').innerHTML = units.map(([name, chs, o = {}], u) => {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], 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>`; }+ return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, o.sample ? translate('samples') : translate('unit', { n: o.unit ?? u + start.unit }), name)}<div class="grid">` ++ chs.map(([t, min, c = {}], k) => {+ const href = c.href ?? o.href;+ if (href) { away++; return `<a class="ch" href="${href}" style="--i:${i++}"><b>${c.chapter ?? (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>`;+ return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${c.chapter ?? shown(n)}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';}).join('');// A unit's sketch draws itself the first time the unit scrolls into view.@@ -106,7 +110,7 @@ const Contents = (() => {const r = $('resume');r.hidden = false;r.href = last.getAttribute('href');- r.textContent = translate('resume', { n: P.last });+ r.textContent = translate('resume', { n: last.querySelector('b').textContent });}}@@ -175,7 +179,8 @@ const Contents = (() => {}// 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.+ // order from start (a book whose scope starts mid-way keeps the original numbers in its folders, and may show them+ // from start.label). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();contents(units, start, hues, progress(progressKey ?? 'animebook:progress:' + new URL('.', location.href).pathname));diff --git a/site/elementary-algebra/lib/engine.js b/site/elementary-algebra/lib/engine.jsindex e732270..719a99d 100644--- a/site/elementary-algebra/lib/engine.js+++ b/site/elementary-algebra/lib/engine.js@@ -1243,7 +1243,7 @@ function finishCard() {P.keys = e => e.key === 'Enter' ? ((next ? next.onclick() : restart()), true): isShortcut(e, 'r') ? (restart(), true) : false;const guide = mascotEl(240);- c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.number })), h('p', 'prompt', CHAPTER.title),+ c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.label ?? CHAPTER.number })), h('p', 'prompt', CHAPTER.title),line(translate('quickChecks'), sum('c-')), line(translate('chapterPractice'), sum('p-')), h('div', 'acts', next ? [home, again, next] : [home, again])]));setTimeout(() => mood(guide, 'happy'), 400);}@@ -2013,7 +2013,7 @@ function progress(f) {} catch {}}function boot() {- $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.number });+ $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.label ?? CHAPTER.number });$('coverT').textContent = CHAPTER.title;$('bHome').href = `../#ch${String(CHAPTER.number).padStart(2, '0')}`;progress(p => { p.last = CHAPTER.number; });diff --git a/site/math-notebook/lib/contents.js b/site/math-notebook/lib/contents.jsindex 0afe424..6b3272b 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: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, samples: 'Sample chapters, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -22,21 +22,21 @@ const Contents = (() => {metaChapters: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' },metaUnits: { one: '{n} раздел', few: '{n} раздела', many: '{n} разделов', other: '{n} раздела' },metaSamples: { one: ' + {n} пробная', few: ' + {n} пробные', many: ' + {n} пробных', other: ' + {n} пробной' },- sampleUnit: ' · Пробная глава в другом стиле',+ samples: 'Пробные главы в другом стиле',chapterCount: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' }, finished: 'Пройдено {done} из {n}',doneMark: '✓ Пройдено · ', lastMark: ' · Открыта последней',},zh: {open: '打开这本书', toCover: '返回封面', resume: '继续 · 第 {n} 章', unit: '第 {n} 单元', minutes: '{n} 分钟',meta: '{chapters}{samples} · {units} · 有配音', metaChapters: '{n} 章', metaUnits: '{n} 个单元',- metaSamples: ' + {n} 个示例章', sampleUnit: ' · 示例章,另一种风格',+ metaSamples: ' + {n} 个示例章', samples: '示例章,另一种风格',chapterCount: '{n} 章', finished: '已完成 {done} / {n}',doneMark: '✓ 已完成 · ', lastMark: ' · 上次打开',},ja: {open: '本を開く', toCover: '表紙に戻る', resume: '続きから · 第{n}章', unit: '単元 {n}', minutes: '{n}分',meta: '{chapters}{samples} · {units} · 音声つき', metaChapters: '{n}章', metaUnits: '{n}単元',- metaSamples: ' + サンプル{n}章', sampleUnit: ' · サンプル章(別のスタイル)',+ metaSamples: ' + サンプル{n}章', samples: 'サンプル章(別のスタイル)',chapterCount: '{n}章', finished: '{n}章中 {done}章 完了',doneMark: '✓ 完了 · ', lastMark: ' · 最後に開いた章',},@@ -78,19 +78,23 @@ 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, 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.+ // made to show another look, is not counted with the book's chapters, and a unit of samples has no unit number.+ // 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. A chapter's own third entry { href, chapter } does the same for that chapter alone;+ // without href, its chapter is only the number shown on the card.+ // start.label is the number shown for start.chapter (folders keep the book's numbers; lessons set CHAPTER.label).function contents(units, start, hues, P) {let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading order- const samples = new Set();+ const samples = new Set(), shown = k => k - start.chapter + (start.label ?? start.chapter);$('units').innerHTML = units.map(([name, chs, o = {}], u) => {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], 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>`; }+ return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, o.sample ? translate('samples') : translate('unit', { n: o.unit ?? u + start.unit }), name)}<div class="grid">` ++ chs.map(([t, min, c = {}], k) => {+ const href = c.href ?? o.href;+ if (href) { away++; return `<a class="ch" href="${href}" style="--i:${i++}"><b>${c.chapter ?? (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>`;+ return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${c.chapter ?? shown(n)}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';}).join('');// A unit's sketch draws itself the first time the unit scrolls into view.@@ -106,7 +110,7 @@ const Contents = (() => {const r = $('resume');r.hidden = false;r.href = last.getAttribute('href');- r.textContent = translate('resume', { n: P.last });+ r.textContent = translate('resume', { n: last.querySelector('b').textContent });}}@@ -175,7 +179,8 @@ const Contents = (() => {}// 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.+ // order from start (a book whose scope starts mid-way keeps the original numbers in its folders, and may show them+ // from start.label). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();contents(units, start, hues, progress(progressKey ?? 'animebook:progress:' + new URL('.', location.href).pathname));diff --git a/site/math-notebook/lib/engine.js b/site/math-notebook/lib/engine.jsindex e732270..719a99d 100644--- a/site/math-notebook/lib/engine.js+++ b/site/math-notebook/lib/engine.js@@ -1243,7 +1243,7 @@ function finishCard() {P.keys = e => e.key === 'Enter' ? ((next ? next.onclick() : restart()), true): isShortcut(e, 'r') ? (restart(), true) : false;const guide = mascotEl(240);- c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.number })), h('p', 'prompt', CHAPTER.title),+ c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.label ?? CHAPTER.number })), h('p', 'prompt', CHAPTER.title),line(translate('quickChecks'), sum('c-')), line(translate('chapterPractice'), sum('p-')), h('div', 'acts', next ? [home, again, next] : [home, again])]));setTimeout(() => mood(guide, 'happy'), 400);}@@ -2013,7 +2013,7 @@ function progress(f) {} catch {}}function boot() {- $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.number });+ $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.label ?? CHAPTER.number });$('coverT').textContent = CHAPTER.title;$('bHome').href = `../#ch${String(CHAPTER.number).padStart(2, '0')}`;progress(p => { p.last = CHAPTER.number; });diff --git a/site/physics-notebook/ch13/audio/en/finish.mp3 b/site/physics-notebook/ch13/audio/en/finish.mp3index ad422c6..4ee4175 100644Binary files a/site/physics-notebook/ch13/audio/en/finish.mp3 and b/site/physics-notebook/ch13/audio/en/finish.mp3 differdiff --git a/site/physics-notebook/ch13/audio/en/intro.mp3 b/site/physics-notebook/ch13/audio/en/intro.mp3index f87423c..b3e2a1b 100644Binary files a/site/physics-notebook/ch13/audio/en/intro.mp3 and b/site/physics-notebook/ch13/audio/en/intro.mp3 differdiff --git a/site/physics-notebook/ch13/audio/en/timings.js b/site/physics-notebook/ch13/audio/en/timings.jsindex 7af7924..cf91c5f 100644--- a/site/physics-notebook/ch13/audio/en/timings.js+++ b/site/physics-notebook/ch13/audio/en/timings.js@@ -1,27 +1,27 @@window.TIMINGS = {"intro": {- "dur": 12.336,+ "dur": 12.384,"marks": {- "title": 3.633,- "blob": 5.026,+ "title": 3.542,+ "blob": 4.883,"forms": 8.438,- "never": 10.612+ "never": 10.638},"cues": [[0.104,- "Unit four, energy."+ "Unit two, energy."],[- 1.94,- "Chapter thirteen: forms of energy."+ 2.214,+ "Chapter five: forms of energy."],[- 5.026,+ 4.883,"Meet Blip."],[- 6.055,+ 5.925,"Blip is a little bundle of energy."],[@@ -590,7 +590,7 @@ window.TIMINGS = {]},"finish": {- "dur": 3.216,+ "dur": 2.952,"marks": {},"cues": [[@@ -598,8 +598,8 @@ window.TIMINGS = {"Well done."],[- 1.081,- "That's the end of chapter thirteen."+ 1.159,+ "That's the end of chapter five."]]}diff --git a/site/physics-notebook/ch13/index.html b/site/physics-notebook/ch13/index.htmlindex 36ab77d..6d18210 100644--- a/site/physics-notebook/ch13/index.html+++ b/site/physics-notebook/ch13/index.html@@ -14,7 +14,7 @@<script src="audio/en/timings.js"></script><script>'use strict';-const CHAPTER = { number: 13, title: 'Forms of Energy', minutes: 9, language: 'en' };+const CHAPTER = { number: 13, label: 5, title: 'Forms of Energy', minutes: 9, language: 'en' };/* ---------- chapter drawing helpers ---------- */const DEG = Math.PI / 180;@@ -288,8 +288,8 @@ const BEATS = [['intro', 'Forms of energy', (m, D) => {const p = G(scene);S.panel = p;- show(hand(p, 'Unit 4 · Energy', 200, 230, { size: 36, fill: COL.dim, anchor: 'start', o: 0 }), .2);- show(hand(p, 'Chapter 13', 200, 300, { size: 44, anchor: 'start', o: 0 }), .3);+ show(hand(p, 'Unit 2 · Energy', 200, 230, { size: 36, fill: COL.dim, anchor: 'start', o: 0 }), .2);+ show(hand(p, 'Chapter 5', 200, 300, { size: 44, anchor: 'start', o: 0 }), .3);term(p, 'Forms of', 200, 440, { size: 100, anchor: 'start', color: HL.yellow, t0: m('title') });term(p, 'Energy', 200, 580, { size: 130, anchor: 'start', color: HL.pink, t0: m('title', .35) });ground(p, 760, 960, 1480);diff --git a/site/physics-notebook/index.html b/site/physics-notebook/index.htmlindex 7f029a7..7f37a04 100644--- a/site/physics-notebook/index.html+++ b/site/physics-notebook/index.html@@ -63,7 +63,7 @@ h1 i { font-style: normal; }<script>// Add a chapter here when its lesson is ready; chapters are numbered in order from start.Contents.book({- start: { unit: 4, chapter: 13 },+ start: { unit: 2, chapter: 13, label: 5 },units: [ // [unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?]['Energy', [['Forms of Energy', 9]]],],diff --git a/site/physics-notebook/lib/contents.js b/site/physics-notebook/lib/contents.jsindex 0afe424..6b3272b 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: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, samples: 'Sample chapters, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -22,21 +22,21 @@ const Contents = (() => {metaChapters: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' },metaUnits: { one: '{n} раздел', few: '{n} раздела', many: '{n} разделов', other: '{n} раздела' },metaSamples: { one: ' + {n} пробная', few: ' + {n} пробные', many: ' + {n} пробных', other: ' + {n} пробной' },- sampleUnit: ' · Пробная глава в другом стиле',+ samples: 'Пробные главы в другом стиле',chapterCount: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' }, finished: 'Пройдено {done} из {n}',doneMark: '✓ Пройдено · ', lastMark: ' · Открыта последней',},zh: {open: '打开这本书', toCover: '返回封面', resume: '继续 · 第 {n} 章', unit: '第 {n} 单元', minutes: '{n} 分钟',meta: '{chapters}{samples} · {units} · 有配音', metaChapters: '{n} 章', metaUnits: '{n} 个单元',- metaSamples: ' + {n} 个示例章', sampleUnit: ' · 示例章,另一种风格',+ metaSamples: ' + {n} 个示例章', samples: '示例章,另一种风格',chapterCount: '{n} 章', finished: '已完成 {done} / {n}',doneMark: '✓ 已完成 · ', lastMark: ' · 上次打开',},ja: {open: '本を開く', toCover: '表紙に戻る', resume: '続きから · 第{n}章', unit: '単元 {n}', minutes: '{n}分',meta: '{chapters}{samples} · {units} · 音声つき', metaChapters: '{n}章', metaUnits: '{n}単元',- metaSamples: ' + サンプル{n}章', sampleUnit: ' · サンプル章(別のスタイル)',+ metaSamples: ' + サンプル{n}章', samples: 'サンプル章(別のスタイル)',chapterCount: '{n}章', finished: '{n}章中 {done}章 完了',doneMark: '✓ 完了 · ', lastMark: ' · 最後に開いた章',},@@ -78,19 +78,23 @@ 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, 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.+ // made to show another look, is not counted with the book's chapters, and a unit of samples has no unit number.+ // 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. A chapter's own third entry { href, chapter } does the same for that chapter alone;+ // without href, its chapter is only the number shown on the card.+ // start.label is the number shown for start.chapter (folders keep the book's numbers; lessons set CHAPTER.label).function contents(units, start, hues, P) {let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading order- const samples = new Set();+ const samples = new Set(), shown = k => k - start.chapter + (start.label ?? start.chapter);$('units').innerHTML = units.map(([name, chs, o = {}], u) => {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], 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>`; }+ return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, o.sample ? translate('samples') : translate('unit', { n: o.unit ?? u + start.unit }), name)}<div class="grid">` ++ chs.map(([t, min, c = {}], k) => {+ const href = c.href ?? o.href;+ if (href) { away++; return `<a class="ch" href="${href}" style="--i:${i++}"><b>${c.chapter ?? (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>`;+ return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${c.chapter ?? shown(n)}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';}).join('');// A unit's sketch draws itself the first time the unit scrolls into view.@@ -106,7 +110,7 @@ const Contents = (() => {const r = $('resume');r.hidden = false;r.href = last.getAttribute('href');- r.textContent = translate('resume', { n: P.last });+ r.textContent = translate('resume', { n: last.querySelector('b').textContent });}}@@ -175,7 +179,8 @@ const Contents = (() => {}// 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.+ // order from start (a book whose scope starts mid-way keeps the original numbers in its folders, and may show them+ // from start.label). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();contents(units, start, hues, progress(progressKey ?? 'animebook:progress:' + new URL('.', location.href).pathname));diff --git a/site/physics-notebook/lib/engine.js b/site/physics-notebook/lib/engine.jsindex e732270..719a99d 100644--- a/site/physics-notebook/lib/engine.js+++ b/site/physics-notebook/lib/engine.js@@ -1243,7 +1243,7 @@ function finishCard() {P.keys = e => e.key === 'Enter' ? ((next ? next.onclick() : restart()), true): isShortcut(e, 'r') ? (restart(), true) : false;const guide = mascotEl(240);- c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.number })), h('p', 'prompt', CHAPTER.title),+ c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.label ?? CHAPTER.number })), h('p', 'prompt', CHAPTER.title),line(translate('quickChecks'), sum('c-')), line(translate('chapterPractice'), sum('p-')), h('div', 'acts', next ? [home, again, next] : [home, again])]));setTimeout(() => mood(guide, 'happy'), 400);}@@ -2013,7 +2013,7 @@ function progress(f) {} catch {}}function boot() {- $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.number });+ $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.label ?? CHAPTER.number });$('coverT').textContent = CHAPTER.title;$('bHome').href = `../#ch${String(CHAPTER.number).padStart(2, '0')}`;progress(p => { p.last = CHAPTER.number; });diff --git a/site/science/ch09/audio/en/intro.mp3 b/site/science/ch09/audio/en/intro.mp3index 2c4fd86..303cf7c 100644Binary files a/site/science/ch09/audio/en/intro.mp3 and b/site/science/ch09/audio/en/intro.mp3 differdiff --git a/site/science/ch09/audio/en/timings.js b/site/science/ch09/audio/en/timings.jsindex 5916151..3f9ec45 100644--- a/site/science/ch09/audio/en/timings.js+++ b/site/science/ch09/audio/en/timings.js@@ -1,20 +1,20 @@window.TIMINGS = {"intro": {- "dur": 7.944,+ "dur": 7.704,"marks": {- "sub": 2.083+ "sub": 1.979},"cues": [[0.104,- "Chapter nine."+ "Chapter one."],[- 1.198,+ 1.094,"Motion."],[- 2.083,+ 1.979,"In this first part, we answer a simple question: what does it really mean for something to move?"]]diff --git a/site/science/ch09/index.html b/site/science/ch09/index.htmlindex d3bff14..ad6e79b 100644--- a/site/science/ch09/index.html+++ b/site/science/ch09/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 9: Motion — Science</title>+<title>Chapter 1: Motion — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -14,7 +14,7 @@<script>'use strict';// Chapter 9, one page in book order: part 1 (motion; relative motion), part 2 (speed), part 3 (velocity), part 4 (acceleration).-const CHAPTER = { number: 9, title: 'Motion', minutes: 18, language: 'en', next: '../ch10/' };+const CHAPTER = { number: 9, label: 1, title: 'Motion', minutes: 18, language: 'en', next: '../ch10/' };/* ---------- chapter helpers ---------- */const V = 150; // 30 mph on screen, in world px per second (same scale in every road beat)@@ -139,7 +139,7 @@ const BEATS = [const x = carX(t); put(car, { x }); phRoll(car, x);}, D);const g = G(p, { o: 0, y: 24 });- T(g, 'Unit 3 · Motion, Forces, and Work · Chapter 9', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });+ T(g, 'Unit 1 · Motion, Forces, and Work · Chapter 1', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });phLabel(g, 'Motion', { x: 800, y: 250, size: 120, weight: 600 });tw(g, { o: 1, y: 0 }, .2, 1.1, out);txt(p, 'Part 1 · Motion and relative motion', 800, 320, m('sub'), { size: 36, fill: COL.dim });@@ -387,7 +387,7 @@ const BEATS = [put(car, { x: cx }); phRoll(car, cx); put(run, { x: rx }); if (u > 0) walkTo(run, rx); else phPose(run);}, D);const g = G(p, { o: 0, y: 24 });- T(g, 'Chapter 9 · Motion', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });+ T(g, 'Chapter 1 · Motion', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });phLabel(g, 'Speed', { x: 800, y: 250, size: 120, weight: 600 });tw(g, { o: 1, y: 0 }, .2, 1.1, out);txt(p, 'Part 2 · How fast is something moving?', 800, 320, m('q'), { size: 36, fill: COL.dim });@@ -575,7 +575,7 @@ const BEATS = [arrowAt(arA, xa - 55, ROAD.near - 130, 110, 0); arrowAt(arB, xb + 55, ROAD.far - 222, 110, 180);}, D);const g = G(p, { o: 0, y: 24 });- T(g, 'Chapter 9 · Motion', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });+ T(g, 'Chapter 1 · Motion', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });phLabel(g, 'Velocity', { x: 800, y: 250, size: 120, weight: 600 });tw(g, { o: 1, y: 0 }, .2, 1.1, out);txt(p, 'Part 3 · Same speed, which way?', 800, 320, m('q'), { size: 36, fill: COL.dim });@@ -720,7 +720,7 @@ const BEATS = [put(car, { x }); phRoll(car, x); arrowAt(av, x - 40, ROAD.near - 130, v * .35, 0); arrowAt(aa, x - 40, ROAD.near - 160, 90, 0);}, D);const g = G(p, { o: 0, y: 24 });- T(g, 'Chapter 9 · Motion', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });+ T(g, 'Chapter 1 · Motion', { x: 800, y: 130, size: 28, fill: COL.dim, anchor: 'middle' });phLabel(g, 'Acceleration', { x: 800, y: 250, size: 120, weight: 600 });tw(g, { o: 1, y: 0 }, .2, 1.1, out);txt(p, 'Part 4 · Speeding up, slowing down, turning', 800, 320, m('q'), { size: 36, fill: COL.dim });diff --git a/site/science/ch10/audio/en/intro.mp3 b/site/science/ch10/audio/en/intro.mp3index 656aaa7..4dd96df 100644Binary files a/site/science/ch10/audio/en/intro.mp3 and b/site/science/ch10/audio/en/intro.mp3 differdiff --git a/site/science/ch10/audio/en/timings.js b/site/science/ch10/audio/en/timings.jsindex 886a4f1..84b2914 100644--- a/site/science/ch10/audio/en/timings.js+++ b/site/science/ch10/audio/en/timings.js@@ -1,20 +1,20 @@window.TIMINGS = {"intro": {- "dur": 6.816,+ "dur": 6.768,"marks": {- "sub": 3.594+ "sub": 3.568},"cues": [[- 0.104,- "Chapter ten."+ 0.091,+ "Chapter two."],[- 1.25,+ 1.211,"Force and Newton's laws of motion."],[- 3.594,+ 3.568,"What makes things start, stop, speed up, or turn?"]]diff --git a/site/science/ch10/index.html b/site/science/ch10/index.htmlindex 6eae1a4..2542792 100644--- a/site/science/ch10/index.html+++ b/site/science/ch10/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 10: Force and Newton's Laws of Motion — Science</title>+<title>Chapter 2: Force and Newton's Laws of Motion — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -17,7 +17,7 @@'use strict';// Chapter 10, one page in book order: part 1 (force, net force, balanced forces, newtons), part 2 (first law: inertia,// momentum), part 3 (second law), part 4 (third law), then the chapter practice.-const CHAPTER = { number: 10, title: 'Force and Newton’s Laws of Motion', minutes: 13, language: 'en', next: '../ch11/' };+const CHAPTER = { number: 10, label: 2, title: 'Force and Newton’s Laws of Motion', minutes: 13, language: 'en', next: '../ch11/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst GY = 560; // ground line in side-view scenesconst Y1 = 740; // part 1: a lower ground line under big actors@@ -98,7 +98,7 @@ const BEATS = [ground(p, Y);// You push the title crate into the frame, then let go: it slides a little and stops.const a = phActor(p, 'you', { y: Y, s: S, anim: 'push' }), c = crate(p, { y: Y, w: W, h: H }), f = forceArrow(p, { w: 14, size: 34 });- phLabel(c, 'Unit 3 · Motion, Forces, and Work · Chapter 10', { x: -10, y: -400, size: 26, fill: '#eedec4', weight: 600 });+ phLabel(c, 'Unit 1 · Motion, Forces, and Work · Chapter 2', { x: -10, y: -400, size: 26, fill: '#eedec4', weight: 600 });phLabel(c, 'Force &', { x: -10, y: -326, size: 70 }); phLabel(c, 'Newton’s Laws', { x: -10, y: -256, size: 70 });const X = t => t < tp ? x0 + v * t : t < tp + .4 ? x0 + v * tp + v * ((t - tp) - (t - tp) ** 2 / .8) : x0 + v * (tp + .2);clockRun(t => {diff --git a/site/science/ch11/audio/en/intro.mp3 b/site/science/ch11/audio/en/intro.mp3index 44fec9f..72a2d2e 100644Binary files a/site/science/ch11/audio/en/intro.mp3 and b/site/science/ch11/audio/en/intro.mp3 differdiff --git a/site/science/ch11/audio/en/timings.js b/site/science/ch11/audio/en/timings.jsindex b00ee99..4be86dc 100644--- a/site/science/ch11/audio/en/timings.js+++ b/site/science/ch11/audio/en/timings.js@@ -1,24 +1,24 @@window.TIMINGS = {"intro": {- "dur": 13.104,+ "dur": 13.44,"marks": {- "q": 6.107+ "q": 6.432},"cues": [[- 0.104,- "Chapter eleven."+ 0.091,+ "Chapter three."],[- 1.315,+ 1.263,"Gravity, friction, and more forces in everyday life."],[- 6.107,+ 6.432,"Everywhere you look, forces are at work."],[- 8.854,+ 9.102,"Why do things fall, slow down, stick together, or float?"]]diff --git a/site/science/ch11/index.html b/site/science/ch11/index.htmlindex 29a1f24..b72eb6d 100644--- a/site/science/ch11/index.html+++ b/site/science/ch11/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 11: Gravity, Friction, and More Forces in Everyday Life — Science</title>+<title>Chapter 3: Gravity, Friction, and More Forces in Everyday Life — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -18,7 +18,7 @@// Chapter 11, one page in book order: part 1 (gravity, weight, falling), part 2 (friction, air resistance, terminal// velocity), part 3 (magnetic and electric forces, electromagnets), part 4 (centripetal force, buoyancy), then the// chapter practice. Notes and storyboard intents: books/science/chapters/ch11.md.-const CHAPTER = { number: 11, title: 'Gravity, Friction, and More Forces in Everyday Life', minutes: 15, language: 'en', next: '../ch12/' };+const CHAPTER = { number: 11, label: 3, title: 'Gravity, Friction, and More Forces in Everyday Life', minutes: 15, language: 'en', next: '../ch12/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst GY = 560; // ground line in quick-check picturesconst Y1 = 740; // ground line under big actors@@ -199,7 +199,7 @@ const BEATS = [up.set(x - 70, hy2 + 70, t > tl ? 110 : 0, -90, '');}, D);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 3 · Motion, Forces, and Work · Chapter 11', { x: 1150, y: 330, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 1 · Motion, Forces, and Work · Chapter 3', { x: 1150, y: 330, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Gravity, Friction,', { x: 1150, y: 420, size: 76 }); phLabel(ttl, 'and More Forces', { x: 1150, y: 500, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out);thought(p, [70, 60, 930, 220], 510, ['Why do things fall, slow down,', 'stick together, or float?'], tq);diff --git a/site/science/ch12/audio/en/finish.mp3 b/site/science/ch12/audio/en/finish.mp3index 1e21d1d..d4e5eb5 100644Binary files a/site/science/ch12/audio/en/finish.mp3 and b/site/science/ch12/audio/en/finish.mp3 differdiff --git a/site/science/ch12/audio/en/intro.mp3 b/site/science/ch12/audio/en/intro.mp3index 5036fc8..5df6630 100644Binary files a/site/science/ch12/audio/en/intro.mp3 and b/site/science/ch12/audio/en/intro.mp3 differdiff --git a/site/science/ch12/audio/en/timings.js b/site/science/ch12/audio/en/timings.jsindex 865e045..7e3f279 100644--- a/site/science/ch12/audio/en/timings.js+++ b/site/science/ch12/audio/en/timings.js@@ -1,24 +1,24 @@window.TIMINGS = {"intro": {- "dur": 8.832,+ "dur": 8.928,"marks": {- "q": 5.091+ "q": 5.208},"cues": [[0.104,- "Chapter twelve: work and machines."+ "Chapter four: work and machines."],[- 2.891,+ 2.982,"You lift a heavy box into a truck."],[- 5.091,+ 5.208,"Is that work?"],[- 6.172,+ 6.302,"And how could a simple ramp make it easier?"]]@@ -817,15 +817,15 @@ window.TIMINGS = {]},"finish": {- "dur": 7.272,+ "dur": 7.008,"marks": {},"cues": [[0.104,- "Chapter twelve is done."+ "Chapter four is done."],[- 2.148,+ 1.927,"Work is force times distance, and machines help you do it with less force."]]diff --git a/site/science/ch12/index.html b/site/science/ch12/index.htmlindex f6edcc0..0a4bdb9 100644--- a/site/science/ch12/index.html+++ b/site/science/ch12/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 12: Work and Machines — Science</title>+<title>Chapter 4: Work and Machines — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -19,7 +19,7 @@// Chapter 12, one page in book order: part 1 (work, force × distance, direction, power), part 2 (simple machines:// inclined plane, wedge, screw), part 3 (levers, wheel and axle, pulleys), part 4 (energy, efficiency, compound// machines), then the chapter practice. Notes and storyboard intents: books/science/chapters/ch12.md.-const CHAPTER = { number: 12, title: 'Work and Machines', minutes: 14, language: 'en', next: '../ch13/' };+const CHAPTER = { number: 12, label: 4, title: 'Work and Machines', minutes: 14, language: 'en', next: '../ch13/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst GY = 560; // ground line in quick-check picturesconst Y1 = 740; // ground line under big actors@@ -229,7 +229,7 @@ const BEATS = [put(c, { x: t < 3 ? lerp(700, 680, lift) : lerp(680, 587, carry), y: t < 3 ? lerp(Y1, 650, lift) : lerp(650, BED, carry) });}, D);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 3 · Motion, Forces, and Work · Chapter 12', { x: 1230, y: 330, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 1 · Motion, Forces, and Work · Chapter 4', { x: 1230, y: 330, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Work and', { x: 1230, y: 420, size: 76 }); phLabel(ttl, 'Machines', { x: 1230, y: 500, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out);thought(p, [70, 60, 930, 220], 740, ['Is lifting a box work?', 'How could a ramp help?'], tq);diff --git a/site/science/ch13/audio/en/finish.mp3 b/site/science/ch13/audio/en/finish.mp3index 549b20b..04a156c 100644Binary files a/site/science/ch13/audio/en/finish.mp3 and b/site/science/ch13/audio/en/finish.mp3 differdiff --git a/site/science/ch13/audio/en/intro.mp3 b/site/science/ch13/audio/en/intro.mp3index 2959f0f..f931f8a 100644Binary files a/site/science/ch13/audio/en/intro.mp3 and b/site/science/ch13/audio/en/intro.mp3 differdiff --git a/site/science/ch13/audio/en/timings.js b/site/science/ch13/audio/en/timings.jsindex 5e483a9..b458716 100644--- a/site/science/ch13/audio/en/timings.js+++ b/site/science/ch13/audio/en/timings.js@@ -1,24 +1,24 @@window.TIMINGS = {"intro": {- "dur": 12.36,+ "dur": 11.76,"marks": {- "q": 6.797+ "q": 6.393},"cues": [[0.104,- "Chapter thirteen: forms of energy."+ "Chapter five: forms of energy."],[- 3.073,+ 2.734,"You swing a golf club, and the ball flies off down the course."],[- 6.797,+ 6.393,"Where did the ball's energy come from?"],[- 8.802,+ 8.477,"And where does energy go when it seems to disappear?"]]@@ -613,15 +613,15 @@ window.TIMINGS = {]},"finish": {- "dur": 9.696,+ "dur": 9.0,"marks": {},"cues": [[0.104,- "Chapter thirteen is done."+ "Chapter five is done."],[- 2.37,+ 1.719,"Energy comes in many forms, moving and stored, and it is never lost: it only changes form."]]diff --git a/site/science/ch13/index.html b/site/science/ch13/index.htmlindex a666e67..48fb7bb 100644--- a/site/science/ch13/index.html+++ b/site/science/ch13/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 13: Forms of Energy — Science</title>+<title>Chapter 5: Forms of Energy — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -21,7 +21,7 @@// energy), part 3 (how much energy; moving and stored forms), then the chapter practice. Energy is drawn as blocks that// move and change colour with their form but never appear or vanish, and as energy bars with a fixed total line.// Notes, storyboard and errata: books/science/chapters/ch13.md.-const CHAPTER = { number: 13, title: 'Forms of Energy', minutes: 11, language: 'en', next: '../ch14/' };+const CHAPTER = { number: 13, label: 5, title: 'Forms of Energy', minutes: 11, language: 'en', next: '../ch14/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst GY = 560; // ground line in quick-check picturesconst Y1 = 740; // ground line under big actors@@ -301,7 +301,7 @@ const BEATS = [put(ball, { x: bx + 760 * f, y: Y1 - 12 - 1100 * f + 330 * f * f });}, D);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 4 · Energy · Chapter 13', { x: 1180, y: 330, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 2 · Energy · Chapter 5', { x: 1180, y: 330, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Forms of', { x: 1180, y: 420, size: 76 }); phLabel(ttl, 'Energy', { x: 1180, y: 500, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out);thought(p, [60, 60, 900, 220], 330, ['Where did the ball’s energy come from?', 'Where does energy go?'], tq);diff --git a/site/science/ch14/audio/en/finish.mp3 b/site/science/ch14/audio/en/finish.mp3index f4bdd09..d2b4353 100644Binary files a/site/science/ch14/audio/en/finish.mp3 and b/site/science/ch14/audio/en/finish.mp3 differdiff --git a/site/science/ch14/audio/en/intro.mp3 b/site/science/ch14/audio/en/intro.mp3index 7351fde..ddbb2ea 100644Binary files a/site/science/ch14/audio/en/intro.mp3 and b/site/science/ch14/audio/en/intro.mp3 differdiff --git a/site/science/ch14/audio/en/timings.js b/site/science/ch14/audio/en/timings.jsindex 635e854..a96ae1a 100644--- a/site/science/ch14/audio/en/timings.js+++ b/site/science/ch14/audio/en/timings.js@@ -1,24 +1,24 @@window.TIMINGS = {"intro": {- "dur": 14.232,+ "dur": 13.8,"marks": {- "q": 7.318+ "q": 7.096},"cues": [[0.104,- "Chapter fourteen: thermal energy."+ "Chapter six: thermal energy."],[- 2.904,+ 2.552,"A mug of hot cocoa sits next to a glass of cold chocolate milk."],[- 7.318,+ 7.096,"What does it really mean for one to be hot and the other cold?"],[- 10.859,+ 10.482,"And what happens to the heat when you wrap your hands around the mug?"]]@@ -627,15 +627,15 @@ window.TIMINGS = {]},"finish": {- "dur": 14.04,+ "dur": 13.968,"marks": {},"cues": [[0.104,- "Chapter fourteen is done."+ "Chapter six is done."],[- 2.396,+ 2.201,"Temperature is the average motion of molecules, thermal energy is the total, and heat is energy flowing from warmer to cooler, by conduction, convection, and radiation."]]diff --git a/site/science/ch14/index.html b/site/science/ch14/index.htmlindex 858cc22..9c08920 100644--- a/site/science/ch14/index.html+++ b/site/science/ch14/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 14: Thermal Energy — Science</title>+<title>Chapter 6: Thermal Energy — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -22,7 +22,7 @@// part 2 (thermal energy and heat), part 3 (conduction, convection, radiation), then the chapter practice. Molecules// are dots whose speed lines grow with their speed; heat is red, cool is blue-grey; heat moves as red energy blocks.// Notes, storyboard and errata: books/science/chapters/ch14.md.-const CHAPTER = { number: 14, title: 'Thermal Energy', minutes: 11, language: 'en', next: '../ch15/' };+const CHAPTER = { number: 14, label: 6, title: 'Thermal Energy', minutes: 11, language: 'en', next: '../ch15/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst GY = 560; // ground line in quick-check picturesconst Y1 = 740; // floor line under big actors@@ -160,7 +160,7 @@ const BEATS = [const steam = riseLines(p, 410, 470, { n: 3, c: COL.chalk }); put(steam, { o: 0 }); show(steam, .4);clockRun(t => { put(steam, { y: 470 - 10 * ((t * .9) % 1) }); if (t > TH) you.show('catch', 1); else you.show('stand'); }, D);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 4 · Energy · Chapter 14', { x: 1230, y: 330, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 2 · Energy · Chapter 6', { x: 1230, y: 330, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Thermal', { x: 1230, y: 420, size: 76 }); phLabel(ttl, 'Energy', { x: 1230, y: 500, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out);say(p, 'hot cocoa', 392, 728, 2.9, { size: 28, fill: HEAT, anchor: 'start' }); say(p, 'cold milk', 700, 728, 4.6, { size: 28, fill: COLD });diff --git a/site/science/ch15/audio/en/finish.mp3 b/site/science/ch15/audio/en/finish.mp3index e11d68f..47efe67 100644Binary files a/site/science/ch15/audio/en/finish.mp3 and b/site/science/ch15/audio/en/finish.mp3 differdiff --git a/site/science/ch15/audio/en/intro.mp3 b/site/science/ch15/audio/en/intro.mp3index e90c06f..4784a0b 100644Binary files a/site/science/ch15/audio/en/intro.mp3 and b/site/science/ch15/audio/en/intro.mp3 differdiff --git a/site/science/ch15/audio/en/timings.js b/site/science/ch15/audio/en/timings.jsindex b2c1201..60e238e 100644--- a/site/science/ch15/audio/en/timings.js+++ b/site/science/ch15/audio/en/timings.js@@ -1,25 +1,25 @@window.TIMINGS = {"intro": {- "dur": 15.432,+ "dur": 15.144,"marks": {- "q": 3.542,- "both": 10.56+ "q": 3.464,+ "both": 10.365},"cues": [[0.104,- "Chapter fifteen: light and sound waves."+ "Chapter seven: light and sound waves."],[- 3.542,+ 3.464,"You flip a light switch, and the room fills with light."],[- 7.565,+ 7.552,"You clap, and a friend across the room hears it."],[- 10.56,+ 10.365,"What travels from the lamp to your eyes, and from your hands to their ears?"]]@@ -1035,19 +1035,19 @@ window.TIMINGS = {]},"finish": {- "dur": 12.792,+ "dur": 12.216,"marks": {},"cues": [[0.104,- "Chapter fifteen is done."+ "Chapter seven is done."],[- 2.435,+ 2.018,"Waves carry energy."],[- 3.906,+ 3.438,"Light is a transverse electromagnetic wave that crosses empty space, and sound is a longitudinal wave that needs matter."]]diff --git a/site/science/ch15/index.html b/site/science/ch15/index.htmlindex 5911543..da63c7b 100644--- a/site/science/ch15/index.html+++ b/site/science/ch15/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 15: Light and Sound Waves — Science</title>+<title>Chapter 7: Light and Sound Waves — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -23,7 +23,7 @@// and the electromagnetic spectrum), part 4 (sound), then the chapter practice. Amplitude green (energy), wavelength// pink (distance), frequency blue (time), wave speed yellow; light pale gold, sound grey-white.// Notes, storyboard and errata: books/science/chapters/ch15.md.-const CHAPTER = { number: 15, title: 'Light and Sound Waves', minutes: 15, language: 'en', next: '../ch16/' };+const CHAPTER = { number: 15, label: 7, title: 'Light and Sound Waves', minutes: 15, language: 'en', next: '../ch16/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst Y1 = 740; // floor line under big actorsconst floorIn = (p, y = Y1, x = 0, w = 1600) => { phBlock(p, x, y, w, 90, '#6b5a48', { top: 8, ol: 0 }); };@@ -198,7 +198,7 @@ const BEATS = [}, D);tw(lamp.glow, { o: 1 }, tq + .25, .3); tw(lamp.shade, { c_fill: LIGHT }, tq + .25, .3);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 4 · Energy · Chapter 15', { x: 1050, y: 150, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 2 · Energy · Chapter 7', { x: 1050, y: 150, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Light and', { x: 1050, y: 240, size: 76 }); phLabel(ttl, 'Sound Waves', { x: 1050, y: 320, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out); hide(ttl, tb - .4);say(p, 'light?', 300, 420, tb + .6, { size: 40, fill: LIGHT });diff --git a/site/science/ch16/audio/en/finish.mp3 b/site/science/ch16/audio/en/finish.mp3index e0a3a3d..fe8120b 100644Binary files a/site/science/ch16/audio/en/finish.mp3 and b/site/science/ch16/audio/en/finish.mp3 differdiff --git a/site/science/ch16/audio/en/intro.mp3 b/site/science/ch16/audio/en/intro.mp3index 532d662..5981895 100644Binary files a/site/science/ch16/audio/en/intro.mp3 and b/site/science/ch16/audio/en/intro.mp3 differdiff --git a/site/science/ch16/audio/en/timings.js b/site/science/ch16/audio/en/timings.jsindex 298f36e..3b9ecc3 100644--- a/site/science/ch16/audio/en/timings.js+++ b/site/science/ch16/audio/en/timings.js@@ -1,26 +1,26 @@window.TIMINGS = {"intro": {- "dur": 14.616,+ "dur": 13.992,"marks": {- "q": 3.945,- "fan": 6.484,- "both": 9.167+ "q": 3.503,+ "fan": 6.029,+ "both": 8.776},"cues": [[0.104,- "Chapter sixteen: electricity and magnetism."+ "Chapter eight: electricity and magnetism."],[- 3.945,+ 3.503,"You flip a switch, and a lamp comes on."],[- 6.484,+ 6.029,"You press a button, and a motor spins."],[- 9.167,+ 8.776,"These look like two different things, but both come from the tiny charges inside matter."]]@@ -919,15 +919,15 @@ window.TIMINGS = {]},"finish": {- "dur": 11.352,+ "dur": 11.424,"marks": {},"cues": [[0.104,- "Chapter sixteen is done."+ "Chapter eight is done."],[- 2.188,+ 1.953,"Moving charges make a current and a magnetic field, a closed circuit lets them flow, and motors and generators trade electric energy for motion."]]diff --git a/site/science/ch16/index.html b/site/science/ch16/index.htmlindex 5f5c6ad..9684a81 100644--- a/site/science/ch16/index.html+++ b/site/science/ch16/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 16: Electricity and Magnetism — Science</title>+<title>Chapter 8: Electricity and Magnetism — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -25,7 +25,7 @@// Positive charge red, negative blue (electrons are blue dots wherever they flow); current I blue, voltage amber,// resistance pink, power lilac, magnetic field green; a magnet's N end blue and S end red.// Notes, storyboard and errata: books/science/chapters/ch16.md.-const CHAPTER = { number: 16, title: 'Electricity and Magnetism', minutes: 14, language: 'en', next: '../ch17/' };+const CHAPTER = { number: 16, label: 8, title: 'Electricity and Magnetism', minutes: 14, language: 'en', next: '../ch17/' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenes; it moves up by itself when tallerconst Y1 = 740; // floor line under big actorsconst floorIn = (p, y = Y1, x = 0, w = 1600) => { phBlock(p, x, y, w, 90, '#6b5a48', { top: 8, ol: 0 }); };@@ -170,7 +170,7 @@ const BEATS = [}, D);tw(lamp.glow, { o: 1 }, tq + .25, .3); tw(lamp.shade, { c_fill: LIGHT }, tq + .25, .3);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 4 · Energy · Chapter 16', { x: 800, y: 130, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 2 · Energy · Chapter 8', { x: 800, y: 130, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Electricity and', { x: 800, y: 220, size: 76 }); phLabel(ttl, 'Magnetism', { x: 800, y: 300, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out); hide(ttl, tb - .4);say(p, 'electricity', 250, 270, tb + .6, { size: 44, fill: CHG_N });diff --git a/site/science/ch17/audio/en/finish.mp3 b/site/science/ch17/audio/en/finish.mp3index 578a273..a30ee5e 100644Binary files a/site/science/ch17/audio/en/finish.mp3 and b/site/science/ch17/audio/en/finish.mp3 differdiff --git a/site/science/ch17/audio/en/intro.mp3 b/site/science/ch17/audio/en/intro.mp3index a0ca0f3..0e299fa 100644Binary files a/site/science/ch17/audio/en/intro.mp3 and b/site/science/ch17/audio/en/intro.mp3 differdiff --git a/site/science/ch17/audio/en/timings.js b/site/science/ch17/audio/en/timings.jsindex 3ce7de0..860d5cc 100644--- a/site/science/ch17/audio/en/timings.js+++ b/site/science/ch17/audio/en/timings.js@@ -1,30 +1,30 @@window.TIMINGS = {"intro": {- "dur": 16.2,+ "dur": 15.48,"marks": {- "plug": 4.036,- "where": 6.55,- "mix": 9.036+ "plug": 3.464,+ "where": 5.846,+ "mix": 8.281},"cues": [[0.104,- "Chapter seventeen: electrical energy sources."+ "Chapter nine: electrical energy sources."],[- 4.036,+ 3.464,"Plug something into the wall, and it works."],[- 6.55,+ 5.846,"But where does that electrical energy come from?"],[- 9.036,+ 8.281,"Almost every answer starts the same way."],[- 12.175,+ 11.354,"Something turns a turbine, and the turbine turns a generator."]]@@ -592,23 +592,23 @@ window.TIMINGS = {]},"finish": {- "dur": 16.704,+ "dur": 16.272,"marks": {},"cues": [[0.104,- "Chapter seventeen is done."+ "Chapter nine is done."],[- 2.461,+ 1.602,"Nearly every power plant spins a turbine, and the main exception is a solar panel."],[- 8.203,+ 7.513,"Fossil fuels and uranium run out."],[- 10.846,+ 10.026,"Water, wind, sunlight, the earth's heat, and replanted biomass can be replenished."]]diff --git a/site/science/ch17/index.html b/site/science/ch17/index.htmlindex 0757c02..25f14b5 100644--- a/site/science/ch17/index.html+++ b/site/science/ch17/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">-<title>Chapter 17: Electrical Energy Sources — Science</title>+<title>Chapter 9: Electrical Energy Sources — Science</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"></head>@@ -26,7 +26,7 @@// Energy blocks keep the book's colours (kinetic yellow, potential blue, chemical lime, heat red, light pale gold) and// electric energy is ch16's electron blue; water blue, steam white, smoke grey. Every turbine, stream and electron// moves whenever it is on screen. Notes, storyboard and errata: books/science/chapters/ch17.md.-const CHAPTER = { number: 17, title: 'Electrical Energy Sources', minutes: 12, language: 'en' };+const CHAPTER = { number: 17, label: 9, title: 'Electrical Energy Sources', minutes: 12, language: 'en' };const Q_CARD = { x: 96, y: 586, w: 1408, cls: 'band' }; // a band card under the scenesconst Y1 = 740; // ground lineconst sm = (t, a, b) => io(ramp(t, a, b));@@ -235,7 +235,7 @@ const BEATS = [tw(wall, { o: .25 }, tw_ + .1, .8);cam.to({ x: 1720, y: 400, z: .42 }, tw_ + .1, 2.4); cam.to({ x: 2900, y: 600, z: 1.3 }, tm + .3, 2.4);const ttl = G(p, { o: 0, y: 24 });- phLabel(ttl, 'Unit 4 · Energy · Chapter 17', { x: 1160, y: 190, size: 26, fill: COL.dim, weight: 600 });+ phLabel(ttl, 'Unit 2 · Energy · Chapter 9', { x: 1160, y: 190, size: 26, fill: COL.dim, weight: 600 });phLabel(ttl, 'Electrical Energy', { x: 1160, y: 280, size: 76 }); phLabel(ttl, 'Sources', { x: 1160, y: 360, size: 76 });tw(ttl, { o: 1, y: 0 }, .3, 1.1, out); hide(ttl, tw_ - .2);line(p, [['turbine', COL.chalk], [' → ', COL.dim], ['generator', COL.chalk]], 800, 120, tm + 3.6, { size: 48 });diff --git a/site/science/ch19/audio/en/finish.mp3 b/site/science/ch19/audio/en/finish.mp3index 3db9866..bd60242 100644Binary files a/site/science/ch19/audio/en/finish.mp3 and b/site/science/ch19/audio/en/finish.mp3 differdiff --git a/site/science/ch19/audio/en/intro.mp3 b/site/science/ch19/audio/en/intro.mp3index ca69ac3..d190493 100644Binary files a/site/science/ch19/audio/en/intro.mp3 and b/site/science/ch19/audio/en/intro.mp3 differdiff --git a/site/science/ch19/audio/en/timings.js b/site/science/ch19/audio/en/timings.jsindex 159e92b..eecbc8f 100644--- a/site/science/ch19/audio/en/timings.js+++ b/site/science/ch19/audio/en/timings.js@@ -1,20 +1,20 @@window.TIMINGS = {"intro": {- "dur": 9.384,+ "dur": 9.624,"marks": {- "sub": 4.154+ "sub": 3.971},"cues": [[- 0.091,- "Chapter nineteen."+ 0.104,+ "Chapter ten."],[- 1.445,+ 1.224,"The sun, the earth, and the moon."],[- 4.154,+ 3.971,"Three bodies, always moving, and every day we see the results."]]@@ -975,7 +975,7 @@ window.TIMINGS = {]},"finish": {- "dur": 3.144,+ "dur": 3.0,"marks": {},"cues": [[@@ -984,7 +984,7 @@ window.TIMINGS = {],[1.107,- "That's the end of chapter nineteen."+ "That's the end of chapter ten."]]}diff --git a/site/science/ch19/index.html b/site/science/ch19/index.htmlindex cf3d417..24c10e1 100644--- a/site/science/ch19/index.html+++ b/site/science/ch19/index.html@@ -15,7 +15,7 @@<script src="audio/en/timings.js"></script><script>'use strict';-const CHAPTER = { number: 19, title: 'The Sun-Earth-Moon System', minutes: 14, language: 'en' };+const CHAPTER = { number: 19, label: 10, title: 'The Sun-Earth-Moon System', minutes: 14, language: 'en' };/* ---------- chapter helpers ---------- */const at = (e, o, t) => tw(e, o, t, 0); // a cut: e takes state o at time t@@ -107,7 +107,7 @@ const BEATS = [put(mo, { x: mx, y: my }); mo.light(toward(mx, my, ...C)); moDepth(Math.sin(deg(a)) > 0);}, D);const t = G(p, { o: 0, y: 20 });- pen(t, 'Unit 5 · Chapter 19', { x: 800, y: 170, size: 34, fill: INK.blue, anchor: 'middle', o: 1 });+ pen(t, 'Outer space · Chapter 10', { x: 800, y: 170, size: 34, fill: INK.blue, anchor: 'middle', o: 1 });pen(t, 'The Sun-Earth-Moon System', { x: 800, y: 270, size: 92, fill: INK.note, anchor: 'middle', o: 1 });const ul = path(t, 'M380 302Q800 286 1220 300', { stroke: INK.hl, 'stroke-width': 8 }, { d: 0 });tw(t, { o: 1, y: 0 }, .2, 1, out); draw(ul, .9, .7);diff --git a/site/science/index.html b/site/science/index.htmlindex ea7ef50..79e77cb 100644--- a/site/science/index.html+++ b/site/science/index.html@@ -25,7 +25,7 @@<svg class="mascot draw" id="guide" width="210" height="147"></svg><p class="kicker">An animated science book · physics</p><h1>Motion <i>&</i> Forces</h1>- <p class="lede">The physics chapters of a middle-school science notebook, as short narrated animations with quick checks. Chapters 9 to 17 are ready.</p>+ <p class="lede">The physics chapters of a middle-school science notebook, as short narrated animations with quick checks. Chapters 1 to 9 are ready.</p><div class="acts"><a class="btn go" href="#contents" data-t="open">Open the book<svg viewBox="0 0 16 16"><path d="M6 2.5 11.5 8 6 13.5 4.6 12.1 8.7 8 4.6 3.9z"/></svg></a><a class="btn quiet" id="resume" hidden></a>@@ -46,14 +46,14 @@<script>// Add a chapter here when its lesson is ready; chapters are numbered in order from start.Contents.book({- start: { unit: 3, chapter: 9 },- units: [ // [unit title, [[chapter title, minutes], ...], { unit, chapter, sample }?]+ start: { unit: 1, chapter: 9, label: 1 }, // folders keep the book's numbers (ch09–ch17), shown from 1+ units: [ // [unit title, [[chapter title, minutes, { href, chapter }?], ...], { unit, chapter, sample }?]['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], ['Light and Sound Waves', 15], ['Electricity and Magnetism', 14], ['Electrical Energy Sources', 12]]],- ['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/' }],+ ['Energy in a light notebook, and outer space', [['Forms of Energy, light notebook edition', 9, { href: '../physics-notebook/ch13/', chapter: 5 }],+ ['The Sun-Earth-Moon System', 14, { chapter: 10 }]], { chapter: 19, sample: true }],],- hues: ['#f4a48c', '#8fd6b0', '#86c9e8', '#e8a0c8', '#e8a0c8', '#bba8ee', '#f0b45a'], // unit 4 (energy) green; the samples keep blue and pink+ hues: ['#f4a48c', '#8fd6b0', '#86c9e8', '#bba8ee', '#f0b45a'], // unit 2 (energy) green; the samples blue});</script></body>diff --git a/site/science/lib/contents.js b/site/science/lib/contents.jsindex 0afe424..6b3272b 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: { one: ' + {n} sample', other: ' + {n} samples' }, sampleUnit: ' · Sample chapter, another look',+ metaUnits: { one: '{n} unit', other: '{n} units' }, metaSamples: { one: ' + {n} sample', other: ' + {n} samples' }, samples: 'Sample chapters, another look',chapterCount: { one: '{n} chapter', other: '{n} chapters' }, finished: '{done} of {n} finished',doneMark: '✓ Finished · ', lastMark: ' · Last opened',},@@ -22,21 +22,21 @@ const Contents = (() => {metaChapters: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' },metaUnits: { one: '{n} раздел', few: '{n} раздела', many: '{n} разделов', other: '{n} раздела' },metaSamples: { one: ' + {n} пробная', few: ' + {n} пробные', many: ' + {n} пробных', other: ' + {n} пробной' },- sampleUnit: ' · Пробная глава в другом стиле',+ samples: 'Пробные главы в другом стиле',chapterCount: { one: '{n} глава', few: '{n} главы', many: '{n} глав', other: '{n} главы' }, finished: 'Пройдено {done} из {n}',doneMark: '✓ Пройдено · ', lastMark: ' · Открыта последней',},zh: {open: '打开这本书', toCover: '返回封面', resume: '继续 · 第 {n} 章', unit: '第 {n} 单元', minutes: '{n} 分钟',meta: '{chapters}{samples} · {units} · 有配音', metaChapters: '{n} 章', metaUnits: '{n} 个单元',- metaSamples: ' + {n} 个示例章', sampleUnit: ' · 示例章,另一种风格',+ metaSamples: ' + {n} 个示例章', samples: '示例章,另一种风格',chapterCount: '{n} 章', finished: '已完成 {done} / {n}',doneMark: '✓ 已完成 · ', lastMark: ' · 上次打开',},ja: {open: '本を開く', toCover: '表紙に戻る', resume: '続きから · 第{n}章', unit: '単元 {n}', minutes: '{n}分',meta: '{chapters}{samples} · {units} · 音声つき', metaChapters: '{n}章', metaUnits: '{n}単元',- metaSamples: ' + サンプル{n}章', sampleUnit: ' · サンプル章(別のスタイル)',+ metaSamples: ' + サンプル{n}章', samples: 'サンプル章(別のスタイル)',chapterCount: '{n}章', finished: '{n}章中 {done}章 完了',doneMark: '✓ 完了 · ', lastMark: ' · 最後に開いた章',},@@ -78,19 +78,23 @@ 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, 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.+ // made to show another look, is not counted with the book's chapters, and a unit of samples has no unit number.+ // 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. A chapter's own third entry { href, chapter } does the same for that chapter alone;+ // without href, its chapter is only the number shown on the card.+ // start.label is the number shown for start.chapter (folders keep the book's numbers; lessons set CHAPTER.label).function contents(units, start, hues, P) {let n = start.chapter - 1, total = 0, i = 0, away = 0; // i staggers the entrance, in reading order- const samples = new Set();+ const samples = new Set(), shown = k => k - start.chapter + (start.label ?? start.chapter);$('units').innerHTML = units.map(([name, chs, o = {}], u) => {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], 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>`; }+ return `<section class="unit" style="--c:${hues[u % hues.length]};--i:${i++}">${Units.header(u, o.sample ? translate('samples') : translate('unit', { n: o.unit ?? u + start.unit }), name)}<div class="grid">` ++ chs.map(([t, min, c = {}], k) => {+ const href = c.href ?? o.href;+ if (href) { away++; return `<a class="ch" href="${href}" style="--i:${i++}"><b>${c.chapter ?? (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>`;+ return `<a class="${cls}" id="${id(n)}" href="${id(n)}/" style="--i:${i++}"><b>${c.chapter ?? shown(n)}</b><span>${esc(t)}</span><small>${translate('minutes', { n: min })}</small></a>`;}).join('') + '</div></section>';}).join('');// A unit's sketch draws itself the first time the unit scrolls into view.@@ -106,7 +110,7 @@ const Contents = (() => {const r = $('resume');r.hidden = false;r.href = last.getAttribute('href');- r.textContent = translate('resume', { n: P.last });+ r.textContent = translate('resume', { n: last.querySelector('b').textContent });}}@@ -175,7 +179,8 @@ const Contents = (() => {}// 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.+ // order from start (a book whose scope starts mid-way keeps the original numbers in its folders, and may show them+ // from start.label). hues: one colour per unit, cycling.function book({ units, start = { unit: 1, chapter: 1 }, hues = HUES, progressKey, ink } = {}) {translatePage();contents(units, start, hues, progress(progressKey ?? 'animebook:progress:' + new URL('.', location.href).pathname));diff --git a/site/science/lib/engine.js b/site/science/lib/engine.jsindex e732270..719a99d 100644--- a/site/science/lib/engine.js+++ b/site/science/lib/engine.js@@ -1243,7 +1243,7 @@ function finishCard() {P.keys = e => e.key === 'Enter' ? ((next ? next.onclick() : restart()), true): isShortcut(e, 'r') ? (restart(), true) : false;const guide = mascotEl(240);- c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.number })), h('p', 'prompt', CHAPTER.title),+ c.append(h('div', 'finwrap', [guide, h('p', 'kicker', translate('chapterComplete', { n: CHAPTER.label ?? CHAPTER.number })), h('p', 'prompt', CHAPTER.title),line(translate('quickChecks'), sum('c-')), line(translate('chapterPractice'), sum('p-')), h('div', 'acts', next ? [home, again, next] : [home, again])]));setTimeout(() => mood(guide, 'happy'), 400);}@@ -2013,7 +2013,7 @@ function progress(f) {} catch {}}function boot() {- $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.number });+ $('coverK').textContent = translate('chapterNumber', { n: CHAPTER.label ?? CHAPTER.number });$('coverT').textContent = CHAPTER.title;$('bHome').href = `../#ch${String(CHAPTER.number).padStart(2, '0')}`;progress(p => { p.last = CHAPTER.number; });diff --git a/site/science/unit-art.js b/site/science/unit-art.jsindex ae7cf88..bcd2eb4 100644--- a/site/science/unit-art.js+++ b/site/science/unit-art.js@@ -15,21 +15,18 @@const reset = s => { k = 0; return s; };window.UNIT_ART = [- // Unit 3 (motion, forces, work): a road with a car-dot speeding along it, and speed = distance ÷ time.+ // Unit 1 (motion, forces, work): a road with a car-dot speeding along it, and speed = distance ÷ time.reset(P('M228 130H572') + Array.from({ length: 7 }, (_, i) => P(`M${250 + i * 50} 122v16`, 'a')).join('') +`<circle class="t hop" r="8" fill="currentColor" stroke="none" style="--k:${k++};offset-path:path('M250 116Q275 84 300 116Q325 84 350 116Q375 84 400 116')"/>` +Tx(250, 60, 'speed = distance ÷ time', 26) + P('M480 70h70m-14 -10l14 10l-14 10', 'a')),- // Unit 4 (energy): a ball rolling to and fro in a dip, potential ⇄ kinetic.+ // Unit 2 (energy): a ball rolling to and fro in a dip, potential ⇄ kinetic.reset(P('M228 60Q400 200 572 60') +`<circle class="t hop" r="9" fill="currentColor" stroke="none" style="--k:${k++};offset-path:path('M250 54Q400 186 550 54Q400 186 250 54')"/>` +Tx(400, 40, 'potential ⇄ kinetic', 24, 'a', 'middle')),- // Unit 5 sample (outer space): a sun with an orbit, Earth going round it with its moon.+ // The samples (the light notebook edition of chapter 5, and outer space): a sun with an orbit, Earth going round it with its moon.reset(C(420, 92, 30) + Array.from({ length: 8 }, (_, i) => { const a = i * Math.PI / 4; return P(`M${420 + 40 * Math.cos(a)} ${92 + 40 * Math.sin(a)}L${420 + 52 * Math.cos(a)} ${92 + 52 * Math.sin(a)}`); }).join('') +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')),];})();