@softure-ai/marketing-kit 0.34.0 → 0.36.0

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/NOTICE +6 -0
  3. package/README.md +49 -1
  4. package/dist/config/config.d.ts.map +1 -1
  5. package/dist/config/config.js +1 -0
  6. package/dist/config/config.js.map +1 -1
  7. package/dist/config/schema.d.ts +10 -0
  8. package/dist/config/schema.d.ts.map +1 -1
  9. package/dist/config/schema.js +9 -3
  10. package/dist/config/schema.js.map +1 -1
  11. package/dist/footage/captions.d.ts +22 -2
  12. package/dist/footage/captions.d.ts.map +1 -1
  13. package/dist/footage/captions.js +23 -4
  14. package/dist/footage/captions.js.map +1 -1
  15. package/dist/footage/compose.d.ts +11 -1
  16. package/dist/footage/compose.d.ts.map +1 -1
  17. package/dist/footage/compose.js +51 -17
  18. package/dist/footage/compose.js.map +1 -1
  19. package/dist/footage/draft-overlays.d.ts +6 -0
  20. package/dist/footage/draft-overlays.d.ts.map +1 -1
  21. package/dist/footage/draft-overlays.js +188 -4
  22. package/dist/footage/draft-overlays.js.map +1 -1
  23. package/dist/footage/draft.d.ts +14 -1
  24. package/dist/footage/draft.d.ts.map +1 -1
  25. package/dist/footage/draft.js +117 -17
  26. package/dist/footage/draft.js.map +1 -1
  27. package/dist/footage/drawn-transitions.d.ts +63 -0
  28. package/dist/footage/drawn-transitions.d.ts.map +1 -0
  29. package/dist/footage/drawn-transitions.js +177 -0
  30. package/dist/footage/drawn-transitions.js.map +1 -0
  31. package/dist/footage/edl.d.ts +42 -0
  32. package/dist/footage/edl.d.ts.map +1 -1
  33. package/dist/footage/edl.js +72 -2
  34. package/dist/footage/edl.js.map +1 -1
  35. package/dist/footage/film.d.ts +29 -5
  36. package/dist/footage/film.d.ts.map +1 -1
  37. package/dist/footage/film.js +13 -3
  38. package/dist/footage/film.js.map +1 -1
  39. package/dist/footage/hand-font.d.ts +16 -0
  40. package/dist/footage/hand-font.d.ts.map +1 -0
  41. package/dist/footage/hand-font.js +43 -0
  42. package/dist/footage/hand-font.js.map +1 -0
  43. package/dist/footage/overlay-html.d.ts +1 -0
  44. package/dist/footage/overlay-html.d.ts.map +1 -1
  45. package/dist/footage/overlay-html.js +134 -8
  46. package/dist/footage/overlay-html.js.map +1 -1
  47. package/dist/footage/overlay-motion.d.ts +35 -0
  48. package/dist/footage/overlay-motion.d.ts.map +1 -1
  49. package/dist/footage/overlay-motion.js +45 -0
  50. package/dist/footage/overlay-motion.js.map +1 -1
  51. package/dist/footage/overlay-schema.d.ts +48 -6
  52. package/dist/footage/overlay-schema.d.ts.map +1 -1
  53. package/dist/footage/overlay-schema.js +71 -18
  54. package/dist/footage/overlay-schema.js.map +1 -1
  55. package/dist/footage/overlays.d.ts +125 -1
  56. package/dist/footage/overlays.d.ts.map +1 -1
  57. package/dist/footage/overlays.js +265 -8
  58. package/dist/footage/overlays.js.map +1 -1
  59. package/dist/footage/picture.d.ts +10 -2
  60. package/dist/footage/picture.d.ts.map +1 -1
  61. package/dist/footage/picture.js +53 -13
  62. package/dist/footage/picture.js.map +1 -1
  63. package/dist/footage/pipeline.d.ts.map +1 -1
  64. package/dist/footage/pipeline.js +14 -4
  65. package/dist/footage/pipeline.js.map +1 -1
  66. package/dist/footage/split-screen.d.ts +167 -0
  67. package/dist/footage/split-screen.d.ts.map +1 -0
  68. package/dist/footage/split-screen.js +233 -0
  69. package/dist/footage/split-screen.js.map +1 -0
  70. package/dist/footage/tools.d.ts +1 -1
  71. package/dist/footage/tools.d.ts.map +1 -1
  72. package/dist/footage/tools.js +1 -1
  73. package/dist/footage/tools.js.map +1 -1
  74. package/dist/index.d.ts +8 -5
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +8 -5
  77. package/dist/index.js.map +1 -1
  78. package/fonts/Caveat-SemiBold-Latin.ttf +0 -0
  79. package/fonts/LICENSE-Caveat.txt +93 -0
  80. package/fonts/README.md +14 -0
  81. package/package.json +1 -1
  82. package/schema/edl.schema.json +167 -11
  83. package/schema/marketing.schema.json +19 -4
  84. package/src/config/config.ts +1 -0
  85. package/src/config/schema.ts +9 -3
  86. package/src/footage/captions.ts +32 -4
  87. package/src/footage/compose.ts +44 -11
  88. package/src/footage/draft-overlays.ts +217 -2
  89. package/src/footage/draft.ts +137 -17
  90. package/src/footage/drawn-transitions.ts +214 -0
  91. package/src/footage/edl.ts +67 -2
  92. package/src/footage/film.ts +23 -4
  93. package/src/footage/hand-font.ts +47 -0
  94. package/src/footage/overlay-html.ts +141 -7
  95. package/src/footage/overlay-motion.ts +49 -0
  96. package/src/footage/overlay-schema.ts +78 -19
  97. package/src/footage/overlays.ts +311 -10
  98. package/src/footage/picture.ts +58 -15
  99. package/src/footage/pipeline.ts +14 -4
  100. package/src/footage/split-screen.ts +319 -0
  101. package/src/footage/tools.ts +1 -1
  102. package/src/index.ts +62 -0
@@ -17,9 +17,10 @@ export declare const CLIP_FITS: readonly ["auto", "crop", "blur"];
17
17
  export type ClipFit = (typeof CLIP_FITS)[number];
18
18
  /**
19
19
  * How a segment of the cut starts: `cut` (hard), `fade` (a short cross-fade from the previous segment), `zoom` (a
20
- * punch-in that hides a jump cut inside one talking clip) or `whoosh` (a hard cut with the whoosh sound).
20
+ * punch-in that hides a jump cut inside one talking clip), `whoosh` (a hard cut with the whoosh sound), the drawn
21
+ * transitions `whip`, `card` and `paper` (`drawn-transitions.ts`) or `stutter` (five frames wide, then tight).
21
22
  */
22
- export declare const CUT_TRANSITIONS: readonly ["cut", "fade", "zoom", "whoosh"];
23
+ export declare const CUT_TRANSITIONS: readonly ["cut", "fade", "zoom", "whoosh", "whip", "card", "paper", "stutter"];
23
24
  export type CutTransition = (typeof CUT_TRANSITIONS)[number];
24
25
  export interface FootageClip {
25
26
  /** Unique within the film; the EDL refers to the clip by it. */
@@ -80,7 +81,7 @@ export interface CutOptions {
80
81
  maxSeconds: number | null;
81
82
  }
82
83
  /** A jump cut's default: a transition, or `auto` to choose `zoom` or `fade` from the frames around each cut. */
83
- export declare const JUMP_TRANSITIONS: readonly ["cut", "fade", "zoom", "whoosh", "auto"];
84
+ export declare const JUMP_TRANSITIONS: readonly ["cut", "fade", "zoom", "whoosh", "whip", "card", "paper", "stutter", "auto"];
84
85
  export type JumpTransition = (typeof JUMP_TRANSITIONS)[number];
85
86
  /** Default transitions by kind of cut; a segment of the EDL may name its own. */
86
87
  export interface FootageTransitions {
@@ -115,8 +116,14 @@ export interface FootageFilm {
115
116
  music: FootageMusic;
116
117
  /** Captions from the transcript. */
117
118
  captions: boolean;
118
- /** `phrase` (the default): 2-6 words of plain text with a soft shadow; `highlight`: a pill that lights each word as it is said. */
119
+ /**
120
+ * `phrase` (the default): 2-6 words of plain text with a soft shadow; `highlight`: a pill that lights each word as it
121
+ * is said; `ribbon`: bold capitals, each line on its own flat strip of `captionBackground`, the block turned by
122
+ * `captionRibbonTilt`.
123
+ */
119
124
  captionStyle?: CaptionStyle;
125
+ /** A `ribbon` caption's turn in degrees, counter-clockwise positive (-10 to 10); absent: `CAPTION_RIBBON_TILT`. */
126
+ captionRibbonTilt?: number;
120
127
  /**
121
128
  * How a `highlight` caption lights the word being said: `text` (the default) colours its text `captionHighlight`;
122
129
  * `box` puts it on a rounded box of `captionHighlightBox` with its text in `captionHighlightText` (both brand colours
@@ -248,8 +255,25 @@ export declare function getDefaultFillers(language: string): string[];
248
255
  export declare const DEFAULT_CUT: Omit<CutOptions, "fillers">;
249
256
  /** Hard cuts everywhere: an ordinary phone video, not a promo. */
250
257
  export declare const DEFAULT_TRANSITIONS: FootageTransitions;
251
- export declare const CAPTION_STYLES: readonly ["phrase", "highlight"];
258
+ export declare const CAPTION_STYLES: readonly ["phrase", "highlight", "ribbon"];
252
259
  export type CaptionStyle = (typeof CAPTION_STYLES)[number];
260
+ /** A `ribbon` caption's turn in degrees, counter-clockwise positive as ASS turns, unless the film names its own. */
261
+ export declare const CAPTION_RIBBON_TILT = 4;
262
+ /** The most a `ribbon` caption may turn either way, in degrees. */
263
+ export declare const CAPTION_RIBBON_MAX_TILT = 10;
264
+ /**
265
+ * A `ribbon` caption's geometry, shared by the render and the draft: its lines' height in font sizes, each line's strip
266
+ * padding in font sizes, the strip's corner in px of a 1080 px frame, and the letters' weight.
267
+ */
268
+ export declare const CAPTION_RIBBON: {
269
+ readonly lineHeight: 1.42;
270
+ readonly padding: {
271
+ readonly y: 0.1;
272
+ readonly x: 0.32;
273
+ };
274
+ readonly radius: 6;
275
+ readonly weight: 800;
276
+ };
253
277
  /** How a `highlight` caption lights the word being said: its text colour, a box behind it (issue #1199), or an accent underline. */
254
278
  export declare const CAPTION_HIGHLIGHT_STYLES: readonly ["text", "box", "underline"];
255
279
  export type CaptionHighlightStyle = (typeof CAPTION_HIGHLIGHT_STYLES)[number];
@@ -1 +1 @@
1
- {"version":3,"file":"film.d.ts","sourceRoot":"","sources":["../../src/footage/film.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvE;;;GAGG;AAEH,2HAA2H;AAC3H,eAAO,MAAM,UAAU,YAAI,MAAM,EAAE,OAAO,CAAU,CAAC;AAErD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,SAAS,YAAI,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAE3D,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,eAAe,YAAI,KAAK,EAAE,MAAM,EAAE,MA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O,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,eAAe,YAAI,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,+GAA+G;IAC/G,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,eAAe,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,YAAY,EAAE,WAAiK,CAAC;AAE7L,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,WAAW,CAE3E;AAED,eAAO,MAAM,oBAAoB;aAAK,MAAM,EAAE,IAAI;aAAE,YAAY,EAAE,GAAG;CAAW,CAAC"}
@@ -11,9 +11,10 @@ export const CLIP_ROLES = ["talk", "broll"];
11
11
  export const CLIP_FITS = ["auto", "crop", "blur"];
12
12
  /**
13
13
  * How a segment of the cut starts: `cut` (hard), `fade` (a short cross-fade from the previous segment), `zoom` (a
14
- * punch-in that hides a jump cut inside one talking clip) or `whoosh` (a hard cut with the whoosh sound).
14
+ * punch-in that hides a jump cut inside one talking clip), `whoosh` (a hard cut with the whoosh sound), the drawn
15
+ * transitions `whip`, `card` and `paper` (`drawn-transitions.ts`) or `stutter` (five frames wide, then tight).
15
16
  */
16
- export const CUT_TRANSITIONS = ["cut", "fade", "zoom", "whoosh"];
17
+ export const CUT_TRANSITIONS = ["cut", "fade", "zoom", "whoosh", "whip", "card", "paper", "stutter"];
17
18
  /** A jump cut's default: a transition, or `auto` to choose `zoom` or `fade` from the frames around each cut. */
18
19
  export const JUMP_TRANSITIONS = [...CUT_TRANSITIONS, "auto"];
19
20
  /** The frame difference (0-1) from which an `auto` jump cut fades instead of zooming. */
@@ -65,7 +66,16 @@ export function getDefaultFillers(language) {
65
66
  export const DEFAULT_CUT = { pauseSeconds: 0.6, padSeconds: 0.12, maxSeconds: null };
66
67
  /** Hard cuts everywhere: an ordinary phone video, not a promo. */
67
68
  export const DEFAULT_TRANSITIONS = { jump: "cut", clip: "cut" };
68
- export const CAPTION_STYLES = ["phrase", "highlight"];
69
+ export const CAPTION_STYLES = ["phrase", "highlight", "ribbon"];
70
+ /** A `ribbon` caption's turn in degrees, counter-clockwise positive as ASS turns, unless the film names its own. */
71
+ export const CAPTION_RIBBON_TILT = 4;
72
+ /** The most a `ribbon` caption may turn either way, in degrees. */
73
+ export const CAPTION_RIBBON_MAX_TILT = 10;
74
+ /**
75
+ * A `ribbon` caption's geometry, shared by the render and the draft: its lines' height in font sizes, each line's strip
76
+ * padding in font sizes, the strip's corner in px of a 1080 px frame, and the letters' weight.
77
+ */
78
+ export const CAPTION_RIBBON = { lineHeight: 1.42, padding: { y: 0.1, x: 0.32 }, radius: 6, weight: 800 };
69
79
  /** How a `highlight` caption lights the word being said: its text colour, a box behind it (issue #1199), or an accent underline. */
70
80
  export const CAPTION_HIGHLIGHT_STYLES = ["text", "box", "underline"];
71
81
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"film.js","sourceRoot":"","sources":["../../src/footage/film.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH,2HAA2H;AAC3H,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAIrD;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAI3D;;;GAGG;AACH,MAAM,CAAC,MA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,oIAAoI;AACpI,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,CAAU,CAAC;AAI9E;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC;AAIlE,wGAAwG;AACxG,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AA2B7E,MAAM,CAAC,MAAM,YAAY,GAAgB,EAAE,WAAW,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC;AAE7L,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAAC,IAA+B;IAC5D,OAAO,EAAE,GAAG,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAW,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The kit's handwriting: Caveat (SIL Open Font License 1.1, `fonts/LICENSE-Caveat.txt`), a static SemiBold instance
3
+ * subset to Latin with every Polish letter. A note card and an end word are written in it in both paths: the draft
4
+ * copies the file into its fonts folder (libass finds it by `family`), the render copies it to `asset` with its
5
+ * `@font-face`.
6
+ */
7
+ export declare const HAND_FONT: {
8
+ readonly family: "Caveat";
9
+ readonly file: string;
10
+ readonly asset: "assets/fonts/hand.ttf";
11
+ };
12
+ /** How wide `text` is written in the hand font at `fontSize` px in the render. */
13
+ export declare function measureHandText(text: string, fontSize: number): number;
14
+ /** The draft's `\fs` for the hand font at the render's `fontSize`: libass sizes a font by its ascent and descent, so the letters match the render's. */
15
+ export declare function getHandFontAssSize(fontSize: number): number;
16
+ //# sourceMappingURL=hand-font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hand-font.d.ts","sourceRoot":"","sources":["../../src/footage/hand-font.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,eAAO,MAAM,SAAS;aACpB,MAAM,EAAE,QAAQ;aAChB,IAAI;aACJ,KAAK,EAAE,uBAAuB;CACtB,CAAC;AAsBX,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wJAAwJ;AACxJ,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -0,0 +1,43 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { fileURLToPath } from "node:url";
3
+ import { readFontTables, readUint16 } from "../og/font-tables.js";
4
+ import { createDraftTextMeasure } from "./draft-text-width.js";
5
+ /**
6
+ * The kit's handwriting: Caveat (SIL Open Font License 1.1, `fonts/LICENSE-Caveat.txt`), a static SemiBold instance
7
+ * subset to Latin with every Polish letter. A note card and an end word are written in it in both paths: the draft
8
+ * copies the file into its fonts folder (libass finds it by `family`), the render copies it to `asset` with its
9
+ * `@font-face`.
10
+ */
11
+ export const HAND_FONT = {
12
+ family: "Caveat",
13
+ file: fileURLToPath(new URL("../../fonts/Caveat-SemiBold-Latin.ttf", import.meta.url)),
14
+ asset: "assets/fonts/hand.ttf",
15
+ };
16
+ /** Room left round a measured handwritten line: kerning and Caveat's contextual letters are not read. */
17
+ const HAND_WIDTH_SLACK = 1.04;
18
+ let handMetrics;
19
+ /** The hand font's measure in CSS pixels and its libass-size-to-em ratio, read once from the kit's own file. */
20
+ function getHandMetrics() {
21
+ if (handMetrics !== undefined)
22
+ return handMetrics;
23
+ const font = readFileSync(HAND_FONT.file);
24
+ const tables = readFontTables(font);
25
+ const libass = createDraftTextMeasure(font);
26
+ const head = tables.ok ? tables.value.get("head") : undefined;
27
+ const os2 = tables.ok ? tables.value.get("OS/2") : undefined;
28
+ if (libass === null || head === undefined || os2 === undefined)
29
+ throw new Error(`the kit's hand font ${HAND_FONT.file} cannot be read`);
30
+ // `createDraftTextMeasure` measures as libass sizes a font (by usWinAscent + usWinDescent); a browser sizes it by the em.
31
+ const toEm = (readUint16(os2, 74) + readUint16(os2, 76)) / readUint16(head, 18);
32
+ handMetrics = { measure: (text, fontSize) => Math.ceil(libass(text, fontSize * toEm) * HAND_WIDTH_SLACK), toEm };
33
+ return handMetrics;
34
+ }
35
+ /** How wide `text` is written in the hand font at `fontSize` px in the render. */
36
+ export function measureHandText(text, fontSize) {
37
+ return getHandMetrics().measure(text, fontSize);
38
+ }
39
+ /** The draft's `\fs` for the hand font at the render's `fontSize`: libass sizes a font by its ascent and descent, so the letters match the render's. */
40
+ export function getHandFontAssSize(fontSize) {
41
+ return Math.round(fontSize * getHandMetrics().toEm);
42
+ }
43
+ //# sourceMappingURL=hand-font.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hand-font.js","sourceRoot":"","sources":["../../src/footage/hand-font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAyB,MAAM,uBAAuB,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,aAAa,CAAC,IAAI,GAAG,CAAC,uCAAuC,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACtF,KAAK,EAAE,uBAAuB;CACtB,CAAC;AAEX,yGAAyG;AACzG,MAAM,gBAA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AAO,cAAc,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,wJAAwJ;AACxJ,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC"}
@@ -55,5 +55,6 @@ export declare function getOverlayMarkup(overlays: readonly ResolvedOverlay[], i
55
55
  height: number;
56
56
  };
57
57
  style?: BrandStyle;
58
+ handFontSrc?: string;
58
59
  }): OverlayMarkup;
59
60
  //# sourceMappingURL=overlay-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay-html.d.ts","sourceRoot":"","sources":["../../src/footage/overlay-html.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAA4D,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAc7G,OAAO,EAcL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAoBvB,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAMxC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,mHAAmH;AACnH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC;AAEtF,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,aAAa,CAG9F;AAED,oHAAoH;AACpH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,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B,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,eAAe,CAAC,GAAG;IAC7J,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAGA;AAED,kHAAkH;AAClH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMlE;AA6FD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,KAAK,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjL,aAAa,CAgBf"}
@@ -1,7 +1,8 @@
1
1
  import { escapeHtml } from "../compose/html.js";
2
2
  import { getCornerRadiusCss, getStyleBorderCss, getStyleShadowCss } from "./brand-style.js";
3
- import { PIN_DROP_SECONDS, PIN_DROP_SHARE, PIN_TITLE_LEAD, UNDERLINE_EM, UNDERLINE_SECONDS, getEntranceMotion, getExitMotion, getWipeHalves, } from "./overlay-motion.js";
4
- import { OVERLAY_LINE_HEIGHT, OVERLAY_LIST_LINE_HEIGHT, OVERLAY_PADDING_EM, OVERLAY_TITLE_LINE_HEIGHT, SEARCH_BAR_PADDING_EM, formatOverlayNumber, getOverlayPadding, getPlaceCardPinRow, getPlaceCardPinSize, getListCardsByItem, getListItemTimes, getTitleContentBox, } from "./overlays.js";
3
+ import { HAND_FONT } from "./hand-font.js";
4
+ import { DROP_FROM_EM, DROP_LETTER_GAP, DROP_LETTER_SECONDS, NOTE_GROW_FROM_SCALE, NOTE_GROW_SECONDS, NOTE_TICK_SECONDS, getDropLetterTurns, PIN_DROP_SECONDS, PIN_DROP_SHARE, PIN_TITLE_LEAD, UNDERLINE_EM, UNDERLINE_SECONDS, getEntranceMotion, getExitMotion, getWipeHalves, } from "./overlay-motion.js";
5
+ import { NOTE_LINE_HEIGHT, OVERLAY_LINE_HEIGHT, OVERLAY_LIST_LINE_HEIGHT, OVERLAY_PADDING_EM, OVERLAY_TITLE_LINE_HEIGHT, SEARCH_BAR_PADDING_EM, formatOverlayNumber, getOverlayPadding, getPlaceCardPinRow, getPlaceCardPinSize, getListCardsByItem, getListItemTimes, getNoteColors, getNotePaperPoints, getNoteTextBox, getNoteTickPoints, getNoteWordsByLine, getTitleContentBox, isHandFontNeeded, } from "./overlays.js";
5
6
  /**
6
7
  * The render's overlays (issue #1200): HTML, CSS and GSAP tweens for the HyperFrames composition, every look in the
7
8
  * brand's colours and fonts (or the overlay's own colours) and every element a local clip (no network at render time).
@@ -89,6 +90,22 @@ function getOverlayCss(colors, fonts, style, scale = 1) {
89
90
  `.pd .ov-pinrow svg,.pl .ov-line,.sd .ov-sub{opacity:0}`,
90
91
  // An underlined keyword keeps only its drawn bar: the card's own accent edge would be a second line under it.
91
92
  `.ov-keyword.ul .ov-card{border-bottom-color:transparent}`,
93
+ // Dropped letters: each its own box, hidden until it starts falling.
94
+ `.dl{display:inline-block;opacity:0}`,
95
+ // A highlight backdrop: no card, each line on its own tight box that grows with the typed letters.
96
+ `.ov-mark{padding:.04em .22em;border-radius:.14em;-webkit-box-decoration-break:clone;box-decoration-break:clone}`,
97
+ `.ty .hl .ch{display:none}`,
98
+ // A typed line's mark waits for its first letter: an empty mark would show as a bare block of padding.
99
+ `.ty .hl .ov-mark{display:none}`,
100
+ // A note: its paper (an SVG outline with a torn edge and a soft shadow), its lines placed in px, its words hidden until said.
101
+ `.ov-note .nb{position:absolute;inset:0;transform-origin:50% 50%}`,
102
+ `.ov-note .paper{position:absolute;inset:0;overflow:visible;filter:drop-shadow(0 6px 14px rgba(0,0,0,.28))}`,
103
+ `.ov-note .nt{position:absolute;white-space:nowrap;line-height:${NOTE_LINE_HEIGHT}}`,
104
+ `.ov-note .nw{opacity:0}`,
105
+ `.ov-note .tick{position:absolute;inset:0;overflow:visible}`,
106
+ `.ov-strip .nt{font-family:${fonts.heading};font-weight:800;letter-spacing:.02em}`,
107
+ `.ov-hand{font-family:"${HAND_FONT.family}",cursive;font-weight:400}`,
108
+ `.ov-endword{white-space:nowrap;line-height:${OVERLAY_LINE_HEIGHT};text-shadow:0 3px 10px rgba(0,0,0,.45)}`,
92
109
  // The brand's style (after the kinds' own rules, so it wins over them; the search bar stays a pill).
93
110
  ...(style === undefined
94
111
  ? []
@@ -97,6 +114,27 @@ function getOverlayCss(colors, fonts, style, scale = 1) {
97
114
  `.ov-search{border-radius:999px}`,
98
115
  ...(style.border === "none" ? [] : [`.ov-keyword .ov-card{border-bottom:.12em solid ${colors.accent}}`]),
99
116
  ]),
117
+ // After the brand's style, so a highlight backdrop never draws the card under its marks.
118
+ `.ov .ov-card.hl{background:transparent;box-shadow:none;border:none}`,
119
+ ];
120
+ }
121
+ /** The hand font's face, when a note card or an end word is drawn: the kit's file, copied to `src` by the render. */
122
+ function getHandFontCss(overlays, src) {
123
+ return isHandFontNeeded(overlays) ? [`@font-face{font-family:"${HAND_FONT.family}";src:url("${src}") format("truetype");font-weight:400;font-style:normal}`] : [];
124
+ }
125
+ /** A text whose letters drop in: each letter its own box (spaces stay text, so the line breaks and spaces as before). */
126
+ function toDropHtml(text) {
127
+ return [...text].map((char) => (char.trim() === "" ? " " : `<span class="dl">${escapeHtml(char)}</span>`)).join("");
128
+ }
129
+ /**
130
+ * The tweens of dropped letters under `target`: each falls from `DROP_FROM_EM` above with its turn and lands eased out
131
+ * (`power2.out`, never past its place), `DROP_LETTER_GAP` after the one before, fading in over its first half.
132
+ */
133
+ function getDropTweens(target, text, start, fontSize) {
134
+ const turns = getDropLetterTurns([...text].filter((char) => char.trim() !== "").join(""));
135
+ return [
136
+ `tl.fromTo("${target} .dl", { y: ${r3(-DROP_FROM_EM * fontSize)}, rotation: (i) => ${JSON.stringify(turns)}[i] }, { y: 0, rotation: 0, duration: ${DROP_LETTER_SECONDS}, ease: "power2.out", stagger: ${DROP_LETTER_GAP}, immediateRender: false }, ${r3(start)});`,
137
+ `tl.fromTo("${target} .dl", { opacity: 0 }, { opacity: 1, duration: ${r3(DROP_LETTER_SECONDS / 2)}, ease: "none", stagger: ${DROP_LETTER_GAP}, immediateRender: false }, ${r3(start)});`,
100
138
  ];
101
139
  }
102
140
  /** The SVG path of an arrow from `from` to `to`: a gentle curve bowed to one side, and its head's two strokes. */
@@ -134,7 +172,8 @@ function getCardStyle(overlay, colors, scale = 1) {
134
172
  if (overlay.kind === "punch_in")
135
173
  return "";
136
174
  const own = overlay.colors;
137
- const parts = [own.card === undefined ? "" : `background:${colors.background}`, own.text === undefined ? "" : `color:${colors.foreground}`];
175
+ const isMarked = (overlay.kind === "hook_title" || overlay.kind === "keyword") && overlay.backdrop === "highlight";
176
+ const parts = [own.card === undefined || isMarked ? "" : `background:${colors.background}`, own.text === undefined ? "" : `color:${colors.foreground}`];
138
177
  if (overlay.cornerRadius !== undefined && overlay.cornerRadius !== null)
139
178
  parts.push(`border-radius:${getCornerRadiusCss(overlay.cornerRadius, scale)}`);
140
179
  if (overlay.kind === "hook_title" || overlay.kind === "place_card") {
@@ -207,6 +246,19 @@ function getTypingTweens(id, overlay, length) {
207
246
  return [];
208
247
  return [`tl.to("#${id} .ch", { opacity: 1, display: "inline", duration: 0.01, ease: "none", stagger: ${r3(1 / overlay.typing)} }, ${r3(overlay.start + OVERLAY_TYPING_DELAY)});`];
209
248
  }
249
+ /** Shows each typed line's highlight mark (`#<id>m<line>`, a keyword's `#<id>t`) with the line's first letter. */
250
+ function getMarkRevealTweens(ids, overlay, lines) {
251
+ const { typing } = overlay;
252
+ if (typing === null)
253
+ return [];
254
+ let offset = 0;
255
+ return lines.flatMap((line, index) => {
256
+ const at = overlay.start + OVERLAY_TYPING_DELAY + offset / typing;
257
+ offset += [...line].length;
258
+ const target = ids[index];
259
+ return line === "" || target === undefined ? [] : [`tl.set("#${target}", { display: "inline" }, ${r3(at)});`];
260
+ });
261
+ }
210
262
  /** Each new kind's own entrance when the overlay names none. */
211
263
  const DEFAULT_ENTRANCES = { hook_title: "slide", search_bar: "fade", place_card: "slide", counter: "fade", date_stamp: "fade" };
212
264
  /** A keyword or a lower third, entering as the soft pill (or by its own entrance). */
@@ -218,14 +270,21 @@ function addSideText(overlay, id, context, out) {
218
270
  const dotStyle = overlay.colors.accent === undefined ? "" : ` style="background:${colors.accent}"`;
219
271
  const isTyped = overlay.typing !== null;
220
272
  const style = `left:${box.left}px;top:${box.top}px;width:${box.width}px;height:${box.height}px;font-size:${fontSize}px;align-items:${overlay.kind === "lower_third" ? "flex-end" : "flex-start"}`;
221
- const text = isTyped ? toTypedHtml(overlay.text) : escapeHtml(overlay.text);
273
+ const isDrop = overlay.kind === "keyword" && overlay.entrance === "drop";
274
+ const text = isTyped ? toTypedHtml(overlay.text) : isDrop ? toDropHtml(overlay.text) : escapeHtml(overlay.text);
275
+ const isMarked = overlay.kind === "keyword" && overlay.backdrop === "highlight";
222
276
  const wipe = overlay.entrance === "wipe" ? `<i class="ov-wipe" id="${id}w"></i>` : "";
223
277
  const underline = overlay.kind === "keyword" && overlay.underline === true ? `<i class="ov-ul" id="${id}u" style="${getUnderlineStyle(overlay)}"></i>` : "";
224
- const body = `<div class="ov-card"${cardStyle}>${wipe}${overlay.kind === "lower_third" ? `<i class="ov-dot" id="${id}d"${dotStyle}></i>` : ""}<span id="${id}t">${text}</span>${underline}</div>`;
278
+ const mark = isMarked ? ` class="ov-mark" style="background:${colors.background}"` : "";
279
+ const body = `<div class="ov-card${isMarked ? " hl" : ""}"${cardStyle}>${wipe}${overlay.kind === "lower_third" ? `<i class="ov-dot" id="${id}d"${dotStyle}></i>` : ""}<span id="${id}t"${mark}>${text}</span>${underline}</div>`;
225
280
  out.html.push(clipDiv(overlay, id, `ov ov-${overlay.kind.replace("_", "-")}${isCentred ? " center" : side === "right" ? " right" : ""}${isTyped ? " ty" : ""}${underline === "" ? "" : " ul"}`, style, body));
226
281
  if (overlay.entrance !== null) {
227
282
  out.tweens.push(...getMotionTweens(`#${id} .ov-card`, getEntranceMotion(overlay.entrance, overlay.easing ?? "smooth", context.frame), overlay.start));
228
283
  out.tweens.push(...getTypingTweens(id, overlay, [...overlay.text].length));
284
+ if (isMarked)
285
+ out.tweens.push(...getMarkRevealTweens([`${id}t`], overlay, [[...overlay.text].join("")]));
286
+ if (isDrop)
287
+ out.tweens.push(...getDropTweens(`#${id}`, overlay.text, overlay.start, overlay.fontSize));
229
288
  }
230
289
  else {
231
290
  // The soft pill's entrance: the card rises from its foot, then its dot and its text settle in, eased out without
@@ -312,8 +371,14 @@ function getCardBody(overlay, id, colors, locale) {
312
371
  const typedOrPlain = (text) => (overlay.typing === null ? escapeHtml(text) : toTypedHtml(text));
313
372
  if (overlay.kind === "hook_title") {
314
373
  const place = overlay.place === null ? "" : `<div class="ov-place" style="font-size:${overlay.placeFontSize}px">${getPinSvg(colors.accent)}<span>${escapeHtml(overlay.place)}</span></div>`;
315
- const lines = overlay.lines.map((line) => `<div class="ov-line">${typedOrPlain(line)}</div>`).join("");
316
- return { classes: "ov-hook-title center", body: `<div class="ov-card ov-stack${overlay.align === "left" ? " left" : ""}"__STYLE__>__WIPE__${place}${lines}</div>`, typed: overlay.lines.join("").length };
374
+ const isMarked = overlay.backdrop === "highlight";
375
+ const draw = (line) => (overlay.entrance === "drop" ? toDropHtml(line) : typedOrPlain(line));
376
+ const lines = overlay.lines.map((line, index) => `<div class="ov-line">${isMarked ? `<span class="ov-mark" id="${id}m${String(index)}" style="background:${colors.background}">${draw(line)}</span>` : draw(line)}</div>`).join("");
377
+ return {
378
+ classes: "ov-hook-title center",
379
+ body: `<div class="ov-card ov-stack${overlay.align === "left" ? " left" : ""}${isMarked ? " hl" : ""}"__STYLE__>__WIPE__${place}${lines}</div>`,
380
+ typed: overlay.lines.join("").length,
381
+ };
317
382
  }
318
383
  if (overlay.kind === "place_card") {
319
384
  const subtitle = overlay.subtitle === null ? "" : `<div class="ov-sub" style="font-size:${overlay.subtitleFontSize}px">${escapeHtml(overlay.subtitle)}</div>`;
@@ -344,6 +409,10 @@ function addCard(overlay, id, context, out) {
344
409
  const entrance = overlay.entrance ?? (overlay.typing !== null ? "type" : DEFAULT_ENTRANCES[overlay.kind]);
345
410
  out.tweens.push(...getEntranceTweens(`#${id} .ov-card`, entrance, overlay.start, { ...(overlay.easing === undefined ? {} : { easing: overlay.easing }), frame: context.frame }));
346
411
  out.tweens.push(...getTypingTweens(id, overlay, typed));
412
+ if (overlay.kind === "hook_title" && overlay.backdrop === "highlight")
413
+ out.tweens.push(...getMarkRevealTweens(overlay.lines.map((_, index) => `${id}m${String(index)}`), overlay, overlay.lines));
414
+ if (overlay.kind === "hook_title" && overlay.entrance === "drop")
415
+ out.tweens.push(...getDropTweens(`#${id}`, overlay.lines.join(""), overlay.start, overlay.fontSize));
347
416
  if (overlay.kind === "place_card")
348
417
  out.tweens.push(...getPlaceCardPartTweens(overlay, id, context));
349
418
  if (overlay.kind === "counter") {
@@ -391,6 +460,58 @@ export function getScriptLocale(locale) {
391
460
  function toScriptString(value) {
392
461
  return JSON.stringify(value).replace(/</g, "\\u003c");
393
462
  }
463
+ /**
464
+ * A note: its paper (the torn outline of `getNotePaperPoints`) turned by its tilt about its middle; a card's words
465
+ * handwritten and shown each on its said second, the card there (empty) just before; a strip growing in from
466
+ * `NOTE_GROW_FROM_SCALE` (eased out, never past its size) and typing its capitals; the tick drawn after the last word.
467
+ */
468
+ function addNote(overlay, id, context, out) {
469
+ const { box, fontSize } = overlay;
470
+ const colors = getNoteColors(overlay);
471
+ const isStrip = overlay.noteStyle === "strip";
472
+ const local = (point) => `${r3(point.x - box.left)},${r3(point.y - box.top)}`;
473
+ const paper = `<svg class="paper" viewBox="0 0 ${box.width} ${box.height}"><polygon points="${getNotePaperPoints(overlay).map(local).join(" ")}" fill="${colors.paper}"/></svg>`;
474
+ const text = getNoteTextBox(overlay);
475
+ const lineHeight = fontSize * NOTE_LINE_HEIGHT;
476
+ const place = (index) => `left:${r3(text.left - box.left)}px;top:${r3(text.top - box.top + index * lineHeight)}px`;
477
+ let word = 0;
478
+ const lines = isStrip
479
+ ? overlay.lines.map((line, index) => `<div class="nt" style="${place(index)}">${toTypedHtml(line)}</div>`)
480
+ : getNoteWordsByLine(overlay).map((words, index) => `<div class="nt" style="${place(index)}">${words.map((entry) => `<span class="nw" id="${id}w${word++}">${escapeHtml(entry.text)}</span>`).join(" ")}</div>`);
481
+ const tick = overlay.tickAt === null ? "" : `<svg class="tick" viewBox="0 0 ${box.width} ${box.height}"><polyline id="${id}k" points="${getNoteTickPoints(overlay).map(local).join(" ")}" fill="none" stroke="${colors.tick}" stroke-width="${r3(fontSize * 0.12)}" stroke-linecap="round" stroke-linejoin="round" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"/></svg>`;
482
+ const style = `left:${box.left}px;top:${box.top}px;width:${box.width}px;height:${box.height}px;font-size:${fontSize}px;color:${colors.ink};transform:rotate(${r3(-overlay.tilt)}deg)`;
483
+ out.html.push(clipDiv(overlay, id, `ov ov-note ${isStrip ? "ov-strip ty" : "ov-hand"}`, style, `<div class="nb">${paper}${lines.join("")}${tick}</div>`));
484
+ const look = { ...(overlay.easing === undefined ? {} : { easing: overlay.easing }), frame: context.frame };
485
+ if (isStrip && overlay.entrance === null) {
486
+ out.tweens.push(`tl.fromTo("#${id} .nb", { scale: ${NOTE_GROW_FROM_SCALE} }, { scale: 1, duration: ${NOTE_GROW_SECONDS}, ease: "power2.out", immediateRender: false }, ${overlay.start});`);
487
+ }
488
+ else
489
+ out.tweens.push(...getEntranceTweens(`#${id} .nb`, overlay.entrance ?? "none", overlay.start, look));
490
+ if (isStrip)
491
+ out.tweens.push(...getTypingTweens(id, overlay, overlay.lines.join("").length));
492
+ else {
493
+ getNoteWordsByLine(overlay)
494
+ .flat()
495
+ .forEach((entry, index) => out.tweens.push(`tl.fromTo("#${id}w${index}", { opacity: 0 }, { opacity: 1, duration: 0.1, ease: "none", immediateRender: false }, ${entry.at});`));
496
+ }
497
+ if (overlay.tickAt !== null) {
498
+ out.tweens.push(`tl.fromTo("#${id}k", { attr: { "stroke-dashoffset": 1 } }, { attr: { "stroke-dashoffset": 0 }, duration: ${NOTE_TICK_SECONDS}, ease: "power2.out", immediateRender: false }, ${overlay.tickAt});`);
499
+ }
500
+ out.tweens.push(...getExitTweens(`#${id} .nb`, overlay, context.frame, `tl.to("#${id} .nb", { opacity: 0, duration: ${EXIT_SECONDS}, ease: "power2.in" }, ${r3(overlay.end - EXIT_SECONDS)});`));
501
+ }
502
+ /** An end word: one big handwritten line, no card, its letters dropping in (or its own entrance), fading out at the end. */
503
+ function addEndWord(overlay, id, context, out) {
504
+ const { box, fontSize } = overlay;
505
+ const entrance = overlay.entrance ?? "drop";
506
+ const text = entrance === "drop" ? toDropHtml(overlay.text) : escapeHtml(overlay.text);
507
+ const style = `left:${box.left}px;top:${box.top}px;width:${box.width}px;height:${box.height}px;font-size:${fontSize}px;justify-content:center;align-items:flex-start`;
508
+ out.html.push(clipDiv(overlay, id, "ov ov-end-word", style, `<div class="ov-endword ov-hand nb" style="color:${overlay.colors.text ?? "#ffffff"}">${text}</div>`));
509
+ if (entrance === "drop")
510
+ out.tweens.push(...getDropTweens(`#${id}`, overlay.text, overlay.start, fontSize));
511
+ else
512
+ out.tweens.push(...getEntranceTweens(`#${id} .nb`, entrance, overlay.start, { ...(overlay.easing === undefined ? {} : { easing: overlay.easing }), frame: context.frame }));
513
+ out.tweens.push(...getExitTweens(`#${id} .nb`, overlay, context.frame, `tl.to("#${id} .nb", { opacity: 0, duration: ${EXIT_SECONDS}, ease: "power2.in" }, ${r3(overlay.end - EXIT_SECONDS)});`));
514
+ }
394
515
  /** An overlay's clip: shown for its own span. */
395
516
  function clipDiv(overlay, id, classes, style, body) {
396
517
  return `<div id="${id}" class="clip ${classes}" data-start="${overlay.start}" data-duration="${r3(overlay.end - overlay.start)}" style="${style}">${body}</div>`;
@@ -439,7 +560,8 @@ export function getOverlayMarkup(overlays, input) {
439
560
  if (drawn.length === 0)
440
561
  return { html: [], css: [], tweens: [] };
441
562
  const context = { colors: input.colors, scale: input.frame.width / 1080, locale: input.locale ?? "en-US", frame: input.frame };
442
- const out = { html: [], css: getOverlayCss(input.colors, { heading: input.headingFont, interface: input.interfaceFont ?? "inherit" }, input.style, context.scale), tweens: [] };
563
+ const css = [...getHandFontCss(drawn, input.handFontSrc ?? HAND_FONT.asset), ...getOverlayCss(input.colors, { heading: input.headingFont, interface: input.interfaceFont ?? "inherit" }, input.style, context.scale)];
564
+ const out = { html: [], css, tweens: [] };
443
565
  for (const overlay of drawn) {
444
566
  const id = `ov${overlay.index}`;
445
567
  if (overlay.kind === "list")
@@ -448,6 +570,10 @@ export function getOverlayMarkup(overlays, input) {
448
570
  addSideText(overlay, id, context, out);
449
571
  else if (overlay.kind === "arrow" || overlay.kind === "highlight")
450
572
  addMark(overlay, id, context, out);
573
+ else if (overlay.kind === "note")
574
+ addNote(overlay, id, context, out);
575
+ else if (overlay.kind === "end_word")
576
+ addEndWord(overlay, id, context, out);
451
577
  else
452
578
  addCard(overlay, id, context, out);
453
579
  }