decktalk init writes, so each is markup the runtime already accepts.
Each recipe is three things: the markup for one slide, the cues.json rows that give its moments a
second, and one sentence saying what the pattern costs to measure. That last sentence matters,
because a reveal DeckTalk cannot measure is usually a reveal a viewer cannot see either.
Before you start
The recipes are slides of one scene numbered 4, which neither packaged deck uses. A project that followed Your first deck already has a section 4, so give the recipe the next free number instead, in the scene, the slide ids, thecues.json key and the section alike. To add
one to a project:
- Paste the
<template>inside a<div data-scene="4" data-name="…">in the page’s<body>. - Paste the recipe’s
<style>rules into the page’s own<style>block. - Paste the
cues.jsonrows into"4": { "cues": [ … ] }insidesections. - Add a
[[section]]withnumber = 4, the page path andscene = "4"todecktalk.toml, and a## 4. …section toscript.mdthat speaks each phrase.
<template data-slide="4.1"> is qualified with that slide id, so data-in="title"
is the cue id 4.1:title and that is what cues.json carries. The recipes use the starter’s own
custom properties, such as --ink and --accent, and its .eyebrow class.
The recipes are laid out on the wide canvas, 1920 by 1080. For a square or vertical project, write
their widths and left edges against --dt-width, as the starter does: var(--span) for 1680px and
var(--margin) for 120px.
A title that arrives on its word
The heading and the bar under it are one element with one cue, so the whole block lands together.deck/index.html
cues.json
CUE_THIN_CHANGE.
A list that staggers
One cue, and the container’s children arrive one step apart.deck/index.html
cues.json
PAGE_STAGGER_OVERRUN, and the arithmetic that says
so is exact, so the finding is an error.
A figure that swaps for another
The card that leaves and the card that arrives share one cue.data-swaps holds the leaving card in
place until its replacement has arrived, so the two read as one thing changing.
deck/index.html
cues.json
PAGE_SWAP_AMBIGUOUS and
an error, and two halves landing far enough apart to read as unrelated is
PAGE_SWAP_APART and a warning, which is why both cards here
share a box.
An element that steps back while a second comes to the front
data-back dims an element to 45 percent and data-front brings it back. Neither is a second
reveal, so neither needs a second element.
deck/index.html
cues.json
A line shown word by word on the voice
data-words matches the element’s own text against the section’s spoken words and reveals it one
word at a time, each word whole by the second the voice reaches it.
deck/index.html
cues.json
PAGE_WORDS_NOT_FOUND. data-words defaults
to highlight, which starts every word dim. data-words="appear" starts them absent and is limited
to eight words, above which it earns
PAGE_APPEAR_TOO_LONG.
A number that counts up
data-count="last" grows the last number in the text from zero when the element arrives, and
data-count="first" grows the first one, so the figure the voice says and the figure on screen land
together.
deck/index.html
cues.json
draw entrance as the
longest span the contract declares and stays under the 0.5 second ceiling with a frame to spare. The digits alone are
a slow, thin change, and the filled band arriving underneath them is what the cue is measured on. The
script writes the figure in words, because a cue phrase is matched against spoken words.
A formula typeset with KaTeX
data-tex holds the TeX and the element’s own text is the readable fallback. data-tex-display
makes it a display equation on its own line.
deck/index.html
cues.json
PAGE_KATEX_ERROR and the element falls
back to that text, and a page with no KaTeX at all is
PAGE_KATEX_MISSING.
A class change the page’s own stylesheet animates
data-class adds a class at a cue, written as cue:class pairs. It is how a page makes a change
the contract has no word for.
deck/index.html
cues.json
data-describe-class or the change earns
PAGE_CLASS_UNDESCRIBED, and the stylesheet must drop
the motion under .dt-reduced or a reduced build earns
PAGE_CLASS_NOT_REDUCED.
A cue only a handler serves
A cue that no moment attribute names has to be listed indata-owns, which is how a slide declares a
cue it draws with script of its own.
deck/index.html
cues.json
CUE_NO_CHANGE. A cue named in data-owns that the deck never
declares is PAGE_CUE_UNKNOWN, and a handler that throws is
PAGE_HANDLER_THREW, which leaves that moment doing
nothing rather than failing the page.
Next
- Understand the rules every pattern obeys: Design a slide
- Write the whole page yourself: Write a page by hand
- Choose the words each reveal lands on: Writing for the ear