@slidevideo/cli 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/addons/slidevideo/geometry.ts +334 -1
- package/addons/slidevideo/global-top.vue +57 -6
- package/addons/slidevideo/preview.ts +242 -25
- package/assets/fonts/OFL-LICENSES.txt +95 -0
- package/assets/fonts/instrument-serif-latin-2.woff2 +0 -0
- package/assets/fonts/instrument-serif-latin-ext-1.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-4.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-ext-3.woff2 +0 -0
- package/assets/fonts/plus-jakarta-sans-latin-6.woff2 +0 -0
- package/assets/fonts/plus-jakarta-sans-latin-ext-5.woff2 +0 -0
- package/dist/adapters/powerpoint-preview.d.ts +1 -1
- package/dist/adapters/powerpoint-preview.js +13 -2
- package/dist/adapters/powerpoint.js +91 -14
- package/dist/adapters/slidev-inspection.js +7 -2
- package/dist/annotation-paint.d.ts +195 -5
- package/dist/annotation-paint.js +1188 -2
- package/dist/annotations.d.ts +26 -2
- package/dist/annotations.js +1117 -29
- package/dist/captions.d.ts +6 -0
- package/dist/captions.js +320 -0
- package/dist/cli.js +40 -17
- package/dist/compositor.js +51 -3
- package/dist/contracts.d.ts +253 -14
- package/dist/pipeline.d.ts +6 -1
- package/dist/pipeline.js +66 -19
- package/dist/preview/contracts.d.ts +14 -0
- package/dist/preview/player.js +523 -33
- package/dist/preview/server.d.ts +1 -1
- package/dist/preview/server.js +124 -3
- package/dist/preview/view.d.ts +1 -1
- package/dist/preview/view.js +26 -7
- package/dist/run.d.ts +1 -0
- package/dist/run.js +20 -0
- package/dist/speech.d.ts +10 -1
- package/dist/speech.js +17 -1
- package/dist/stamp-fonts.d.ts +17 -0
- package/dist/stamp-fonts.js +202 -0
- package/dist/storyboard.js +60 -3
- package/dist/timing.d.ts +2 -0
- package/dist/timing.js +277 -11
- package/package.json +12 -1
- package/schemas/annotation-geometry.v1.json +111 -0
- package/schemas/schedule.v1.json +1672 -84
- package/schemas/storyboard.v1.json +3725 -85
- package/skills/slidevideo/SKILL.md +5 -5
- package/skills/slidevideo/references/decks.md +6 -4
- package/skills/slidevideo/references/production.md +12 -11
- package/skills/slidevideo/references/storyboard.md +268 -5
- package/tools/powerpoint/powerpoint.ps1 +155 -6
- package/tools/powerpoint/preview.ps1 +68 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: slidevideo
|
|
3
|
-
description: Draft, explain, review, and revise slidevideo.yaml storyboards for Slidev or PowerPoint presentations, create or adapt SlideVideo-compatible slides when requested, and operate the SlideVideo CLI to produce narrated videos. Use for narration, reveals, phrase cues, marker highlights, underlines, image overlays, pauses, media, voice settings, deck compatibility, and production feedback.
|
|
3
|
+
description: Draft, explain, review, and revise slidevideo.yaml storyboards for Slidev or PowerPoint presentations, create or adapt SlideVideo-compatible slides when requested, and operate the SlideVideo CLI to produce narrated videos. Use for narration, reveals, phrase cues, marker highlights, underlines, spotlights, zoom and pan, laser pointers, stamps and badges, image overlays, pauses, media, voice settings, deck compatibility, and production feedback.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Author and produce a SlideVideo
|
|
@@ -9,7 +9,7 @@ Own the storyboard and the workflow from a presentation to a narrated MP4. Treat
|
|
|
9
9
|
|
|
10
10
|
Work in the folder containing the creator's presentation. The installed CLI supplies this skill and its references offline. Run `slidevideo skill --install` to link the skill into `~/.agents/skills/slidevideo`, plus `~/.claude/skills/slidevideo` when Claude Code is present, or add `--project` to link it in the current project. Use `slidevideo skill --json` for the installed Markdown file's path and contents, and resolve relative links from that file.
|
|
11
11
|
|
|
12
|
-
Run `slidevideo skill storyboard` for the [storyboard reference](references/storyboard.md) when drafting or revising YAML. It covers timing, marker highlights, underline annotations, image overlays, voice options, and presentation limits. The bundled [storyboard schema](../../schemas/storyboard.v1.json) defines the fields. Use `slidevideo validate` to check the draft against the actual deck.
|
|
12
|
+
Run `slidevideo skill storyboard` for the [storyboard reference](references/storyboard.md) when drafting or revising YAML. It covers timing, marker highlights, underline annotations, spotlight annotations, zoom and pan, image overlays, voice options, and presentation limits. The bundled [storyboard schema](../../schemas/storyboard.v1.json) defines the fields. Use `slidevideo validate` to check the draft against the actual deck.
|
|
13
13
|
|
|
14
14
|
Run `slidevideo skill decks` for the [deck compatibility reference](references/decks.md) when creating, adapting, or troubleshooting `slides.md` or `.pptx` presentations.
|
|
15
15
|
|
|
@@ -35,13 +35,13 @@ Use stable IDs and paths relative to the storyboard. Include all required root f
|
|
|
35
35
|
|
|
36
36
|
## Review and revise with the creator
|
|
37
37
|
|
|
38
|
-
For marker highlights, run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboard <file> --json` to discover existing audience-slide selectors
|
|
38
|
+
For marker highlights, underlines, spotlights, and zoom/pan, run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboard <file> --json` to discover existing audience-slide selectors, native shape IDs, and shape text previews. Inspect the deck and returned visibility/click information before choosing a target. Use `target: { type: text, text, container?, occurrence? }` to target visible slide phrases or words directly without wrapping Slidev copy in `<span>` tags. Regions need no element metadata. Never reference a nonexistent element ID in `slidevideo.yaml`, infer words inside an image, or claim whole-shape bounds establish word geometry. When a Slidev slide lacks a stable selector for a whole-card highlight and normalized regions are a poor fit, add a targeted `id` attribute only when slide creation or editing is part of the request or approved by the creator.
|
|
39
39
|
|
|
40
|
-
Use the `annotations` array for `highlight` and `
|
|
40
|
+
Use the `annotations` array for `highlight`, `underline`, `spotlight`, `zoom`, `laser`, and `stamp` effects. The [marker reference](references/storyboard.md#marker-highlights), [underline reference](references/storyboard.md#underline-annotations), [spotlight reference](references/storyboard.md#spotlight-annotations), [zoom reference](references/storyboard.md#zoom-and-pan), [laser pointer reference](references/storyboard.md#laser-pointer), and [stamp and badge reference](references/storyboard.md#stamp-and-badge-annotations) cover Slidev and PowerPoint. Bind each annotation to a scene using either `at` (a phrase cue or an explicit scene-relative millisecond offset) with an explicit positive `duration_ms` or `follow` against retained speech alignment (`mode: words` for word-by-word read-along on `type: text` targets, or `mode: phrase` for exact spoken-span lifetimes), keeping every resolved interval inside one settled slide visit and reveal state. Choose visible `text` targets, normalized regions, normalized points (for `stamp`), Slidev element selectors, native PowerPoint shape IDs, or slide-relative `path` waypoints (for `laser`) as appropriate. Keep highlight padding and optional `bottom_border` under `highlight`, use `underline` for standalone solid or dashed strokes with normalized `width`, optional `offset` and `padding_x`, and optional `motion: { type: wipe }`, use `spotlight` to dim the surrounding slide while keeping `rounded-rect` or `ellipse` apertures bright (with optional `padding`, `radius`, `softness`, and `motion: { type: fade }`), use `zoom` to smoothly pan and magnify a target (with optional `fit`, `scale`, `max_scale`, `padding`, and `motion: { type: ease }`) while keeping attached annotations locked to slide content and `overlays`/watermarks frame-fixed, use `laser` to move a glowing pointer with optional dwell and decaying trail along normalized or target-anchored waypoints without clicking or mutating the deck, and use `stamp` to place reproducible bundled-font text and/or vector symbols (`check`, `cross`, `warning`, `star`, `info`, `arrow-right`) with optional background, border, rotation, multiline wrapping, and `fade` or `pop` motion. Moving targets, overlapping `zoom` intervals, and unimplemented effects are unsupported.
|
|
41
41
|
|
|
42
42
|
Add, change or remove only the requested annotation and preserve unrelated annotations, narration, scene actions, media, IDs and settings. A new video after an annotation-only edit needs a new run and can reuse matching speech. Validate the draft through the real CLI. Required phrase alignment and actual target geometry are checked during resolution and capture. Highlights are composited into the final MP4, so ordinary deck playback and the raw recording remain unannotated.
|
|
43
43
|
|
|
44
|
-
When the creator wants to watch the storyboard, run `slidevideo play --storyboard <file>` and give them the local URL.
|
|
44
|
+
When the creator wants to watch the storyboard, run `slidevideo play --storyboard <file>` and give them the local URL. It automatically reads matching speech timing and synchronized cached narration audio (with a Mute/Unmute toggle) from `.slidevideo/speech` beside the storyboard; pass `--cache-dir <directory>` to use another cache or `--no-cache` to disable cache reads. The browser player shows live highlights and supports Play, Pause, Replay, timeline scrubbing, and scene jumping. Restart the command after a YAML edit. Phrase cues and `follow` annotations require matching alignment. [Preview and recording commands](references/production.md#choose-the-operation)
|
|
45
45
|
|
|
46
46
|
For an authoring or review request, deliver the YAML and a readable outline of the narration, slide changes, reveals, holds, media and voice. Point out assumptions, unsupported requests and choices that affect pacing. A compact table is useful when several scenes or cues need review. Do not generate speech or record a video merely to review a text draft.
|
|
47
47
|
|
|
@@ -53,13 +53,15 @@ Every storyboard `scene.slide` and `slide.target` value must match `^[a-zA-Z][a-
|
|
|
53
53
|
### Slidev
|
|
54
54
|
|
|
55
55
|
- Slidev renders `#slide-container > #slide-content` at the deck's configured logical canvas, `980` by `552` at `16:9` by default unless headmatter or a theme overrides `canvasWidth` or `aspectRatio`, and scales that canvas to the output dimensions, defaulting to `1920` by `1080` and letterboxing when `--width` and `--height` use another aspect ratio.
|
|
56
|
-
- Element annotations (`highlight` and `
|
|
57
|
-
-
|
|
58
|
-
-
|
|
56
|
+
- Element annotations (`highlight`, `underline`, and `spotlight`) use `target: { type: element, selector: "#card-id" }` and must match one visible, stationary, axis-aligned element inside the active audience slide.
|
|
57
|
+
- Text-range and word-following annotations use `target: { type: text, text: "...", container?: { type: element, selector: "#card-id" }, occurrence?: 1 }` against ordinary slide Markdown or HTML text (including across inline `<em>`, `<strong>`, or `<code>` nodes). Do not wrap individual words in `<span id="...">` tags; add a container `id` only when needed to scope repeated text.
|
|
58
|
+
- Keep annotated elements, text ranges, highlight padding, and underline `offset` strokes wholly inside the deck's rendered `#slide-content` rectangle. Elements or text ranges that overflow `#slide-content`, sit inside an ancestor whose `overflow` clips their bounds, use CSS `clip-path`, `mask-image`, rotation, skew, or negative scale, or sit inside an SVG `<g>` group fail geometry collection during playback.
|
|
59
|
+
- Add stable `id` attributes to cards, callouts, rows, or code containers when authoring or adapting `slides.md` so whole-element `annotations` or `text` containers do not depend on fragile tag-order selectors.
|
|
59
60
|
|
|
60
61
|
### PowerPoint
|
|
61
62
|
|
|
62
|
-
- Shape annotations (`highlight` and `
|
|
63
|
+
- Shape annotations (`highlight`, `underline`, and `spotlight`) use `target: { type: shape, id: <number> }` with the integer shape ID reported by `slidevideo inspect --deck <file> --json`. Shape names are descriptive only and are not valid target identifiers.
|
|
64
|
+
- Text-range and word-following annotations use `target: { type: text, text: "...", container?: { type: shape, id: <number> }, occurrence?: 1 }`. PowerPoint `text` targets require visible shapes with horizontal, unwarped text frames (`Orientation == msoTextOrientationHorizontal` and no WordArt warp); rotated or warped text frames report `text-range unsupported` in inspection and fail `ANNOTATION_TARGET`.
|
|
63
65
|
- `--width` and `--height` scale the native slide uniformly and letterbox when the output aspect ratio differs from the slide size. The native slideshow window sizes dynamically to the monitor bounds (using borderless capture during recording when windowed chrome would exceed the work area) to preserve full native resolution when the display permits.
|
|
64
66
|
- Static `.svg` media parts, unrotated cropped pictures, and stationary groups or group members are supported. Rotated, flipped, or 3D shapes, paragraph-level text animations, and shapes exited or hidden after animation fail `ANNOTATION_TARGET`. Any animation on the target shape must finish settling before the annotation interval starts.
|
|
65
67
|
- Both Slidev and PowerPoint also accept `target: { type: region, units: normalized, x, y, width, height }` in `[0, 1]` slide coordinates without modifying the deck.
|
|
@@ -14,33 +14,33 @@ Keep the existing presentation as input. The production CLI does not require an
|
|
|
14
14
|
|
|
15
15
|
Before drafting a storyboard for an existing presentation, run `slidevideo inspect --deck <file> --json` to list slide targets, click counts, media IDs, and highlight targets without generating speech or recording. For an authoring or explanation request, return the draft, revision, or answer without starting production. When validation is requested, use `validate`; it checks syntax, references, and capabilities without requesting speech or recording. Pending phrase alignment is checked later, during resolution.
|
|
16
16
|
|
|
17
|
-
For a visual pacing review, use `play --storyboard <file>` and open the printed URL. Pass `--width` and `--height` together as even integers from `640` to `3840` wide and `360` to `2160` high to test a non-default viewport; the default is `1920` by `1080`.
|
|
17
|
+
For a visual pacing review, use `play --storyboard <file>` and open the printed URL. Pass `--width` and `--height` together as even integers from `640` to `3840` wide and `360` to `2160` high to test a non-default viewport; the default is `1920` by `1080`. `play` automatically reads retained speech timing and synchronized cached narration audio (with a Mute/Unmute toggle) from `.slidevideo/speech` beside the storyboard; pass `--cache-dir <directory>` to override the cache path or `--no-cache` to ignore cached speech. Uncached segments estimate duration and stay silent while embedded media stays muted. Phrase cues and `follow` annotations require matching alignment. Keep the CLI running while the creator uses the browser controls, timeline scrubber, and scene selector. Stop and relaunch it after storyboard edits.
|
|
18
18
|
|
|
19
|
-
For a requested finished video, use `build`. It validates inputs, generates or reuses matching speech, resolves timing, captures the presentation, and assembles the MP4 at `1920` by `1080` and `30 fps` by default. Pass `--width` and `--height` together and optional `--fps` of `15`, `24`, `30`, or `60` to `build` or `record` to select another resolution or frame rate. `record` and `build` bind `width`, `height`, and `fps` in the run manifest. `assemble` and `build --resume` inherit those settings and fail with `RUN_MODE_MISMATCH` when you pass conflicting values.
|
|
19
|
+
For a requested finished video, use `build`. It validates inputs, generates or reuses matching speech, resolves timing, captures the presentation, and assembles the MP4 at `1920` by `1080` and `30 fps` by default, along with speech-aligned `final.vtt` and `final.srt` captions in the run directory whenever narration is present. Pass `--captions <vtt|srt|both|none>` on `build`, `assemble`, or `resolve` to select one format, write alongside an external `--output`, export during `resolve` (`timing/captions.<ext>`), or disable captions. Pass `--width` and `--height` together and optional `--fps` of `15`, `24`, `30`, or `60` to `build` or `record` to select another resolution or frame rate. `record` and `build` bind `width`, `height`, and `fps` in the run manifest. `assemble` and `build --resume` inherit those settings and fail with `RUN_MODE_MISMATCH` when you pass conflicting values.
|
|
20
20
|
|
|
21
|
-
`tts` and `resolve` reject `--width`, `--height`, and `--fps` because speech cache keys and millisecond schedules are independent of pixel dimensions. Changing from `1280` by `720` to `1920` by `1080` requires a new run directory for capture and assembly while reusing cached speech and alignment
|
|
21
|
+
`tts` and `resolve` reject `--width`, `--height`, and `--fps` because speech cache keys and millisecond schedules are independent of pixel dimensions. Changing from `1280` by `720` to `1920` by `1080` requires a new run directory for capture and assembly while automatically reusing cached speech and alignment from `.slidevideo/speech` (or `--cache-dir`). Scaling within the same aspect ratio preserves Slidev and PowerPoint layout and frame-fixed `overlays[].box` placement, while changing aspect ratio alters letterboxing for both adapters.
|
|
22
22
|
|
|
23
23
|
Use staged commands when an intermediate result is useful to the creator. `tts` prepares audio and alignment, `resolve` calculates the schedule, `record` captures from resolved inputs, and `assemble` produces the final MP4. Begin with a new or empty run directory. Commands reject a nonempty directory without a run manifest before writing run artifacts. A requested narration review can occur after `tts` and before capture. `record` does not generate speech implicitly.
|
|
24
24
|
|
|
25
|
-
Run `slidevideo --help` for command options. To record the presentation in the current folder, run the following command.
|
|
25
|
+
Run `slidevideo --help` for command options. To record the presentation in the current folder, run the following command (omit `--run` to create a fresh `runs/YYYYMMDD-HHmmss` directory automatically, or pass `--run <directory>` to name it; `--run` remains required for `resolve`, `record`, `assemble`, and `build --resume`).
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
slidevideo build --storyboard slidevideo.yaml --
|
|
28
|
+
slidevideo build --storyboard slidevideo.yaml --json
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
When `--run` is supplied, that directory must be new or empty. A nonzero exit, failed status or missing requested completed stages is failure. A completed normal build reports `status: completed`, `run_dir`, and `timing_status: not_evaluated`, with a video artifact path.
|
|
32
32
|
|
|
33
|
-
## Produce marker highlights and
|
|
33
|
+
## Produce marker highlights, underlines, and spotlights
|
|
34
34
|
|
|
35
|
-
Follow the [marker reference](storyboard.md#marker-highlights)
|
|
35
|
+
Follow the [marker reference](storyboard.md#marker-highlights), [underline reference](storyboard.md#underline-annotations), and [spotlight reference](storyboard.md#spotlight-annotations). Discover actual slide names, click counts, media declarations, and annotation targets with `slidevideo inspect --deck <file> --json` before a storyboard exists, or `slidevideo inspect --storyboard <file> --json`. Pass `--width` and `--height` together with `inspect` to check a non-default viewport. Existing Slidev selectors and native shape IDs belong to their adapters, `type: text` targets match visible rendered slide text in either adapter (with optional `container` and `occurrence`), and `region` targets use normalized slide coordinates. Preserve existing decks by default, and follow [deck compatibility](decks.md) when the creator asks to create or edit slides or add target IDs.
|
|
36
36
|
|
|
37
|
-
Use the same `validate` and `build` commands for a storyboard with annotations. The assembler draws highlights and
|
|
37
|
+
Use the same `validate` and `build` commands for a storyboard with annotations. The assembler draws highlights, underlines, and spotlights on the captured frames. A changed annotation needs a new run and can reuse matching speech.
|
|
38
38
|
|
|
39
|
-
Inspect geometry observations, `assembly/annotations-applied.json`, and `assembly/report.json` separately from base-capture timing. Normal final-composite evidence remains `not_evaluated`. Requested timing proof checks native-resolution decoded final frames, including interior wipe samples for animated underlines, and retains `assembly/annotations-evidence.json`. Unobservable strokes or boundaries fail explicitly. [Marker limits and target types](storyboard.md#marker-highlights)
|
|
39
|
+
Inspect geometry observations, `assembly/annotations-applied.json`, and `assembly/report.json` separately from base-capture timing. Normal final-composite evidence remains `not_evaluated`. Requested timing proof checks native-resolution decoded final frames, including interior wipe samples for animated underlines and bright-aperture plus fade-midpoint checks for spotlights, and retains `assembly/annotations-evidence.json`. Unobservable strokes, apertures, or boundaries fail explicitly. [Marker limits and target types](storyboard.md#marker-highlights)
|
|
40
40
|
|
|
41
41
|
## Reuse speech and preserve revisions
|
|
42
42
|
|
|
43
|
-
Speech reuse depends on the segment text, provider, voice, options and adapter version.
|
|
43
|
+
Speech reuse depends on the segment text, provider, voice, options and adapter version. `tts`, `build`, and `play` default to `.slidevideo/speech` beside the storyboard so unchanged audio and alignment are reused automatically across runs, including paid ElevenLabs narration. Pass `--cache-dir <directory>` to use a different cache location or `--no-cache` to disable cache reading and writing.
|
|
44
44
|
|
|
45
45
|
After feedback changes the storyboard, choose a new run and reuse compatible speech through the cache. `build --resume` is for unchanged inputs and intact completed stages. It cannot apply an edited storyboard to an old run. An occupied destination does not bind a fresh assembly attempt. Retry `assemble` with another output filename and the same retained capture. Never overwrite failed recording evidence. Follow an explicit user cleanup request separately from production.
|
|
46
46
|
|
|
@@ -63,6 +63,7 @@ Staged `assemble` and resumed builds inherit the run's timing mode. Changing tha
|
|
|
63
63
|
| `NEW_RUN_REQUIRED` | Preserve the existing files and choose a new or empty run directory. Use `build --resume` only for initialized runs with unchanged inputs. |
|
|
64
64
|
| `SCHEMA`, `DUPLICATE_ID`, reference errors | Correct the authored fields or references against the storyboard reference. |
|
|
65
65
|
| `CUE_ALIGNMENT_REQUIRED`, `CUE_PHRASE_MISSING`, `CUE_AMBIGUOUS`, `CUE_BOUNDARY` | Inspect the exact paired transcript and alignment. Revise the intended phrase or action with the creator. Do not invent timings. |
|
|
66
|
+
| `ANNOTATION_FOLLOW`, `FOLLOW_TEXT_MISMATCH`, `FOLLOW_TEXT_MISSING`, `FOLLOW_AMBIGUOUS`, `FOLLOW_OCCURRENCE`, `ANNOTATION_DURATION`, `ANNOTATION_ORDER` | Use `target.type: text` for `mode: words`, disambiguate repeated substrings, or add `follow.tokens` when slide text differs editorially from spoken words. |
|
|
66
67
|
| `REVEAL_TARGET`, `REVEAL_ORDER`, `ACTION_CONFLICT`, `MEDIA_NAVIGATION`, `SCENE_DURATION` | Check the merged sequence and cues, active slide, click order and reserved durations. |
|
|
67
68
|
| `RUN_MISMATCH`, `RUN_MODE_MISMATCH`, `SCHEDULE_MISMATCH` | Start a new run for revised inputs, timing-verification mode, or output dimensions and frame rate. |
|
|
68
69
|
| `RECORD_RETRY_NEW_RUN` | Preserve the failed capture and use a new run for another attempt. |
|
|
@@ -21,7 +21,7 @@ IDs and slide targets use `^[a-zA-Z][a-zA-Z0-9_-]*$`. They start with an ASCII l
|
|
|
21
21
|
| `narration` | Yes | Array of text segments. `[]` supports a silent or source-audio-only production. |
|
|
22
22
|
| `scenes` | Yes | Ordered scenes and their sequential actions. Total resolved production duration must be positive. |
|
|
23
23
|
| `cues` | Yes | Array of phrase-driven visual actions. `[]` is valid. |
|
|
24
|
-
| `annotations` | Yes | Array of phrase-triggered slide annotations (`highlight` and `
|
|
24
|
+
| `annotations` | Yes | Array of phrase-triggered or speech-following slide annotations (`highlight`, `underline`, and `spotlight`). Use `[]` when none are needed. |
|
|
25
25
|
| `overlays` | No | Frame-fixed image layers for the exported video. |
|
|
26
26
|
|
|
27
27
|
Configure video dimensions and frame rate on the CLI with `--width`, `--height`, and `--fps`, defaulting to `1920` by `1080` at `30 fps`.
|
|
@@ -180,7 +180,12 @@ The YAML has no fields for output dimensions, frame rate, output filenames, run
|
|
|
180
180
|
|
|
181
181
|
## Marker highlights
|
|
182
182
|
|
|
183
|
-
The [storyboard schema](../../../schemas/storyboard.v1.json) requires `annotations` and accepts the `highlight` and `
|
|
183
|
+
The [storyboard schema](../../../schemas/storyboard.v1.json) requires `annotations` and accepts the `highlight`, `underline`, `spotlight`, `zoom`, and `laser` effects. Each annotation has globally unique `id`, `scene`, `target`, and `effect` fields, `appearance` (required for `highlight`, `underline`, and `spotlight`; optional for `zoom` and `laser`), optional `motion` where the effect defines it, and **one** of two timing forms:
|
|
184
|
+
|
|
185
|
+
- **Explicit duration (`at` + `duration_ms`):** `at` uses either the phrase-cue fields (`segment`, `phrase`, optional `occurrence`, `boundary`, `offset_ms`) or an explicit nonnegative scene-relative millisecond offset (`number`), and `duration_ms` supplies a positive lifetime in milliseconds.
|
|
186
|
+
- **Speech-following (`follow`):** `follow` derives exact aligned `[start_ms, end_ms)` intervals from retained speech alignment, either spanning a phrase (`mode: phrase`) or stepping word by word across a `type: text` target (`mode: words`, the default).
|
|
187
|
+
|
|
188
|
+
When `at` uses a phrase cue or `follow` is used, the referenced narration `segment` must be scheduled in `scene`.
|
|
184
189
|
|
|
185
190
|
```yaml
|
|
186
191
|
annotations:
|
|
@@ -209,6 +214,63 @@ Run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboar
|
|
|
209
214
|
| Region | `type: region`, `units: normalized`, `x`, `y`, `width`, `height` | Both. Coordinates use the top-left slide origin, with `x` and `width` relative to slide width and `y` and `height` relative to slide height. |
|
|
210
215
|
| Element | `type: element`, nonempty CSS `selector` | Slidev. Matches one visible element in the active audience slide. |
|
|
211
216
|
| Shape | `type: shape`, positive integer `id` | PowerPoint. Matches one native shape ID on the active slide, returned by inspection. Names are descriptions, not identities. |
|
|
217
|
+
| Text | `type: text`, nonempty `text`, optional `container`, optional `occurrence` | Both. Matches visible rendered slide text (whitespace runs collapse to single spaces) without modifying the deck. Optional `container` narrows lookup to `{ type: element, selector }` in Slidev or `{ type: shape, id }` in PowerPoint; optional one-based `occurrence` disambiguates repeated matches. Wrapped text emits one fragment per visual line rather than one bounding box across unrelated text. |
|
|
218
|
+
|
|
219
|
+
### Speech-following timing (`follow`)
|
|
220
|
+
|
|
221
|
+
Use `follow` instead of `at` + `duration_ms` when an annotation should track spoken alignment directly:
|
|
222
|
+
|
|
223
|
+
| `follow` field | Required | Meaning |
|
|
224
|
+
| --- | --- | --- |
|
|
225
|
+
| `segment` | Yes | Narration segment scheduled in the annotation's `scene`. |
|
|
226
|
+
| `phrase` | No | Exact non-whitespace substring in that segment's alignment transcript. Omit to follow the entire segment. |
|
|
227
|
+
| `occurrence` | No | One-based integer of at least `1` to disambiguate a repeated `phrase`. Requires `phrase`. |
|
|
228
|
+
| `mode` | No | `words` (default, requires `target.type: text`) or `phrase` (accepts any target type). |
|
|
229
|
+
| `offset_ms` | No | Millisecond shift applied equally to aligned start and end boundaries. Defaults to `0`. |
|
|
230
|
+
| `linger_ms` | No | Nonnegative post-word dwell in milliseconds added to aligned end boundaries, clamped to the next word's start and any upcoming reveal, slide, or scene boundary. Defaults to `180`; set `0` for raw acoustic end boundaries. |
|
|
231
|
+
| `tokens` | No | Optional array of `{ text, occurrence?, phrase, phrase_occurrence? }` mappings for editorial differences between slide text and spoken narration. Requires `mode: words`. |
|
|
232
|
+
|
|
233
|
+
- **`mode: words` (word-by-word read-along):** Expands into one resolved interval per word (`<id>:1`, `<id>:2`, ...), slicing `target.text` to each word's UTF-16 range. Default `linger_ms: 180` bridges brief consonant micro-gaps so adjacent words step smoothly without a 1–2 frame blink while clearing naturally during real speech pauses (`linger_ms: 0` uses raw acoustic ends). Minor boundary overlaps clamp the earlier word's end to the next word's start, and zero-duration or non-advancing intervals fail with `ANNOTATION_DURATION` or `ANNOTATION_ORDER`. When `tokens` is omitted, `target.text` and the spoken window must have the same word count and canonical words (ignoring case and surrounding punctuation), or resolution fails with `FOLLOW_TEXT_MISMATCH`.
|
|
234
|
+
- **`mode: phrase` (exact spoken span):** Keeps one resolved annotation from the first aligned unit's start to the last aligned unit's end of `phrase` (or the whole segment) plus `linger_ms` without guessing `duration_ms`.
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
annotations:
|
|
238
|
+
- id: read-along
|
|
239
|
+
scene: opening
|
|
240
|
+
target:
|
|
241
|
+
type: text
|
|
242
|
+
container: { type: element, selector: '#hero-copy' }
|
|
243
|
+
text: Every word lands on beat.
|
|
244
|
+
effect: highlight
|
|
245
|
+
appearance:
|
|
246
|
+
color: '#D8FF69'
|
|
247
|
+
opacity: 0.55
|
|
248
|
+
blend: darken
|
|
249
|
+
padding: { units: normalized, x: 0.004, y: 0.003 }
|
|
250
|
+
follow:
|
|
251
|
+
segment: introduction
|
|
252
|
+
phrase: Every word lands on beat
|
|
253
|
+
mode: words
|
|
254
|
+
|
|
255
|
+
- id: editorial-items
|
|
256
|
+
scene: opening
|
|
257
|
+
target:
|
|
258
|
+
type: text
|
|
259
|
+
text: zoom · callouts · arrows
|
|
260
|
+
effect: highlight
|
|
261
|
+
appearance:
|
|
262
|
+
color: '#D8FF69'
|
|
263
|
+
opacity: 0.5
|
|
264
|
+
blend: darken
|
|
265
|
+
follow:
|
|
266
|
+
segment: introduction
|
|
267
|
+
phrase: zoom, callouts, and arrows
|
|
268
|
+
mode: words
|
|
269
|
+
tokens:
|
|
270
|
+
- { text: zoom, phrase: zoom }
|
|
271
|
+
- { text: callouts, phrase: callouts }
|
|
272
|
+
- { text: arrows, phrase: arrows }
|
|
273
|
+
```
|
|
212
274
|
|
|
213
275
|
Regions require `x` and `y` in `[0,1]`, positive `width` and `height` at most one, and `x + width` and `y + height` at most one. Appearance color is `#RRGGBB`, and opacity is greater than zero and at most one. Highlight padding has explicit `units: normalized` and `x` and `y` from zero to one, applied on each side relative to slide width and height. Expanded rectangles clip to slide bounds. Pixel mapping uses the actual captured slide-content rectangle, including letterboxing, rather than assuming the slide fills the output. Edges round outward to captured pixels before clipping.
|
|
214
276
|
|
|
@@ -220,15 +282,15 @@ Requested final-frame verification reports fill and bottom-border checks separat
|
|
|
220
282
|
|
|
221
283
|
The duration is positive milliseconds. An interval containing no output frame at the selected frame rate fails with `ANNOTATION_FRAME_RANGE`. Intervals are half-open `[start,end)` and do not extend scenes. They must fit one scene, slide visit, and settled reveal state. An annotation may end at a navigation or reveal boundary, and it cannot cross one or start during settling. Array order sets the drawing order, so later annotations draw above earlier ones. The first active frame is the first output frame at or after the resolved start, and removal begins on the first frame at or after the end.
|
|
222
284
|
|
|
223
|
-
Targets are stationary, visible, and axis-aligned. Missing, ambiguous, hidden, rotated, reflected, masked, clipped, or moving targets fail with annotation context (including Slidev SVG `<g>` groups). Slidev excludes navigation, notes, and duplicate hidden slide instances and samples geometry each animation frame. Native PowerPoint shape support includes stationary unrotated groups, group members, and cropped pictures, while excluding hidden, rotated, flipped, 3D, paragraph-animated, moving or resized, exited, and hide- or dim-after-animation targets; supported animations must have settled. PowerPoint schedules native geometry samples 50 ms apart. Movement above 0.5 output pixels invalidates the target. Sampling checks the documented stationary subset rather than tracking moving targets or recognizing pixels.
|
|
285
|
+
Targets are stationary, visible, and axis-aligned. Missing, ambiguous, hidden, rotated, reflected, masked, clipped, or moving targets fail with annotation context (including Slidev SVG `<g>` groups, and rotated or warped WordArt text frames for PowerPoint `type: text` targets). Slidev excludes navigation, notes, and duplicate hidden slide instances and samples geometry each animation frame. Native PowerPoint shape support includes stationary unrotated groups, group members, and cropped pictures, while excluding hidden, rotated, flipped, 3D, paragraph-animated, moving or resized, exited, and hide- or dim-after-animation targets; supported animations must have settled. PowerPoint schedules native geometry samples 50 ms apart. Movement above 0.5 output pixels invalidates the target. Sampling checks the documented stationary subset rather than tracking moving targets or recognizing pixels.
|
|
224
286
|
|
|
225
287
|
For a PowerPoint shape, use a target such as `{ type: shape, id: 2 }` when `slidevideo inspect --deck slides.pptx --json` or `slidevideo inspect --storyboard slidevideo.yaml --json` lists that ID on the selected slide without unsupported shape diagnostics.
|
|
226
288
|
|
|
227
|
-
Raw captures contain no annotations. The shared assembler draws them after capture without stretching narration or freezing slide animation. Normal output retains timing `not_evaluated`. Requested timing verification decodes final frames at native output resolution and checks the expected visible and clear states near interval boundaries. Tiny, low-contrast, or obscured regions, or an end with no following output frame, fail requested proof explicitly.
|
|
289
|
+
Raw captures contain no annotations. The shared assembler draws them after capture without stretching narration or freezing slide animation. Normal output retains timing `not_evaluated`. Requested timing verification decodes final frames at native output resolution and checks the expected visible and clear states near interval boundaries. Tiny, low-contrast, or obscured regions, or an end with no following output frame, fail requested proof explicitly.
|
|
228
290
|
|
|
229
291
|
## Underline annotations
|
|
230
292
|
|
|
231
|
-
Use `effect: underline` in `annotations` to draw a standalone horizontal stroke under a stationary `region`, Slidev `element`,
|
|
293
|
+
Use `effect: underline` in `annotations` to draw a standalone horizontal stroke under a stationary `region`, Slidev `element`, PowerPoint `shape`, or visible `text` target (with either `at` + `duration_ms` or `follow` timing) without drawing a box fill.
|
|
232
294
|
|
|
233
295
|
```yaml
|
|
234
296
|
annotations:
|
|
@@ -272,6 +334,207 @@ Optional `motion` accepts `{ type: wipe, in_ms, out_ms }`. `in_ms` and `out_ms`
|
|
|
272
334
|
|
|
273
335
|
When a static `region` underline places the stroke completely outside `[0, 1]` vertically (`y + height + offset >= 1` or `y + height + offset + width <= 0`), validation fails with `ANNOTATION_BOUNDS`. When runtime slide-content clipping reduces an underline fragment's width or height to zero pixels, assembly fails with `ANNOTATION_GEOMETRY`. With `--verify-timing`, the analyzer checks native-resolution boundary frames and interior `wipe_in` and `wipe_out` progression frames. Strokes thinner than two output pixels or wipe durations with no observable partial frame at the selected frame rate fail requested timing verification explicitly.
|
|
274
336
|
|
|
337
|
+
## Spotlight annotations
|
|
338
|
+
|
|
339
|
+
Use `effect: spotlight` in `annotations` to dim the surrounding slide content while keeping a stationary `region`, Slidev `element`, PowerPoint `shape`, or visible `text` target bright (with either `at` + `duration_ms` or `follow` timing).
|
|
340
|
+
|
|
341
|
+
```yaml
|
|
342
|
+
annotations:
|
|
343
|
+
- id: focus-card
|
|
344
|
+
scene: opening
|
|
345
|
+
target:
|
|
346
|
+
type: element
|
|
347
|
+
selector: '#summary-card'
|
|
348
|
+
effect: spotlight
|
|
349
|
+
appearance:
|
|
350
|
+
color: '#000000'
|
|
351
|
+
opacity: 0.58
|
|
352
|
+
shape: rounded-rect
|
|
353
|
+
radius: 0.016
|
|
354
|
+
softness: 0.018
|
|
355
|
+
padding: { units: normalized, x: 0.01, y: 0.008 }
|
|
356
|
+
motion:
|
|
357
|
+
type: fade
|
|
358
|
+
in_ms: 200
|
|
359
|
+
out_ms: 240
|
|
360
|
+
at:
|
|
361
|
+
segment: introduction
|
|
362
|
+
phrase: main takeaway
|
|
363
|
+
boundary: start
|
|
364
|
+
offset_ms: -100
|
|
365
|
+
duration_ms: 2200
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Spotlight `appearance` accepts these fields:
|
|
369
|
+
|
|
370
|
+
- Optional `color` is `#RRGGBB` and defaults to `'#000000'`.
|
|
371
|
+
- `opacity` is greater than zero and at most one, setting the surrounding dim mask opacity.
|
|
372
|
+
- Optional `shape` accepts `rounded-rect` (default) or `ellipse`.
|
|
373
|
+
- Optional `padding` has `{ units: normalized, x, y }` with `x` and `y` in `[0, 1]` relative to slide width and height, defaulting to `0` on each axis.
|
|
374
|
+
- Optional `radius` ranges from `0` to `0.5` in normalized slide-height units on `rounded-rect` spotlights (defaulting to `0.012`; set `0` for sharp corners) and is rejected when `shape: ellipse` is selected. An `ellipse` aperture is inscribed in each fragment's padded box (`rx = width / 2`, `ry = height / 2`), so add `padding` when spotlighting rectangular cards or text with an elliptical cutout.
|
|
375
|
+
- Optional `softness` ranges from `0` to `0.5` in normalized slide-height units and defaults to `0`, feathering the dim mask smoothly outward from the bright padded aperture without dimming the target interior.
|
|
376
|
+
|
|
377
|
+
Optional `motion` accepts `{ type: fade, in_ms, out_ms }` with nonnegative millisecond durations defaulting to `0`. When `in_ms + out_ms` exceeds the explicit or resolved duration, validation or resolution fails with `ANNOTATION_MOTION`.
|
|
378
|
+
|
|
379
|
+
The dim mask clips to the actual captured slide-content rectangle so letterbox bars stay untinted, while partially off-slide padded apertures clip cleanly at the slide boundary without squashing corners or ellipse aspect ratios. Wrapped `type: text` targets punch one aperture per visual line rather than one bounding box across unrelated text. When runtime clipping leaves any aperture fragment with zero visible interior inside the slide-content rectangle, assembly and preview fail with `ANNOTATION_GEOMETRY`.
|
|
380
|
+
|
|
381
|
+
Simultaneous `spotlight` annotations share one unified spotlight mask plane: backdrop dim opacity uses the maximum active effective dim opacity (with opacity-weighted RGB when colors differ), and every active spotlight punches its bright aperture out of that shared mask (`destination-out`) scaled by its relative fade weight so overlapping or simultaneous spotlights illuminate all active targets instead of dimming one another. The unified spotlight mask renders beneath active `highlight` and `underline` annotations (which keep their storyboard array order) and beneath frame-fixed `overlays` and the watermark, so annotation ordering never accidentally dims an active marker. With `--verify-timing`, the analyzer checks surrounding `dim` boundary states, bright `aperture` preservation per fragment, and interior `fade_in` and `fade_out` progression frames.
|
|
382
|
+
|
|
383
|
+
## Zoom and pan
|
|
384
|
+
|
|
385
|
+
Use `effect: zoom` in `annotations` to smoothly pan and magnify a stationary `region`, Slidev `element`, PowerPoint `shape`, or visible `text` target (with phrase-aligned `at` + `duration_ms`, explicit scene-relative numeric `at` + `duration_ms`, or `follow` timing).
|
|
386
|
+
|
|
387
|
+
```yaml
|
|
388
|
+
annotations:
|
|
389
|
+
- id: zoom-code-window
|
|
390
|
+
scene: opening
|
|
391
|
+
target:
|
|
392
|
+
type: element
|
|
393
|
+
selector: '#code-window'
|
|
394
|
+
effect: zoom
|
|
395
|
+
appearance:
|
|
396
|
+
fit: contain
|
|
397
|
+
max_scale: 1.8
|
|
398
|
+
padding: { units: normalized, x: 0.04, y: 0.04 }
|
|
399
|
+
motion:
|
|
400
|
+
type: ease
|
|
401
|
+
in_ms: 400
|
|
402
|
+
out_ms: 400
|
|
403
|
+
easing: ease-in-out
|
|
404
|
+
at:
|
|
405
|
+
segment: introduction
|
|
406
|
+
phrase: YAML storyboard
|
|
407
|
+
boundary: start
|
|
408
|
+
offset_ms: -150
|
|
409
|
+
duration_ms: 2800
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Optional zoom `appearance` accepts these fields:
|
|
413
|
+
|
|
414
|
+
- Optional `fit` accepts `contain` (default, fits the padded target inside the slide-content rectangle) or `cover` (fills the slide-content rectangle with the padded target).
|
|
415
|
+
- Optional `scale` sets an explicit magnification factor (`> 1`, up to `8`) instead of deriving scale from `fit`.
|
|
416
|
+
- Optional `max_scale` caps the derived magnification factor (`> 1`, up to `8`, defaulting to `2.5` when `scale` is omitted). If both `scale` and `max_scale` are supplied, `scale` cannot exceed `max_scale` (`ANNOTATION_ZOOM`).
|
|
417
|
+
- Optional `padding` has `{ units: normalized, x, y }` with `x` and `y` in `[0, 0.5]` relative to slide width and height, defaulting to `0.04` on each axis.
|
|
418
|
+
|
|
419
|
+
Optional `motion` accepts `{ type: ease, in_ms, out_ms, easing }` with nonnegative `in_ms` and `out_ms` defaulting to `0` and `easing` defaulting to `ease-in-out` (`linear` is also supported). When `in_ms + out_ms` exceeds the explicit or resolved duration, validation or resolution fails with `ANNOTATION_MOTION`.
|
|
420
|
+
|
|
421
|
+
The zoomed viewport clamps strictly inside the captured slide-content rectangle so letterbox bars or off-slide pixels never leak in. Multi-line `type: text` targets zoom to the bounding union of their line fragments. When a target plus padding leaves no room to magnify (`target_scale <= 1`), assembly and preview fail with `ANNOTATION_GEOMETRY`. Overlapping `zoom` intervals fail resolution with `ANNOTATION_ZOOM_OVERLAP`; touching intervals (`a.end_ms === b.start_ms`) are allowed.
|
|
422
|
+
|
|
423
|
+
During an active `zoom`, one shared slide-clipped view transform applies to both the captured slide pixels and all slide-attached annotations (`spotlight`, `highlight`, `underline`) so annotations remain locked to slide content, while frame-fixed `overlays` and the installation watermark remain untransformed above the view. Magnification upscales captured pixels and cannot recover detail beyond the capture resolution (keep `scale` / `max_scale` modest, typically `1.3`–`2.2` at 1080p, or capture at higher `--width`/`--height` when heavier magnification is needed). With `--verify-timing`, the analyzer checks unzoomed/zoomed boundary frames, interior `ease_in` and `ease_out` progression frames, and inverse-mapped attached annotations.
|
|
424
|
+
|
|
425
|
+
## Laser pointer
|
|
426
|
+
|
|
427
|
+
Use `effect: laser` in `annotations` to move a glowing pointer along a declared slide-relative path without clicking, dragging, or mutating the presentation (with phrase-aligned `at` + `duration_ms`, explicit scene-relative numeric `at` + `duration_ms`, or `follow` with `mode: phrase`).
|
|
428
|
+
|
|
429
|
+
```yaml
|
|
430
|
+
annotations:
|
|
431
|
+
- id: guide-cards
|
|
432
|
+
scene: opening
|
|
433
|
+
target:
|
|
434
|
+
type: path
|
|
435
|
+
units: normalized
|
|
436
|
+
points:
|
|
437
|
+
- { x: 0.2, y: 0.45, dwell_ms: 200 }
|
|
438
|
+
- target: { type: element, selector: '#key-metric' }
|
|
439
|
+
anchor: center
|
|
440
|
+
dwell_ms: 250
|
|
441
|
+
- { x: 0.8, y: 0.55 }
|
|
442
|
+
effect: laser
|
|
443
|
+
appearance:
|
|
444
|
+
color: '#ff2d2d'
|
|
445
|
+
opacity: 0.95
|
|
446
|
+
radius: 0.008
|
|
447
|
+
glow: 0.024
|
|
448
|
+
trail_ms: 240
|
|
449
|
+
interpolation: smooth
|
|
450
|
+
motion:
|
|
451
|
+
type: fade
|
|
452
|
+
in_ms: 150
|
|
453
|
+
out_ms: 180
|
|
454
|
+
follow:
|
|
455
|
+
segment: introduction
|
|
456
|
+
phrase: key metric
|
|
457
|
+
mode: phrase
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
`target` uses `{ type: path, units: normalized, points }` with at least one waypoint. Each waypoint in `points` is either:
|
|
461
|
+
|
|
462
|
+
- Normalized slide coordinates `{ x, y, dwell_ms? }` with `x` and `y` in `[0, 1]`.
|
|
463
|
+
- Target-anchored `{ target, anchor?, dwell_ms? }` where `target` is any `region`, Slidev `element`, PowerPoint `shape`, or `text` target, and optional `anchor` selects `center` (default), `top-left`, `top`, `top-right`, `left`, `right`, `bottom-left`, `bottom`, or `bottom-right` on the target's bounds.
|
|
464
|
+
|
|
465
|
+
Optional laser `appearance` accepts these fields:
|
|
466
|
+
|
|
467
|
+
- Optional `color` is `#RRGGBB` and defaults to `'#ff2d2d'`.
|
|
468
|
+
- Optional `opacity` is greater than zero and at most one (default `0.95`).
|
|
469
|
+
- Optional `radius` is the core dot radius in normalized slide-height units (`(0, 0.1]`, default `0.008`).
|
|
470
|
+
- Optional `glow` is the outer halo radius in normalized slide-height units (`[0, 0.2]`, default `0.024`).
|
|
471
|
+
- Optional `trail_ms` is the decaying trail lifetime in milliseconds (`>= 0`, default `240`; set `0` to disable the trail).
|
|
472
|
+
- Optional `interpolation` accepts `smooth` (default, Catmull-Rom spline across 3+ waypoints) or `linear`, parameterized by arc length so travel speed stays uniform.
|
|
473
|
+
|
|
474
|
+
Optional `motion` accepts `{ type: fade, in_ms, out_ms }` for entrance/exit opacity fading, distinct from path traversal and trail decay. Waypoint `dwell_ms` values pause the pointer at each waypoint; for multi-point paths, total `dwell_ms` must leave positive traversal time within the resolved duration (`ANNOTATION_MOTION`), and `in_ms + out_ms` must fit within the duration. Single-point paths dwell at that point for the full interval. Active lasers clip to the slide-content rectangle, render above `spotlight`, `highlight`, and `underline` annotations, follow any active `zoom` view transform, and stay beneath frame-fixed `overlays` and the watermark. With `--verify-timing`, the analyzer checks pointer visibility/clearance at interval boundaries and interior movement along multi-point paths.
|
|
475
|
+
|
|
476
|
+
## Stamp and badge annotations
|
|
477
|
+
|
|
478
|
+
Use `effect: stamp` in `annotations` to place reproducible text and/or vector symbols (such as `APPROVED`, `OUTDATED`, `Important`, a check mark, or a cross) over a slide without changing the source deck.
|
|
479
|
+
|
|
480
|
+
```yaml
|
|
481
|
+
annotations:
|
|
482
|
+
- id: approved-stamp
|
|
483
|
+
scene: review
|
|
484
|
+
target:
|
|
485
|
+
type: element
|
|
486
|
+
selector: '#summary-card'
|
|
487
|
+
effect: stamp
|
|
488
|
+
appearance:
|
|
489
|
+
text: APPROVED
|
|
490
|
+
symbol: check
|
|
491
|
+
font: sans
|
|
492
|
+
size: 0.042
|
|
493
|
+
color: '#15803d'
|
|
494
|
+
opacity: 0.95
|
|
495
|
+
background: '#f0fdf4'
|
|
496
|
+
background_opacity: 0.92
|
|
497
|
+
border:
|
|
498
|
+
color: '#15803d'
|
|
499
|
+
opacity: 0.95
|
|
500
|
+
width: 0.005
|
|
501
|
+
radius: 0.012
|
|
502
|
+
padding:
|
|
503
|
+
units: normalized
|
|
504
|
+
x: 0.02
|
|
505
|
+
y: 0.012
|
|
506
|
+
anchor: center
|
|
507
|
+
rotation_deg: -10
|
|
508
|
+
motion:
|
|
509
|
+
type: pop
|
|
510
|
+
in_ms: 180
|
|
511
|
+
out_ms: 200
|
|
512
|
+
start_scale: 1.35
|
|
513
|
+
follow:
|
|
514
|
+
segment: review-voice
|
|
515
|
+
phrase: approved for release
|
|
516
|
+
mode: phrase
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
`target` accepts any `region`, Slidev `element`, PowerPoint `shape`, `text` target, or an explicit normalized point `{ type: point, units: normalized, x, y }` with `x` and `y` in `[0, 1]`.
|
|
520
|
+
|
|
521
|
+
Stamp `appearance` requires at least one of `text` or `symbol` and accepts these fields:
|
|
522
|
+
|
|
523
|
+
- Optional `text` is a non-empty string supporting explicit `\n` line breaks and automatic word wrapping when `max_width` is set. Characters must belong to the bundled Latin / Latin-Extended font coverage; unsupported glyphs (such as emojis or non-Latin scripts) fail validation with `STAMP_GLYPH` rather than falling back to unspecified system fonts.
|
|
524
|
+
- Optional `symbol` draws a crisp vector icon (`check`, `cross`, `warning`, `star`, `info`, or `arrow-right`).
|
|
525
|
+
- Optional `font` selects one of the bundled OFL fonts: `sans` (default, Plus Jakarta Sans), `mono` (JetBrains Mono), or `serif` (Instrument Serif).
|
|
526
|
+
- Optional `size` is the text height in normalized slide-height units (`(0, 0.25]`, default `0.036`).
|
|
527
|
+
- Optional `color` (`#RRGGBB`, default `'#ffffff'`) and `opacity` (`(0, 1]`, default `1`) set text/symbol ink and overall stamp opacity.
|
|
528
|
+
- Optional `background` (`#RRGGBB`) and `background_opacity` (`(0, 1]`, default `0.95`) fill the badge box; omit `background` for a transparent rubber-stamp look.
|
|
529
|
+
- Optional `border` (`{ color, opacity?, width? }`) strokes the badge box (`width` in normalized slide-height units `(0, 0.05]`, default `0.004`).
|
|
530
|
+
- Optional `radius` sets corner rounding in normalized slide-height units (`[0, 0.25]`, default `0.012`).
|
|
531
|
+
- Optional `padding` (`{ units: normalized, x, y }`, default `x: 0.018, y: 0.012`) pads inside the badge box.
|
|
532
|
+
- Optional `anchor` (`center` default, `top-left`, `top`, `top-right`, `left`, `right`, `bottom-left`, `bottom`, `bottom-right`) selects the anchor point on target bounds; optional `offset` (`{ units: normalized, x, y }`) nudges placement.
|
|
533
|
+
- Optional `rotation_deg` rotates the stamp in degrees (`[-180, 180]`, default `0`).
|
|
534
|
+
- Optional `max_width` (`(0, 1]` normalized slide width) enables word wrapping; optional `align` (`left`, `center` default, `right`) aligns multiline text; optional `overflow` selects `error` (default, fails with `STAMP_OVERFLOW` if an unbreakable word exceeds `max_width` or the rotated box extends outside slide bounds) or `clip`.
|
|
535
|
+
|
|
536
|
+
Optional `motion` accepts `{ type: fade, in_ms?, out_ms? }` or `{ type: pop, in_ms?, out_ms?, start_scale? }` (`start_scale` in `[0.2, 2.5]`, default `1.35`). `in_ms + out_ms` must fit within the resolved duration (`ANNOTATION_MOTION`). Active stamps clip to the slide-content rectangle, render above `spotlight`, `highlight`, and `underline` annotations (and beneath `laser` pointers), follow any active `zoom` view transform, and stay beneath frame-fixed `overlays` and the watermark. With `--verify-timing`, the analyzer checks stamp appearance and clearance at interval boundaries.
|
|
537
|
+
|
|
275
538
|
## Image overlays
|
|
276
539
|
|
|
277
540
|
Add these root fields to the storyboard. Use your own image paths and scene IDs.
|