An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat: chalk sketch for every unit on the contents page
yzr851cc014f0e4
diff --git a/CLAUDE.md b/CLAUDE.mdindex 92f2d53..20f7ac6 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -66,7 +66,7 @@ AnimeBook/│ └── check_blank.py # 检测开场留白:旁白已开始、画面仍为空的步骤├── site/ # 可部署的静态站点(只部署此目录)│ ├── index.html # 书架、书封与章节目录(同一页,hash 切换;章节数据在 UNITS;localStorage 记进度)-│ ├── lib/ # 共用引擎 engine.js / engine.css;书架数据与样式 bookshelf.js / bookshelf.css+│ ├── lib/ # 共用引擎 engine.js / engine.css;书架数据与样式 bookshelf.js / bookshelf.css;目录页单元小图 unit-art.js│ └── chNN/ # ch01–ch68 每章一个目录:index.html(本章步骤与题目)、audio/en/(MP3 与 timings.js)├── .venv/ # 现有 PDF 处理工具的 Python 虚拟环境├── .git/ # 本地 Git 仓库,尚未配置远程diff --git a/plan.md b/plan.mdindex d856db3..baea42a 100644--- a/plan.md+++ b/plan.md@@ -22,6 +22,8 @@首页为公开书架,点击书封、标题或文字入口先进入书本身的封面页,再通过封面页打开目录,继续进入章节动画;不要跳过书封页。首版展示已有数学书,书架入口使用轻巧的下划线文字与箭头,不使用大块实底按钮。保留章节深链接和浏览器内的学习进度,继续阅读可直接到上次章节;从书封、目录可回到书架。网站不设登录、支付或访客在线创作系统,制作能力后续通过开源 Skill 分享。+目录页每个单元的标题区是一条“黑板带”(用户 2026-10-03 指出目录页太单调):右侧是该单元数学内容的粉笔线条小图,用单元颜色绘制,背后一层同色柔光;单元第一次滚动进入视野时逐笔画出,之后保留一个与内容相关的小循环动作(如交换律中 a、b 互换,数轴上跳点,饼图填充,天平摆动,坐标线上走点,转盘转动,函数机器进出,面积格依次亮起,平方差缺角闪现,√2 对角线重画,根点脉动,抛物线伸缩)。全部由代码绘制,不使用外部图片;图画在 `site/lib/unit-art.js`,样式与动作在 `site/index.html`;系统设置减少动态时只显示静态完成图。+书架样式与数据在 `site/lib/bookshelf.css` 和 `site/lib/bookshelf.js`,数学书的章节和单元数量由现有目录自动读取。入口不带 hash 时展示书架,`#book` 展示数学书封面,`#contents` / `#chNN` 展示目录;原有章节链接和引擎路径保持兼容。新书发布时增加独立目录及书架条目,不展示未制作的占位作品。## 2. 已确定的要求diff --git a/site/index.html b/site/index.htmlindex 1d2a7ee..2bc9aea 100644--- a/site/index.html+++ b/site/index.html@@ -8,6 +8,7 @@<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%231d2b27'/%3E%3Ctext x='32' y='45' text-anchor='middle' font-size='48' fill='%23f0b45a'%3E∞%3C/text%3E%3C/svg%3E"><link rel="stylesheet" href="lib/bookshelf.css"><script src="lib/bookshelf.js" defer></script>+<script src="lib/unit-art.js"></script><link rel="expect" href="#ch01" blocking="render"><style>:root {@@ -86,8 +87,62 @@ h1 i { color: var(--task); font-style: italic; }.prog { margin-left: auto; color: var(--dim); font-size: 15px; white-space: nowrap; }.prog b { color: var(--good); font-weight: 600; }main#contents { padding-bottom: 80px; }-.unit { max-width: 1212px; margin: 0 auto; padding: 44px 16px 0; }-.unit h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; font: 500 28px/1.2 var(--book); }+.unit { position: relative; max-width: 1212px; margin: 0 auto; padding: 28px 16px 0; }+.unit h2 { position: relative; display: flex; align-items: baseline; gap: 14px; min-height: 168px; margin: 0 0 16px; padding-top: 130px; font: 500 28px/1.2 var(--book); }+.unit .grid { position: relative; }+/* Each unit header is a strip of chalkboard with a sketch of its mathematics, drawn in the unit colour. */+.unit::before { content: ""; position: absolute; inset: 0 16px auto; height: 208px; border-radius: 22px; pointer-events: none;+ background: radial-gradient(ellipse 46% 90% at 74% 55%, color-mix(in srgb, var(--c) 11%, transparent), transparent 70%); }+.unit-art { position: absolute; top: 20px; right: 28px; width: min(580px, 56%); height: auto; overflow: visible; pointer-events: none;+ color: var(--c); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: .78; }+.unit-art text { fill: currentColor; stroke: none; font-family: var(--book); font-style: italic; }+.unit-art .a { color: var(--chalk); opacity: .55; }+.unit-art .faint { opacity: .22; }+.unit-art .d { stroke-dasharray: 1 1; stroke-dashoffset: 1; }+.unit-art .t { opacity: 0; }+.seen .unit-art .d { animation: art-draw 1.1s cubic-bezier(.5, 0, .3, 1) forwards; animation-delay: calc(var(--k) * 55ms + 120ms); }+.seen .unit-art .t { animation: art-fade .6s ease-out forwards; animation-delay: calc(var(--k) * 55ms + 300ms); }+.seen .unit-art .a.t { animation-name: art-fade-a; }+@keyframes art-draw { to { stroke-dashoffset: 0; } }+@keyframes art-fade { to { opacity: 1; } }+@keyframes art-fade-a { to { opacity: .55; } }+/* After the drawing, each sketch keeps one small motion that belongs to its topic. */+.unit-art g { transform-box: fill-box; }+.seen .unit-art .swap-a { animation: swap-a 6s var(--ease) 2.4s infinite; }+.seen .unit-art .swap-b { animation: swap-b 6s var(--ease) 2.4s infinite; }+@keyframes swap-a { 0%, 30%, 100% { transform: none; } 45%, 80% { transform: translate(80px, 0); } 37% { transform: translate(40px, -30px); } 88% { transform: translate(40px, 30px); } }+@keyframes swap-b { 0%, 30%, 100% { transform: none; } 45%, 80% { transform: translate(-80px, 0); } 37% { transform: translate(-40px, 30px); } 88% { transform: translate(-40px, -30px); } }+.seen .unit-art .step { animation: art-fade .6s ease-out forwards, step 4s ease-in-out infinite; animation-delay: calc(var(--k) * 55ms + 300ms), calc(var(--k) * 300ms + 2s); }+@keyframes step { 0%, 20%, 100% { fill-opacity: 1; } 10% { fill-opacity: .3; } }+.unit-art .hop, .unit-art .ride { offset-rotate: 0deg; }+.seen .unit-art .hop { animation: art-fade .4s ease-out 2s forwards, along 3.4s linear 2s infinite; }+.seen .unit-art .ride { animation: art-fade .4s ease-out 2s forwards, along 4s ease-in-out 2s infinite alternate; }+@keyframes along { from { offset-distance: 0%; } to { offset-distance: 100%; } }+.unit-art .pie { stroke: currentColor; stroke-linecap: butt; stroke-dasharray: 0 100; }+.seen .unit-art .pie { animation: art-fade .4s ease-out 1.6s forwards, pie 5s var(--ease) 1.6s infinite; }+@keyframes pie { 0% { stroke-dasharray: 0 100; } 35%, 85% { stroke-dasharray: 25 100; } 100% { stroke-dasharray: 0 100; } }+.seen .unit-art .tilt { transform-box: view-box; transform-origin: 300px 72px; animation: tilt 4.8s ease-in-out 2s infinite; }+@keyframes tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-4deg); } 60% { transform: rotate(2deg); } }+.seen .unit-art .spin { transform-box: view-box; transform-origin: 320px 95px; animation: spin 5s cubic-bezier(.2, .7, .2, 1) 2s infinite; }+@keyframes spin { from { transform: rotate(0); } 70%, to { transform: rotate(1530deg); } }+.seen .unit-art .feed-in { animation: feed-in 4s ease-in-out 2s infinite; }+.seen .unit-art .feed-out { opacity: 0; animation: feed-out 4s ease-in-out 2s infinite; }+@keyframes feed-in { 0% { transform: none; opacity: 1; } 40% { transform: translate(100px, 0); opacity: 0; } 41%, 100% { transform: none; opacity: 0; } 95% { opacity: 1; } }+@keyframes feed-out { 0%, 45% { transform: translate(-40px, 0); opacity: 0; } 70%, 90% { transform: none; opacity: 1; } 100% { opacity: 0; } }+.unit-art .cell { opacity: .25; }+.seen .unit-art .cell { animation: cell 5s ease-in-out infinite; animation-delay: calc(var(--j) * .5s + 2s); }+@keyframes cell { 0%, 100% { opacity: .25; } 15%, 60% { opacity: 1; } }+.unit-art .cut, .unit-art .shade { opacity: 0; }+.seen .unit-art .cut { animation: cut 4s ease-in-out 2s infinite; }+@keyframes cut { 0%, 100% { opacity: 0; } 30%, 70% { opacity: .5; } }+.seen .unit-art .shade { animation: shade 1s ease-out 1.6s forwards; }+@keyframes shade { to { opacity: .14; } }+.seen .unit-art .diag { animation: art-draw 1.1s cubic-bezier(.5, 0, .3, 1) forwards, redraw 4s ease-in-out 2.5s infinite; }+@keyframes redraw { 0%, 15% { stroke-dashoffset: 1; } 50%, 100% { stroke-dashoffset: 0; } }+.seen .unit-art .root { animation: art-fade .4s ease-out 1.8s forwards, root 2.4s ease-in-out 2.2s infinite; }+@keyframes root { 0%, 100% { r: 7px; } 50% { r: 11px; } }+.seen .unit-art .breathe { transform-box: view-box; transform-origin: 380px 140px; animation: breathe 4s ease-in-out 2s infinite alternate; }+@keyframes breathe { from { transform: scaleY(1); } to { transform: scaleY(.35); } }.unit h2 span { font: 600 14px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--c); white-space: nowrap; }.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }.ch { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 16px; row-gap: 8px; min-height: 112px;@@ -112,11 +167,18 @@ main#contents { padding-bottom: 80px; }::view-transition-old(lesson) { animation-duration: .18s; }@media (max-width: 560px) {.home strong { font-size: 18px; }+ .unit-art { width: calc(100% - 32px); right: 16px; opacity: .32; }+ .unit h2 { min-height: 0; padding-top: 104px; }.ch { min-height: 0; }.chalk span:not(:nth-child(3), :nth-child(4), :nth-child(7)) { display: none; }}@media (prefers-reduced-motion: reduce) {*, *::before, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }+ .unit-art .d { stroke-dashoffset: 0; }+ .unit-art .t, .unit-art .cell { opacity: 1; }+ .unit-art .a.t { opacity: .55; }+ .unit-art .shade { opacity: .14; }+ .unit-art .pie { stroke-dasharray: 25 100; }.chalk span { opacity: .075; }}</style>@@ -205,13 +267,16 @@ const done = new Set(P.done || []);let n = 0, total = 0, i = 0; // i staggers the entrance, in reading orderconst esc = s => s.replace(/&/g, '&').replace(/</g, '<');document.getElementById('units').innerHTML = UNITS.map(([name, chs], u) => {- return `<section class="unit" style="--c:${HUES[u % HUES.length]};--i:${i++}"><h2><span>Unit ${u + 1}</span>${esc(name)}</h2><div class="grid">` ++ return `<section class="unit" style="--c:${HUES[u % HUES.length]};--i:${i++}"><svg class="unit-art" viewBox="0 0 600 180" aria-hidden="true">${UNIT_ART[u] || ''}</svg><h2><span>Unit ${u + 1}</span>${esc(name)}</h2><div class="grid">` +chs.map(([t, min]) => { n++;const cls = 'ch' + (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>${min} min</small></a>`;}).join('') + '</div></section>';}).join('');total = n;+// A unit's sketch draws itself the first time the unit scrolls into view.+const seen = new IntersectionObserver(es => es.forEach(e => { if (e.isIntersecting) { e.target.classList.add('seen'); seen.unobserve(e.target); } }), { threshold: .25 });+document.querySelectorAll('.unit').forEach(u => seen.observe(u));const finished = [...done].filter(k => k <= total).length;document.getElementById('prog').innerHTML = finished ? `<b>${finished}</b> of ${total} finished` : `${total} chapters`;document.getElementById('meta').textContent = `${total} chapters · ${UNITS.length} units · with sound`;diff --git a/site/lib/unit-art.js b/site/lib/unit-art.jsnew file mode 100644index 0000000..a8c4978--- /dev/null+++ b/site/lib/unit-art.js@@ -0,0 +1,92 @@+// Chalk sketches for the unit headers on the contents page, one per unit, drawn in the unit's colour.+// Each is the inside of an SVG with viewBox 0 0 600 180. Classes:+// d a line that draws itself in when the unit scrolls into view (--k orders the strokes)+// t text or a filled shape that fades in+// a the faint chalk-white colour instead of the unit colour+// Loop classes (swap-a, hop, spin, tilt, ...) start after the drawing and are styled in index.html.+'use strict';+(() => {+ let k = 0;+ const P = (d, cls = '', extra = '') => `<path class="d ${cls}" pathLength="1" style="--k:${k++}" d="${d}" ${extra}/>`;+ const Tx = (x, y, s, size = 24, cls = '', anchor = 'start') => `<text class="t ${cls}" style="--k:${k++}" x="${x}" y="${y}" font-size="${size}" text-anchor="${anchor}">${s}</text>`;+ const C = (cx, cy, r, cls = '') => `<circle class="d ${cls}" pathLength="1" style="--k:${k++}" cx="${cx}" cy="${cy}" r="${r}"/>`;+ const dotC = (cx, cy, r, cls = '') => `<circle class="t ${cls}" style="--k:${k++}" cx="${cx}" cy="${cy}" r="${r}" fill="currentColor" stroke="none"/>`;+ const reset = s => { k = 0; return s; };+ const parab = (cx, cy, a, x0, x1) => { // y = cy − a(x − cx)² in screen space (a > 0 opens up on screen)+ let d = '';+ for (let i = 0; i <= 40; i++) { const x = x0 + (x1 - x0) * i / 40; d += `${i ? 'L' : 'M'}${x.toFixed(1)} ${(cy - a * (x - cx) ** 2).toFixed(1)}`; }+ return d;+ };+ const sq = (x, y, s, cls = '') => P(`M${x} ${y}h${s}v${s}h${-s}Z`, cls);+ const grid = (x, y, n, u) => { let d = ''; for (let i = 1; i < n; i++) d += `M${x + i * u} ${y}v${n * u}M${x} ${y + i * u}h${n * u}`; return d; };++ window.UNIT_ART = [+ // 1 Arithmetic properties: grouping, a and b trading places, the order-of-operations ladder.+ reset(Tx(30, 70, '(2 + 3) + 4', 26, 'a') + Tx(30, 112, '2 + (3 + 4)', 26, 'a') + P('M30 80H170', 'a faint') ++ `<g class="swap-a">${Tx(258, 118, 'a', 44)}</g>${Tx(290, 116, '+', 36, 'a')}<g class="swap-b">${Tx(338, 118, 'b', 44)}</g>` ++ P('M268 74Q305 30 344 74') + P('M344 128Q305 168 268 128') + P('M336 66l8 8 4-11') + P('M276 136l-8-8-4 11') ++ [['( )', 0], ['x²', 1], ['× ÷', 2], ['+ −', 3]].map(([s, i]) => P(`M${450 + i * 34} ${56 + i * 34}h${150 - i * 34}`, 'a') + Tx(460 + i * 34, 50 + i * 34, s, 20, 'step')).join('')),+ // 2 The number system: a number line with hops from −3 to 2.+ reset(P('M28 130H572') + P('M560 122l12 8-12 8') + P('M40 122l-12 8 12 8') ++ Array.from({ length: 11 }, (_, i) => P(`M${50 + i * 50} 122v16`, 'a') + Tx(50 + i * 50, 162, i - 5 < 0 ? '−' + (5 - i) : String(i - 5), 17, 'a', 'middle')).join('') ++ P('M150 116Q175 84 200 116Q225 84 250 116Q275 84 300 116Q325 84 350 116Q375 84 400 116', 'a faint') ++ `<circle class="t hop" cx="0" cy="0" r="8" fill="currentColor" stroke="none" style="--k:${k++};offset-path:path('M150 116Q175 84 200 116Q225 84 250 116Q275 84 300 116Q325 84 350 116Q375 84 400 116')"/>` ++ Tx(40, 58, '¾ = 0.75', 26, 'a') + Tx(430, 58, '−3 + 5 = 2', 26)),+ // 3 Ratios, proportions, and percents: a filling pie, ratio bars, a percent tag.+ reset(C(110, 95, 62, 'a') + `<circle class="t pie" cx="110" cy="95" r="31" fill="none" stroke-width="62" pathLength="100" transform="rotate(-90 110 95)" style="--k:${k++}"/>` ++ Tx(110, 172, '25%', 20, 'a', 'middle') ++ [0, 1].map(i => sq(220 + i * 36, 52, 30)).join('') + [0, 1, 2].map(i => sq(220 + i * 36, 100, 30, 'a')).join('') + Tx(345, 92, '2 : 3', 26) ++ P('M440 58H560L590 95L560 132H440Z') + C(568, 95, 5) + Tx(500, 105, '40%', 28, '', 'middle') + Tx(500, 160, 'off', 18, 'a', 'middle')),+ // 4 Exponents and expressions: squares of 1, 2, 3, then x² and powers of ten.+ reset([[1, 30], [2, 70], [3, 140]].map(([n, x]) => sq(x, 160 - n * 30, n * 30) + (n > 1 ? P(grid(x, 160 - n * 30, n, 30), 'a faint') : '') + Tx(x + n * 15, 172 - n * 30 - 18, n + '²', 18, 'a', 'middle')).join('') ++ Tx(300, 92, 'x² + 3x', 36) + Tx(300, 140, '2³ = 8', 24, 'a') + Tx(460, 70, '10⁶', 36) + Tx(450, 140, '3.2 × 10⁵', 22, 'a')),+ // 5 Linear equations and inequalities: a balance with x + 3 = 7, and a ray.+ reset(Tx(24, 64, 'x + 3 = 7', 28) + Tx(24, 112, 'x = 4', 28, 'a') ++ P('M300 160L278 172H322Z', 'a') + P('M300 160V72', 'a') ++ `<g class="tilt">${P('M196 72H404')}${P('M210 72l-24 52M210 72l24 52M390 72l-24 52M390 72l24 52', 'a faint')}${P('M180 124Q210 140 240 124Z')}${P('M360 124Q390 140 420 124Z')}` ++ `${P('M190 98h22v22h-22Z')}${Tx(201, 115, 'x', 16, '', 'middle')}${[0, 1, 2].map(i => dotC(222 + i * 9, 116, 4)).join('')}${[0, 1, 2, 3, 4, 5, 6].map(i => dotC(368 + (i % 4) * 11, 116 - Math.floor(i / 4) * 10, 4)).join('')}</g>` ++ P('M470 140H590') + P('M580 132l10 8-10 8') + C(490, 140, 7) + Tx(476, 112, 'x > 2', 22, 'a')),+ // 6 Graphing linear equations: a grid with a line, a slope step, and a point riding the line.+ reset(P(grid(330, 20, 6, 25), 'a faint') + P('M330 95H490M405 20V170', 'a') ++ `<path class="t shade" style="--k:${k++}" d="M330 170L330 132L480 20L480 170Z" fill="currentColor" stroke="none"/>` ++ P('M330 132L480 20') + P('M380 95v-37h50', 'a') + Tx(372, 82, '3', 16, 'a', 'end') + Tx(405, 52, '4', 16, 'a', 'middle') ++ `<circle class="t ride" r="7" fill="currentColor" stroke="none" style="--k:${k++};offset-path:path('M330 132L480 20')"/>` ++ Tx(40, 70, 'y = mx + b', 32) + Tx(40, 120, 'm = rise ÷ run', 22, 'a') + Tx(520, 60, '(x, y)', 22, 'a')),+ // 7 Statistics and probability: a histogram, a spinner, a number cube.+ reset(P('M30 160H210', 'a') + [40, 80, 120, 70, 30].map((h, i) => P(`M${40 + i * 34} 160v${-h}h30v${h}`)).join('') ++ C(320, 95, 62) + P('M320 95V33M320 95L374 126M320 95L266 126', 'a') ++ `<g class="spin">${P('M320 95L320 48', '', 'stroke-width="4"')}${P('M313 58L320 44L327 58')}</g>` + dotC(320, 95, 6) ++ P('M460 52h80a12 12 0 0 1 12 12v80a12 12 0 0 1-12 12h-80a12 12 0 0 1-12-12v-80a12 12 0 0 1 12-12Z') ++ [[478, 70], [522, 70], [500, 104], [478, 138], [522, 138]].map(([x, y]) => dotC(x, y, 6)).join('')),+ // 8 Functions: x goes into the machine, f(x) comes out; a mapping diagram.+ reset(Tx(26, 64, 'f(x) = 2x + 1', 26) + P('M80 112H210', 'a') + P('M200 104l10 8-10 8', 'a') ++ P('M212 72h96v80h-96Z') + Tx(260, 126, 'f', 40, '', 'middle') + P('M310 112H400', 'a') + P('M390 104l10 8-10 8', 'a') ++ `<g class="feed-in">${Tx(110, 106, '3', 26, '', 'middle')}</g><g class="feed-out">${Tx(350, 106, '7', 26, '', 'middle')}</g>` ++ `<ellipse class="d a" pathLength="1" style="--k:${k++}" cx="460" cy="96" rx="22" ry="62"/><ellipse class="d a" pathLength="1" style="--k:${k++}" cx="560" cy="96" rx="22" ry="62"/>` ++ [[60, 70], [96, 70], [132, 120]].map(([a, b]) => P(`M470 ${a}L548 ${b}`)).join('') + [60, 96, 132].map(y => dotC(460, y, 4)).join('') + [70, 120].map(y => dotC(560, y, 4)).join('')),+ // 9 Polynomial operations: the area grid for (x + 2)(x + 3).+ reset(Tx(24, 72, '(x + 2)(x + 3)', 26) + Tx(24, 120, '= x² + 5x + 6', 26, 'a') ++ P('M300 30h140v140h-140Z') + P('M390 30v140M300 120h140', 'a') ++ [['x²', 345, 82, 0], ['2x', 415, 82, 1], ['3x', 345, 152, 2], ['6', 415, 152, 3]].map(([s, x, y, i]) => `<g class="cell" style="--j:${i}">${Tx(x, y, s, 22, '', 'middle')}</g>`).join('') ++ Tx(345, 22, 'x', 18, 'a', 'middle') + Tx(415, 22, '+2', 18, 'a', 'middle') + Tx(292, 82, 'x', 18, 'a', 'end') + Tx(292, 152, '+3', 18, 'a', 'end') ++ Tx(480, 82, '×', 26, 'a') + Tx(510, 82, 'FOIL', 22, 'a')),+ // 10 Factoring: a factor tree and the square with a corner cut away.+ reset(Tx(110, 40, '60', 26, '', 'middle') + P('M100 48L70 78M120 48L150 78') + Tx(64, 100, '6', 22, '', 'middle') + Tx(156, 100, '10', 22, '', 'middle') ++ P('M58 108L42 136M70 108L86 136M150 108L134 136M162 108L178 136', 'a') + ['2', '3', '2', '5'].map((s, i) => Tx([38, 90, 130, 182][i], 160, s, 20, 'a', 'middle')).join('') ++ P('M280 40h110v110h-110Z') + `<path class="t cut" style="--k:${k++}" d="M350 110h40v40h-40Z" fill="currentColor" stroke="none"/>` + P('M350 110v40M350 110h40', 'a faint') ++ Tx(430, 82, 'x² − 9', 28) + Tx(430, 128, '= (x + 3)(x − 3)', 22, 'a')),+ // 11 Radicals: a unit square's diagonal, a big radical, a little cube.+ reset(P('M40 50h90v90h-90Z', 'a') + P('M40 140L130 50', 'diag') + Tx(98, 110, '√2', 22, '', 'start') + Tx(40, 166, '1', 18, 'a') ++ P('M200 98l12-6 18 46 26-100h170') + Tx(266, 120, '72 = 6√2', 34) ++ P('M500 80l40-22 40 22v52l-40 22-40-22Z') + P('M500 80l40 22 40-22M540 102v52', 'a') + Tx(540, 176, '∛27 = 3', 18, 'a', 'middle')),+ // 12 Quadratic equations: a parabola crossing the x-axis at its two roots, and the formula.+ reset(P('M290 120H590M440 20V172', 'a') + P(parab(440, 160, .012, 330, 550)) ++ `<circle class="t root" cx="${440 - Math.sqrt(40 / .012)}" cy="120" r="7" fill="currentColor" stroke="none" style="--k:${k++}"/>` ++ `<circle class="t root" cx="${440 + Math.sqrt(40 / .012)}" cy="120" r="7" fill="currentColor" stroke="none" style="--k:${k++}"/>` ++ Tx(24, 58, 'ax² + bx + c = 0', 24) + Tx(24, 112, 'x =', 24, 'a') + Tx(150, 100, '−b ± √(b² − 4ac)', 20, 'a', 'middle') + P('M78 108H222', 'a') + Tx(150, 132, '2a', 20, 'a', 'middle')),+ // 13 Quadratic functions: a family of parabolas around a vertex and its axis of symmetry.+ reset(P('M260 150H500', 'a') + P('M380 20V172', 'a faint') ++ `<g class="breathe">${P(parab(380, 140, .02, 305, 455))}</g>` + P(parab(380, 140, .007, 265, 495), 'a') + P(parab(380, 40, -.005, 270, 490), 'a faint') ++ dotC(380, 140, 7) + Tx(396, 168, 'vertex', 16, 'a') + Tx(24, 70, 'y = a(x − h)² + k', 24) + Tx(24, 116, 'vertex (h, k)', 20, 'a') + Tx(510, 60, 'x = h', 20, 'a')),+ ];+})();