diff --git a/.agent/knowledge/html5-activities-index.md b/.agent/knowledge/html5-activities-index.md new file mode 100644 index 0000000..3032c06 --- /dev/null +++ b/.agent/knowledge/html5-activities-index.md @@ -0,0 +1,82 @@ +# Reusable Deck-Local HTML5 Activities + +Index of custom interactive widgets built directly inside a presentation's own +HTML/CSS/JS (vanilla, no external libraries). These are distinct from +ActiveBits-hosted "embedded activities" (see +`.agent/skills/vendor/syncdeck/references/AVAILABLE_ACTIVITIES.md`) — everything +here lives inline in the deck itself and is meant to be copied/adapted, not +launched. + +When building a new interactive moment, check this list first. If an existing +engine fits the shape of the interaction (classify items, trace state +step-by-step, select-all-that-apply, timed random prompt, progressive reveal, +drag-to-correct-target), copy the relevant `init*` function and markup from the +source file and re-skin it with new content rather than inventing a new +mechanism. + +## Generic, highly reusable engines + +### Variable-box code trace +- **Where:** `Decks/HPy/Unit 1 - Basic Programming Constructs/1.2 - Data, Expressions, and Variables/1.2-data-expressions-and-variables.html` (`initVarBoxTrace`, JS ~1938-2115, HTML ~362-383) +- **Also reimplemented as:** `initCallTrace` in `.../1.3 - Functions/1.3-functions.html` (JS ~1793-1981); `initBranchTrace` in `.../1.4 - Conditionals/1.4-conditionals.html` (JS ~1737-1927) +- **Concept:** step through a code listing line-by-line (`done`/`current`/`pending` highlighting) while dragging value "chips" onto empty variable boxes to trace program state. +- **Mechanism:** native HTML5 drag-and-drop (`draggable`, `dragstart`/`dragover`/`drop`) with a click-to-select fallback for accessibility; a state object tracks the current step index and box values, with correct/incorrect feedback. +- **Reuse:** very generic — works for any procedural code sequence where you want learners to predict variable state at each step. Follows the `data-fragment-trace` code-tracing convention in AGENTS.md (current-line-is-next-to-execute). + +### Chip-to-bin classifier +- **Where:** same file as above, `initTypeSort` (HTML ~775, JS ~2115+) — sorts values into data-type bins (int/float/str/bool) +- **Also reimplemented as:** `initTruthySort` in `1.3-functions.html` (truthy/falsy); `initBoolSort` in `1.4-conditionals.html` (boolean-expression sort) +- **Concept:** drag chips from a tray into labeled bins; a "N of M sorted" counter tracks progress and correctly-placed chips are removed from the tray. +- **Mechanism:** same drag/drop + click-fallback mechanism as the variable-box trace. +- **Reuse:** very generic classification pattern — swap bin labels and chip data for any "sort these into categories" exercise (data types, even/odd, parts of speech, etc.). + +### Select-all-that-apply scenario matcher +- **Where:** `Decks/AR2/ShopSafety/Industrial_Warning_Signs.html`, `initChooseGame` (section ~595-616, JS ~877-990) +- **Concept:** present a scenario, learner multi-selects applicable chips from a bank, "Check Answer" marks each `state-correct`/`state-incorrect`/`state-missed` with a scored summary ("N of M correct, X missed, Y extra"). +- **Mechanism:** pure click-based (no drag), `chosen` map tracks selection state, resets on `Reveal slidechanged`. +- **Reuse:** strong generic fit for any "select all that apply against a scenario" assessment. + +### Staged progressive-reveal scenario +- **Where:** `Decks/AR2/ShopSafety/Making_Warnings_Unnecessary.html` — three instances of the same engine: `initBeyondGame` (~1324-1391, section `#beyond-game` ~661), `initPpeGame` (~1391-1466, `#ppe-game` ~835), `initRiskyGame` (~1466-1523, `#risky-game` ~962) +- **Concept:** a scenario description with a sequence of hidden "stage" panels; each button click reveals the next stage (marking prior ones `.done`) until all are shown, then advances to the next scenario. +- **Mechanism:** click-driven progressive reveal, per-scenario reset on slide change, no drag/drop. +- **Reuse:** generic step-by-step walkthrough pattern (hazard→control→limit, cause→effect chains, any staged reveal). + +### Timed random-prompt game shell +- **Where:** `Decks/AR1/Engineering Communication/Disruptus.html` (section ~274-307, JS ~343-465) +- **Concept:** round-based brainstorming game — reveals a random "mode," deals random cards, runs a 60s countdown with low-time warning and completion sound. +- **Mechanism:** `data-state` attribute state machine (`idle`→`mode`→`cards`→`done`), plain `setInterval` timer, resets on `Reveal slidechanged`. No external libraries. +- **Reuse:** generic "randomized-prompt + timed-round" mini-game shell, independent of the card art — good for any brainstorming/warm-up activity. + +### Flip-card flashcard quiz +- **Where:** `Decks/AR2/ShopSafety/Industrial_Warning_Signs.html`, `initSignGame` (section ~437-459, JS ~807-877) +- **Concept:** click-to-reveal meaning, with prev/next navigation through a deck of items. +- **Mechanism:** simple click handler toggling a revealed state; no drag/drop or scoring. +- **Reuse:** lightweight, generic flashcard-style reveal pattern. + +### Algorithm growth-rate race +- **Where:** `Decks/CSP/Algorithms/unreasonable-time.html` (HTML ~856-920, JS ~1140-1270) +- **Concept:** simulates multiple algorithms (log n, n, n², 2ⁿ) racing to complete n "steps" on a shared clock, driven by a slider for n; bars fill proportionally with live counts/percentages. +- **Mechanism:** `requestAnimationFrame` timing loop, no canvas, pure DOM/CSS bars. +- **Reuse:** generic "race N processes against a shared clock" pattern, reusable for any compare-growth-curves topic beyond Big-O. + +## Topic-coupled but reusable *mechanism* + +### Drag-to-correct-target credential/tool matching +- **Where:** `Decks/CSP/Cybersecurity/public-private-key-lab.html` (cards ~500-1050, staged wiring/validation ~1280-1433); adapted again in `Decks/CSP/Cybersecurity/protecting-data.html` (cards ~710-1050, wiring ~1950-2059) +- **Concept:** draggable `.key-card` elements (public/private keys) dropped onto `[data-drop-zone]` targets across multiple staged slides (`data-crypto-lab="encrypt"|"decrypt"|"signature"|"tamper"|...`), validating whether the correct key was used, plus a tamper-detection text input. +- **Mechanism:** native drag-and-drop with click/keyboard fallback, per-slide state machine keyed off `data-crypto-lab`. +- **Reuse:** content (asymmetric encryption) is specific, but the drag-a-labeled-card-onto-a-labeled-slot-with-correctness-validation mechanism generalizes to any "which credential/tool goes where" simulation. + +### Fragment-synced diagram morph +- **Where:** `Decks/AR1/DCCircuits/EX7_Parallel_and_Mixed_Circuits.html` (JS ~1994-2110) +- **Concept:** as Reveal fragments advance/reverse across several slides, a parallel-branch circuit diagram visually collapses into its series equivalent (and expands back) in sync with fragment navigation. +- **Mechanism:** toggles a `.collapsing` class deferred via `requestAnimationFrame` to guarantee the CSS transition starts from the correct state, avoiding a transition/reflow race condition. +- **Reuse:** diagram-specific, but the "rAF-deferred class toggle synced to fragment events" technique generalizes to any before/after visual transformation tied to slide progression (equivalent circuits, chemical reactions, state diagrams, etc.). + +--- + +*Last surveyed 2026-07-26 across Decks/HPy, Decks/CSP, Decks/AR1, Decks/AR2. +Line numbers are approximate — re-check with the file itself before copying. +When you build a new substantial, reusable deck-local activity, add an entry +here.* diff --git a/.claude/knowledge b/.claude/knowledge new file mode 120000 index 0000000..e82cad8 --- /dev/null +++ b/.claude/knowledge @@ -0,0 +1 @@ +../.agent/knowledge \ No newline at end of file diff --git a/.claude/skills b/.claude/skills index eb079bd..0f30350 120000 --- a/.claude/skills +++ b/.claude/skills @@ -1 +1 @@ -.agent/skills \ No newline at end of file +../.agent/skills/ \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 82eb04e..d84bd6a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ This repository contains HTML slide presentations built with **Reveal.js**, published via GitHub Pages. Shared runtime/plugin code is consumed from the `SyncDeck-Reveal` git submodule at `vendor/SyncDeck-Reveal/`. -Presentation source folders live under `Decks/`, while deployment remaps +Presentation source folders now live under `Decks/`, while deployment remaps their contents to the site root. For example, `Decks/AR1/...` is published as `/AR1/...`. @@ -141,7 +141,7 @@ Full message schema: `vendor/SyncDeck-Reveal/reveal-iframe-sync-message-schema.m ``` Only add a `