The goal is to let a first-time learner see where things get blocked, where they flow, and when they appear and disappear. Show structure that text alone cannot convey (layers, boundaries, flows, lifetimes) with a model, and let the learner trigger the events with a button. The model is half of the explanation, not decoration.
assets/example-agent-sandbox.html (how AI-agent code sandboxes isolate code, 10 chapters; the same example exists in English as assets/example-agent-sandbox.en.html, so look at that one when building an English page). When you need a similar scene, look in this file first.Decide the page language in this order. If an earlier item exists, ignore the later ones.
<html lang> to that language (ko, en, ja, zh-CN, etc.). The template default is en.say), labels, legend, and scene title directly in that language. Do not write them in another language and translate. The language of this document does not decide the language of the page you build.<html lang> language from the ENGINE’s text dictionary. Built-in languages are English (en, canonical), Korean (ko), Japanese (ja), and Simplified Chinese (zh-CN). ko* maps to ko, ja* to ja, zh* to zh-CN, and anything else to en.window.UI_OVERRIDES. Keys you leave out come out in English. Do not edit the engine. The key list and usage are in “Screen text and language” in references/engine-api.md.data-date of <h3 data-ui="sources" data-date="YYYY-MM-DD">. The engine generates the heading text (“Sources (checked …)”).__explainer.lang().If references/preferences.md exists, read it first. Where items overlap, follow preferences over this document’s defaults. If it does not exist, use the defaults.
Fact-check. If the topic depends on repository code or current product information, check it first (read the code, official docs, web search). Leave the sources you checked and the date at the end of the page, and write “not checked” for anything you could not verify. Learners trust this page as fact and memorize it.
Chapter design. Split into 5-10 chapters. Go from easy to hard, and use the last one or two chapters to apply the idea to the user’s actual situation (an issue in progress, a design draft, a product comparison). Decide three things for each chapter:
A chapter with no action in mind is either well served by text alone or should be merged into another chapter. Write a short chapter list, then build. Ask the user only when the topic scope is ambiguous.
This style is an architectural model (white massing model + ink outlines) seen in axonometric view. It is chosen so that learners read “structure”, so keep it when the topic changes.
:lang(ja), :lang(zh)) fall back to system fonts such as Hiragino Sans, Yu Gothic, PingFang SC, and Noto Sans CJK, because these web fonts lack enough kana and Simplified Chinese glyphs (this is in the template CSS). Do not add CDN fonts.Copy assets/template.html to the output location and fill in only the HTML marked TEXT and the SCENES section. Do not edit the ENGINE sections, which hold the renderer, camera fitting, label handling, animator, chapter switching, and verification hooks. They already contain fixes for bugs we hit.
defineScene(name, { title, base, target, fitW, fitH, build }). The data-scene in the body and the data-run on the button must equal name.build() returns { group, reset, run }. reset() restores everything run() changed (position, size, visibility, label text). The engine restores colors with resetLook.data-run button inside the chapter body’s .act loop; elements without a button (intro, glossary) do not run. It also does not run at the very top of the page (scroll 40px or less). To loop, the scene’s reset() must restore everything run() changed (including the result sentence and label text)..note’s .wide and .narrow, HUD buttons, .hint, .fallback, the glossary and sources headings) carry data-ui="key" or data-ui-aria="key", and the engine fills them in the page language. Do not edit this text directly in TEXT. To change it, override it with UI_OVERRIDES. The stage’s aria-label (data-ui-aria="stageAria") has the generic text “3D model”; to put the topic in it, delete that attribute and write aria-label yourself.references/engine-api.mdreferences/scene-patterns.mdsay) in the past tense, about what just happened.pre.code and quotations such as hidden input in blockquote.planted, and match the button’s result sentences to the example’s step numbers.Read references/gotchas.md first. Overlapping labels and clipped models cannot be found by reading the code.
python3 -m http.server <port> --bind 127.0.0.1 --directory <folder>async () => { const out = {}; for (const n of window.__explainer.scenes()) {
const text = await window.__explainer.run(n);
out[n] = { text, overlaps: window.__explainer.overlaps(), clipped: window.__explainer.clipped() };
} return out; }
overlaps and clipped must be empty arrays. run waits until the action finishes, so
no intermediate state is captured.
__explainer.run(name) for each chapter and look at it. Check that the end state matches the result sentence and that the empty space is not excessive (adjust with fitW and fitH). Give the save path as an absolute path inside a folder the tool allows (see gotchas).__explainer.autorun(true) and scroll to a chapter. In one chapter, confirm that the loop runs three or more times, that each time the result sentence reaches the last step’s sentence and is cleared by reset, and that overlaps() and clipped() are empty at each final state. With it off, scrolling must run nothing; when you move to the next chapter during a run, the previous chapter’s loop must stop and the new chapter’s loop must start.overlaps() and clipped() are empty arrays for every chapter, that there is no horizontal scroll (document.documentElement.scrollWidth === innerWidth), and that the layout does not break in landscape at 844×390. While scrolling, confirm that __explainer.current() matches the chapter being read on screen. Confirm that a vertical swipe on the stage scrolls the page and a horizontal swipe rotates the model.en, ja, zh-CN, an override language), confirm that __explainer.lang() is that language and that the screen text (HUD, hint, glossary and sources headings) appears in that language. At 390×844 and 360×800, confirm that the HUD’s chapter title, switch, and reset-view button do not overlap.__…__ (for example grep -nE '__[^_ ][^_]*__' <page>.html | grep -v -e __explainer -e "label = '__actor__'"; the two filters skip the verification hook and the engine’s own default label argument), and expect no output. If the page language is not Korean, confirm that the visible text (excluding script and style, for example document.body.innerText and document.title) contains no Hangul (/[\uAC00-\uD7A3]/).The phone layout is built into the template.
git check-ignore). This keeps study documents from getting mixed into the repository and committed. If there is no such folder, or you are outside a repository, put it in the location set in preferences. If there is none, ask the user, and with no answer put it in the current directory.open <path> command, the chapter list, and the verification scope (resolutions, whether there were errors and overlaps). Tell the user that the temporary server address closes when the session ends.