An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
style(science): calmer labels and practice layout (Codex T1, T3, L4)
yzrb36127f78955
diff --git a/site/science/lib/engine.css b/site/science/lib/engine.cssindex 902eea8..4fcc2ff 100644--- a/site/science/lib/engine.css+++ b/site/science/lib/engine.css@@ -148,6 +148,7 @@ kbd { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: .5e.icon.cc[aria-pressed="true"] { background: var(--chalk); border-color: var(--chalk); color: var(--board); }.card.side { overflow: auto; }svg.m { display: inline-block; overflow: visible; }+.card b { font-weight: 700; } /* not 'bolder' (900 under a 600 prompt) */.card { animation: card-in .45s cubic-bezier(.2, .9, .3, 1.15); }.fb:not(:empty) { animation: fb-in .3s ease-out; }.opt.bad, .grid .mark.bad { animation: shake .4s; }@@ -161,7 +162,9 @@ svg.m { display: inline-block; overflow: visible; }.screen .kicker { font-size: 22px; }.screen .prompt { font-size: 40px; font-weight: 600; }.screen .body { margin-top: 30px; }-.screen .fb { position: absolute; left: 70px; bottom: 56px; max-width: 1080px; margin: 0; font-size: 24px; }+.card.screen { display: flex; flex-direction: column; }+.screen .head { order: 1; } .screen .body { order: 2; }+.screen .fb { order: 3; max-width: 1080px; margin: 26px 0 0; font-size: 24px; } /* feedback right under the answers */.screen .acts { position: absolute; right: 70px; bottom: 48px; }.screen .grid .row { grid-template-columns: 200px minmax(0, 1fr) 40px; padding: 9px 0 9px 12px; }.screen .grid.text .row { grid-template-columns: minmax(0, 1fr) auto 40px; }@@ -172,7 +175,7 @@ svg.m { display: inline-block; overflow: visible; }.screen.sort > * { pointer-events: auto; }.screen.sort .head { position: absolute; right: 34px; top: 40px; width: 330px; }.screen.sort .prompt { font-size: 28px; }-.screen.sort .fb { left: auto; right: 34px; bottom: 116px; width: 330px; max-height: 240px; overflow: auto; font-size: 20px; }+.screen.sort .fb { position: absolute; margin: 0; left: auto; right: 34px; bottom: 116px; width: 330px; max-height: 240px; overflow: auto; font-size: 20px; }.screen.sort .acts { right: 34px; }.fin .finwrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding-bottom: 60px; }.fin .mascot { margin-bottom: 28px; }diff --git a/site/science/lib/engine.js b/site/science/lib/engine.jsindex d9cf62c..47fdd22 100644--- a/site/science/lib/engine.js+++ b/site/science/lib/engine.js@@ -82,7 +82,7 @@ const NS = 'http://www.w3.org/2000/svg';const COL = { nat: '#f4a48c', whole: '#86c9e8', int: '#f3c95c', rat: '#e8a0c8', irr: '#8fd6b0', real: '#bba8ee',chalk: '#ece8dc', dim: '#9aaba3', faint: '#5d7068', task: '#f0b45a', good: '#8fd6b0', bad: '#f08c7a', board: '#1d2b27' };const UI = '"Avenir Next","Segoe UI","Helvetica Neue",Arial,sans-serif';-const MATH = '"STIX Two Text","Cambria Math","Iowan Old Style",Palatino,Georgia,serif';+const MATH = UI; // science book: one face for numbers and formulas in demos and questionsconst NAME = { nat: 'Natural', whole: 'Whole', int: 'Integers', rat: 'Rational', irr: 'Irrational', real: 'Real' };// Card positions inside the 1600×900 picture.const BAND = { x: 96, y: 686, w: 1408, cls: 'band' }; // bottom band (moves up when taller than the space left)diff --git a/site/science/lib/figures.js b/site/science/lib/figures.jsindex b8dce68..9207113 100644--- a/site/science/lib/figures.js+++ b/site/science/lib/figures.js@@ -25,10 +25,11 @@ function phBlock(p, x, y, w, h, c, { top = 4, right = 0, bottom = 0, ol = OL } =if (ol) mk('rect', { x, y, width: w, height: h, fill: 'none', ...phLine(ol) }, p);}-// Text with a dark backing stroke, so it stays legible when something passes behind it.+// Text with a thin dark outline, so it stays legible when something passes behind it.function phLabel(p, str, { x = 0, y = 0, size = 30, fill = COL.chalk, anchor = 'middle', weight = 700, o = 1 } = {}) {const t = T(p, str, { x, y, size, fill, anchor, weight, o });- t.setAttribute('stroke', COL.board); t.setAttribute('stroke-width', size / 4); t.setAttribute('paint-order', 'stroke');+ // A thin, capped outline keeps small labels legible over pictures; titles (72 px and up) sit on clean board and get none.+ if (size < 72) { t.setAttribute('stroke', COL.board); t.setAttribute('stroke-width', Math.min(5, size * .16)); t.setAttribute('paint-order', 'stroke'); }t.setAttribute('stroke-linejoin', 'round');return t;}