Skip to main content
This page has six slides that you can copy into a project. Use a recipe when you need a common slide, such as a derivation or a code block.

Before you start

Each recipe is one section, shown as four files: script.md, decktalk.toml, cues.json, and deck/index.html. The recipes use section numbers 7 to 12, which the scaffold does not use. Each <style> block defines the classes that its recipe needs. The recipes also use the scaffold’s .slide and .eyebrow classes and its color and font variables. To add a recipe to a project, follow these steps:
  1. Paste the script.md lines after the last section of the script.
  2. Paste the [[section]] table after the last [[section]] in decktalk.toml.
  3. Paste the cues.json entry inside the sections object.
  4. Paste the <style> and <script> blocks into deck/index.html, after the decktalk-runtime.js tag.
  5. If the section number is already in use, change it in all four files.

Sync a subtitle to the voice

An element with data-sync shows its words one at a time, as the voice says them. The scaffold’s edit section uses it for its caption.
The cue makes each line appear, and its words appear one at a time from there. The text must match the script word for word. If a line differs by one word, it appears whole, and the page warns data-sync text not found in the spoken words. To check the slide at one cue, open ?step=7.1&cue=7.1b, which hides the line for 7.1c.

Show a derivation line by line

Each line of the derivation is its own element with its own cue. data-display typesets it as display math, and the answer uses pop so it stands out. The scaffold’s deck/index.html loads KaTeX.
Inside the backticks of render, write every backslash twice. A single backslash breaks the TeX or blanks the page (data-tex).
The plain text inside each element shows when KaTeX is absent, so write it as a readable fallback.

Show a chat before and after

The question types in with data-type, and the reply fades in one line at a time. The bubble and its first line share a cue, so the bubble’s background appears when its text starts. The second step is the “after”, and its cue 9.2 mounts it.

Show code one line per phrase

Each line of code is a block element with its own cue. The container keeps the indentation with white-space: pre and a monospace font. The lines use fade, because the motion of rise looks wrong on code.
Keep the lines on one physical line inside the render template. With white-space: pre, the page would otherwise show the template’s own indentation.

Compare two columns

Two columns appear left and then right, and each column has one cue. The <style> block lays them out with flex.

Wait for a screenshot to load

The recorder starts the clock only after window.__sceneReady resolves. This recipe adds the decode of a large image to that wait, so the image is ready before narration t=0. The recipe extends the runtime’s own wait, so the KaTeX wait still applies.
The listener runs after the runtime’s own DOMContentLoaded listener, so window.__sceneReady already holds the runtime’s Promise. window.__sceneReady explains the default wait.

Next