Skip to content

Code-first video & image, rendered natively on WebGPU.

replace logo & rndr

okanaslf75f79351ce4
diff --git a/assets/brand/banner.png b/assets/brand/banner.png
index 09324e03..d13b77e5 100644
Binary files a/assets/brand/banner.png and b/assets/brand/banner.png differ
diff --git a/assets/brand/banner.svg b/assets/brand/banner.svg
index aab5a4f6..6839638e 100644
--- a/assets/brand/banner.svg
+++ b/assets/brand/banner.svg
@@ -15,9 +15,11 @@
<rect x="0.5" y="0.5" width="1279" height="399" rx="23.5" fill="none" stroke="#FFFFFF" stroke-opacity="0.14"/>
<g transform="translate(82 148)">
-
<path d="M 37.38 11.38 L 17.47 11.38 Q 11.38 11.38 11.38 17.47 L 11.38 37.38 M 66.63 11.38 L 86.53 11.38 Q 92.63 11.38 92.63 17.47 L 92.63 37.38 M 37.38 92.63 L 17.47 92.63 Q 11.38 92.63 11.38 86.53 L 11.38 66.63 M 66.63 92.63 L 86.53 92.63 Q 92.63 92.63 92.63 86.53 L 92.63 66.63" fill="none" stroke="#FFFFFF" stroke-width="6.91" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M 43.47 36.16 L 70.28 52.00 L 43.47 67.84 Z" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="8.13" stroke-linejoin="round"/>
+ <path d="M 35.75 36.97 L 35.75 67.03 M 35.75 36.97 C 35.75 52.00 47.94 52.00 56.06 52.00" fill="none" stroke="#FFFFFF" stroke-width="5.69" stroke-linecap="round"/>
+ <circle cx="35.75" cy="34.94" r="6.50" fill="#FFFFFF"/>
+ <circle cx="35.75" cy="69.06" r="6.50" fill="#FFFFFF"/>
+ <path d="M 57.69 40.63 L 73.53 52.00 L 57.69 63.38 Z" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="6.91" stroke-linejoin="round"/>
</g>
<path d="M218.82 242.4Q214.04 242.4 210.51 241.18Q206.98 239.95 204.7 237.91Q202.42 235.87 201.23 233.38L208.06 230.16Q208.8 231.34 210.05 232.66Q211.29 233.98 213.4 234.91Q215.52 235.83 218.82 235.83Q223.57 235.83 226.52 233.59Q229.47 231.34 229.47 226.56L229.47 218.47L228.77 218.47Q228.03 219.84 226.71 221.44Q225.39 223.03 223.03 224.2Q220.68 225.37 216.89 225.37Q211.99 225.37 208.08 223.07Q204.16 220.77 201.86 216.24Q199.56 211.71 199.56 205.11Q199.56 198.5 201.84 193.77Q204.13 189.04 208.08 186.52Q212.03 183.99 217 183.99Q220.83 183.99 223.22 185.25Q225.61 186.52 226.97 188.24Q228.32 189.97 229.03 191.27L229.62 191.27L229.62 184.51L237.6 184.51L237.6 226.59Q237.6 232.05 235.13 235.56Q232.66 239.06 228.42 240.73Q224.17 242.4 218.82 242.4ZM218.79 218.58Q222.27 218.58 224.67 216.96Q227.06 215.35 228.29 212.29Q229.51 209.23 229.51 205Q229.51 200.8 228.29 197.65Q227.06 194.49 224.67 192.71Q222.27 190.93 218.79 190.93Q215.19 190.93 212.77 192.81Q210.36 194.68 209.14 197.85Q207.91 201.03 207.91 205Q207.91 209.04 209.14 212.1Q210.36 215.16 212.79 216.87Q215.22 218.58 218.79 218.58ZM246.29 226L246.29 184.51L254.45 184.51L254.45 226ZM250.41 178.17Q248.29 178.17 246.79 176.76Q245.29 175.35 245.29 173.34Q245.29 171.3 246.79 169.89Q248.29 168.48 250.41 168.48Q252.52 168.48 254.04 169.89Q255.57 171.3 255.57 173.34Q255.57 175.35 254.04 176.76Q252.52 178.17 250.41 178.17ZM280.89 184.51L280.89 191.15L258.4 191.15L258.4 184.51ZM264.45 174.64L272.61 174.64L272.61 214.79Q272.61 217.28 273.67 218.45Q274.73 219.62 277.14 219.62Q277.77 219.62 278.81 219.47Q279.85 219.32 280.59 219.17L282.04 225.7Q280.74 226.15 279.26 226.35Q277.77 226.56 276.32 226.56Q270.68 226.56 267.57 223.64Q264.45 220.73 264.45 215.46Z" fill="#FFFFFF" fill-opacity="0.6"/>
<path d="M309.06 184.51L309.06 193.01L281.97 193.01L281.97 184.51ZM289.28 226L289.28 181.32Q289.28 176.9 291.05 173.97Q292.81 171.04 295.85 169.58Q298.89 168.11 302.75 168.11Q305.39 168.11 307.56 168.54Q309.73 168.96 310.73 169.26L308.73 177.65Q308.02 177.46 307.08 177.28Q306.13 177.09 305.02 177.09Q302.49 177.09 301.44 178.3Q300.38 179.5 300.38 181.69L300.38 226ZM313.95 226L313.95 184.51L324.71 184.51L324.71 191.75L325.16 191.75Q326.31 187.89 329 185.92Q331.69 183.96 335.18 183.96Q336.03 183.96 337.03 184.05Q338.04 184.14 338.78 184.33L338.78 194.27Q338.04 194.01 336.63 193.86Q335.22 193.71 333.95 193.71Q331.43 193.71 329.39 194.81Q327.35 195.9 326.22 197.85Q325.09 199.8 325.09 202.4L325.09 226ZM353.16 226.82Q349.23 226.82 346.1 225.42Q342.96 224.03 341.16 221.27Q339.36 218.5 339.36 214.38Q339.36 210.93 340.64 208.6Q341.92 206.26 344.13 204.85Q346.34 203.44 349.14 202.7Q351.94 201.95 355.02 201.66Q358.62 201.29 360.83 200.97Q363.04 200.65 364.06 199.97Q365.08 199.28 365.08 197.95L365.08 197.76Q365.08 195.98 364.33 194.75Q363.59 193.53 362.13 192.88Q360.66 192.23 358.58 192.23Q356.43 192.23 354.83 192.88Q353.24 193.53 352.24 194.61Q351.24 195.68 350.75 197.02L340.55 195.35Q341.62 191.71 344.11 189.19Q346.6 186.66 350.29 185.33Q353.98 183.99 358.62 183.99Q361.96 183.99 365.11 184.79Q368.27 185.59 370.77 187.26Q373.28 188.93 374.74 191.62Q376.21 194.31 376.21 198.06L376.21 226L365.67 226L365.67 220.25L365.3 220.25Q364.3 222.18 362.63 223.64Q360.96 225.11 358.6 225.96Q356.24 226.82 353.16 226.82ZM356.32 218.99Q358.95 218.99 360.94 217.95Q362.92 216.91 364.04 215.13Q365.15 213.35 365.15 211.16L365.15 206.67Q364.67 207.04 363.67 207.33Q362.66 207.63 361.44 207.85Q360.22 208.08 359.03 208.26Q357.84 208.45 356.91 208.56Q354.87 208.86 353.31 209.52Q351.75 210.19 350.9 211.29Q350.05 212.38 350.05 214.09Q350.05 215.68 350.86 216.78Q351.68 217.87 353.09 218.43Q354.5 218.99 356.32 218.99ZM383.43 226L383.43 184.51L393.74 184.51L394.3 194.83L393.48 194.83Q394.45 191.01 396.32 188.59Q398.19 186.18 400.72 185.03Q403.24 183.88 406.02 183.88Q410.52 183.88 413.26 186.72Q416.01 189.56 417.31 195.5L416.01 195.5Q416.93 191.53 419.03 188.95Q421.13 186.37 424 185.12Q426.88 183.88 430.03 183.88Q433.86 183.88 436.84 185.55Q439.83 187.22 441.56 190.36Q443.28 193.49 443.28 198.02L443.28 226L432.15 226L432.15 200.13Q432.15 196.61 430.24 194.9Q428.33 193.2 425.54 193.2Q423.47 193.2 421.93 194.1Q420.39 195.01 419.55 196.65Q418.72 198.28 418.72 200.47L418.72 226L407.95 226L407.95 199.84Q407.95 196.79 406.15 195Q404.35 193.2 401.5 193.2Q399.53 193.2 397.95 194.09Q396.38 194.98 395.47 196.7Q394.56 198.43 394.56 200.91L394.56 226ZM469.23 226.82Q462.88 226.82 458.28 224.22Q453.68 221.62 451.21 216.83Q448.74 212.05 448.74 205.48Q448.74 199.06 451.19 194.23Q453.64 189.41 458.13 186.7Q462.62 183.99 468.67 183.99Q472.75 183.99 476.28 185.29Q479.8 186.59 482.47 189.21Q485.14 191.82 486.65 195.76Q488.15 199.69 488.15 205.03L488.15 208.15L453.31 208.15L453.31 201.17L482.7 201.17L477.5 203.03Q477.5 199.8 476.52 197.41Q475.53 195.01 473.59 193.7Q471.64 192.38 468.78 192.38Q465.89 192.38 463.86 193.71Q461.84 195.05 460.8 197.33Q459.76 199.62 459.76 202.55L459.76 207.48Q459.76 211.08 460.97 213.53Q462.17 215.98 464.35 217.21Q466.52 218.43 469.41 218.43Q471.38 218.43 472.97 217.87Q474.57 217.32 475.7 216.22Q476.83 215.13 477.43 213.53L487.52 215.42Q486.52 218.84 484.03 221.42Q481.55 224 477.82 225.41Q474.09 226.82 469.23 226.82ZM509.95 226.82Q504.94 226.82 501.08 225.39Q497.22 223.96 494.77 221.23Q492.32 218.5 491.62 214.64L501.97 212.86Q502.79 215.76 504.83 217.21Q506.87 218.65 510.29 218.65Q513.48 218.65 515.31 217.45Q517.15 216.24 517.15 214.38Q517.15 212.75 515.83 211.71Q514.52 210.67 511.81 210.12L504.65 208.63Q498.63 207.41 495.66 204.46Q492.7 201.51 492.7 196.87Q492.7 192.86 494.89 189.99Q497.07 187.11 500.97 185.55Q504.87 183.99 510.14 183.99Q515.04 183.99 518.64 185.35Q522.24 186.7 524.46 189.19Q526.69 191.67 527.43 195.05L517.56 196.79Q516.93 194.68 515.13 193.33Q513.33 191.97 510.29 191.97Q507.54 191.97 505.68 193.12Q503.83 194.27 503.83 196.2Q503.83 197.76 505.03 198.84Q506.24 199.91 509.17 200.51L516.63 201.99Q522.64 203.21 525.57 205.98Q528.51 208.74 528.51 213.2Q528.51 217.28 526.13 220.34Q523.76 223.4 519.58 225.11Q515.41 226.82 509.95 226.82Z" fill="#FFFFFF"/>
diff --git a/assets/brand/generate.mjs b/assets/brand/generate.mjs
index 09cd16a5..f0e19c59 100644
--- a/assets/brand/generate.mjs
+++ b/assets/brand/generate.mjs
@@ -27,12 +27,6 @@ const AZURE = "#3B82F6";
const BLUE = "#1D4ED8";
const NAVY = "#0B1E4D";
const WHITE = "#FFFFFF";
-/** Mark gradient on light backgrounds: sky → azure → deep blue. */
-const BLUE_STOPS = [
- [0, "#38BDF8"],
- [0.5, AZURE],
- [1, BLUE],
-];
/** Lays out `text` as one SVG path (outlines), returning the path and its advance width. */
function textPath(
@@ -57,10 +51,12 @@ function textPath(
}
/**
- * The mark: viewfinder brackets (frame + vision reticle) around a play triangle.
- * `paint` is a solid color; omit it for the blue gradient.
+ * The mark: git and frames. Viewfinder brackets (the frame) around a git
+ * branch: two commits on a line, and a branch leaving the top commit whose
+ * head is a play triangle (the commit that plays).
+ * One solid paint: azure unless `paint` says otherwise.
*/
-function mark({ x, y, size, id, paint }) {
+function mark({ x, y, size, paint }) {
const s = size / 512;
const t = (v) => (v * s).toFixed(2);
const stroke = 34;
@@ -77,18 +73,21 @@ function mark({ x, y, size, id, paint }) {
corner(a, b, 1, -1),
corner(b, b, -1, -1),
].join(" ");
- // Play triangle, optically centered (nudged right); a round-joined stroke of the same
- // paint softens the corners evenly.
- const tri = `M ${t(214)} ${t(178)} L ${t(346)} ${t(256)} L ${t(214)} ${t(334)} Z`;
- const fill = paint ?? `url(#${id}-g)`;
- const defs = paint
- ? ""
- : `<defs><linearGradient id="${id}-g" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="${t(512)}" y2="${t(512)}">${BLUE_STOPS.map(([o, c]) => `<stop offset="${o}" stop-color="${c}"/>`).join("")}</linearGradient></defs>`;
+ const fill = paint ?? AZURE;
+ // The branch: a trunk between two commits, and a curve off the top commit
+ // into the play triangle (the branch head), whose round-joined stroke of
+ // the same paint softens its corners evenly.
+ const trunk = `M ${t(176)} ${t(182)} L ${t(176)} ${t(330)} M ${t(176)} ${t(182)} C ${t(176)} ${t(256)} ${t(236)} ${t(256)} ${t(276)} ${t(256)}`;
+ const commit = (cy) =>
+ `<circle cx="${t(176)}" cy="${t(cy)}" r="${t(32)}" fill="${fill}"/>`;
+ const tri = `M ${t(284)} ${t(200)} L ${t(362)} ${t(256)} L ${t(284)} ${t(312)} Z`;
return `
<g transform="translate(${x} ${y})">
- ${defs}
<path d="${brackets}" fill="none" stroke="${fill}" stroke-width="${t(stroke)}" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="${tri}" fill="${fill}" stroke="${fill}" stroke-width="${t(40)}" stroke-linejoin="round"/>
+ <path d="${trunk}" fill="none" stroke="${fill}" stroke-width="${t(28)}" stroke-linecap="round"/>
+ ${commit(172)}
+ ${commit(340)}
+ <path d="${tri}" fill="${fill}" stroke="${fill}" stroke-width="${t(34)}" stroke-linejoin="round"/>
</g>`;
}
@@ -111,7 +110,7 @@ function writeBoth(name, content, width) {
// ── Logo (mark only, transparent) ───────────────────────────────────────────
writeBoth(
"logo",
- svg(512, 512, mark({ x: 0, y: 0, size: 512, id: "logo" })),
+ svg(512, 512, mark({ x: 0, y: 0, size: 512 })),
512,
);
@@ -140,7 +139,7 @@ for (const [name, fg, gitFill, markPaint] of [
svg(
width,
150,
- `${mark({ x: 0, y: 4, size: 140, id: name, paint: markPaint })}
+ `${mark({ x: 0, y: 4, size: 140, paint: markPaint })}
<path d="${git.d}" fill="${gitFill}"/>
<path d="${frames.d}" fill="${fg}"/>`,
),
@@ -235,7 +234,7 @@ for (const [name, fg, gitFill, markPaint] of [
<rect width="${W}" height="${H}" rx="24" fill="url(#banner-bg)"/>
<rect width="${W}" height="${H}" rx="24" fill="url(#banner-glow)"/>
<rect x="0.5" y="0.5" width="${W - 1}" height="${H - 1}" rx="23.5" fill="none" stroke="${WHITE}" stroke-opacity="0.14"/>
- ${mark({ x: 82, y: 148, size: 104, id: "banner", paint: WHITE })}
+ ${mark({ x: 82, y: 148, size: 104, paint: WHITE })}
<path d="${git.d}" fill="${WHITE}" fill-opacity="0.6"/>
<path d="${frames.d}" fill="${WHITE}"/>
${timeline}
diff --git a/assets/brand/logo-wordmark-dark.png b/assets/brand/logo-wordmark-dark.png
index 02dfcd87..99bdb3c2 100644
Binary files a/assets/brand/logo-wordmark-dark.png and b/assets/brand/logo-wordmark-dark.png differ
diff --git a/assets/brand/logo-wordmark-dark.svg b/assets/brand/logo-wordmark-dark.svg
index 8554fcbe..5eea51b8 100644
--- a/assets/brand/logo-wordmark-dark.svg
+++ b/assets/brand/logo-wordmark-dark.svg
@@ -1,8 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="655" height="150" viewBox="0 0 655 150">
<g transform="translate(0 4)">
-
<path d="M 50.31 15.31 L 23.52 15.31 Q 15.31 15.31 15.31 23.52 L 15.31 50.31 M 89.69 15.31 L 116.48 15.31 Q 124.69 15.31 124.69 23.52 L 124.69 50.31 M 50.31 124.69 L 23.52 124.69 Q 15.31 124.69 15.31 116.48 L 15.31 89.69 M 89.69 124.69 L 116.48 124.69 Q 124.69 124.69 124.69 116.48 L 124.69 89.69" fill="none" stroke="#FFFFFF" stroke-width="9.30" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M 58.52 48.67 L 94.61 70.00 L 58.52 91.33 Z" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="10.94" stroke-linejoin="round"/>
+ <path d="M 48.13 49.77 L 48.13 90.23 M 48.13 49.77 C 48.13 70.00 64.53 70.00 75.47 70.00" fill="none" stroke="#FFFFFF" stroke-width="7.66" stroke-linecap="round"/>
+ <circle cx="48.13" cy="47.03" r="8.75" fill="#FFFFFF"/>
+ <circle cx="48.13" cy="92.97" r="8.75" fill="#FFFFFF"/>
+ <path d="M 77.66 54.69 L 98.98 70.00 L 77.66 85.31 Z" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="9.30" stroke-linejoin="round"/>
</g>
<path d="M189.63 136.17Q182.58 136.17 177.38 134.37Q172.19 132.56 168.82 129.55Q165.46 126.55 163.71 122.88L173.77 118.13Q174.87 119.88 176.7 121.82Q178.53 123.76 181.65 125.13Q184.77 126.49 189.63 126.49Q196.63 126.49 200.98 123.18Q205.33 119.88 205.33 112.82L205.33 100.9L204.29 100.9Q203.2 102.92 201.25 105.27Q199.31 107.63 195.84 109.35Q192.37 111.07 186.79 111.07Q179.57 111.07 173.8 107.68Q168.03 104.29 164.64 97.62Q161.25 90.95 161.25 81.21Q161.25 71.48 164.61 64.5Q167.98 57.53 173.8 53.81Q179.63 50.09 186.95 50.09Q192.59 50.09 196.11 51.95Q199.64 53.81 201.64 56.36Q203.63 58.9 204.67 60.81L205.55 60.81L205.55 50.86L217.3 50.86L217.3 112.88Q217.3 120.91 213.67 126.08Q210.03 131.25 203.77 133.71Q197.51 136.17 189.63 136.17ZM189.58 101.06Q194.72 101.06 198.25 98.68Q201.77 96.3 203.58 91.79Q205.38 87.28 205.38 81.05Q205.38 74.87 203.58 70.22Q201.77 65.57 198.25 62.95Q194.72 60.32 189.58 60.32Q184.27 60.32 180.72 63.08Q177.16 65.84 175.36 70.52Q173.55 75.2 173.55 81.05Q173.55 87.01 175.36 91.52Q177.16 96.03 180.75 98.55Q184.33 101.06 189.58 101.06ZM230.11 112L230.11 50.86L242.14 50.86L242.14 112ZM236.18 41.51Q233.06 41.51 230.85 39.43Q228.63 37.35 228.63 34.4Q228.63 31.39 230.85 29.31Q233.06 27.23 236.18 27.23Q239.3 27.23 241.54 29.31Q243.78 31.39 243.78 34.4Q243.78 37.35 241.54 39.43Q239.3 41.51 236.18 41.51ZM281.1 50.86L281.1 60.65L247.96 60.65L247.96 50.86ZM256.87 36.31L268.9 36.31L268.9 95.48Q268.9 99.15 270.46 100.87Q272.02 102.59 275.58 102.59Q276.5 102.59 278.04 102.38Q279.57 102.16 280.66 101.94L282.79 111.56Q280.88 112.22 278.69 112.52Q276.5 112.82 274.37 112.82Q266.06 112.82 261.47 108.53Q256.87 104.23 256.87 96.47Z" fill="#FFFFFF99"/>
<path d="M322.62 50.86L322.62 63.38L282.7 63.38L282.7 50.86ZM293.47 112L293.47 46.16Q293.47 39.65 296.07 35.33Q298.66 31.01 303.15 28.85Q307.63 26.69 313.32 26.69Q317.2 26.69 320.4 27.32Q323.6 27.95 325.08 28.38L322.12 40.74Q321.09 40.47 319.69 40.2Q318.3 39.92 316.66 39.92Q312.94 39.92 311.38 41.7Q309.82 43.48 309.82 46.7L309.82 112ZM329.83 112L329.83 50.86L345.68 50.86L345.68 61.52L346.34 61.52Q348.04 55.84 352 52.94Q355.97 50.04 361.11 50.04Q362.36 50.04 363.84 50.18Q365.32 50.31 366.41 50.59L366.41 65.24Q365.32 64.86 363.24 64.64Q361.16 64.42 359.3 64.42Q355.58 64.42 352.58 66.04Q349.57 67.65 347.9 70.52Q346.23 73.39 346.23 77.22L346.23 112ZM387.61 113.2Q381.81 113.2 377.19 111.15Q372.57 109.1 369.92 105.03Q367.27 100.95 367.27 94.88Q367.27 89.8 369.15 86.35Q371.04 82.91 374.29 80.83Q377.55 78.75 381.68 77.66Q385.81 76.56 390.35 76.13Q395.65 75.58 398.9 75.11Q402.16 74.65 403.66 73.64Q405.17 72.63 405.17 70.66L405.17 70.38Q405.17 67.76 404.07 65.95Q402.98 64.15 400.82 63.19Q398.66 62.23 395.6 62.23Q392.42 62.23 390.07 63.19Q387.72 64.15 386.24 65.73Q384.77 67.32 384.06 69.29L369.02 66.83Q370.6 61.47 374.27 57.75Q377.93 54.03 383.37 52.06Q388.81 50.09 395.65 50.09Q400.57 50.09 405.22 51.27Q409.87 52.45 413.56 54.91Q417.25 57.37 419.41 61.33Q421.57 65.3 421.57 70.82L421.57 112L406.04 112L406.04 103.52L405.49 103.52Q404.02 106.37 401.56 108.53Q399.1 110.69 395.62 111.95Q392.15 113.2 387.61 113.2ZM392.26 101.66Q396.14 101.66 399.07 100.13Q401.99 98.6 403.63 95.98Q405.28 93.35 405.28 90.13L405.28 83.51Q404.56 84.05 403.09 84.49Q401.61 84.93 399.81 85.26Q398 85.59 396.25 85.86Q394.5 86.13 393.13 86.3Q390.13 86.73 387.83 87.72Q385.53 88.7 384.28 90.32Q383.02 91.93 383.02 94.45Q383.02 96.8 384.22 98.41Q385.42 100.02 387.5 100.84Q389.58 101.66 392.26 101.66ZM432.21 112L432.21 50.86L447.41 50.86L448.23 66.06L447.03 66.06Q448.45 60.43 451.21 56.88Q453.97 53.32 457.69 51.63Q461.41 49.93 465.51 49.93Q472.13 49.93 476.17 54.11Q480.22 58.3 482.14 67.05L480.22 67.05Q481.59 61.2 484.68 57.39Q487.77 53.59 492.01 51.76Q496.24 49.93 500.89 49.93Q506.53 49.93 510.93 52.39Q515.33 54.85 517.87 59.47Q520.42 64.09 520.42 70.77L520.42 112L504.01 112L504.01 73.88Q504.01 68.69 501.19 66.17Q498.38 63.66 494.28 63.66Q491.21 63.66 488.94 65Q486.67 66.34 485.44 68.74Q484.21 71.15 484.21 74.38L484.21 112L468.35 112L468.35 73.45Q468.35 68.96 465.7 66.31Q463.05 63.66 458.84 63.66Q455.94 63.66 453.62 64.97Q451.29 66.28 449.95 68.82Q448.61 71.37 448.61 75.03L448.61 112ZM558.65 113.2Q549.3 113.2 542.51 109.38Q535.73 105.55 532.1 98.49Q528.46 91.44 528.46 81.76Q528.46 72.3 532.07 65.19Q535.68 58.08 542.3 54.09Q548.91 50.09 557.83 50.09Q563.84 50.09 569.04 52.01Q574.23 53.92 578.17 57.78Q582.11 61.63 584.32 67.43Q586.54 73.23 586.54 81.1L586.54 85.7L535.19 85.7L535.19 75.41L578.5 75.41L570.84 78.15Q570.84 73.39 569.39 69.86Q567.94 66.34 565.07 64.39Q562.2 62.45 557.99 62.45Q553.73 62.45 550.75 64.42Q547.76 66.39 546.23 69.75Q544.7 73.12 544.7 77.44L544.7 84.71Q544.7 90.02 546.48 93.63Q548.26 97.23 551.46 99.04Q554.66 100.84 558.92 100.84Q561.82 100.84 564.17 100.02Q566.52 99.2 568.19 97.59Q569.86 95.98 570.73 93.63L585.61 96.41Q584.13 101.45 580.47 105.25Q576.8 109.05 571.31 111.13Q565.81 113.2 558.65 113.2ZM618.67 113.2Q611.28 113.2 605.6 111.1Q599.91 108.99 596.3 104.97Q592.69 100.95 591.65 95.27L606.91 92.64Q608.11 96.91 611.12 99.04Q614.13 101.17 619.16 101.17Q623.86 101.17 626.57 99.39Q629.28 97.62 629.28 94.88Q629.28 92.48 627.33 90.95Q625.39 89.41 621.4 88.59L610.85 86.41Q601.99 84.6 597.61 80.25Q593.24 75.91 593.24 69.07Q593.24 63.16 596.46 58.93Q599.69 54.69 605.43 52.39Q611.17 50.09 618.94 50.09Q626.16 50.09 631.46 52.09Q636.77 54.09 640.05 57.75Q643.33 61.41 644.42 66.39L629.88 68.96Q628.95 65.84 626.29 63.85Q623.64 61.85 619.16 61.85Q615.11 61.85 612.38 63.55Q609.64 65.24 609.64 68.09Q609.64 70.38 611.42 71.97Q613.2 73.55 617.52 74.43L628.51 76.62Q637.37 78.42 641.69 82.5Q646.01 86.57 646.01 93.13Q646.01 99.15 642.51 103.66Q639.01 108.17 632.86 110.69Q626.7 113.2 618.67 113.2Z" fill="#FFFFFF"/>
diff --git a/assets/brand/logo-wordmark-light.png b/assets/brand/logo-wordmark-light.png
index fa62c457..392f4f5e 100644
Binary files a/assets/brand/logo-wordmark-light.png and b/assets/brand/logo-wordmark-light.png differ
diff --git a/assets/brand/logo-wordmark-light.svg b/assets/brand/logo-wordmark-light.svg
index e2eba69c..cb9e130d 100644
--- a/assets/brand/logo-wordmark-light.svg
+++ b/assets/brand/logo-wordmark-light.svg
@@ -1,8 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="655" height="150" viewBox="0 0 655 150">
<g transform="translate(0 4)">
- <defs><linearGradient id="logo-wordmark-light-g" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="140.00" y2="140.00"><stop offset="0" stop-color="#38BDF8"/><stop offset="0.5" stop-color="#3B82F6"/><stop offset="1" stop-color="#1D4ED8"/></linearGradient></defs>
- <path d="M 50.31 15.31 L 23.52 15.31 Q 15.31 15.31 15.31 23.52 L 15.31 50.31 M 89.69 15.31 L 116.48 15.31 Q 124.69 15.31 124.69 23.52 L 124.69 50.31 M 50.31 124.69 L 23.52 124.69 Q 15.31 124.69 15.31 116.48 L 15.31 89.69 M 89.69 124.69 L 116.48 124.69 Q 124.69 124.69 124.69 116.48 L 124.69 89.69" fill="none" stroke="url(#logo-wordmark-light-g)" stroke-width="9.30" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M 58.52 48.67 L 94.61 70.00 L 58.52 91.33 Z" fill="url(#logo-wordmark-light-g)" stroke="url(#logo-wordmark-light-g)" stroke-width="10.94" stroke-linejoin="round"/>
+ <path d="M 50.31 15.31 L 23.52 15.31 Q 15.31 15.31 15.31 23.52 L 15.31 50.31 M 89.69 15.31 L 116.48 15.31 Q 124.69 15.31 124.69 23.52 L 124.69 50.31 M 50.31 124.69 L 23.52 124.69 Q 15.31 124.69 15.31 116.48 L 15.31 89.69 M 89.69 124.69 L 116.48 124.69 Q 124.69 124.69 124.69 116.48 L 124.69 89.69" fill="none" stroke="#3B82F6" stroke-width="9.30" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M 48.13 49.77 L 48.13 90.23 M 48.13 49.77 C 48.13 70.00 64.53 70.00 75.47 70.00" fill="none" stroke="#3B82F6" stroke-width="7.66" stroke-linecap="round"/>
+ <circle cx="48.13" cy="47.03" r="8.75" fill="#3B82F6"/>
+ <circle cx="48.13" cy="92.97" r="8.75" fill="#3B82F6"/>
+ <path d="M 77.66 54.69 L 98.98 70.00 L 77.66 85.31 Z" fill="#3B82F6" stroke="#3B82F6" stroke-width="9.30" stroke-linejoin="round"/>
</g>
<path d="M189.63 136.17Q182.58 136.17 177.38 134.37Q172.19 132.56 168.82 129.55Q165.46 126.55 163.71 122.88L173.77 118.13Q174.87 119.88 176.7 121.82Q178.53 123.76 181.65 125.13Q184.77 126.49 189.63 126.49Q196.63 126.49 200.98 123.18Q205.33 119.88 205.33 112.82L205.33 100.9L204.29 100.9Q203.2 102.92 201.25 105.27Q199.31 107.63 195.84 109.35Q192.37 111.07 186.79 111.07Q179.57 111.07 173.8 107.68Q168.03 104.29 164.64 97.62Q161.25 90.95 161.25 81.21Q161.25 71.48 164.61 64.5Q167.98 57.53 173.8 53.81Q179.63 50.09 186.95 50.09Q192.59 50.09 196.11 51.95Q199.64 53.81 201.64 56.36Q203.63 58.9 204.67 60.81L205.55 60.81L205.55 50.86L217.3 50.86L217.3 112.88Q217.3 120.91 213.67 126.08Q210.03 131.25 203.77 133.71Q197.51 136.17 189.63 136.17ZM189.58 101.06Q194.72 101.06 198.25 98.68Q201.77 96.3 203.58 91.79Q205.38 87.28 205.38 81.05Q205.38 74.87 203.58 70.22Q201.77 65.57 198.25 62.95Q194.72 60.32 189.58 60.32Q184.27 60.32 180.72 63.08Q177.16 65.84 175.36 70.52Q173.55 75.2 173.55 81.05Q173.55 87.01 175.36 91.52Q177.16 96.03 180.75 98.55Q184.33 101.06 189.58 101.06ZM230.11 112L230.11 50.86L242.14 50.86L242.14 112ZM236.18 41.51Q233.06 41.51 230.85 39.43Q228.63 37.35 228.63 34.4Q228.63 31.39 230.85 29.31Q233.06 27.23 236.18 27.23Q239.3 27.23 241.54 29.31Q243.78 31.39 243.78 34.4Q243.78 37.35 241.54 39.43Q239.3 41.51 236.18 41.51ZM281.1 50.86L281.1 60.65L247.96 60.65L247.96 50.86ZM256.87 36.31L268.9 36.31L268.9 95.48Q268.9 99.15 270.46 100.87Q272.02 102.59 275.58 102.59Q276.5 102.59 278.04 102.38Q279.57 102.16 280.66 101.94L282.79 111.56Q280.88 112.22 278.69 112.52Q276.5 112.82 274.37 112.82Q266.06 112.82 261.47 108.53Q256.87 104.23 256.87 96.47Z" fill="#3B82F6"/>
<path d="M322.62 50.86L322.62 63.38L282.7 63.38L282.7 50.86ZM293.47 112L293.47 46.16Q293.47 39.65 296.07 35.33Q298.66 31.01 303.15 28.85Q307.63 26.69 313.32 26.69Q317.2 26.69 320.4 27.32Q323.6 27.95 325.08 28.38L322.12 40.74Q321.09 40.47 319.69 40.2Q318.3 39.92 316.66 39.92Q312.94 39.92 311.38 41.7Q309.82 43.48 309.82 46.7L309.82 112ZM329.83 112L329.83 50.86L345.68 50.86L345.68 61.52L346.34 61.52Q348.04 55.84 352 52.94Q355.97 50.04 361.11 50.04Q362.36 50.04 363.84 50.18Q365.32 50.31 366.41 50.59L366.41 65.24Q365.32 64.86 363.24 64.64Q361.16 64.42 359.3 64.42Q355.58 64.42 352.58 66.04Q349.57 67.65 347.9 70.52Q346.23 73.39 346.23 77.22L346.23 112ZM387.61 113.2Q381.81 113.2 377.19 111.15Q372.57 109.1 369.92 105.03Q367.27 100.95 367.27 94.88Q367.27 89.8 369.15 86.35Q371.04 82.91 374.29 80.83Q377.55 78.75 381.68 77.66Q385.81 76.56 390.35 76.13Q395.65 75.58 398.9 75.11Q402.16 74.65 403.66 73.64Q405.17 72.63 405.17 70.66L405.17 70.38Q405.17 67.76 404.07 65.95Q402.98 64.15 400.82 63.19Q398.66 62.23 395.6 62.23Q392.42 62.23 390.07 63.19Q387.72 64.15 386.24 65.73Q384.77 67.32 384.06 69.29L369.02 66.83Q370.6 61.47 374.27 57.75Q377.93 54.03 383.37 52.06Q388.81 50.09 395.65 50.09Q400.57 50.09 405.22 51.27Q409.87 52.45 413.56 54.91Q417.25 57.37 419.41 61.33Q421.57 65.3 421.57 70.82L421.57 112L406.04 112L406.04 103.52L405.49 103.52Q404.02 106.37 401.56 108.53Q399.1 110.69 395.62 111.95Q392.15 113.2 387.61 113.2ZM392.26 101.66Q396.14 101.66 399.07 100.13Q401.99 98.6 403.63 95.98Q405.28 93.35 405.28 90.13L405.28 83.51Q404.56 84.05 403.09 84.49Q401.61 84.93 399.81 85.26Q398 85.59 396.25 85.86Q394.5 86.13 393.13 86.3Q390.13 86.73 387.83 87.72Q385.53 88.7 384.28 90.32Q383.02 91.93 383.02 94.45Q383.02 96.8 384.22 98.41Q385.42 100.02 387.5 100.84Q389.58 101.66 392.26 101.66ZM432.21 112L432.21 50.86L447.41 50.86L448.23 66.06L447.03 66.06Q448.45 60.43 451.21 56.88Q453.97 53.32 457.69 51.63Q461.41 49.93 465.51 49.93Q472.13 49.93 476.17 54.11Q480.22 58.3 482.14 67.05L480.22 67.05Q481.59 61.2 484.68 57.39Q487.77 53.59 492.01 51.76Q496.24 49.93 500.89 49.93Q506.53 49.93 510.93 52.39Q515.33 54.85 517.87 59.47Q520.42 64.09 520.42 70.77L520.42 112L504.01 112L504.01 73.88Q504.01 68.69 501.19 66.17Q498.38 63.66 494.28 63.66Q491.21 63.66 488.94 65Q486.67 66.34 485.44 68.74Q484.21 71.15 484.21 74.38L484.21 112L468.35 112L468.35 73.45Q468.35 68.96 465.7 66.31Q463.05 63.66 458.84 63.66Q455.94 63.66 453.62 64.97Q451.29 66.28 449.95 68.82Q448.61 71.37 448.61 75.03L448.61 112ZM558.65 113.2Q549.3 113.2 542.51 109.38Q535.73 105.55 532.1 98.49Q528.46 91.44 528.46 81.76Q528.46 72.3 532.07 65.19Q535.68 58.08 542.3 54.09Q548.91 50.09 557.83 50.09Q563.84 50.09 569.04 52.01Q574.23 53.92 578.17 57.78Q582.11 61.63 584.32 67.43Q586.54 73.23 586.54 81.1L586.54 85.7L535.19 85.7L535.19 75.41L578.5 75.41L570.84 78.15Q570.84 73.39 569.39 69.86Q567.94 66.34 565.07 64.39Q562.2 62.45 557.99 62.45Q553.73 62.45 550.75 64.42Q547.76 66.39 546.23 69.75Q544.7 73.12 544.7 77.44L544.7 84.71Q544.7 90.02 546.48 93.63Q548.26 97.23 551.46 99.04Q554.66 100.84 558.92 100.84Q561.82 100.84 564.17 100.02Q566.52 99.2 568.19 97.59Q569.86 95.98 570.73 93.63L585.61 96.41Q584.13 101.45 580.47 105.25Q576.8 109.05 571.31 111.13Q565.81 113.2 558.65 113.2ZM618.67 113.2Q611.28 113.2 605.6 111.1Q599.91 108.99 596.3 104.97Q592.69 100.95 591.65 95.27L606.91 92.64Q608.11 96.91 611.12 99.04Q614.13 101.17 619.16 101.17Q623.86 101.17 626.57 99.39Q629.28 97.62 629.28 94.88Q629.28 92.48 627.33 90.95Q625.39 89.41 621.4 88.59L610.85 86.41Q601.99 84.6 597.61 80.25Q593.24 75.91 593.24 69.07Q593.24 63.16 596.46 58.93Q599.69 54.69 605.43 52.39Q611.17 50.09 618.94 50.09Q626.16 50.09 631.46 52.09Q636.77 54.09 640.05 57.75Q643.33 61.41 644.42 66.39L629.88 68.96Q628.95 65.84 626.29 63.85Q623.64 61.85 619.16 61.85Q615.11 61.85 612.38 63.55Q609.64 65.24 609.64 68.09Q609.64 70.38 611.42 71.97Q613.2 73.55 617.52 74.43L628.51 76.62Q637.37 78.42 641.69 82.5Q646.01 86.57 646.01 93.13Q646.01 99.15 642.51 103.66Q639.01 108.17 632.86 110.69Q626.7 113.2 618.67 113.2Z" fill="#0B1E4D"/>
diff --git a/assets/brand/logo.png b/assets/brand/logo.png
index 6b9acc67..cbb506c8 100644
Binary files a/assets/brand/logo.png and b/assets/brand/logo.png differ
diff --git a/assets/brand/logo.svg b/assets/brand/logo.svg
index 0bf36fa7..10ff2cbd 100644
--- a/assets/brand/logo.svg
+++ b/assets/brand/logo.svg
@@ -1,7 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
<g transform="translate(0 0)">
- <defs><linearGradient id="logo-g" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="512.00" y2="512.00"><stop offset="0" stop-color="#38BDF8"/><stop offset="0.5" stop-color="#3B82F6"/><stop offset="1" stop-color="#1D4ED8"/></linearGradient></defs>
- <path d="M 184.00 56.00 L 86.00 56.00 Q 56.00 56.00 56.00 86.00 L 56.00 184.00 M 328.00 56.00 L 426.00 56.00 Q 456.00 56.00 456.00 86.00 L 456.00 184.00 M 184.00 456.00 L 86.00 456.00 Q 56.00 456.00 56.00 426.00 L 56.00 328.00 M 328.00 456.00 L 426.00 456.00 Q 456.00 456.00 456.00 426.00 L 456.00 328.00" fill="none" stroke="url(#logo-g)" stroke-width="34.00" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M 214.00 178.00 L 346.00 256.00 L 214.00 334.00 Z" fill="url(#logo-g)" stroke="url(#logo-g)" stroke-width="40.00" stroke-linejoin="round"/>
+ <path d="M 184.00 56.00 L 86.00 56.00 Q 56.00 56.00 56.00 86.00 L 56.00 184.00 M 328.00 56.00 L 426.00 56.00 Q 456.00 56.00 456.00 86.00 L 456.00 184.00 M 184.00 456.00 L 86.00 456.00 Q 56.00 456.00 56.00 426.00 L 56.00 328.00 M 328.00 456.00 L 426.00 456.00 Q 456.00 456.00 456.00 426.00 L 456.00 328.00" fill="none" stroke="#3B82F6" stroke-width="34.00" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M 176.00 182.00 L 176.00 330.00 M 176.00 182.00 C 176.00 256.00 236.00 256.00 276.00 256.00" fill="none" stroke="#3B82F6" stroke-width="28.00" stroke-linecap="round"/>
+ <circle cx="176.00" cy="172.00" r="32.00" fill="#3B82F6"/>
+ <circle cx="176.00" cy="340.00" r="32.00" fill="#3B82F6"/>
+ <path d="M 284.00 200.00 L 362.00 256.00 L 284.00 312.00 Z" fill="#3B82F6" stroke="#3B82F6" stroke-width="34.00" stroke-linejoin="round"/>
</g>
</svg>
diff --git a/examples/22_gitframes_launch/README.md b/examples/22_gitframes_launch/README.md
index 4baa091e..b010ffb8 100644
--- a/examples/22_gitframes_launch/README.md
+++ b/examples/22_gitframes_launch/README.md
@@ -12,7 +12,7 @@ pnpm song cost # estimate (~$0.06), no calls
pnpm song # song → stems → words → grid → chapters (retries takes that skip a line)
pnpm song measure # re-run only the free steps on the cached take
pnpm images # the compositing chapter's four layers (~$0.25)
-pnpm precomp # the 3D chapter, without its lyrics, rendered as footage → assets/plate.mp4
+pnpm precomp # the finished composite rendered as footage for the chorus → assets/plate.mp4
pnpm render frames 483 2900 3300
pnpm render # output/gitframes-launch.mp4
pnpm test
@@ -43,17 +43,17 @@ window usually means a layer with its own `startFrame` was keyed in scene frames
| Lyric | Picture |
| --- | --- |
-| "What if video was just code? … just type it and let it hit." | the camera leaps phrase to phrase down a 3D runway; a commit, a timeline struck out; dives through the brand mark |
-| "Gitframes!" | the name, extruded, whips in on an orbiting camera |
+| "What if video was just code? … just type it and let it hit." | the camera leaps phrase to phrase through depth; a commit, a timeline struck out; dives through the logo (`assets/brand/logo.png`) |
+| "Gitframes!" | the logo and the lowercase name, extruded, whip in on an orbiting camera |
| "No browser, no Chromium, no screenshots, just the GPU." | each word redacted on the beat |
-| "A hundred twenty frames a second, every pixel rendered true" | cube stacks build on sixteenths; the figure counts with the voice |
+| "A hundred twenty frames a second, every pixel rendered true, watch it move" | the figure counts with the voice; three lanes render the same clip, each bar filling left to right at 12, 30 or 120 frames rendered a second and counting the clips it finishes; gitframes laps the others, and on "watch it move" the slow lanes drop out |
| "After Effects, Photoshop, Premiere, Cinema 4D, Blender, Illustrator, all of it in one import" | each tool lands as a monogram tile (not its logo) captioned with what gitframes takes from it; the tiles fall into one `import` line |
-| "Every letter razor sharp … kinetic on every beat." | a font per sixteenth, a 40× Slug zoom, the line built along an arc, split / stagger / spin each set with the animator they name, a face per word |
-| "Step inside the camera … light it up in depth." | one camera move: viewfinder, flight, floor paths, a cube burst, an orbit and dolly through a ring of capabilities, lit DEPTH |
-| "Drop a mesh and make it bend … every frame a different shape." | procedural meshes deformed on the GPU by the song: harmonic wave, normal extrusion on the bass, ripple, twist; the floor folds; a new shape every beat |
+| "Every letter razor sharp … kinetic on every beat. Step inside the camera" | a font per sixteenth, a 40× Slug zoom, the line built along an arc, split / stagger / spin each set with the animator they name, a face per word; each kinetic word slams into its own row and the rows run against each other, a sliding wall that closes into a viewfinder the lens rushes |
+| "fly the third dimension … light it up in depth." | one camera move: flight through hanging cubes, paths drawn in space, a cube burst, an orbit and dolly through a ring of capabilities, lit DEPTH |
+| "Drop a mesh and make it bend … every frame a different shape." | procedural meshes deformed on the GPU by the song: harmonic wave, normal extrusion on the bass, ripple, twist; a new shape every beat |
| "It's just code … render true every night." | the comp's source beside its images; ColorKey pulls the green, an iris mask closes, a light leak screens and a paper grain multiplies; the stack explodes in 3D and collapses back |
-| "Frame by frame … faster and faster!" | the 3D chapter, precomposed, through each named effect; a knot twisting under an accelerating camera |
-| "Gitframes. Motion, compiled." | lock-up: brand mark, extruded name, the line built word by word, `pnpm add gitframes` on the final hit |
+| "Frame by frame … faster and faster!" | the composite, precomposed, through each named effect; two strips of graded footage accelerating against each other |
+| "Gitframes. Motion, compiled." | lock-up: logo, lowercase extruded name, the line built word by word, `pnpm add gitframes` on the final hit |
## Engine work done for this film
@@ -70,5 +70,6 @@ Each has a regression test (`packages/gitframes/src/*.test.ts`, `packages/webgpu
- Audio mesh deformation gained `twist` and `ripple`.
- Text on a path: SVG arcs (`A`/`a`) were ignored by the path parser; the last margin was read as an absolute position; force alignment dropped spaces.
- `overflow: hidden` ignored `borderRadius` (rounded and animated clips now hold).
+- Text `verticalAlign` was ignored: a text block always sat at the top of its box (`text-vertical-align.test.ts`).
- Text antialiasing: each glyph's quad was its exact bounding box, so pixels just outside the outline never got their partial coverage, and the two Slug coverage rays were averaged rather than weighted; a glyph turned in the shader (text on a path) had stair-stepped edges. Quads are now dilated by a pixel, rays weighted by how near they cross an edge, and the pixel footprint measured per glyph axis (`text-antialias.test.ts`).
- `ColorKey` is exposed as an SDK effect (node-colorkey migrated to the generated classes).
diff --git a/examples/22_gitframes_launch/assets/structure.json b/examples/22_gitframes_launch/assets/structure.json
index f1df4990..043ffc41 100644
--- a/examples/22_gitframes_launch/assets/structure.json
+++ b/examples/22_gitframes_launch/assets/structure.json
@@ -11,7 +11,7 @@
"speed": 7,
"tools": 10,
"type": 16,
- "world": 22.25,
+ "world": 23.25,
"warp": 28,
"code": 32,
"comp": 33,
diff --git a/examples/22_gitframes_launch/src/music/chapters.ts b/examples/22_gitframes_launch/src/music/chapters.ts
index ebc71c60..2cddaba0 100644
--- a/examples/22_gitframes_launch/src/music/chapters.ts
+++ b/examples/22_gitframes_launch/src/music/chapters.ts
@@ -67,7 +67,7 @@ export function chaptersOf(
speed: lineBar(words, "A hundred"),
tools: lineBar(words, "After Effects"),
type: lineBar(words, "Every letter"),
- world: lineBar(words, "Step inside"),
+ world: lineBar(words, "fly the third"),
warp: lineBar(words, "Drop a mesh"),
code: lineBar(words, "It's just code"),
comp: lineBar(words, "key it"),
diff --git a/examples/22_gitframes_launch/src/precomp.ts b/examples/22_gitframes_launch/src/precomp.ts
index 4a0cd345..eec901c4 100644
--- a/examples/22_gitframes_launch/src/precomp.ts
+++ b/examples/22_gitframes_launch/src/precomp.ts
@@ -1,19 +1,18 @@
/**
- * pnpm precomp → assets/plate.mp4: the 3D chapter rendered on its own, as the
- * footage the chorus grades, grains and glitches. Effects attach to media, so
- * the film's own frames become media first (an After Effects-style precomp),
- * rendered on the film's clock: frame f of the plate is film frame from + f.
- * Re-run after the song or the world scene changes.
+ * pnpm precomp → assets/plate.mp4: the compositing chapter's finished
+ * composite (backdrop, keyed camera, light leak in screen, paper in multiply)
+ * rendered on its own, as the footage the chorus grades, grains and glitches.
+ * Effects attach to media, so the composite becomes media first (an After
+ * Effects-style precomp). Re-run after the images or the composite change.
*/
import { execFileSync } from "node:child_process";
import fs from "node:fs/promises";
import path from "node:path";
import { Composition, HeadlessMediaRenderer } from "gitframes";
-import { bar, FPS } from "./grid.js";
+import { FPS } from "./grid.js";
import { asset, OUTPUT } from "./paths.js";
-import { worldScene } from "./scenes/world.js";
+import { compPlate, PLATE_FRAMES } from "./scenes/comp.js";
import { BG, H, registerFonts, W } from "./theme.js";
-import { CH } from "./timeline.js";
interface Plate {
from: number;
@@ -24,12 +23,12 @@ interface Plate {
}
const PLATES: Record<string, Plate> = {
- world: {
- from: bar(CH.world),
- to: bar(CH.warp),
+ comp: {
+ from: 0,
+ to: PLATE_FRAMES,
file: "plate.mp4",
background: BG,
- build: () => worldScene({ lyrics: false }),
+ build: () => compPlate(),
},
};
diff --git a/examples/22_gitframes_launch/src/scenes/comp.ts b/examples/22_gitframes_launch/src/scenes/comp.ts
index 882d57f9..33989619 100644
--- a/examples/22_gitframes_launch/src/scenes/comp.ts
+++ b/examples/22_gitframes_launch/src/scenes/comp.ts
@@ -19,7 +19,7 @@ import {
LayerAnimation,
Signal,
} from "gitframes";
-import { BEAT, bar } from "../grid.js";
+import { BEAT, bar, FPS } from "../grid.js";
import { type ImageName, image } from "../images.js";
import { lineWords, type SungWord, sung } from "../lyrics.js";
import {
@@ -199,6 +199,66 @@ function iris(id: string, at: number, child: unknown) {
} as never).animate(outer);
}
+/** Length of the chorus footage (precomp.ts): eight seconds of the finished composite. */
+export const PLATE_FRAMES = 8 * FPS;
+
+/**
+ * The finished composite as footage for the chorus to grade: the same four
+ * layers and blend modes, the camera keyed from the first frame, drifting
+ * against the backdrop while the leak sweeps through.
+ */
+export function compPlate() {
+ const len = PLATE_FRAMES;
+ const drift = (
+ id: string,
+ child: unknown,
+ x0: number,
+ x1: number,
+ s0: number,
+ s1: number,
+ ) =>
+ Layer.box({
+ id,
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: W,
+ height: H,
+ children: [child as never],
+ }).animate(
+ keys(
+ "x",
+ [
+ [0, x0],
+ [len, x1, "sine.inOut"],
+ ],
+ keys("scale", [
+ [0, s0],
+ [len, s1, "sine.inOut"],
+ ]),
+ ),
+ );
+ return Layer.box({
+ id: "plate",
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: W,
+ height: H,
+ children: [
+ drift("plate-back", full("plate-backdrop", "backdrop"), 0, 0, 1.04, 1.16),
+ drift("plate-subject", keyed("plate-camera", -10), 60, -80, 1, 1.08),
+ full("plate-leak", "leak", { blendMode: "screen" }).animate(
+ keys("x", [
+ [0, -700],
+ [len, 500, "sine.inOut"],
+ ]),
+ ),
+ full("plate-paper", "paper", { blendMode: "multiply" }),
+ ],
+ });
+}
+
export function compScene() {
const from = bar(CH.code);
const to = bar(CH.vfx);
diff --git a/examples/22_gitframes_launch/src/scenes/logo.ts b/examples/22_gitframes_launch/src/scenes/logo.ts
index 7ae615a8..2ea01a32 100644
--- a/examples/22_gitframes_launch/src/scenes/logo.ts
+++ b/examples/22_gitframes_launch/src/scenes/logo.ts
@@ -1,5 +1,5 @@
/**
- * "Gitframes!" — out of the accent flood the name, extruded in 3D, whips
+ * "Gitframes!" — out of the accent flood the logo and the name, extruded in 3D, whip
* round on an orbiting camera and lands on the sung word, then drifts until
* the drop cuts it away.
*/
@@ -11,10 +11,10 @@ import {
DISPLAY,
EASE_OUT,
FG,
- GRID,
H,
keys,
label,
+ logoMark,
plane,
scene,
W,
@@ -69,22 +69,19 @@ export function logoScene() {
color: "#FFFFFF",
intensity: 0.6,
} as never),
- Layer3D.grid({
- id: "logo-floor",
- width: 6000,
- height: 6000,
- divisions: 30,
- lineWidth: 3,
- color: GRID,
+ // The logo and the name stand only once the name is sung.
+ logoMark({
+ id: "logo-mark",
+ size: 200,
x: CX,
- y: CY + 260,
+ y: CY - 250,
z: 0,
+ startFrame: land - 12,
}),
- // The name stands only once it is sung.
window3D("logo-name-window", land - 12, len - land + 12, [
Layer3D.extrudedText({
id: "logo-3d",
- text: "GITFRAMES",
+ text: "gitframes",
fontFamily: DISPLAY,
fontWeight: 900,
fontSize: 210,
diff --git a/examples/22_gitframes_launch/src/scenes/open.ts b/examples/22_gitframes_launch/src/scenes/open.ts
index 70cbea62..dd6e4a92 100644
--- a/examples/22_gitframes_launch/src/scenes/open.ts
+++ b/examples/22_gitframes_launch/src/scenes/open.ts
@@ -1,11 +1,11 @@
/**
* The hook, four lines in four bars. A dot lands with the first sound and a
- * ring draws around it; then the camera leaps down a runway from phrase to
+ * ring draws around it; then the camera leaps through depth from phrase to
* phrase, arriving as each is sung (a word never shows before its syllable).
* "commit" gets its commit, "no timeline" a timeline that is struck out, and
* on "hit" the camera dives through the brand mark into the logo.
*/
-import { Layer, Layer3D, LayerAnimation } from "gitframes";
+import { Layer, LayerAnimation } from "gitframes";
import { BEAT } from "../grid.js";
import { type SungWord, sung } from "../lyrics.js";
import {
@@ -18,6 +18,7 @@ import {
H,
type Key,
keys,
+ logoMark,
MONO,
MUTED,
plane,
@@ -32,7 +33,6 @@ const CX = W / 2;
const CY = H / 2;
/** Eye height above the look point: the camera looks slightly down onto the floor. */
const LIFT = 160;
-const FLOOR_Y = CY + 420;
const STEP_Z = 820;
/** The logo takes over on the beat "Gitframes!" is sung in. */
@@ -113,8 +113,9 @@ function phrase(s: Stop, i: number, list: Stop[]) {
color: s.color,
enter: "rise",
z: s.z,
- // Passed phrases leave as the camera leaps on, or they fill the lens.
- outAt: next ? next.words[0].at - 4 : undefined,
+ // Passed phrases leave as the camera leaps on, or they fill the lens;
+ // the last clears as the camera dives, so the logo is seen whole.
+ outAt: next ? next.words[0].at - 4 : OPEN_TO - 12,
});
}
@@ -215,56 +216,16 @@ function timeline(s: Stop, strikeAt: number) {
];
}
-/** The runway: a grid of 3D line quads on the floor. */
-function floor(length: number) {
- return Layer3D.grid({
- id: "open-floor",
- width: 9000,
- height: length,
- divisions: 80,
- lineWidth: 4,
- color: ACCENT,
- x: CX,
- y: FLOOR_Y,
- z: length / 2 - 1200,
- rotateX: 90,
- }).animate(
- keys("opacity", [
- [0, 0],
- [24, 0.4, EASE_OUT],
- ]),
- );
-}
-
-/** The brand mark waiting at the end of the runway: a frame with a playhead. */
+/** The logo waiting at the end of the flight. */
function brandMark(z: number, appearAt: number) {
- const size = 420;
- return Layer.box({
+ return logoMark({
id: "open-mark",
- is3D: true,
- position: "absolute",
- x: CX - size / 2,
- y: CY - size / 2,
+ size: 460,
+ x: CX,
+ y: CY,
z,
- width: size,
- height: size,
- borderRadius: 64,
- borderColor: ACCENT,
- borderWidth: 34,
startFrame: appearAt,
- children: [
- Layer.box({
- id: "open-mark-head",
- position: "absolute",
- x: size * 0.36,
- y: size * 0.36,
- width: size * 0.28,
- height: size * 0.28,
- borderRadius: 18,
- background: ACCENT,
- }),
- ],
- } as never);
+ });
}
export function openScene() {
@@ -307,7 +268,6 @@ export function openScene() {
targetZ: 0,
animation: camAnim,
} as never),
- floor(markZ + 3000),
Layer.shape("ellipse", {
id: "open-dot",
is3D: true,
diff --git a/examples/22_gitframes_launch/src/scenes/outro.ts b/examples/22_gitframes_launch/src/scenes/outro.ts
index e322b2f2..a324f56d 100644
--- a/examples/22_gitframes_launch/src/scenes/outro.ts
+++ b/examples/22_gitframes_launch/src/scenes/outro.ts
@@ -1,5 +1,5 @@
/**
- * The end. On "Gitframes." the name, extruded in 3D, whips in under an
+ * The end. On "Gitframes." the logo and the name, extruded in 3D, whips in under an
* orbiting camera; "Motion, compiled." builds word by word beneath it, and
* on the final hit the install line lands, held through the ring-out.
*/
@@ -13,11 +13,11 @@ import {
EASE_OUT,
FG,
flashes,
- GRID,
GUEST,
H,
keys,
label,
+ logoMark,
MONO,
plane,
SNAP,
@@ -31,35 +31,15 @@ import { CH, DURATION } from "../timeline.js";
const CX = W / 2;
const CY = H / 2;
-const MARK = 150;
-
-/** The brand mark: a frame with a playhead, standing in the 3D scene above the name. */
+/** The logo, standing in the 3D scene above the name. */
function brandMark(at: number) {
- return Layer.box({
+ return logoMark({
id: "final-mark",
- is3D: true,
- position: "absolute",
- x: CX - MARK / 2,
- y: CY - 300,
+ size: 190,
+ x: CX,
+ y: CY - 225,
z: 0,
- width: MARK,
- height: MARK,
- borderRadius: 26,
- borderColor: ACCENT,
- borderWidth: 14,
- children: [
- Layer.box({
- id: "final-mark-head",
- position: "absolute",
- x: MARK * 0.36,
- y: MARK * 0.36,
- width: MARK * 0.28,
- height: MARK * 0.28,
- borderRadius: 8,
- background: ACCENT,
- }),
- ],
- } as never).animate(
+ }).animate(
keys("scale", [
[0, 0],
[at, 0],
@@ -114,23 +94,12 @@ function lockup() {
color: "#FFFFFF",
intensity: 0.6,
} as never),
- Layer3D.grid({
- id: "final-floor",
- width: 6000,
- height: 6000,
- divisions: 30,
- lineWidth: 3,
- color: GRID,
- x: CX,
- y: CY + 360,
- z: 0,
- }),
brandMark(settle - 10),
// The name stands only once it is sung.
window3D("final-name-window", settle - 10, len - settle + 10, [
Layer3D.extrudedText({
id: "final-name",
- text: "GITFRAMES",
+ text: "gitframes",
fontFamily: DISPLAY,
fontWeight: 900,
fontSize: 200,
@@ -181,7 +150,7 @@ function lockup() {
),
label({
id: "final-url",
- text: "gitframes · WebGPU motion engine",
+ text: "WebGPU motion engine",
y: H - 90,
inAt: hit + 16,
color: FG,
diff --git a/examples/22_gitframes_launch/src/scenes/speed.ts b/examples/22_gitframes_launch/src/scenes/speed.ts
index 19f16848..685b0dc5 100644
--- a/examples/22_gitframes_launch/src/scenes/speed.ts
+++ b/examples/22_gitframes_launch/src/scenes/speed.ts
@@ -1,27 +1,29 @@
/**
- * "A hundred twenty frames a second, watch it move." Three stacks of cubes
- * build on sixteenths while the camera orbits; the winner's number counts to
- * the sung figure, and on "move" the camera whips round and rushes it.
+ * "A hundred twenty frames a second, every pixel rendered true, watch it
+ * move." Rendering speed, shown rather than claimed: three lanes render the
+ * same clip, each bar filling left to right at its renderer's frames per
+ * second and starting over when the clip is done, the clips counted at the
+ * end. gitframes laps the others; on "watch it move" the slow lanes drop out.
*/
-import { CameraAnimation, Layer, Layer3D, LayerAnimation } from "gitframes";
+import { Layer, LayerAnimation } from "gitframes";
import { BEAT, bar } from "../grid.js";
import { kickPulse } from "../hits.js";
import { lineWords, sung } from "../lyrics.js";
import {
ACCENT,
- ACCENT_DEEP,
- BG,
DISPLAY,
EASE_IN,
+ EASE_OUT,
FG,
- GRID,
H,
+ HAIRLINE,
+ type Key,
keys,
+ label,
MONO,
MUTED,
plane,
SNAP,
- SURFACE,
scene,
sungLine,
W,
@@ -30,238 +32,280 @@ import { CH } from "../timeline.js";
import { NOT_TO } from "./not.js";
const CX = W / 2;
-const CY = H / 2;
-const CUBE = 64;
-const GAP = 8;
-const FLOOR = CY + 380;
+const TRACK_X0 = 620;
+const TRACK_X1 = 1620;
+const PUCK = 44;
+/** Film frames gitframes takes to render the clip: two beats. The others take 120 / fps times as long. */
+const HERO_CLIP = 2 * BEAT;
-interface Stack {
+interface Lane {
name: string;
fps: number;
- blocks: number;
+ y: number;
hero: boolean;
- x: number;
}
-const STACKS: Stack[] = [
- { name: "HEADLESS CHROMIUM", fps: 12, blocks: 1, hero: false, x: CX - 520 },
- { name: "GITFRAMES", fps: 120, blocks: 10, hero: true, x: CX },
- { name: "CANVAS 2D", fps: 30, blocks: 3, hero: false, x: CX + 520 },
+const LANES: Lane[] = [
+ { name: "headless chromium", fps: 12, y: 610, hero: false },
+ { name: "canvas 2d", fps: 30, y: 770, hero: false },
+ { name: "gitframes", fps: 120, y: 930, hero: true },
];
-const top = (s: Stack) => FLOOR - s.blocks * (CUBE + GAP);
-
-function cubes(s: Stack, popFrom: number) {
- return Array.from({ length: s.blocks }, (_, i) => {
- const at = popFrom + i * (BEAT / 4);
- const face = s.hero ? ACCENT : SURFACE;
- const side = s.hero ? ACCENT_DEEP : MUTED;
- return Layer3D.cube({
- id: `speed-${s.fps}-${i}`,
- size: CUBE,
- x: s.x,
- y: FLOOR - CUBE / 2 - i * (CUBE + GAP),
- z: 0,
- faces: {
- front: face,
- back: face,
- left: side,
- right: side,
- top: BG,
- bottom: side,
- },
- }).animate(
- keys("scale", [
- [0, 0],
- [at, 0],
- [at + 8, 1, SNAP],
- ]),
- );
- });
+/**
+ * Render progress, left to right only: the head runs across at the lane's
+ * rendering speed and starts the next clip from the left when it gets there.
+ * Returns the x keys of the head and the scene frames each clip finished.
+ */
+function progress(l: Lane, start: number, until: number) {
+ const clip = (HERO_CLIP * 120) / l.fps;
+ const span = TRACK_X1 - TRACK_X0;
+ const x: Key[] = [[start, TRACK_X0]];
+ const done: number[] = [];
+ for (let f = start + clip; ; f += clip) {
+ const end = Math.min(f, until);
+ x.push([end, TRACK_X0 + (span * (end - (f - clip))) / clip, "none"]);
+ if (f > until) break;
+ done.push(f);
+ x.push([f + 1, TRACK_X0, "hold"]);
+ }
+ return { x, done };
}
-/** A number standing in 3D above its stack, shown over [from, to) of the scene. */
-function figure(id: string, s: Stack, text: string, from: number, to?: number) {
- return Layer.text(text, {
- id,
- is3D: true,
- position: "absolute",
- x: s.x - 300,
- y: top(s) - 180,
- z: 0,
- width: 600,
- height: 160,
- fontFamily: DISPLAY,
- fontWeight: 900,
- fontSize: s.hero ? 150 : 90,
- fill: s.hero ? ACCENT : FG,
- align: "center",
- verticalAlign: "middle",
- startFrame: from,
- durationFrames: to === undefined ? undefined : to - from,
- } as never).animate(
- keys("scale", [
- [0, 1.25],
- [10, 1, "expo.out"],
- ]),
+function lane(
+ l: Lane,
+ i: number,
+ o: { inAt: number; start: number; stopAt: number; end: number },
+) {
+ const cy = l.y;
+ const run = progress(l, o.start, l.hero ? o.end : o.stopAt);
+ const colour = l.hero ? ACCENT : FG;
+ const fade = keys("opacity", [
+ [0, 0],
+ [o.inAt, 0],
+ [o.inAt + 4, 1, "none"],
+ ...(l.hero
+ ? []
+ : ([
+ [o.stopAt, 1],
+ [o.stopAt + 8, 0, EASE_IN],
+ ] as Key[])),
+ ]);
+ keys(
+ "x",
+ [
+ [0, -160],
+ [o.inAt, -160],
+ [o.inAt + 12, 0, EASE_OUT],
+ ],
+ fade,
);
+ if (!l.hero)
+ keys(
+ "y",
+ [
+ [o.stopAt, 0],
+ [o.stopAt + 8, 60, EASE_IN],
+ ],
+ fade,
+ );
+ // The bar fills behind the head: its width follows the head's x.
+ const fill: Key[] = run.x.map(([f, x, e]) => [f, Number(x) - TRACK_X0, e]);
+ return Layer.box({
+ id: `speed-lane-${i}`,
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: W,
+ height: H,
+ children: [
+ Layer.text(l.hero ? l.name : l.name.toUpperCase(), {
+ id: `speed-lane-${i}-name`,
+ position: "absolute",
+ x: 120,
+ y: cy - 44,
+ width: 440,
+ fontFamily: MONO,
+ fontSize: 24,
+ fontWeight: 600,
+ letterSpacing: 6,
+ fill: l.hero ? ACCENT : MUTED,
+ }),
+ Layer.text(`${l.fps} FPS`, {
+ id: `speed-lane-${i}-fps`,
+ position: "absolute",
+ x: 120,
+ y: cy - 8,
+ width: 440,
+ fontFamily: DISPLAY,
+ fontSize: 44,
+ fontWeight: 900,
+ fill: colour,
+ }),
+ Layer.shape("rect", {
+ id: `speed-lane-${i}-track`,
+ position: "absolute",
+ x: TRACK_X0,
+ y: cy - 4,
+ width: TRACK_X1 - TRACK_X0,
+ height: 8,
+ borderRadius: 4,
+ fillColor: HAIRLINE,
+ }),
+ Layer.shape("rect", {
+ id: `speed-lane-${i}-fill`,
+ position: "absolute",
+ x: TRACK_X0,
+ y: cy - 4,
+ width: 0,
+ height: 8,
+ borderRadius: 4,
+ fillColor: colour,
+ }).animate(keys("width", fill)),
+ Layer.shape("ellipse", {
+ id: `speed-lane-${i}-head`,
+ position: "absolute",
+ x: TRACK_X0 - PUCK / 2,
+ y: cy - PUCK / 2,
+ width: PUCK,
+ height: PUCK,
+ fillColor: colour,
+ }).animate(
+ keys(
+ "x",
+ run.x.map(([f, x, e]) => [f, Number(x) - PUCK / 2, e]),
+ ),
+ ),
+ // Clips rendered so far, counted at the end of the track.
+ ...run.done.map((at, k) =>
+ Layer.text(`×${k + 1}`, {
+ id: `speed-lane-${i}-done-${k}`,
+ position: "absolute",
+ x: TRACK_X1 + 50,
+ y: cy - 30,
+ width: 200,
+ fontFamily: DISPLAY,
+ fontSize: 48,
+ fontWeight: 900,
+ fill: colour,
+ startFrame: at,
+ durationFrames: (run.done[k + 1] ?? o.end + 1) - at,
+ }).animate(
+ keys("scale", [
+ [0, 1.5],
+ [8, 1, SNAP],
+ ]),
+ ),
+ ),
+ ],
+ }).animate(fade);
}
-function caption(
- id: string,
- text: string,
- s: Stack,
- y: number,
- size: number,
- at: number,
-) {
- return Layer.text(text, {
- id,
- is3D: true,
- position: "absolute",
- x: s.x - 400,
- y,
- z: -80,
- width: 800,
- fontFamily: MONO,
- fontWeight: 600,
- fontSize: size,
- letterSpacing: size * 0.25,
- fill: FG,
- align: "center",
- } as never).animate(
- keys("opacity", [
- [0, 0],
- [at - 1, 0],
- [at, 1, "none"],
- ]),
- );
+/** The figure, counting with the voice: up to 100 on "a hundred", 120 on "twenty". */
+function counter(a: number, hundred: number, twenty: number, outAt: number) {
+ const steps: [number, string][] = [];
+ for (let f = a; f < hundred; f += 2)
+ steps.push([f, String(Math.round(((f - a) / (hundred - a)) * 100))]);
+ steps.push([hundred, "100"], [twenty, "120"]);
+ return steps.map(([at, text], i) => {
+ const until = steps[i + 1]?.[0] ?? outAt + 8;
+ const last = i === steps.length - 1;
+ const anim = LayerAnimation.create();
+ if (last)
+ anim
+ .fromTo("scale", 1.3, 1, { start: 0, end: 10, ease: SNAP })
+ .fadeOut(outAt - at, outAt - at + 8, "power2.in")
+ .fromTo("y", 70, -40, {
+ start: outAt - at,
+ end: outAt - at + 8,
+ ease: EASE_IN,
+ });
+ return Layer.text(text, {
+ id: `speed-count-${i}`,
+ position: "absolute",
+ x: 0,
+ y: 70,
+ width: W,
+ height: 330,
+ fontFamily: DISPLAY,
+ fontWeight: 900,
+ fontSize: 300,
+ fill: last ? ACCENT : FG,
+ align: "center",
+ verticalAlign: "middle",
+ anchorX: 0.5,
+ anchorY: 0.5,
+ startFrame: at,
+ durationFrames: until - at,
+ }).animate(anim);
+ });
}
export function speedScene() {
const from = NOT_TO;
const to = bar(CH.tools);
- const len = to - from;
- const local = (word: string) => sung(word, from).at - from;
- const move = local("move");
- const cam = CameraAnimation.camera()
- .orbit({
- azimuth: { from: 42, to: -18 },
- elevation: { from: 6, to: 14 },
- radius: { from: 1650, to: 1500 },
- start: 0,
- end: move,
- ease: "sine.inOut",
- })
- // "watch it move": the whip, then a slow orbit, then the rush onto the winner.
- .orbit({
- azimuth: { from: -18, to: -70 },
- elevation: { from: 14, to: 24 },
- radius: { from: 1500, to: 1400 },
- start: move + 1,
- end: move + 30,
- ease: "expo.out",
- })
- .orbit({
- azimuth: { from: -70, to: -40 },
- elevation: { from: 24, to: 18 },
- radius: { from: 1400, to: 1350 },
- start: move + 31,
- end: len - 40,
- ease: "sine.inOut",
- })
- .orbit({
- azimuth: { from: -40, to: 0 },
- elevation: { from: 18, to: 2 },
- radius: { from: 1350, to: 380 },
- start: len - 39,
- end: len,
- ease: EASE_IN,
- });
- keys(
- "targetY",
- [
- [0, CY],
- [len - 40, CY],
- [len, top(STACKS[1]) - 100, EASE_IN],
- ],
- cam,
- );
+ const local = (word: string, after = from) => sung(word, after).at - from;
+ const a = local("a");
+ const hundred = local("hundred");
+ const twenty = local("twenty");
+ const frames = sung("frames", from);
+ const every = sung("every", frames.at);
+ const watch = sung("watch", every.at);
+ const runFrom = a + 4;
- const hero = STACKS[1];
- const popFrom = local("a");
return scene("speed", from, to, [
- Layer.camera({
- id: "speed-cam",
- targetX: CX,
- targetY: CY,
- targetZ: 0,
- animation: cam,
- } as never),
- Layer.directionalLight({
- id: "speed-key",
- color: "#FFFFFF",
- intensity: 1,
- direction: [-0.5, 0.7, 0.8],
- } as never),
- Layer.ambientLight({
- id: "speed-fill",
- color: "#FFFFFF",
- intensity: 0.6,
- } as never),
- Layer3D.grid({
- id: "speed-floor",
- width: 6000,
- height: 6000,
- divisions: 40,
- lineWidth: 3,
- color: GRID,
- x: CX,
- y: FLOOR,
- z: 0,
- }),
- ...STACKS.flatMap((s) => cubes(s, popFrom)),
- // The figure counts with the voice: "a hundred" … "twenty".
- figure("speed-num-100", hero, "100", local("hundred"), local("twenty")),
- figure("speed-num-120", hero, "120", local("twenty")),
- figure("speed-num-12", STACKS[0], "12", local("twenty")),
- figure("speed-num-30", STACKS[2], "30", local("twenty")),
+ ...LANES.map((l, i) =>
+ lane(l, i, {
+ inAt: a + i * (BEAT / 4),
+ start: runFrom,
+ stopAt: watch.at - from,
+ end: to - from,
+ }),
+ ),
+ ...counter(a, hundred, twenty, every.at - from - 4),
sungLine({
id: "speed-unit",
- words: [
- sung("frames", from),
- sung("a", sung("frames", from).at),
- sung("second", from),
- ],
+ words: [frames, sung("a", frames.at), sung("second", frames.at)],
from,
- x: hero.x - 500,
- width: 1000,
- y: top(hero) - 50,
- size: 34,
+ y: 400,
+ size: 46,
font: MONO,
weight: 600,
- z: -80,
+ color: FG,
+ outAt: every.at - from - 4,
}),
- // "every pixel rendered true": standing tall behind the stacks.
+ // "every pixel rendered true": where the figure stood.
sungLine({
id: "speed-true",
- words: lineWords(sung("pixel", from).line),
+ words: lineWords(every.line),
from,
- x: CX - 1200,
- width: 2400,
- y: CY - 610,
+ y: 200,
size: 130,
- color: ACCENT,
- z: 1200,
- outAt: local("watch") - 4,
+ color: FG,
+ colors: [undefined, ACCENT],
+ outAt: watch.at - from - 4,
+ }),
+ sungLine({
+ id: "speed-watch",
+ words: lineWords(watch.line),
+ from,
+ y: 200,
+ size: 170,
+ colors: [undefined, undefined, ACCENT],
+ }),
+ label({
+ id: "speed-caption",
+ text: "same clip · frames rendered per second",
+ x: CX - 700,
+ width: 1400,
+ y: 500,
+ size: 20,
+ inAt: runFrom + BEAT,
+ outAt: watch.at - from - 4,
}),
- ...STACKS.map((s) =>
- caption(`speed-name-${s.fps}`, s.name, s, FLOOR + 40, 24, popFrom + BEAT),
- ),
// The kick lights the room: one reactive accent.
plane("speed-pulse", ACCENT, "multiply").animate(
LayerAnimation.create().signal("opacity", kickPulse(), {
- multiplier: 0.06,
+ multiplier: 0.05,
offset: 0,
}),
),
diff --git a/examples/22_gitframes_launch/src/scenes/type.ts b/examples/22_gitframes_launch/src/scenes/type.ts
index a40d9ec0..85556634 100644
--- a/examples/22_gitframes_launch/src/scenes/type.ts
+++ b/examples/22_gitframes_launch/src/scenes/type.ts
@@ -6,7 +6,9 @@
* "type that moves the way you speak" each word lands on its spoken syllable
* "split it, stagger it, spin it sweet" each verb is the text animator it names
* "every font a different feel" a face per word, FONT flickering through them all
- * "kinetic on every beat" the words slam, then a marquee wall of faces runs
+ * "kinetic on every beat" each word slams into its own row, and the row runs:
+ * a wall of faces sliding against each other
+ * "Step inside the camera" the wall closes into a viewfinder and the lens rushes it
*/
import {
Layer,
@@ -20,6 +22,7 @@ import { bare, lineSpan, lineWords, type SungWord, sung } from "../lyrics.js";
import {
ACCENT,
DISPLAY,
+ EASE_IN,
EASE_OUT,
FG,
GUEST,
@@ -28,6 +31,7 @@ import {
MUTED,
SNAP,
scene,
+ sungLine,
W,
word,
} from "../theme.js";
@@ -389,73 +393,213 @@ function faces(line: number, from: number, until: number) {
];
}
-/** "KINETIC ON EVERY BEAT": each word slams on its syllable in a different face. */
-function kinetic(line: number, from: number, until: number) {
- const words = lineWords(line);
- const faces = [DISPLAY, GUEST.anton, GUEST.dela, GUEST.shade];
- const rows = [CY - 330, CY - 140, CY + 40, CY + 210];
- return words.map((w, i) =>
- word({
- id: `type-kinetic-${i}`,
- text: bare(w).toUpperCase(),
- at: w.at - from,
- outAt: until - from,
- y: rows[i],
- size: i === 0 ? 170 : 130,
- font: faces[i],
- weight: faces[i] === DISPLAY ? 900 : 400,
- color: i === words.length - 1 ? ACCENT : FG,
+const ROWS = 6;
+const ROW_H = H / ROWS;
+/** Each row keeps its own face; the kinetic words land in rows 1–4. */
+const ROW_FACES = [
+ GUEST.fraunces,
+ DISPLAY,
+ GUEST.anton,
+ GUEST.dela,
+ GUEST.shade,
+ GUEST.michroma,
+];
+/** Rough advance of a face's caps, in em: sizes the run of copies a row needs. */
+const CAP_EM = 0.95;
+
+interface Row {
+ text: string;
+ /** Scene frame the centre copy lands (the word is sung). */
+ at: number;
+ /** Scene frame the rest of the row fills in and starts to run. */
+ runAt: number;
+ color: string;
+}
+
+/**
+ * One row of the wall: copies of a word in a line, the centre one exactly
+ * where the word slams in. The copies fill in either side and the row runs,
+ * picking up speed, alternate rows in opposite directions.
+ */
+function row(r: Row, i: number, until: number) {
+ const face = ROW_FACES[i];
+ const size = Math.round(ROW_H * 0.72);
+ const gap = Math.round(size * 0.45);
+ const copyW = r.text.length * CAP_EM * size + gap;
+ const dir = i % 2 ? 1 : -1;
+ const travel = 1700;
+ // Enough copies to cover the screen wherever the row has run to.
+ const side = Math.ceil((W / 2 + travel + copyW) / copyW);
+ const copies = side * 2 + 1;
+ const span = 40000;
+ return Layer.flex({
+ id: `type-row-${i}`,
+ position: "absolute",
+ x: CX - span / 2,
+ y: i * ROW_H,
+ width: span,
+ height: ROW_H,
+ dir: "row",
+ justify: "center",
+ align: "center",
+ gap,
+ children: Array.from({ length: copies }, (_, k) => {
+ const centre = k === side;
+ const anim = centre
+ ? LayerAnimation.create()
+ .fromTo("scale", 1.6, 1, {
+ start: r.at,
+ end: r.at + 9,
+ ease: EASE_OUT,
+ })
+ .fromTo("opacity", 0, 1, {
+ start: r.at,
+ end: r.at + 3,
+ ease: "none",
+ })
+ : LayerAnimation.create().fromTo("opacity", 0, 1, {
+ start: r.runAt + Math.abs(k - side) * 2,
+ end: r.runAt + Math.abs(k - side) * 2 + 4,
+ ease: "none",
+ });
+ return Layer.text(r.text, {
+ id: `type-row-${i}-${k}`,
+ fontFamily: face,
+ fontWeight: face === DISPLAY ? 900 : 400,
+ fontSize: size,
+ fill: centre ? r.color : i % 3 === 1 ? FG : MUTED,
+ anchorX: 0.5,
+ anchorY: 0.5,
+ opacity: 0,
+ }).animate(anim);
}),
+ }).animate(
+ keys("x", [
+ [r.runAt, CX - span / 2],
+ [until, CX - span / 2 + dir * travel, "power2.in"],
+ ]),
);
}
-const MARQUEE = ["GITFRAMES", "KINETIC", "TYPE", "SLUG", "GPU"];
+/**
+ * The viewfinder's corners, drawn round the window the wall shrinks into on
+ * "Step inside the camera".
+ */
+const FRAME_W = 1240;
+const FRAME_H = 700;
+const FRAME_L = CX - FRAME_W / 2;
+const FRAME_T = CY - FRAME_H / 2;
+
+function viewfinder(at: number) {
+ const corner = (id: string, x: number, y: number, rot: number) =>
+ Layer.shape("path", {
+ id,
+ position: "absolute",
+ x,
+ y,
+ width: 120,
+ height: 120,
+ rotation: rot,
+ d: "M 10 110 L 10 10 L 110 10",
+ fillType: "none",
+ strokeColor: ACCENT,
+ strokeWidth: 14,
+ strokeLineCap: "round",
+ } as never).animate(
+ keys("trimEnd", [
+ [0, 0],
+ [at, 0],
+ [at + 12, 1, EASE_OUT],
+ ]),
+ );
+ const l = FRAME_L - 30;
+ const t = FRAME_T - 30;
+ const r = FRAME_L + FRAME_W - 90;
+ const b = FRAME_T + FRAME_H - 90;
+ return [
+ corner("type-vf-tl", l, t, 0),
+ corner("type-vf-tr", r, t, 90),
+ corner("type-vf-br", r, b, 180),
+ corner("type-vf-bl", l, b, 270),
+ ];
+}
-/** The wall: rows of faces scrolling against each other, breathing with the kick. */
-function marquee(at: number, len: number) {
- const rows = FACES.slice(0, 7);
- const rowH = H / rows.length;
+/**
+ * The wall in a window: full frame until "Step", then an overflow-hidden box
+ * closes to the viewfinder (the wall holds still inside it), and on the way
+ * out into the 3D chapter the window rushes the lens.
+ */
+function window2D(
+ children: unknown[],
+ closeAt: number,
+ pushAt: number,
+ end: number,
+) {
+ const outer = LayerAnimation.create();
+ const close = (prop: string, a: number, b: number) =>
+ keys(
+ prop as never,
+ [
+ [closeAt, a],
+ [closeAt + 14, b, EASE_OUT],
+ ],
+ outer,
+ );
+ close("x", 0, FRAME_L);
+ close("y", 0, FRAME_T);
+ close("width", W, FRAME_W);
+ close("height", H, FRAME_H);
+ close("borderRadius", 0, 36);
+ const inner = LayerAnimation.create();
+ keys(
+ "x",
+ [
+ [closeAt, 0],
+ [closeAt + 14, -FRAME_L, EASE_OUT],
+ ],
+ inner,
+ );
+ keys(
+ "y",
+ [
+ [closeAt, 0],
+ [closeAt + 14, -FRAME_T, EASE_OUT],
+ ],
+ inner,
+ );
return Layer.box({
- id: "type-wall",
+ id: "type-lens",
position: "absolute",
x: 0,
y: 0,
width: W,
height: H,
- startFrame: at,
- durationFrames: len,
- children: rows.map((face, i) =>
- Layer.text(`${MARQUEE.join(" · ")} · `.repeat(3), {
- id: `type-wall-${i}`,
+ children: [
+ Layer.box({
+ id: "type-window",
position: "absolute",
x: 0,
- y: i * rowH,
+ y: 0,
width: W,
- height: rowH,
- fontFamily: face,
- fontSize: rowH * 0.62,
- fill: i % 3 === 1 ? ACCENT : FG,
- verticalAlign: "middle",
- marquee: {
- direction: i % 2 ? "right" : "left",
- velocity: 700 + i * 90,
- loop: true,
- repeatGap: 60,
- },
- } as never).animate(
- LayerAnimation.create()
- .fromTo("opacity", 0, 1, {
- start: i * 2,
- end: i * 2 + 6,
- ease: "none",
- })
- .signal("scale", kickPulse(), { multiplier: 0.05, offset: 1 }),
- ),
- ),
+ height: H,
+ overflow: "hidden",
+ children: [
+ Layer.box({
+ id: "type-window-hold",
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: W,
+ height: H,
+ children: children as never,
+ }).animate(inner),
+ ],
+ } as never).animate(outer),
+ ],
}).animate(
- keys("rotation", [
- [0, -8],
- [len, -4, "sine.inOut"],
+ keys("scale", [
+ [pushAt, 1],
+ [end, 3.2, EASE_IN],
]),
);
}
@@ -476,8 +620,24 @@ export function typeScene() {
const faceLine = verbLine + 1;
const face = lineSpan(faceLine);
const kineticLine = faceLine + 1;
- const kin = lineSpan(kineticLine);
- const wallAt = kin.end + 4;
+ const kin = lineWords(kineticLine);
+ const kinEnd = lineSpan(kineticLine).end;
+ // "Step inside the camera" is the wall's last line: the 3D chapter starts on "fly".
+ const stepWords = lineWords(kineticLine + 1);
+ const step = stepWords[0];
+ const theCam = sung("the", step.at);
+ const local = (f: number) => f - from;
+ const fill = local(kinEnd) + 2;
+ const rows: Row[] = [
+ { text: "gitframes", at: fill, runAt: fill, color: MUTED },
+ ...kin.map((w, i) => ({
+ text: bare(w).toUpperCase(),
+ at: local(w.at),
+ runAt: local(w.at) + BEAT / 2,
+ color: i === kin.length - 1 ? ACCENT : FG,
+ })),
+ { text: "TYPE", at: fill + 4, runAt: fill + 4, color: MUTED },
+ ];
const group = (
id: string,
@@ -534,10 +694,50 @@ export function typeScene() {
group(
"type-faces-group",
face.at - 2,
- kin.at - 2,
- faces(faceLine, face.at - 2, kin.at - 2),
+ kin[0].at - 2,
+ faces(faceLine, face.at - 2, kin[0].at - 2),
),
- ...kinetic(kineticLine, from, wallAt),
- marquee(wallAt - from, to - wallAt),
+ window2D(
+ [
+ Layer.box({
+ id: "type-wall",
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: W,
+ height: H,
+ children: rows.map((r, i) => row(r, i, to - from)),
+ }).animate(
+ LayerAnimation.create().signal("scale", kickPulse(), {
+ multiplier: 0.04,
+ offset: 1,
+ }),
+ ),
+ ],
+ step.at - from,
+ to - from - 12,
+ to - from,
+ ),
+ ...viewfinder(step.at - from),
+ sungLine({
+ id: "type-step",
+ words: stepWords.filter((w) => w.at < theCam.at),
+ from,
+ y: 40,
+ size: 96,
+ weight: 300,
+ enter: "rise",
+ outAt: to - from - 12,
+ }),
+ sungLine({
+ id: "type-camera",
+ words: stepWords.filter((w) => w.at >= theCam.at),
+ from,
+ y: FRAME_T + FRAME_H + 30,
+ size: 110,
+ color: ACCENT,
+ enter: "rise",
+ outAt: to - from - 12,
+ }),
]);
}
diff --git a/examples/22_gitframes_launch/src/scenes/vfx.ts b/examples/22_gitframes_launch/src/scenes/vfx.ts
index c4275a6e..f75048c9 100644
--- a/examples/22_gitframes_launch/src/scenes/vfx.ts
+++ b/examples/22_gitframes_launch/src/scenes/vfx.ts
@@ -1,19 +1,18 @@
/**
* "Frame by frame, shader by shader, grade it, grain it, glitch it, make it
- * louder, frame by frame, faster and faster!" The 3D chapter, precomposed
- * (precomp.ts), is the footage; each verb is the effect it names, cut on the
- * syllable. "faster and faster" ends it under an accelerating camera.
+ * louder, frame by frame, faster and faster!" The composite the last chapter
+ * built (backdrop, keyed camera, light leak, paper), precomposed (precomp.ts),
+ * is the footage; each verb is the effect it names, cut on the syllable.
+ * "faster and faster" ends it on three strips of it accelerating to a blur.
*/
import {
Blur,
- CameraAnimation,
ColorBalance,
Curves,
FilmGrain,
GradientMap,
HalftoneScreen,
Layer,
- Layer3D,
LayerAnimation,
Signal,
TileOffset,
@@ -38,7 +37,7 @@ import {
word,
} from "../theme.js";
import { CH } from "../timeline.js";
-import { meshFile } from "../warp/meshes.js";
+import { PLATE_FRAMES } from "./comp.js";
type Clip = ReturnType<typeof Layer.video>;
interface Frame {
@@ -50,8 +49,8 @@ interface Frame {
const FULL: Frame = { x: 0, y: 0, w: W, h: H };
-/** The plate is the 3D chapter (precomp.ts); a shot's in-point is a fraction of it. */
-const PLATE_SEC = (bar(CH.warp) - bar(CH.world)) / FPS;
+/** The plate is the composite (precomp.ts); a shot's in-point is a fraction of it. */
+const PLATE_SEC = PLATE_FRAMES / FPS;
const into = (fraction: number) =>
Number((fraction * (PLATE_SEC - 1.4)).toFixed(3));
@@ -457,85 +456,71 @@ function wall(words: SungWord[], sceneFrom: number, at: number, len: number) {
]);
}
-/** "faster and faster": a knot winding on the bass under a camera that keeps accelerating round it. */
+/**
+ * "faster and faster": two strips of graded footage running against each
+ * other, accelerating to a blur, the words on the paper between them.
+ */
function fasterShot(
words: SungWord[],
sceneFrom: number,
at: number,
len: number,
) {
- const cam = CameraAnimation.camera().orbit({
- azimuth: { from: 0, to: 540 },
- elevation: { from: 6, to: 20 },
- radius: { from: 1700, to: 1250 },
- start: 0,
- end: len,
- ease: "expo.in",
+ const tile = { w: 440, h: 248 };
+ const gap = 24;
+ const count = 7;
+ const rowW = count * (tile.w + gap);
+ const margin = 70;
+ const passes = [grade, halftone];
+ const rows = passes.map((fx, r) => {
+ const dir = r % 2 ? 1 : -1;
+ const start = dir < 0 ? 0 : W - rowW;
+ return Layer.box({
+ id: `vfx-faster-row-${r}`,
+ position: "absolute",
+ x: 0,
+ y: r === 0 ? margin : H - margin - tile.h,
+ width: rowW,
+ height: tile.h,
+ children: Array.from({ length: count }, (_, i) =>
+ Layer.box({
+ id: `vfx-faster-${r}-${i}`,
+ position: "absolute",
+ x: i * (tile.w + gap),
+ y: 0,
+ width: tile.w,
+ height: tile.h,
+ borderRadius: 10,
+ overflow: "hidden",
+ children: [
+ fx(
+ plate(`vfx-faster-plate-${r}-${i}`, into(((i * 3 + r) % 8) / 8), {
+ x: 0,
+ y: 0,
+ w: tile.w,
+ h: tile.h,
+ }),
+ ),
+ ],
+ }),
+ ),
+ }).animate(
+ keys("x", [
+ [0, start],
+ [len, start + dir * (rowW - W), "expo.in"],
+ ]),
+ );
});
return shot("vfx-faster", at, at + len, [
- Layer.camera({
- id: "vfx-faster-cam",
- targetX: W / 2,
- targetY: H / 2,
- targetZ: 0,
- animation: cam,
- } as never),
- Layer.directionalLight({
- id: "vfx-faster-key",
- color: "#FFFFFF",
- intensity: 1,
- direction: [-0.4, 0.5, 1],
- } as never),
- Layer.ambientLight({
- id: "vfx-faster-fill",
- color: "#FFFFFF",
- intensity: 0.6,
- } as never),
- Layer3D.grid({
- id: "vfx-faster-floor",
- width: 6000,
- height: 6000,
- divisions: 40,
- lineWidth: 4,
- color: ACCENT,
- x: W / 2,
- y: H / 2 + 430,
- z: 0,
- opacity: 0.5,
- }),
- Layer3D.obj(meshFile("knot"), {
- id: "vfx-faster-knot",
- x: W / 2,
- y: H / 2,
- z: 0,
- color: ACCENT,
- material: "lit",
- shininess: 48,
- } as never)
- .animate(
- LayerAnimation.create().fromTo("rotateX", 10, 70, {
- start: 0,
- end: len,
- ease: "expo.in",
- }),
- )
- .deformWithAudio({
- audioTrackId: asset("song.mp3"),
- mode: "twist",
- frequencyRange: [20, 120],
- amplitudeMultiplier: 2.2,
- }),
+ ...rows,
...words.map((w, i) =>
- word({
- id: `vfx-faster-word-${i}`,
- text: bare(w).toUpperCase(),
- at: w.at - sceneFrom - at,
- outAt: i < words.length - 1 ? words[i + 1].at - sceneFrom - at : len,
- y: i === 1 ? H / 2 - 80 : i === 0 ? 120 : H - 330,
- size: i === 1 ? 110 : 210,
- weight: i === 1 ? 300 : 900,
- color: i === 2 ? ACCENT : FG,
- }),
+ shout(
+ `vfx-faster-word-${i}`,
+ bare(w).toUpperCase(),
+ w.at - sceneFrom - at,
+ i < words.length - 1 ? words[i + 1].at - sceneFrom - at : len + 4,
+ i === 2 ? ACCENT : FG,
+ ),
),
]);
}
diff --git a/examples/22_gitframes_launch/src/scenes/warp.ts b/examples/22_gitframes_launch/src/scenes/warp.ts
index ae5a4ccf..37e3b343 100644
--- a/examples/22_gitframes_launch/src/scenes/warp.ts
+++ b/examples/22_gitframes_launch/src/scenes/warp.ts
@@ -7,7 +7,7 @@
* warp … bass its vertices push out along their normals with the 20–120 Hz band
* ripple concentric waves run across a torus, struck by the drums
* twist a column winds about its axis on the bass
- * fold the space the floor folds up around it
+ * fold the space the camera cranes over the winding column
* every frame … a new shape on every beat, pulsing from the centre
*/
import { CameraAnimation, Layer, Layer3D, LayerAnimation } from "gitframes";
@@ -21,10 +21,8 @@ import {
EASE_OUT,
FG,
flashes,
- GRID,
H,
keys,
- label,
plane,
SNAP,
scene,
@@ -36,7 +34,6 @@ import { type MeshName, meshFile } from "../warp/meshes.js";
const CX = W / 2;
const CY = H / 2 - 40;
-const FLOOR_Y = CY + 380;
const SONG = asset("song.mp3");
type Mode =
@@ -54,8 +51,6 @@ interface Take {
amp: number;
color: string;
rotateX?: number;
- /** Shown bottom left: the deformer's name. */
- chip: string;
}
/** One mesh under one deformer, on screen over [at, until) of the scene, turning slowly. */
@@ -91,29 +86,6 @@ function warped(t: Take, i: number) {
});
}
-/** The floor in two halves hinged at the stage: "fold the space" closes them up like a book. */
-function floor(foldAt: number) {
- const half = (side: number) =>
- Layer3D.grid({
- id: `warp-floor-${side < 0 ? "l" : "r"}`,
- width: 3000,
- height: 6000,
- divisions: 30,
- lineWidth: 4,
- color: GRID,
- x: CX + side * 1500,
- y: FLOOR_Y,
- z: 0,
- }).animate(
- keys("rotateZ", [
- [0, 0],
- [foldAt, 0],
- [foldAt + 22, side * -70, EASE_OUT],
- ]),
- );
- return [half(-1), half(1)];
-}
-
export function warpScene() {
const from = bar(CH.warp);
const to = bar(CH.code);
@@ -147,7 +119,6 @@ export function warpScene() {
amp: 1.4,
color: k % 2 ? FG : ACCENT,
rotateX: 20,
- chip: "deformWithAudio · radial_pulse",
});
const takes: Take[] = [
{
@@ -157,7 +128,6 @@ export function warpScene() {
until: local(warp),
amp: 2.2,
color: ACCENT,
- chip: "deformWithAudio · harmonic_wave",
},
{
mesh: "sphere",
@@ -166,7 +136,6 @@ export function warpScene() {
until: local(ripple),
amp: 2.6,
color: ACCENT,
- chip: "deformWithAudio · normal_extrusion · 20–120 Hz",
},
{
mesh: "torus",
@@ -176,7 +145,6 @@ export function warpScene() {
amp: 2,
color: FG,
rotateX: -62,
- chip: "deformWithAudio · ripple",
},
{
mesh: "column",
@@ -185,7 +153,6 @@ export function warpScene() {
until: local(every),
amp: 1.6,
color: ACCENT,
- chip: "deformWithAudio · twist",
},
...shapeTakes,
];
@@ -207,7 +174,7 @@ export function warpScene() {
end: local(fold),
ease: "sine.inOut",
})
- // "fold the space": crane up as the floor closes around the column.
+ // "fold the space": crane over the column as it winds.
.orbit({
azimuth: { from: -10, to: 20 },
elevation: { from: 30, to: 8 },
@@ -243,7 +210,6 @@ export function warpScene() {
color: "#FFFFFF",
intensity: 0.5,
} as never),
- ...floor(local(fold)),
// "Drop a mesh": the first one falls onto the stage.
Layer.box({
id: "warp-drop",
@@ -276,22 +242,6 @@ export function warpScene() {
outAt: lineEnds[i] - 4 < len - 6 ? lineEnds[i] - 4 : undefined,
}),
),
- ...takes
- .filter((t, i) => i === 0 || t.chip !== takes[i - 1]?.chip)
- .map((t, i, list) =>
- label({
- id: `warp-chip-${i}`,
- text: t.chip,
- x: 90,
- width: 1000,
- align: "start",
- y: 80,
- size: 20,
- color: FG,
- inAt: t.at + 4,
- outAt: list[i + 1] ? list[i + 1].at - 2 : undefined,
- }),
- ),
],
{ background: BG },
);
diff --git a/examples/22_gitframes_launch/src/scenes/world.ts b/examples/22_gitframes_launch/src/scenes/world.ts
index a3cbcf80..d40b4455 100644
--- a/examples/22_gitframes_launch/src/scenes/world.ts
+++ b/examples/22_gitframes_launch/src/scenes/world.ts
@@ -1,6 +1,7 @@
/**
* The 3D verse: one camera move through one world, every waypoint on a sung word.
- * "Step inside the camera" the lens pushes through a giant viewfinder
+ * ("Step inside the camera" closes the type chapter: its wall shrinks into a
+ * viewfinder and the lens rushes it; this chapter opens mid-flight.)
* "fly the third dimension" a banking flight past words standing in depth
* "paths and planes in motion" curves draw themselves across the floor, planes rise and turn
* "cubes in every direction" a cluster of cubes bursts outward on "direction"
@@ -19,11 +20,9 @@ import {
EASE_IN_OUT,
EASE_OUT,
FG,
- GRID,
H,
type Key,
keys,
- MONO,
SNAP,
SURFACE,
scene,
@@ -135,115 +134,6 @@ function standing(s: Standing) {
);
}
-// ── 1. The viewfinder ────────────────────────────────────────────────────────
-const FRAME_W = 1240;
-const FRAME_H = 700;
-
-function viewfinder(
- steps: SungWord[],
- cams: SungWord[],
- from: number,
- lyrics: boolean,
-) {
- const stepAt = steps[0].at - from;
- const corner = (id: string, x: number, y: number, rot: number) =>
- Layer.shape("path", {
- id,
- is3D: true,
- position: "absolute",
- x,
- y,
- z: 0,
- width: 120,
- height: 120,
- rotateZ: rot,
- d: "M 10 110 L 10 10 L 110 10",
- fillType: "none",
- strokeColor: ACCENT,
- strokeWidth: 14,
- strokeLineCap: "round",
- startFrame: stepAt - 6,
- } as never).animate(
- keys("trimEnd", [
- [0, 0],
- [12, 1, EASE_OUT],
- ]),
- );
- const l = CX - FRAME_W / 2;
- const t = CY - FRAME_H / 2;
- return [
- corner("world-c-tl", l - 20, t - 20, 0),
- corner("world-c-tr", l + FRAME_W - 100, t - 20, 90),
- corner("world-c-br", l + FRAME_W - 100, t + FRAME_H - 100, 180),
- corner("world-c-bl", l - 20, t + FRAME_H - 100, 270),
- Layer.shape("ellipse", {
- id: "world-rec",
- is3D: true,
- position: "absolute",
- x: l + 50,
- y: t + 46,
- z: 0,
- width: 26,
- height: 26,
- fillColor: ACCENT,
- startFrame: stepAt,
- } as never).animate(
- keys("opacity", [
- [0, 1],
- [10, 0, "hold"],
- [20, 1, "hold"],
- [30, 0, "hold"],
- [40, 1, "hold"],
- ]),
- ),
- Layer.text("REC · 60 FPS · 1920×1080", {
- id: "world-rec-label",
- is3D: true,
- position: "absolute",
- x: l + 90,
- y: t + 40,
- z: 0,
- width: 700,
- fontFamily: MONO,
- fontSize: 26,
- fontWeight: 600,
- letterSpacing: 6,
- fill: FG,
- startFrame: stepAt,
- } as never),
- ...lyric(
- lyrics,
- sungLine({
- id: "world-step",
- words: steps,
- from,
- x: CX - 900,
- width: 1800,
- y: CY - 140,
- size: 120,
- weight: 300,
- enter: "rise",
- z: 0,
- }),
- ),
- ...lyric(
- lyrics,
- sungLine({
- id: "world-camera",
- words: cams,
- from,
- x: CX - 900,
- width: 1800,
- y: CY + 10,
- size: 150,
- color: ACCENT,
- enter: "rise",
- z: 0,
- }),
- ),
- ];
-}
-
// ── 3. Paths and planes ──────────────────────────────────────────────────────
const PATHS_Z = 5200;
@@ -320,13 +210,7 @@ const CUBES_Z = 6900;
const RING_Z = 9300;
const DEPTH_Z = 13000;
-function depth(
- probeAt: number,
- lightAt: number,
- depthAt: number,
- len: number,
- lyrics: boolean,
-) {
+function depth(probeAt: number, lightAt: number, depthAt: number, len: number) {
return [
// What the dolly flies toward and the light comes up on before DEPTH lands: a glossy probe sphere.
window3D("world-probe-window", probeAt, len - probeAt, [
@@ -341,25 +225,22 @@ function depth(
shininess: 96,
} as never),
]),
- ...lyric(
- lyrics,
- window3D("world-depth-window", depthAt, len - depthAt, [
- Layer3D.extrudedText({
- id: "world-depth",
- text: "DEPTH",
- fontFamily: DISPLAY,
- fontWeight: 900,
- fontSize: 300,
- fill: ACCENT,
- bevelColor: ACCENT_DEEP,
- depth: 140,
- slices: 28,
- x: CX,
- y: CY + 40,
- z: DEPTH_Z,
- }),
- ]),
- ),
+ window3D("world-depth-window", depthAt, len - depthAt, [
+ Layer3D.extrudedText({
+ id: "world-depth",
+ text: "DEPTH",
+ fontFamily: DISPLAY,
+ fontWeight: 900,
+ fontSize: 300,
+ fill: ACCENT,
+ bevelColor: ACCENT_DEEP,
+ depth: 140,
+ slices: 28,
+ x: CX,
+ y: CY + 40,
+ z: DEPTH_Z,
+ }),
+ ]),
Layer.pointLight({
id: "world-sweep",
color: "#FFFFFF",
@@ -433,7 +314,7 @@ function carousel(at: number, len: number) {
return window3D("world-carousel-window", at, len - at, [ring]);
}
-/** Seeded cubes hanging in the air between the viewfinder and the flight words. */
+/** Seeded cubes hanging in the air the flight opens through. */
function cubeField(count: number) {
let seed = 7;
const rand = () => {
@@ -565,24 +446,13 @@ function orbitShots(
});
}
-/** Lyric layers, left out when the scene is rendered as footage (precomp.ts). */
-const lyric = <T>(on: boolean, node: T): T[] => (on ? [node] : []);
-
-export interface WorldOptions {
- /** The sung words standing in the world; off for the chorus footage, which must not replay them. */
- lyrics?: boolean;
-}
-
-export function worldScene(o: WorldOptions = {}) {
- const lyrics = o.lyrics ?? true;
+export function worldScene() {
const from = bar(CH.world);
const to = bar(CH.warp);
const len = to - from;
const at = (w: SungWord) => w.at - from;
- const step = sung("step", from - BEAT);
- const cameraW = sung("camera", step.at);
- const fly = sung("fly", cameraW.at);
+ const fly = sung("fly", from - BEAT);
const theThird = sung("the", fly.at);
const third = sung("third", fly.at);
const dimension = sung("dimension", fly.at);
@@ -596,22 +466,15 @@ export function worldScene(o: WorldOptions = {}) {
const through = sung("through", dolly.at);
const light = sung("light", through.at);
const depthW = sung("depth", light.at);
- const stepLine = lineWords(step.line);
const cam = camera([
- { f: 0, eye: [CX, CY, -2400], at: [CX, CY, 0] },
- {
- f: at(cameraW) - 4,
- eye: [CX, CY, -1300],
- at: [CX, CY, 0],
- ease: "sine.inOut",
- },
- // Through the viewfinder and on through the cubes.
+ // Already moving: in through the cubes hanging at the threshold.
+ { f: 0, eye: [CX, CY - 40, -900], at: [CX - 100, CY - 40, 2000] },
{
- f: at(fly) - 4,
+ f: Math.max(at(fly) + 6, 10),
eye: [CX, CY - 40, 600],
at: [CX - 100, CY - 40, 2000],
- ease: EASE_IN_OUT,
+ ease: "none",
},
// The flight: bank past FLY and THE THIRD, level onto DIMENSION.
{
@@ -736,7 +599,7 @@ export function worldScene(o: WorldOptions = {}) {
id: "world-cam",
x: CX,
y: CY,
- z: -2400,
+ z: -900,
targetX: CX,
targetY: CY,
targetZ: 0,
@@ -753,86 +616,57 @@ export function worldScene(o: WorldOptions = {}) {
color: "#FFFFFF",
intensity: 0.55,
} as never),
- Layer3D.grid({
- id: "world-floor",
- width: 9000,
- height: 18000,
- divisions: 72,
- lineWidth: 4,
- color: GRID,
- x: CX,
- y: FLOOR,
- z: 6500,
- }),
- ...viewfinder(
- stepLine.filter((w) => w.at < sung("the", step.at).at),
- stepLine.filter((w) => w.at >= sung("the", step.at).at),
- from,
- lyrics,
- ),
...cubeField(22),
- ...(lyrics ? flight.map(standing) : []),
+ ...flight.map(standing),
...floorCurves(at(paths)),
...risingPlanes(at(planes)),
- ...lyric(
- lyrics,
- standing({
- id: "world-motion",
- text: "MOTION",
- at: at(motion),
- until: at(cubes),
- x: CX,
- y: FLOOR - 640,
- z: PATHS_Z + 400,
- size: 200,
- color: ACCENT,
- }),
- ),
+ standing({
+ id: "world-motion",
+ text: "MOTION",
+ at: at(motion),
+ until: at(cubes),
+ x: CX,
+ y: FLOOR - 640,
+ z: PATHS_Z + 400,
+ size: 200,
+ color: ACCENT,
+ }),
...cubeBurst(at(cubes), at(direction)),
- ...lyric(
- lyrics,
- sungLine({
- id: "world-cubes",
- words: lineWords(cubes.line),
- from,
- x: CX - 1300,
- width: 2600,
- y: CY - 420,
- size: 130,
- outAt: at(orbit) - 4,
- z: CUBES_Z + 400,
- }),
- ),
+ sungLine({
+ id: "world-cubes",
+ words: lineWords(cubes.line),
+ from,
+ x: CX - 1300,
+ width: 2600,
+ y: CY - 420,
+ size: 130,
+ outAt: at(orbit) - 4,
+ z: CUBES_Z + 400,
+ }),
carousel(at(orbit) - 10, len),
- ...lyric(
- lyrics,
- sungLine({
- id: "world-orbit",
- words: lineWords(orbit.line),
- from,
- x: CX - 1300,
- width: 2600,
- y: CY - 520,
- size: 120,
- weight: 300,
- outAt: at(light) - 4,
- z: RING_Z,
- }),
- ),
- ...lyric(
- lyrics,
- sungLine({
- id: "world-light",
- words: lineWords(light.line).filter((w) => w !== depthW),
- from,
- x: CX - 1200,
- width: 2400,
- y: CY - 330,
- size: 110,
- weight: 300,
- z: DEPTH_Z - 150,
- }),
- ),
- ...depth(at(through), at(light), at(depthW), len, lyrics),
+ sungLine({
+ id: "world-orbit",
+ words: lineWords(orbit.line),
+ from,
+ x: CX - 1300,
+ width: 2600,
+ y: CY - 520,
+ size: 120,
+ weight: 300,
+ outAt: at(light) - 4,
+ z: RING_Z,
+ }),
+ sungLine({
+ id: "world-light",
+ words: lineWords(light.line).filter((w) => w !== depthW),
+ from,
+ x: CX - 1200,
+ width: 2400,
+ y: CY - 330,
+ size: 110,
+ weight: 300,
+ z: DEPTH_Z - 150,
+ }),
+ ...depth(at(through), at(light), at(depthW), len),
]);
}
diff --git a/examples/22_gitframes_launch/src/theme.ts b/examples/22_gitframes_launch/src/theme.ts
index 1015c7dc..13911e64 100644
--- a/examples/22_gitframes_launch/src/theme.ts
+++ b/examples/22_gitframes_launch/src/theme.ts
@@ -8,7 +8,7 @@ import path from "node:path";
import { FontManager, Layer, LayerAnimation, TextAnimator } from "gitframes";
import { FPS } from "./grid.js";
import { bare, type SungWord } from "./lyrics.js";
-import { ASSETS } from "./paths.js";
+import { ASSETS, ROOT } from "./paths.js";
export const W = 1920;
export const H = 1080;
@@ -21,7 +21,6 @@ export const SURFACE = "#E4E0D8";
export const MUTED = "#7C786F";
export const ACCENT = "#2B44FF";
export const ACCENT_DEEP = "#1A2BB0";
-export const GRID = "#CFCAC0";
export const HAIRLINE = "rgba(18,18,22,0.14)";
/** The green screen behind the generated subject (images.ts), keyed out by ColorKey. */
export const KEY_GREEN = "#00FF00";
@@ -367,3 +366,42 @@ export function window3D(
children: children as never,
} as never);
}
+
+/** The gitframes logo (the repo's brand mark): a viewfinder round a play head. */
+export const LOGO = path.join(ROOT, "assets", "brand", "logo.png");
+
+export interface LogoOptions {
+ id: string;
+ size: number;
+ /** Centre of the mark. */
+ x: number;
+ y: number;
+ /** Stand the mark in the 3D scene at this depth. */
+ z?: number;
+ startFrame?: number;
+}
+
+/** The logo as a square layer centred on (x, y), flat or standing in 3D. */
+export function logoMark(o: LogoOptions): Node {
+ return Layer.box({
+ id: o.id,
+ position: "absolute",
+ x: o.x - o.size / 2,
+ y: o.y - o.size / 2,
+ width: o.size,
+ height: o.size,
+ ...(o.z !== undefined ? { is3D: true, z: o.z } : {}),
+ startFrame: o.startFrame,
+ children: [
+ Layer.image(LOGO, {
+ id: `${o.id}-image`,
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: o.size,
+ height: o.size,
+ fit: "contain",
+ }),
+ ],
+ } as never);
+}
diff --git a/nodes/node-compositor/SKILL.md b/nodes/node-compositor/SKILL.md
index 81e3a163..cd924912 100644
--- a/nodes/node-compositor/SKILL.md
+++ b/nodes/node-compositor/SKILL.md
@@ -109,7 +109,7 @@ Container styles (flex/block/box with children):
Per-kind fields:
- **`box`**: `background` (CSS color, also accepts gradients), `borderRadius` (number), `padding`. A `box` with children behaves like a column container.
-- **`text`**: `text` (string), `fontSize`, `fontFamily`, `fontWeight`, `fontStyle`, `fill` (text color), `align`, `verticalAlign`, `lineHeight`, `letterSpacing`, `textShadow`, `shadows`, `background` (rounded text box fill), `borderRadius`, `padding`.
+- **`text`**: `text` (string), `fontSize`, `fontFamily`, `fontWeight`, `fontStyle`, `fill` (text color), `align`, `verticalAlign` (`top` default | `middle` | `bottom`: places the text block in a `height` taller than it; ignored for path text), `lineHeight`, `letterSpacing`, `textShadow`, `shadows`, `background` (rounded text box fill), `borderRadius`, `padding`.
- **Kinetic Typography Animators (`animators`)**: Array of text animators applied sequentially at the Slug GPU glyph instancing stage:
- `id` (string): Unique animator identifier.
- `unit` (`"character"` | `"word"` | `"line"`, default `"character"`): Granularity of text breakdown.
diff --git a/packages/compositions/src/compositions/canvas-composition.tsx b/packages/compositions/src/compositions/canvas-composition.tsx
index 58a5de2f..fd6ab4f1 100644
--- a/packages/compositions/src/compositions/canvas-composition.tsx
+++ b/packages/compositions/src/compositions/canvas-composition.tsx
@@ -477,6 +477,7 @@ export async function drawCompositionTree(
height: opText.height ? Number(opText.height) : undefined,
lineHeight: Number(opText.lineHeight ?? 1.2),
align: opText.align,
+ verticalAlign: opText.verticalAlign,
fontWeight: opText.fontWeight,
fontStyle: opText.fontStyle,
letterSpacing: opText.letterSpacing,
@@ -628,6 +629,7 @@ export async function drawCompositionTree(
height: opText.height ? Number(opText.height) : undefined,
lineHeight: Number(opText.lineHeight ?? 1.2),
align: opText.align,
+ verticalAlign: opText.verticalAlign,
fontWeight: opText.fontWeight,
fontStyle: opText.fontStyle,
letterSpacing: opText.letterSpacing,
diff --git a/packages/gitframes/src/text-vertical-align.test.ts b/packages/gitframes/src/text-vertical-align.test.ts
new file mode 100644
index 00000000..e23ec763
--- /dev/null
+++ b/packages/gitframes/src/text-vertical-align.test.ts
@@ -0,0 +1,71 @@
+/**
+ * verticalAlign places a text block inside a box taller than the text:
+ * "middle" centres its line box, "bottom" sits it on the floor, "top" (the
+ * default) keeps it at the top. It used to be ignored, so text asked to be
+ * centred in a pill sat at the pill's top.
+ */
+import { Canvas, loadImage } from "skia-canvas";
+import { describe, expect, it } from "vitest";
+import { Composition, FontManager, Layer } from "./index.js";
+
+const W = 400;
+const BOX = 400;
+const FONT = 60;
+
+/** The vertical centre of the ink (dark pixels) in a rendered frame. */
+async function inkCentreY(png: Buffer): Promise<number> {
+ const img = await loadImage(png);
+ const canvas = new Canvas(img.width, img.height);
+ const ctx = canvas.getContext("2d");
+ ctx.drawImage(img, 0, 0);
+ const data = ctx.getImageData(0, 0, img.width, img.height).data;
+ let top = -1;
+ let bottom = -1;
+ for (let y = 0; y < img.height; y++)
+ for (let x = 0; x < img.width; x++)
+ if ((data[(y * img.width + x) * 4] ?? 255) < 128) {
+ if (top < 0) top = y;
+ bottom = y;
+ break;
+ }
+ return (top + bottom) / 2;
+}
+
+async function render(verticalAlign?: "top" | "middle" | "bottom") {
+ await FontManager.register("assets/fonts/Inter.ttf");
+ const comp = new Composition({
+ width: W,
+ height: BOX,
+ fps: 30,
+ durationFrames: 1,
+ backgroundColor: "#ffffff",
+ });
+ comp.add(
+ Layer.text("HH", {
+ id: "t",
+ position: "absolute",
+ x: 0,
+ y: 0,
+ width: W,
+ height: BOX,
+ fontFamily: "Inter",
+ fontWeight: 700,
+ fontSize: FONT,
+ fill: "#000000",
+ align: "center",
+ verticalAlign,
+ }),
+ );
+ return inkCentreY(await comp.renderFrame({ frame: 0 }));
+}
+
+describe("text verticalAlign", () => {
+ it("centres, bottoms and tops the text block in its box", async () => {
+ const top = await render();
+ const middle = await render("middle");
+ const bottom = await render("bottom");
+ expect(top).toBeLessThan(FONT);
+ expect(Math.abs(middle - BOX / 2)).toBeLessThan(FONT * 0.25);
+ expect(bottom).toBeGreaterThan(BOX - FONT);
+ });
+});
diff --git a/packages/webgpu-renderers/src/nodes/audio-signal-extractor.ts b/packages/webgpu-renderers/src/nodes/audio-signal-extractor.ts
index 370aa708..09137f5e 100644
--- a/packages/webgpu-renderers/src/nodes/audio-signal-extractor.ts
+++ b/packages/webgpu-renderers/src/nodes/audio-signal-extractor.ts
@@ -135,7 +135,8 @@ export async function drawAudioSignalExtractorNode(
props: AudioSignalExtractorNodeProps,
): Promise<void> {
const config = props.signalConfig as Record<string, unknown> | undefined;
- const nodeId = props.nodeId ?? (config?.nodeId as string) ?? "audio-extractor";
+ const nodeId =
+ props.nodeId ?? (config?.nodeId as string) ?? "audio-extractor";
const frame = props.frame ?? 0;
const fps = props.fps ?? 24;
const width = props.width ?? 512;
@@ -202,7 +203,9 @@ export async function drawAudioSignalExtractorNode(
const calculatedStats =
signalRegistry.getStats(nodeId) ??
- (config?.nodeId ? signalRegistry.getStats(config.nodeId as string) : undefined);
+ (config?.nodeId
+ ? signalRegistry.getStats(config.nodeId as string)
+ : undefined);
const minVal = calculatedStats?.min ?? 0.0;
const maxVal = calculatedStats?.max ?? 1.0;
diff --git a/packages/webgpu-renderers/src/nodes/caption.ts b/packages/webgpu-renderers/src/nodes/caption.ts
index b613e876..c54c5902 100644
--- a/packages/webgpu-renderers/src/nodes/caption.ts
+++ b/packages/webgpu-renderers/src/nodes/caption.ts
@@ -197,10 +197,7 @@ class SrtLoaderCache {
}
} else if (src.includes("-->")) {
srtString = src;
- } else if (
- src.startsWith("http://") ||
- src.startsWith("https://")
- ) {
+ } else if (src.startsWith("http://") || src.startsWith("https://")) {
const res = await fetch(src);
if (!res.ok) throw new Error(`Failed to fetch SRT: ${src}`);
srtString = await res.text();
@@ -215,7 +212,9 @@ class SrtLoaderCache {
}
if (typeof process !== "undefined" && process.versions?.node) {
try {
- const fs = await import(/* webpackIgnore: true */ "node:fs/promises");
+ const fs = await import(
+ /* webpackIgnore: true */ "node:fs/promises"
+ );
srtString = await fs.readFile(filePath, "utf-8");
} catch {
const res = await fetch(src);
diff --git a/packages/webgpu-renderers/src/nodes/chart.ts b/packages/webgpu-renderers/src/nodes/chart.ts
index 15916acb..f538f1f7 100644
--- a/packages/webgpu-renderers/src/nodes/chart.ts
+++ b/packages/webgpu-renderers/src/nodes/chart.ts
@@ -102,11 +102,11 @@ export class HeadlessChartCanvasElementMock {
}
if (!this.ctx2d) {
this.ctx2d = {
- save: () => { },
- restore: () => { },
- setTransform: () => { },
- clearRect: () => { },
- fillText: () => { },
+ save: () => {},
+ restore: () => {},
+ setTransform: () => {},
+ clearRect: () => {},
+ fillText: () => {},
measureText: (text: string) => ({ width: text.length * 7 }),
};
}
@@ -142,23 +142,23 @@ export class HeadlessChartCanvasElementMock {
_type: string,
_listener: unknown,
_options?: unknown,
- ): void { }
+ ): void {}
removeEventListener(
_type: string,
_listener: unknown,
_options?: unknown,
- ): void { }
+ ): void {}
- setPointerCapture(_pointerId: number): void { }
+ setPointerCapture(_pointerId: number): void {}
- releasePointerCapture(_pointerId: number): void { }
+ releasePointerCapture(_pointerId: number): void {}
hasPointerCapture(_pointerId: number): boolean {
return false;
}
- remove(): void { }
+ remove(): void {}
}
export class HeadlessChartContainerMock {
@@ -298,8 +298,8 @@ export class ChartGPUEngineBridge {
const originalCreateElement =
typeof doc.createElement === "function"
? (
- doc.createElement as (tag: string, ...args: unknown[]) => unknown
- ).bind(doc)
+ doc.createElement as (tag: string, ...args: unknown[]) => unknown
+ ).bind(doc)
: null;
doc.createElement = (tag: string, ...args: unknown[]) => {
@@ -314,15 +314,15 @@ export class ChartGPUEngineBridge {
const el = originalCreateElement(tag, ...args);
if (el) {
const elObj = el as Record<string, unknown>;
- if (typeof elObj.remove !== "function") elObj.remove = () => { };
+ if (typeof elObj.remove !== "function") elObj.remove = () => {};
if (typeof elObj.addEventListener !== "function")
- elObj.addEventListener = () => { };
+ elObj.addEventListener = () => {};
if (typeof elObj.removeEventListener !== "function")
- elObj.removeEventListener = () => { };
+ elObj.removeEventListener = () => {};
if (!elObj.style) elObj.style = {};
return el;
}
- } catch (_) { }
+ } catch (_) {}
}
return new HeadlessChartCanvasElementMock(this.target);
}
@@ -332,37 +332,37 @@ export class ChartGPUEngineBridge {
const el = originalCreateElement(tag, ...args);
if (el) {
const elObj = el as Record<string, unknown>;
- if (typeof elObj.remove !== "function") elObj.remove = () => { };
+ if (typeof elObj.remove !== "function") elObj.remove = () => {};
if (typeof elObj.addEventListener !== "function")
- elObj.addEventListener = () => { };
+ elObj.addEventListener = () => {};
if (typeof elObj.removeEventListener !== "function")
- elObj.removeEventListener = () => { };
+ elObj.removeEventListener = () => {};
if (!elObj.style) elObj.style = {};
return el;
}
- } catch (_) { }
+ } catch (_) {}
}
return {
style: {},
- appendChild: () => { },
- removeChild: () => { },
- remove: () => { },
- addEventListener: () => { },
- removeEventListener: () => { },
+ appendChild: () => {},
+ removeChild: () => {},
+ remove: () => {},
+ addEventListener: () => {},
+ removeEventListener: () => {},
};
};
if (typeof doc.createElementNS === "undefined") {
doc.createElementNS = (_ns: string, _tag: string) => ({
style: {},
- setAttribute: () => { },
+ setAttribute: () => {},
getAttribute: () => null,
- appendChild: () => { },
- removeChild: () => { },
- remove: () => { },
- addEventListener: () => { },
- removeEventListener: () => { },
+ appendChild: () => {},
+ removeChild: () => {},
+ remove: () => {},
+ addEventListener: () => {},
+ removeEventListener: () => {},
});
}
@@ -525,7 +525,7 @@ export class ChartGPUEngineBridge {
) {
try {
this.target.currentTexture.destroy();
- } catch (_) { }
+ } catch (_) {}
this.ownsTexture = false;
}
this.target.currentTexture = destinationTexture;
@@ -578,7 +578,7 @@ export class ChartGPUEngineBridge {
if (this.ownsTexture && this.target.currentTexture) {
try {
this.target.currentTexture.destroy();
- } catch (_) { }
+ } catch (_) {}
}
}
}
diff --git a/packages/webgpu-renderers/src/nodes/index.ts b/packages/webgpu-renderers/src/nodes/index.ts
index e7051d2b..e047def3 100644
--- a/packages/webgpu-renderers/src/nodes/index.ts
+++ b/packages/webgpu-renderers/src/nodes/index.ts
@@ -10,4 +10,3 @@ export * from "./signal.js";
export * from "./svg.js";
export * from "./types.js";
export * from "./video.js";
-
diff --git a/packages/webgpu-renderers/src/nodes/lottie.ts b/packages/webgpu-renderers/src/nodes/lottie.ts
index ef6acc77..a1c56756 100644
--- a/packages/webgpu-renderers/src/nodes/lottie.ts
+++ b/packages/webgpu-renderers/src/nodes/lottie.ts
@@ -515,7 +515,8 @@ class LottieLoader {
let resolvedSrc = src;
try {
let lottieJson: any = null;
- const isNode = typeof process !== "undefined" && Boolean(process.versions?.node);
+ const isNode =
+ typeof process !== "undefined" && Boolean(process.versions?.node);
if (resolvedSrc.startsWith("data:application/json;base64,")) {
const base64Data = resolvedSrc.split(",")[1];
@@ -524,7 +525,12 @@ class LottieLoader {
} else if (resolvedSrc.startsWith("data:application/json,")) {
const decodeData = decodeURIComponent(resolvedSrc.split(",")[1]);
lottieJson = JSON.parse(decodeData);
- } else if (isNode && (resolvedSrc.startsWith("/") || resolvedSrc.startsWith("file://")) && resolvedSrc.endsWith(".json")) {
+ } else if (
+ isNode &&
+ (resolvedSrc.startsWith("/") ||
+ resolvedSrc.startsWith("file://")) &&
+ resolvedSrc.endsWith(".json")
+ ) {
let filePath = resolvedSrc;
if (filePath.startsWith("file://")) {
try {
@@ -544,7 +550,10 @@ class LottieLoader {
resolvedSrc.startsWith("/")
) {
// Only pre-fetch JSON animations. Binary .lottie zip files pack their own fonts.
- if (resolvedSrc.endsWith(".json") || resolvedSrc.includes("/assets/")) {
+ if (
+ resolvedSrc.endsWith(".json") ||
+ resolvedSrc.includes("/assets/")
+ ) {
const response = await fetch(resolveUrl(resolvedSrc));
if (response.ok) {
lottieJson = await response.json();
@@ -568,7 +577,11 @@ class LottieLoader {
}
// 2. Create the instance and wait for it to be ready.
- const instance = new LottieInstance(resolvedSrc, resolvedWidth, resolvedHeight);
+ const instance = new LottieInstance(
+ resolvedSrc,
+ resolvedWidth,
+ resolvedHeight,
+ );
await instance.ready();
return instance;
diff --git a/packages/webgpu-renderers/src/nodes/paragraph.ts b/packages/webgpu-renderers/src/nodes/paragraph.ts
index 0a1422c6..fc2cc9f8 100644
--- a/packages/webgpu-renderers/src/nodes/paragraph.ts
+++ b/packages/webgpu-renderers/src/nodes/paragraph.ts
@@ -1031,6 +1031,19 @@ export function drawParagraphNode(
pathOptions,
props.spans,
);
+ // verticalAlign places the text block inside a box taller than it (CSS
+ // line-box centring). Path text follows its path; captions place themselves.
+ const vAlign = props.verticalAlign ?? "top";
+ const slack =
+ props.height != null && !pathOptions && !props.isCaption
+ ? props.height - (measured.height + padding * 2)
+ : 0;
+ const textRect = {
+ ...props.dstRect,
+ y:
+ props.dstRect.y +
+ (vAlign === "middle" ? slack / 2 : vAlign === "bottom" ? slack : 0),
+ };
const anim = props.animation;
const isBold =
props.fontWeight === "bold" ||
@@ -1218,7 +1231,7 @@ export function drawParagraphNode(
{
rect: {
x: props.dstRect.x + padding + m.x,
- y: props.dstRect.y + padding + m.y,
+ y: textRect.y + padding + m.y,
width: m.width,
height: m.height,
},
@@ -1522,7 +1535,7 @@ export function drawParagraphNode(
padding +
offsetX +
boldShift;
- biasY = glyph.y + rotatedR0y + props.dstRect.y + padding + offsetY;
+ biasY = glyph.y + rotatedR0y + textRect.y + padding + offsetY;
} else {
biasX =
glyphX +
@@ -1536,7 +1549,7 @@ export function drawParagraphNode(
glyph.y -
cp.bearingY * fontScale +
scaleY +
- props.dstRect.y +
+ textRect.y +
padding +
offsetY;
}
@@ -1902,7 +1915,7 @@ export function drawParagraphNode(
const emojiDstRect = {
x: props.dstRect.x + emoji.x + padding - offsetAdjustment,
- y: props.dstRect.y + emoji.y + padding - offsetAdjustment,
+ y: textRect.y + emoji.y + padding - offsetAdjustment,
width: localEmojiSize,
height: localEmojiSize,
};
@@ -1951,14 +1964,14 @@ export function drawParagraphNode(
const cursorSpacing = cursorCfg.spacing ?? 3.0;
let cursorX = props.dstRect.x + padding;
- let cursorY = props.dstRect.y + padding;
+ let cursorY = textRect.y + padding;
if (layout.glyphs.length > 0) {
const lastG = layout.glyphs[layout.glyphs.length - 1];
const fontScale = fontSize / slugFont.unitsPerEm;
const adv = (lastG.cp?.advanceWidth || 0) * fontScale;
cursorX = lastG.x + props.dstRect.x + padding + adv + cursorSpacing;
- cursorY = lastG.y + props.dstRect.y + padding;
+ cursorY = lastG.y + textRect.y + padding;
}
if (cursorCfg.style === "underscore") {
diff --git a/packages/webgpu-renderers/src/nodes/signal-integration.test.ts b/packages/webgpu-renderers/src/nodes/signal-integration.test.ts
index 70184d44..fbb1f987 100644
--- a/packages/webgpu-renderers/src/nodes/signal-integration.test.ts
+++ b/packages/webgpu-renderers/src/nodes/signal-integration.test.ts
@@ -62,10 +62,7 @@ describe("Signal Node Audio Integration", () => {
return buf;
},
samplerCache: {
- getSampler: (
- d: GPUDevice,
- desc?: GPUSamplerDescriptor,
- ) => {
+ getSampler: (d: GPUDevice, desc?: GPUSamplerDescriptor) => {
return d.createSampler(desc);
},
},
diff --git a/packages/webgpu-renderers/src/nodes/signal.test.ts b/packages/webgpu-renderers/src/nodes/signal.test.ts
index c3dd3903..40d26443 100644
--- a/packages/webgpu-renderers/src/nodes/signal.test.ts
+++ b/packages/webgpu-renderers/src/nodes/signal.test.ts
@@ -10,18 +10,20 @@ import { drawSignalNode } from "./signal.js";
vi.mock("../signals/signal-registry.js", () => {
const mockExtract = vi.fn().mockResolvedValue(undefined);
- const mockEnsure = vi.fn().mockImplementation(async (device, sd, fps, renderId) => {
- if (!sd) return;
- const check = async (s: any) => {
- if (!s || typeof s !== "object") return;
- if (s.sourceUrl && s.nodeId) {
- await mockExtract(device, s.sourceUrl, s, s.nodeId, fps, renderId);
- }
- if (s.signalA) await check(s.signalA);
- if (s.signalB) await check(s.signalB);
- };
- await check(sd);
- });
+ const mockEnsure = vi
+ .fn()
+ .mockImplementation(async (device, sd, fps, renderId) => {
+ if (!sd) return;
+ const check = async (s: any) => {
+ if (!s || typeof s !== "object") return;
+ if (s.sourceUrl && s.nodeId) {
+ await mockExtract(device, s.sourceUrl, s, s.nodeId, fps, renderId);
+ }
+ if (s.signalA) await check(s.signalA);
+ if (s.signalB) await check(s.signalB);
+ };
+ await check(sd);
+ });
return {
signalRegistry: {
diff --git a/packages/webgpu-renderers/src/nodes/signal.ts b/packages/webgpu-renderers/src/nodes/signal.ts
index a035ca8d..d397f7b8 100644
--- a/packages/webgpu-renderers/src/nodes/signal.ts
+++ b/packages/webgpu-renderers/src/nodes/signal.ts
@@ -179,12 +179,13 @@ export async function drawSignalNode(
config.type === "signal_math" ||
Boolean(cfgRecord.operation) ||
cfgRecord.op === "SignalMath";
- const isGateNode =
- config.type === "gate" || cfgRecord.op === "SignalGate";
+ const isGateNode = config.type === "gate" || cfgRecord.op === "SignalGate";
if (durationSec <= 0) {
const mathSigA = cfgRecord.signalA as Record<string, unknown> | undefined;
- const gateSrcSig = cfgRecord.sourceSignal as Record<string, unknown> | undefined;
+ const gateSrcSig = cfgRecord.sourceSignal as
+ | Record<string, unknown>
+ | undefined;
const regDuration =
signalRegistry.getDuration?.(ctx.device, nodeId, props.renderId) ||
(isMathNode && mathSigA?.nodeId
@@ -285,7 +286,9 @@ export async function drawSignalNode(
const calculatedStats =
signalRegistry.getStats?.(nodeId) ??
- (typeof cfgRecord.nodeId === "string" ? signalRegistry.getStats?.(cfgRecord.nodeId as string) : undefined);
+ (typeof cfgRecord.nodeId === "string"
+ ? signalRegistry.getStats?.(cfgRecord.nodeId as string)
+ : undefined);
const minVal: number =
typeof calculatedStats?.min === "number"
? calculatedStats.min
diff --git a/packages/webgpu-renderers/src/nodes/types.ts b/packages/webgpu-renderers/src/nodes/types.ts
index b999794d..fdcd1fb1 100644
--- a/packages/webgpu-renderers/src/nodes/types.ts
+++ b/packages/webgpu-renderers/src/nodes/types.ts
@@ -120,6 +120,8 @@ export interface ParagraphNodeProps {
dstRect: Rect;
width?: number;
height?: number;
+ /** Where the text block sits in a `height` taller than it. Default "top". */
+ verticalAlign?: "top" | "middle" | "bottom";
fontFamily?: string;
fontSize?: number;
color?: string;
@@ -182,7 +184,6 @@ export interface CaptionNodeProps extends Omit<ParagraphNodeProps, "text"> {
fps: number;
maxWidth?: number;
padding?: number;
- verticalAlign?: "top" | "middle" | "bottom";
}
export interface BlurNodeProps {