Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

fix(linear-algebra): parked turn handles; a shorter playground key line

yzre8a6cdbc5fa6
diff --git a/site/linear-algebra/ch22/index.html b/site/linear-algebra/ch22/index.html
index d758350..ab4e74f 100644
--- a/site/linear-algebra/ch22/index.html
+++ b/site/linear-algebra/ch22/index.html
@@ -402,10 +402,9 @@ const BEATS = [
const p = panel(0);
text(p, 'Playground', 60, 110, .2, { size: 40, weight: 600 });
const t = three(p, LEC, '');
- S.em = t.em;
- t.em.work(0, .3);
+ S.em = t.em; // no working rows here: PA itself shows the result, and the card sits where they were
text(p, 'try: all six orders; a 2 instead of a 1; two 1s in one row', 64, 160, m('go'), { size: 24, fill: COL.dim });
- }, { ask: playAsk(() => S.em, { pos: { x: 40, y: 600, w: 820, cls: 'side' }, tip: 'Your matrices. Change any number of P or of A | b, turn the space, or draw on the board. Nothing is marked.' }) }],
+ }, { ask: playAsk(() => S.em, { pos: { x: 40, y: 560, w: 820, cls: 'side' }, tip: 'Your matrices. Change any number of P or of A | b, turn the space, or draw on the board. Nothing is marked.' }) }],
['finish', 'Finished', () => { panel(0); }, { ask: finishCard }],
].map(([id, title, run, extra]) => ({ id, title, run, ...extra }));
diff --git a/site/linear-algebra/lib/linsys.js b/site/linear-algebra/lib/linsys.js
index 4beae1e..54dc396 100644
--- a/site/linear-algebra/lib/linsys.js
+++ b/site/linear-algebra/lib/linsys.js
@@ -311,6 +311,7 @@ function linsys(p, { A = [[2, -1], [-1, 2]], b = [0, 3], eq = [90, 250], mat = [
if (l.getAttribute('d') !== d) { l.setAttribute('d', d); hit.setAttribute('d', d); }
const kp = turning && turning.i === i ? (turning.k ? [turning.pivot, turning.at] : [turning.at, turning.pivot]) : knobsFor(i);
if (kp) { knobPos[i] = kp; kp.forEach(([x, y], k) => put(knobs[i][k], { x: PX(x), y: PY(y) })); }
+ else knobs[i].forEach(h => put(h, { x: 0, y: 0 })); // parked where every path to this moment leaves them, so a seek and a play agree
knobs[i].forEach(h => { const want = kp ? '' : 'none'; if (h.style.display !== want) h.style.display = want; }); // no line (0 = 0, or off the grid): no handles
});
const s = solve(), inGrid = s.x !== undefined && s.x >= bx[0] && s.x <= bx[1] && s.y >= by[0] && s.y <= by[1];
diff --git a/site/linear-algebra/lib/play.js b/site/linear-algebra/lib/play.js
index 0adc830..08b864d 100644
--- a/site/linear-algebra/lib/play.js
+++ b/site/linear-algebra/lib/play.js
@@ -60,7 +60,7 @@ function playAsk(getSys, { pos = { x: 40, y: 430, w: 720, cls: 'side' }, tip = '
const acts = h('div', 'acts', [bDraw, bInk, bClear, bReset, bOn]);
acts.style.flexWrap = 'wrap';
c.replaceChildren(h('div', 'head', [h('p', 'kicker', 'Playground · no score'), h('p', 'prompt', [rich([tip], 24)]),
- h('p', 'keys', ['Drag numbers sideways or use ', kbd('Tab'), kbd('↑'), kbd('↓'), '; drag a line to slide it, its dots to turn it, arrows by their tips; ', kbd('D'), ' to draw on the board.'])]), acts);
+ h('p', 'keys', ['Drag numbers sideways or use ', kbd('Tab'), kbd('↑'), kbd('↓'), '; drag lines, their dots and arrow tips; ', kbd('D'), ' to draw on the board.'])]), acts);
paint();
P.keys = playKeys = e => {
if (P.gen !== gen) return false;