pixi-effects 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +6 -6
- package/ai/SKILL.md +3 -3
- package/ai/chat-template.html +3 -3
- package/ai/reference/cheatsheet.md +7 -7
- package/ai/reference/pitfalls.md +8 -1
- package/ai/reference/recipes.md +55 -0
- package/ai/template.html +5 -5
- package/ai/tools/check.mjs +15 -4
- package/dist/{Base-wYJQ2g5Q.d.cts → Base-BzlPgd-D.d.cts} +1 -1
- package/dist/{Base-CzfLGoDr.d.ts → Base-gu-5X0Cv.d.ts} +1 -1
- package/dist/Composition-BK5SH6J7.cjs +16 -0
- package/dist/{Composition-LL2XXU5N.cjs.map → Composition-BK5SH6J7.cjs.map} +1 -1
- package/dist/Composition-Q5TVG3HM.js +7 -0
- package/dist/{Composition-6PA4C4TV.js.map → Composition-Q5TVG3HM.js.map} +1 -1
- package/dist/Controller.cjs +2 -2
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/Controller.js +1 -1
- package/dist/{Movie-CBxGH5ms.d.ts → Movie--_TJvdJa.d.ts} +3 -1
- package/dist/{Movie-CzzJw8A-.d.cts → Movie-DMxOoTdW.d.cts} +3 -1
- package/dist/Presenter.cjs +2 -2
- package/dist/Presenter.d.cts +2 -2
- package/dist/Presenter.d.ts +2 -2
- package/dist/Presenter.js +1 -1
- package/dist/blendModes-5E4G2ZZQ.cjs +94 -0
- package/dist/blendModes-5E4G2ZZQ.cjs.map +1 -0
- package/dist/blendModes-HCP5XTNP.js +90 -0
- package/dist/blendModes-HCP5XTNP.js.map +1 -0
- package/dist/chunk-BPTW7L25.cjs +275 -0
- package/dist/chunk-BPTW7L25.cjs.map +1 -0
- package/dist/{chunk-DQHXVNOI.js → chunk-DC4JPY6A.js} +108 -273
- package/dist/chunk-DC4JPY6A.js.map +1 -0
- package/dist/chunk-E7RONUZ7.js +268 -0
- package/dist/chunk-E7RONUZ7.js.map +1 -0
- package/dist/{chunk-NO26HWR7.cjs → chunk-IFZOI3JQ.cjs} +131 -295
- package/dist/chunk-IFZOI3JQ.cjs.map +1 -0
- package/dist/chunk-K4JVI5HK.cjs +143 -0
- package/dist/chunk-K4JVI5HK.cjs.map +1 -0
- package/dist/{chunk-FFYA3UBU.cjs → chunk-MHOO2CVU.cjs} +290 -62
- package/dist/chunk-MHOO2CVU.cjs.map +1 -0
- package/dist/{chunk-MNM56B3X.js → chunk-NHICCDTC.js} +13 -3
- package/dist/chunk-NHICCDTC.js.map +1 -0
- package/dist/{chunk-TSPMKV2F.js → chunk-UQDEDYVM.js} +261 -33
- package/dist/chunk-UQDEDYVM.js.map +1 -0
- package/dist/{chunk-WTRKDIKH.cjs → chunk-UZTKEYFP.cjs} +13 -3
- package/dist/chunk-UZTKEYFP.cjs.map +1 -0
- package/dist/chunk-YEPDQ7I3.js +132 -0
- package/dist/chunk-YEPDQ7I3.js.map +1 -0
- package/dist/index.cjs +72 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/loader.css +1 -1
- package/dist/{music-CFEC7HKL.js → music-FUN7N225.js} +3 -3
- package/dist/{music-CFEC7HKL.js.map → music-FUN7N225.js.map} +1 -1
- package/dist/{music-UAN7DXK4.cjs → music-GEAH2XCT.cjs} +7 -7
- package/dist/{music-UAN7DXK4.cjs.map → music-GEAH2XCT.cjs.map} +1 -1
- package/dist/{sfx-EX4PUBMV.cjs → sfx-2DYTYNYW.cjs} +8 -8
- package/dist/{sfx-EX4PUBMV.cjs.map → sfx-2DYTYNYW.cjs.map} +1 -1
- package/dist/{sfx-U3GM2MED.js → sfx-3IDAJ3UZ.js} +3 -3
- package/dist/{sfx-U3GM2MED.js.map → sfx-3IDAJ3UZ.js.map} +1 -1
- package/dist/three.cjs +7 -6
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +3 -2
- package/dist/three.js.map +1 -1
- package/dist/{types-YmUaViL1.d.cts → types-DBbZVKGS.d.cts} +7 -4
- package/dist/{types-YmUaViL1.d.ts → types-DBbZVKGS.d.ts} +7 -4
- package/docs/dsl.md +82 -3
- package/llms-full.txt +155 -14
- package/package.json +1 -1
- package/dist/Composition-6PA4C4TV.js +0 -5
- package/dist/Composition-LL2XXU5N.cjs +0 -14
- package/dist/chunk-DQHXVNOI.js.map +0 -1
- package/dist/chunk-FFYA3UBU.cjs.map +0 -1
- package/dist/chunk-MNM56B3X.js.map +0 -1
- package/dist/chunk-NO26HWR7.cjs.map +0 -1
- package/dist/chunk-TSPMKV2F.js.map +0 -1
- package/dist/chunk-WTRKDIKH.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkMHOO2CVU_cjs = require('./chunk-MHOO2CVU.cjs');
|
|
4
|
+
var chunkIFZOI3JQ_cjs = require('./chunk-IFZOI3JQ.cjs');
|
|
5
|
+
var chunkK4JVI5HK_cjs = require('./chunk-K4JVI5HK.cjs');
|
|
6
|
+
var chunkBPTW7L25_cjs = require('./chunk-BPTW7L25.cjs');
|
|
7
|
+
var chunkUZTKEYFP_cjs = require('./chunk-UZTKEYFP.cjs');
|
|
6
8
|
var PIXI = require('pixi.js');
|
|
7
9
|
var gsap = require('gsap');
|
|
8
10
|
var PixiPlugin = require('gsap/PixiPlugin');
|
|
@@ -715,7 +717,7 @@ var DEFAULTS = { samples: 8, shutter: 0.5 };
|
|
|
715
717
|
function resolveMotionBlur(spec, where) {
|
|
716
718
|
if (spec === void 0 || spec === null || spec === false) return null;
|
|
717
719
|
const o = spec === true ? {} : typeof spec === "number" ? { samples: spec } : spec;
|
|
718
|
-
if (typeof spec === "object")
|
|
720
|
+
if (typeof spec === "object") chunkUZTKEYFP_cjs.warnUnknownOptions(`${where} motionBlur`, o, ["samples", "shutter"]);
|
|
719
721
|
const samples = o.samples ?? DEFAULTS.samples, shutter = o.shutter ?? DEFAULTS.shutter;
|
|
720
722
|
if (!(Number.isInteger(samples) && samples >= 2 && samples <= 64)) throw new Error(`pixi-effects: ${where}: motionBlur samples must be a whole number from 2 to 64, got ${samples}`);
|
|
721
723
|
if (!(Number.isFinite(shutter) && shutter > 0 && shutter <= 1)) throw new Error(`pixi-effects: ${where}: motionBlur shutter must be a fraction of the frame time above 0 and up to 1 (0.5 is a 180\xB0 shutter), got ${shutter}`);
|
|
@@ -1278,8 +1280,8 @@ function expandTransitions(spec) {
|
|
|
1278
1280
|
}
|
|
1279
1281
|
const transitions = out.transitions;
|
|
1280
1282
|
const sequences = out.sequences ?? [];
|
|
1281
|
-
const remap = out.duration !== void 0 ?
|
|
1282
|
-
const parentDuration = remap ?
|
|
1283
|
+
const remap = out.duration !== void 0 ? chunkIFZOI3JQ_cjs.timeRemapOf(out) : null;
|
|
1284
|
+
const parentDuration = remap ? chunkIFZOI3JQ_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1283
1285
|
const compW = out.width;
|
|
1284
1286
|
const compH = out.height;
|
|
1285
1287
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1347,16 +1349,16 @@ function expandTransitions(spec) {
|
|
|
1347
1349
|
if (toUses > 1) {
|
|
1348
1350
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1349
1351
|
}
|
|
1350
|
-
const tStart =
|
|
1352
|
+
const tStart = chunkIFZOI3JQ_cjs.resolveAt(t.at, parentDuration);
|
|
1351
1353
|
const tEnd = tStart + t.duration;
|
|
1352
1354
|
const fromSeq = fromEntry.seq;
|
|
1353
|
-
const fromStart =
|
|
1355
|
+
const fromStart = chunkIFZOI3JQ_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1354
1356
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1355
1357
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1356
1358
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1357
1359
|
}
|
|
1358
1360
|
const toSeq = toEntry.seq;
|
|
1359
|
-
const toStart =
|
|
1361
|
+
const toStart = chunkIFZOI3JQ_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1360
1362
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1361
1363
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1362
1364
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1678,7 +1680,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1678
1680
|
blending.add(w.to);
|
|
1679
1681
|
}
|
|
1680
1682
|
}
|
|
1681
|
-
comp.layers().forEach(({ seq, display, threeD, carriers }, i) => {
|
|
1683
|
+
comp.layers().forEach(({ seq, display, threeD, carriers, depthBlur }, i) => {
|
|
1682
1684
|
const t = seq.target;
|
|
1683
1685
|
const name = seq.spec.name;
|
|
1684
1686
|
const label = name ?? `${seq.spec.type}#${i}`;
|
|
@@ -1697,9 +1699,9 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1697
1699
|
onCanvas = inter === 0 && area > 0 ? "none" : inter >= area - 1e-6 ? "full" : "partial";
|
|
1698
1700
|
if (area === 0) onCanvas = "none";
|
|
1699
1701
|
}
|
|
1700
|
-
const keys =
|
|
1702
|
+
const keys = chunkBPTW7L25_cjs.collectPropKeys(seq.spec);
|
|
1701
1703
|
const carried = carriers.some((c) => {
|
|
1702
|
-
const k =
|
|
1704
|
+
const k = chunkBPTW7L25_cjs.collectPropKeys(c.spec);
|
|
1703
1705
|
return (c.spec.keyframes ?? []).length > 0 && (k.has("x") || k.has("y") || k.has("rotation") || k.has("scale"));
|
|
1704
1706
|
});
|
|
1705
1707
|
const moving = parentMoving || carried || (seq.spec.keyframes ?? []).length > 0 && (keys.has("x") || keys.has("y"));
|
|
@@ -1709,6 +1711,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1709
1711
|
};
|
|
1710
1712
|
const zero = parentZero || zeroScale(t) || carriers.some((c) => zeroScale(c.target));
|
|
1711
1713
|
const info = { path: prefix + label, name, type: seq.spec.type, threeD, visible, alpha, moving, bounds, onCanvas };
|
|
1714
|
+
if (threeD) info.depthBlur = Number(depthBlur.toFixed(2));
|
|
1712
1715
|
layers.push(info);
|
|
1713
1716
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1714
1717
|
const maskTarget = seq.maskSequence?.target;
|
|
@@ -1720,7 +1723,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1720
1723
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1721
1724
|
if (group) scene.set(info, group);
|
|
1722
1725
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1723
|
-
if (seq instanceof
|
|
1726
|
+
if (seq instanceof chunkMHOO2CVU_cjs.CompositionSequence) walk2(seq, prefix + label + "/", insideThreeD || threeD, visible, group, moving, zero);
|
|
1724
1727
|
});
|
|
1725
1728
|
};
|
|
1726
1729
|
walk2(root, "", false, true);
|
|
@@ -1781,10 +1784,10 @@ function walk(comp, parentStart, parentEnd, depth, prefix, rows, transitions, lo
|
|
|
1781
1784
|
const start = parentStart + (seq.at ?? 0);
|
|
1782
1785
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
1783
1786
|
const span = end - start;
|
|
1784
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
1787
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkIFZOI3JQ_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
1785
1788
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
1786
1789
|
const inner = [];
|
|
1787
|
-
const isComp = seq instanceof
|
|
1790
|
+
const isComp = seq instanceof chunkMHOO2CVU_cjs.CompositionSequence;
|
|
1788
1791
|
if (isComp) {
|
|
1789
1792
|
const label = seq.remapLabel();
|
|
1790
1793
|
walk(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2067,7 +2070,7 @@ function normalizeStops(raw, duration, frameRate) {
|
|
|
2067
2070
|
console.warn(`pixi-effects: stops[${i}] ${JSON.stringify(r)} is not a time in seconds (or { at, page?, notes?, advance?, pdf? }); ignored`);
|
|
2068
2071
|
return;
|
|
2069
2072
|
}
|
|
2070
|
-
if (typeof r === "object")
|
|
2073
|
+
if (typeof r === "object") chunkUZTKEYFP_cjs.warnUnknownOptions(`stops[${i}]`, r, KEYS);
|
|
2071
2074
|
const at = spec.at < 0 ? duration + spec.at : spec.at;
|
|
2072
2075
|
if (at < -1e-9 || at > duration + 1e-9) {
|
|
2073
2076
|
console.warn(`pixi-effects: stops[${i}] at ${spec.at} s is outside the movie (0 to ${duration} s); ignored`);
|
|
@@ -2297,7 +2300,7 @@ var Movie = class {
|
|
|
2297
2300
|
return this._audioContext;
|
|
2298
2301
|
}
|
|
2299
2302
|
async init(options = {}) {
|
|
2300
|
-
|
|
2303
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.init()", options, ["width", "height", "duration", "frameRate", "background", "canvas", "assets", "composition", "poster", "motionBlur", "loader"]);
|
|
2301
2304
|
this._initState = "pending";
|
|
2302
2305
|
try {
|
|
2303
2306
|
this.width = options.width ?? 1920;
|
|
@@ -2331,6 +2334,7 @@ var Movie = class {
|
|
|
2331
2334
|
this.app = new PIXI.Application();
|
|
2332
2335
|
await this.app.init({ ...baseAppOptions, preference: "webgl" });
|
|
2333
2336
|
}
|
|
2337
|
+
if (chunkK4JVI5HK_cjs.usesAdvancedBlend(options.composition)) await chunkK4JVI5HK_cjs.enableAdvancedBlend(this.app.renderer);
|
|
2334
2338
|
const root = new PIXI.Container();
|
|
2335
2339
|
root.cullable = true;
|
|
2336
2340
|
root.cullableChildren = true;
|
|
@@ -2346,7 +2350,7 @@ var Movie = class {
|
|
|
2346
2350
|
height: options.composition.height ?? this.height,
|
|
2347
2351
|
duration: options.composition.duration ?? this.duration
|
|
2348
2352
|
} : void 0;
|
|
2349
|
-
await
|
|
2353
|
+
await chunkIFZOI3JQ_cjs.ensureFilterLibrary(seededComposition);
|
|
2350
2354
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
2351
2355
|
const rootSeqSpec = {
|
|
2352
2356
|
type: "composition",
|
|
@@ -2356,7 +2360,7 @@ var Movie = class {
|
|
|
2356
2360
|
...userComposition
|
|
2357
2361
|
};
|
|
2358
2362
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
2359
|
-
const composition = new
|
|
2363
|
+
const composition = new chunkMHOO2CVU_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
2360
2364
|
await composition.build();
|
|
2361
2365
|
this._rootSequence = composition;
|
|
2362
2366
|
if (composition.target) root.addChild(composition.target);
|
|
@@ -2440,7 +2444,7 @@ var Movie = class {
|
|
|
2440
2444
|
}));
|
|
2441
2445
|
}
|
|
2442
2446
|
async snapshot(frame = this.currentFrame, opts = {}) {
|
|
2443
|
-
|
|
2447
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.snapshot()", opts, ["scale", "type", "as", "motionBlur"]);
|
|
2444
2448
|
this._requireReady("snapshot");
|
|
2445
2449
|
return this._captureFrame(clampFrame(frame, this.totalFrames), { scale: opts.scale ?? 1, type: opts.type ?? "image/png", as: opts.as ?? "blob", motionBlur: opts.motionBlur });
|
|
2446
2450
|
}
|
|
@@ -2469,7 +2473,7 @@ var Movie = class {
|
|
|
2469
2473
|
return encodeCanvas(out, o.type, o.as, o.quality);
|
|
2470
2474
|
}
|
|
2471
2475
|
async stopImages(opts = {}) {
|
|
2472
|
-
|
|
2476
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.stopImages()", opts, ["which", "pick", "scale", "type", "quality", "as", "motionBlur", "pdf", "onImage"]);
|
|
2473
2477
|
this._requireReady("stopImages");
|
|
2474
2478
|
if (this.stops.length === 0) return [];
|
|
2475
2479
|
const picks = pictureStops(this.stops, { which: opts.which, pick: opts.pick, pdf: opts.pdf });
|
|
@@ -2501,7 +2505,7 @@ var Movie = class {
|
|
|
2501
2505
|
* animation. `issues` says which stop, which page and what to do; leaves the playhead where it was.
|
|
2502
2506
|
*/
|
|
2503
2507
|
async inspectStops(opts = {}) {
|
|
2504
|
-
|
|
2508
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.inspectStops()", opts, ["lookback", "tolerance"]);
|
|
2505
2509
|
this._requireReady("inspectStops");
|
|
2506
2510
|
const out = { stops: [], issues: [] };
|
|
2507
2511
|
if (this.stops.length === 0) return out;
|
|
@@ -2535,7 +2539,7 @@ var Movie = class {
|
|
|
2535
2539
|
* JPEG at the canvas size. Needs `composition.stops`. A transparent background comes out black: give the movie a `background`.
|
|
2536
2540
|
*/
|
|
2537
2541
|
async exportPDF(opts = {}) {
|
|
2538
|
-
|
|
2542
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.exportPDF()", opts, ["which", "pick", "scale", "quality", "title", "motionBlur", "onImage"]);
|
|
2539
2543
|
this._requireReady("exportPDF");
|
|
2540
2544
|
if (this.stops.length === 0) throw new Error("pixi-effects: movie.exportPDF(): this movie has no stops, so there are no pages; add `stops` to the composition (or build it with deck())");
|
|
2541
2545
|
const scale = opts.scale ?? 1;
|
|
@@ -2558,7 +2562,7 @@ var Movie = class {
|
|
|
2558
2562
|
return new Blob([buildPdf(pages, { title: opts.title })], { type: "application/pdf" });
|
|
2559
2563
|
}
|
|
2560
2564
|
async onionSkin(opts = {}) {
|
|
2561
|
-
|
|
2565
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.onionSkin()", opts, ["from", "to", "count", "scale", "as", "motionBlur"]);
|
|
2562
2566
|
this._requireReady("onionSkin");
|
|
2563
2567
|
const from = opts.from ?? 0, to = opts.to ?? this.duration, count = opts.count ?? 8, scale = opts.scale ?? 1;
|
|
2564
2568
|
if (!(Number.isInteger(count) && count >= 1 && count <= 64)) throw new Error(`pixi-effects: movie.onionSkin(): count must be a whole number from 1 to 64, got ${count}`);
|
|
@@ -2589,7 +2593,7 @@ var Movie = class {
|
|
|
2589
2593
|
return encodeCanvas(out, "image/png", opts.as ?? "blob");
|
|
2590
2594
|
}
|
|
2591
2595
|
async contactSheet(opts = {}) {
|
|
2592
|
-
|
|
2596
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.contactSheet()", opts, ["frames", "times", "count", "columns", "cellWidth", "as", "motionBlur"]);
|
|
2593
2597
|
this._requireReady("contactSheet");
|
|
2594
2598
|
const mb = this._blurFor(opts.motionBlur, "movie.contactSheet()");
|
|
2595
2599
|
const blurred = mb ? this._blurCanvas() : null;
|
|
@@ -2626,7 +2630,7 @@ var Movie = class {
|
|
|
2626
2630
|
* the canvas, cut by an edge, empty, or overlapping other text. Seeks there and stays there.
|
|
2627
2631
|
*/
|
|
2628
2632
|
async inspect(frame = this.currentFrame, opts = { layers: "visible" }) {
|
|
2629
|
-
|
|
2633
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.inspect()", opts, ["layers"]);
|
|
2630
2634
|
this._requireReady("inspect");
|
|
2631
2635
|
const f = clampFrame(frame, this.totalFrames);
|
|
2632
2636
|
await this.gotoFrame(f, true);
|
|
@@ -2642,12 +2646,12 @@ var Movie = class {
|
|
|
2642
2646
|
}
|
|
2643
2647
|
/** The timeline as one self-contained HTML page (an inline SVG, no scripts): layers as bars on a time axis, ◆ keyframes, transition bands. Open it in a browser. */
|
|
2644
2648
|
timelineChart(opts = {}) {
|
|
2645
|
-
|
|
2649
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.timelineChart()", opts, ["title"]);
|
|
2646
2650
|
return timelineHtml(this.timelineData(), opts);
|
|
2647
2651
|
}
|
|
2648
2652
|
/** Just the chart: one `<svg>` whose geometry is in `data-*` attributes (a viewer puts a playhead on it: `pixi-effects-view`). */
|
|
2649
2653
|
timelineSvg(opts = {}) {
|
|
2650
|
-
|
|
2654
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.timelineSvg()", opts, ["chartWidth", "labels"]);
|
|
2651
2655
|
return timelineSvg(this.timelineData(), opts);
|
|
2652
2656
|
}
|
|
2653
2657
|
/**
|
|
@@ -2664,7 +2668,7 @@ var Movie = class {
|
|
|
2664
2668
|
* scene's first and last frame and a frame every 0.25 s), fonts and the sound. See `ReviewReport`. Page warnings are in `window.__logs`. The movie is left as it was.
|
|
2665
2669
|
*/
|
|
2666
2670
|
async review(opts = {}) {
|
|
2667
|
-
|
|
2671
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.review()", opts, ["at", "strict"]);
|
|
2668
2672
|
this._requireReady("review");
|
|
2669
2673
|
const back = this.currentFrame, wasAtPoster = this._atPoster;
|
|
2670
2674
|
try {
|
|
@@ -2684,7 +2688,7 @@ var Movie = class {
|
|
|
2684
2688
|
return inspectFonts(this._rootSequence);
|
|
2685
2689
|
}
|
|
2686
2690
|
inspectAudio(opts = {}) {
|
|
2687
|
-
|
|
2691
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.inspectAudio()", opts, ["window", "scenes"]);
|
|
2688
2692
|
this._requireReady("inspectAudio");
|
|
2689
2693
|
const scenes = opts.scenes ?? namedScenes(this.timelineData().rows);
|
|
2690
2694
|
return analyzeAudio(this.audioBuffer, this._audioSources, this._mixStats, this.duration, { ...opts, scenes });
|
|
@@ -2962,7 +2966,7 @@ var Movie = class {
|
|
|
2962
2966
|
return this.muted;
|
|
2963
2967
|
}
|
|
2964
2968
|
async render(options) {
|
|
2965
|
-
|
|
2969
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("movie.render()", options, ["format", "video", "audio", "motionBlur", "range", "scale", "draft"]);
|
|
2966
2970
|
try {
|
|
2967
2971
|
return await this._quietly(() => exportFrames(this, options));
|
|
2968
2972
|
} catch (err) {
|
|
@@ -3020,16 +3024,16 @@ function measureText(text, style = {}) {
|
|
|
3020
3024
|
return { width: m.width, height: m.height, lines: text.split("\n").length };
|
|
3021
3025
|
}
|
|
3022
3026
|
function splitText(text, style = {}, opts = {}) {
|
|
3023
|
-
|
|
3027
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("splitText()", opts, ["by", "x", "y", "align"]);
|
|
3024
3028
|
let by = opts.by ?? "chars";
|
|
3025
3029
|
if (!BY.includes(by)) {
|
|
3026
|
-
const g =
|
|
3030
|
+
const g = chunkUZTKEYFP_cjs.suggestName(String(by), BY);
|
|
3027
3031
|
console.warn(`pixi-effects: splitText(): by "${by}" is not one of ${BY.map((b) => `"${b}"`).join(", ")}${g ? ` \u2014 did you mean "${g}"?` : ""}; using "chars"`);
|
|
3028
3032
|
by = "chars";
|
|
3029
3033
|
}
|
|
3030
3034
|
let align = opts.align ?? "left";
|
|
3031
3035
|
if (!ALIGN.includes(align)) {
|
|
3032
|
-
const g =
|
|
3036
|
+
const g = chunkUZTKEYFP_cjs.suggestName(String(align), ALIGN);
|
|
3033
3037
|
console.warn(`pixi-effects: splitText(): align "${align}" is not one of ${ALIGN.join(", ")}${g ? ` \u2014 did you mean "${g}"?` : ""}; using "left"`);
|
|
3034
3038
|
align = "left";
|
|
3035
3039
|
}
|
|
@@ -3066,7 +3070,7 @@ function splitText(text, style = {}, opts = {}) {
|
|
|
3066
3070
|
// src/presets/kenBurns.ts
|
|
3067
3071
|
var KEN_BURNS_KEYS = ["asset", "name", "at", "duration", "fit", "ease", "motion", "origin", "zoom", "direction", "angle", "from", "to"];
|
|
3068
3072
|
function kenBurns(opts) {
|
|
3069
|
-
|
|
3073
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("kenBurns()", opts, KEN_BURNS_KEYS);
|
|
3070
3074
|
const {
|
|
3071
3075
|
asset,
|
|
3072
3076
|
name,
|
|
@@ -3176,14 +3180,14 @@ function clamp(v, lo, hi) {
|
|
|
3176
3180
|
return Math.max(lo, Math.min(hi, v));
|
|
3177
3181
|
}
|
|
3178
3182
|
function parseEase(name) {
|
|
3179
|
-
|
|
3183
|
+
chunkIFZOI3JQ_cjs.checkEase(name, "a preset");
|
|
3180
3184
|
return gsap.gsap.parseEase(name);
|
|
3181
3185
|
}
|
|
3182
3186
|
|
|
3183
3187
|
// src/presets/orbit.ts
|
|
3184
3188
|
var ORBIT_KEYS = ["duration", "degrees", "start", "radius", "center", "width", "height", "fov", "ease", "dollyZoom", "at", "name", "stepsPerSecond"];
|
|
3185
3189
|
function orbit(opts) {
|
|
3186
|
-
|
|
3190
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("orbit()", opts, ORBIT_KEYS);
|
|
3187
3191
|
const {
|
|
3188
3192
|
duration,
|
|
3189
3193
|
degrees,
|
|
@@ -3199,17 +3203,17 @@ function orbit(opts) {
|
|
|
3199
3203
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
3200
3204
|
}
|
|
3201
3205
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
3202
|
-
const fixedR = opts.radius ??
|
|
3206
|
+
const fixedR = opts.radius ?? chunkIFZOI3JQ_cjs.homeDistance(height, fov ?? chunkIFZOI3JQ_cjs.DEFAULT_FOV);
|
|
3203
3207
|
const start = opts.start ?? -degrees / 2;
|
|
3204
3208
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
3205
3209
|
const easeFn = parseEase(ease);
|
|
3206
3210
|
const dollyEase = dolly ? parseEase(dolly.ease ?? ease) : null;
|
|
3207
3211
|
const pos = (i) => {
|
|
3208
3212
|
const p = i / steps;
|
|
3209
|
-
const a = (start + degrees * easeFn(p)) *
|
|
3213
|
+
const a = (start + degrees * easeFn(p)) * chunkIFZOI3JQ_cjs.DEG;
|
|
3210
3214
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
3211
3215
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
3212
|
-
const R =
|
|
3216
|
+
const R = chunkIFZOI3JQ_cjs.homeDistance(height, f);
|
|
3213
3217
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
3214
3218
|
};
|
|
3215
3219
|
const keyframes = [];
|
|
@@ -3241,7 +3245,7 @@ var KEYS2 = ["count", "at", "emit", "life", "area", "angle", "speed", "gravity",
|
|
|
3241
3245
|
var SHAPES = ["circle", "rect", "star"];
|
|
3242
3246
|
var MAX_KEYFRAMES = 3e4;
|
|
3243
3247
|
function particles(opts) {
|
|
3244
|
-
|
|
3248
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("particles()", opts, KEYS2);
|
|
3245
3249
|
const { count, at = 0, emit = 0, gravity = 0, wind = 0, drag = 0, sway, fade, colors = ["#ffffff"], shape = "circle", seed = 0, name = "particle", template, sampleRate = 20 } = opts;
|
|
3246
3250
|
if (!(Number.isInteger(count) && count > 0)) throw new Error(`particles(): count must be a whole number of particles (at least 1), got ${count}`);
|
|
3247
3251
|
const life = range("life", opts.life, 1e-6);
|
|
@@ -3249,7 +3253,7 @@ function particles(opts) {
|
|
|
3249
3253
|
if (!(Number.isFinite(emit) && emit >= 0)) throw new Error(`particles(): emit must be a number of seconds >= 0, got ${emit}`);
|
|
3250
3254
|
if (!(Number.isFinite(sampleRate) && sampleRate > 0)) throw new Error(`particles(): sampleRate must be a positive number (samples per second), got ${sampleRate}`);
|
|
3251
3255
|
if (!SHAPES.includes(shape)) {
|
|
3252
|
-
const g =
|
|
3256
|
+
const g = chunkUZTKEYFP_cjs.suggestName(String(shape), SHAPES);
|
|
3253
3257
|
throw new Error(`particles(): shape "${shape}" is not one of ${SHAPES.map((s) => `"${s}"`).join(", ")}${g ? `; did you mean "${g}"?` : ""}`);
|
|
3254
3258
|
}
|
|
3255
3259
|
const angle = range("angle", opts.angle ?? [0, 360], -Infinity);
|
|
@@ -3264,7 +3268,7 @@ function particles(opts) {
|
|
|
3264
3268
|
const round3 = (v) => Math.round(v * 1e6) / 1e6;
|
|
3265
3269
|
const out = [];
|
|
3266
3270
|
for (let i = 0; i < count; i++) {
|
|
3267
|
-
const r =
|
|
3271
|
+
const r = chunkIFZOI3JQ_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
3268
3272
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
3269
3273
|
const born = at + r() * emit;
|
|
3270
3274
|
const lifetime = pick(life);
|
|
@@ -3277,7 +3281,7 @@ function particles(opts) {
|
|
|
3277
3281
|
const turn = spin ? pick(spin) : 0;
|
|
3278
3282
|
const startAngle = spin ? r() * 360 : 0;
|
|
3279
3283
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
3280
|
-
const n0 = sway ?
|
|
3284
|
+
const n0 = sway ? chunkIFZOI3JQ_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
3281
3285
|
const at_ = (t) => {
|
|
3282
3286
|
const axis = (p0, v0, acc) => {
|
|
3283
3287
|
if (drag > 0) {
|
|
@@ -3286,7 +3290,7 @@ function particles(opts) {
|
|
|
3286
3290
|
}
|
|
3287
3291
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
3288
3292
|
};
|
|
3289
|
-
const sw = sway ? swayAmp * (
|
|
3293
|
+
const sw = sway ? swayAmp * (chunkIFZOI3JQ_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
3290
3294
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
3291
3295
|
};
|
|
3292
3296
|
const kfs = [];
|
|
@@ -3336,7 +3340,7 @@ function range(name, v, min) {
|
|
|
3336
3340
|
var KEYS3 = ["d", "at", "duration", "ease", "from", "to", "orient", "rotate", "frameRate"];
|
|
3337
3341
|
var MAX_STEPS = 2e3;
|
|
3338
3342
|
function followPath(opts) {
|
|
3339
|
-
|
|
3343
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("followPath()", opts, KEYS3);
|
|
3340
3344
|
const { d, at = 0, duration, ease = "none", from = 0, to = 1, orient = false, rotate = 0, frameRate = 30 } = opts;
|
|
3341
3345
|
if (typeof d !== "string" || d.trim() === "") throw new Error('followPath(): d must be SVG path data, e.g. "M 100 600 C 300 100 900 100 1180 600"');
|
|
3342
3346
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`followPath(): duration must be a positive number of seconds, got ${duration}`);
|
|
@@ -3348,7 +3352,7 @@ function followPath(opts) {
|
|
|
3348
3352
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
3349
3353
|
const segments = [];
|
|
3350
3354
|
let total = 0;
|
|
3351
|
-
for (const line of
|
|
3355
|
+
for (const line of chunkIFZOI3JQ_cjs.flattenSvgPath(d)) {
|
|
3352
3356
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
3353
3357
|
for (let i = 2; i < p.length; i += 2) {
|
|
3354
3358
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -3403,7 +3407,7 @@ var KEYS4 = ["points", "at", "duration", "ease", "look", "lookAhead", "smooth",
|
|
|
3403
3407
|
var MAX_STEPS2 = 4e3;
|
|
3404
3408
|
var PER_SPAN = 48;
|
|
3405
3409
|
function cameraPath(opts) {
|
|
3406
|
-
|
|
3410
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("cameraPath()", opts, KEYS4);
|
|
3407
3411
|
const { points, at = 0, duration, ease = "none", look = "ahead", lookAhead = 0.08, smooth = true, from = 0, to = 1, frameRate = 30 } = opts;
|
|
3408
3412
|
if (!Array.isArray(points) || points.length < 2) throw new Error("cameraPath(): points needs at least two points: [[x, y, z], [x, y, z], \u2026]");
|
|
3409
3413
|
points.forEach((p, i) => {
|
|
@@ -3477,7 +3481,7 @@ function stagger(items, options = {}) {
|
|
|
3477
3481
|
const isCount = typeof items === "number";
|
|
3478
3482
|
const n = isCount ? items : items.length;
|
|
3479
3483
|
if (!Number.isInteger(n) || n < 0) throw new Error(`stagger(): count must be a whole number of items, got ${n}`);
|
|
3480
|
-
|
|
3484
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("stagger()", options, STAGGER_KEYS);
|
|
3481
3485
|
const { each, amount, from = "start", grid, ease = "none", seed = 0 } = options;
|
|
3482
3486
|
if (each !== void 0 && amount !== void 0) throw new Error("stagger(): give `each` (seconds between neighbours) or `amount` (seconds in total), not both");
|
|
3483
3487
|
if (each !== void 0 && !(Number.isFinite(each) && each >= 0)) throw new Error(`stagger(): each must be a number of seconds >= 0, got ${each}`);
|
|
@@ -3502,7 +3506,7 @@ function distances(n, from, grid, seed) {
|
|
|
3502
3506
|
if (n === 0) return [];
|
|
3503
3507
|
if (from === "random") {
|
|
3504
3508
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
3505
|
-
const r =
|
|
3509
|
+
const r = chunkIFZOI3JQ_cjs.random(seed);
|
|
3506
3510
|
for (let i = n - 1; i > 0; i--) {
|
|
3507
3511
|
const j = Math.floor(r() * (i + 1));
|
|
3508
3512
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -3539,7 +3543,7 @@ function distances(n, from, grid, seed) {
|
|
|
3539
3543
|
var WIGGLE_KEYS = ["at", "duration", "freq", "seed", "ease", "props"];
|
|
3540
3544
|
var MAX_STEPS3 = 2e3;
|
|
3541
3545
|
function wiggle(opts) {
|
|
3542
|
-
|
|
3546
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("wiggle()", opts, WIGGLE_KEYS);
|
|
3543
3547
|
const { at = 0, duration, freq = 3, seed = 0, ease = "sine.inOut", props } = opts;
|
|
3544
3548
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`wiggle(): duration must be a positive number of seconds, got ${duration}`);
|
|
3545
3549
|
if (!(Number.isFinite(freq) && freq > 0)) throw new Error(`wiggle(): freq must be a positive number (steps per second), got ${freq}`);
|
|
@@ -3564,7 +3568,7 @@ function wiggle(opts) {
|
|
|
3564
3568
|
to[n] = p.around;
|
|
3565
3569
|
return;
|
|
3566
3570
|
}
|
|
3567
|
-
const off = (
|
|
3571
|
+
const off = (chunkIFZOI3JQ_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
3568
3572
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
3569
3573
|
});
|
|
3570
3574
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -3587,7 +3591,7 @@ var PRESETS = {
|
|
|
3587
3591
|
};
|
|
3588
3592
|
var PRESET_NAMES = Object.keys(PRESETS);
|
|
3589
3593
|
function animateText(text, style, options) {
|
|
3590
|
-
|
|
3594
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("animateText()", options, KEYS5);
|
|
3591
3595
|
const { by = "chars", x = 0, y = 0, align = "left", name = "text", at = 0, duration, idle, styleFor } = options;
|
|
3592
3596
|
for (const [n, v] of [["x", x], ["y", y]]) {
|
|
3593
3597
|
if (typeof v !== "number" || !Number.isFinite(v)) {
|
|
@@ -3663,11 +3667,11 @@ function resolveTween(spec, which) {
|
|
|
3663
3667
|
if (TWEEN_KEYS.includes(key)) continue;
|
|
3664
3668
|
if (TIME_KEYS.includes(key)) {
|
|
3665
3669
|
console.warn(`pixi-effects: animateText(): ${which}.${key} ("${key}") is ignored: ${which === "out" ? "an out leaves from the END of the layer (at + duration), so to make the text gone at a time T set duration to T \u2212 at" : "the entrance starts when the piece starts (the options' at, plus the stagger)"}`);
|
|
3666
|
-
} else
|
|
3670
|
+
} else chunkUZTKEYFP_cjs.warnUnknownOptions(`animateText() ${which}`, { [key]: 1 }, TWEEN_KEYS);
|
|
3667
3671
|
}
|
|
3668
3672
|
}
|
|
3669
3673
|
if (t.preset !== void 0 && !(t.preset in PRESETS)) {
|
|
3670
|
-
const guess =
|
|
3674
|
+
const guess = chunkUZTKEYFP_cjs.suggestName(String(t.preset), PRESET_NAMES);
|
|
3671
3675
|
throw new Error(`animateText(): ${which} "${t.preset}" is not a preset${guess ? `; did you mean "${guess}"?` : ""} (presets: ${PRESET_NAMES.map((n) => `"${n}"`).join(", ")})`);
|
|
3672
3676
|
}
|
|
3673
3677
|
const base = t.preset ? PRESETS[t.preset] : void 0;
|
|
@@ -3688,7 +3692,7 @@ var KEYS6 = ["at", "duration", "props", "audioOffset", "loop", "frameRate"];
|
|
|
3688
3692
|
var PROP_KEYS = ["base", "amount", "band", "beats", "decay", "attack", "release", "invert", "curve"];
|
|
3689
3693
|
var MAX_STEPS4 = 4e3;
|
|
3690
3694
|
function react(env, options) {
|
|
3691
|
-
|
|
3695
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("react()", options, KEYS6);
|
|
3692
3696
|
const { at = 0, duration, props, audioOffset = 0, loop = false } = options;
|
|
3693
3697
|
const frameRate = options.frameRate ?? env.frameRate;
|
|
3694
3698
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`react(): duration must be a positive number of seconds, got ${duration}`);
|
|
@@ -3697,7 +3701,7 @@ function react(env, options) {
|
|
|
3697
3701
|
if (names.length === 0) throw new Error("react(): props is empty; name at least one property, e.g. props: { scale: { base: 1, amount: 0.3 } }");
|
|
3698
3702
|
for (const n of names) {
|
|
3699
3703
|
const p = props[n];
|
|
3700
|
-
|
|
3704
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions(`react() props.${n}`, p, PROP_KEYS);
|
|
3701
3705
|
if (!Number.isFinite(p.amount)) throw new Error(`react(): props.${n}.amount must be a number, got ${p.amount}`);
|
|
3702
3706
|
if (!p.beats && p.band !== void 0 && !env.series[p.band]) throw new Error(`react(): props.${n}: band "${p.band}" is not in this envelope (it has: ${Object.keys(env.series).join(", ")})`);
|
|
3703
3707
|
if (p.beats && !(p.decay === void 0 || Number.isFinite(p.decay) && p.decay > 0)) throw new Error(`react(): props.${n}.decay must be a positive number of seconds, got ${p.decay}`);
|
|
@@ -3804,7 +3808,7 @@ function tempo(beats) {
|
|
|
3804
3808
|
return Math.round(60 / median * 10) / 10;
|
|
3805
3809
|
}
|
|
3806
3810
|
function computeEnvelope(audio, options = {}) {
|
|
3807
|
-
|
|
3811
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("audioEnvelope()", options, OPTION_KEYS);
|
|
3808
3812
|
const frameRate = options.frameRate ?? 30;
|
|
3809
3813
|
if (!(Number.isFinite(frameRate) && frameRate > 0)) throw new Error(`pixi-effects: audioEnvelope(): frameRate must be a positive number, got ${frameRate}`);
|
|
3810
3814
|
const bands = options.bands ?? DEFAULT_BANDS;
|
|
@@ -3928,7 +3932,7 @@ async function audioEnvelope(source, options = {}) {
|
|
|
3928
3932
|
|
|
3929
3933
|
// src/audio/musicEnvelope.ts
|
|
3930
3934
|
async function musicEnvelope(music, options = {}) {
|
|
3931
|
-
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-
|
|
3935
|
+
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-GEAH2XCT.cjs');
|
|
3932
3936
|
const messages = [];
|
|
3933
3937
|
const m = resolveMusic(music, "musicEnvelope()", (msg) => messages.push(msg));
|
|
3934
3938
|
if (!m) throw new Error(`pixi-effects: musicEnvelope(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -3941,7 +3945,7 @@ async function musicEnvelope(music, options = {}) {
|
|
|
3941
3945
|
|
|
3942
3946
|
// src/audio/musicBuffer.ts
|
|
3943
3947
|
async function musicBuffer(music, options = {}) {
|
|
3944
|
-
const { resolveMusic, renderMusic, musicLength } = await import('./music-
|
|
3948
|
+
const { resolveMusic, renderMusic, musicLength } = await import('./music-GEAH2XCT.cjs');
|
|
3945
3949
|
const messages = [];
|
|
3946
3950
|
const m = resolveMusic(music, "musicBuffer()", (msg) => messages.push(msg));
|
|
3947
3951
|
if (!m) throw new Error(`pixi-effects: musicBuffer(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -3961,11 +3965,11 @@ var PAGE_KEYS = ["name", "duration", "sequences", "stops", "notes", "advance", "
|
|
|
3961
3965
|
var DECK_KEYS = ["pages", "transition", "width", "height", "frameRate", "background", "canvas", "assets", "poster", "motionBlur", "loader"];
|
|
3962
3966
|
function deck(options) {
|
|
3963
3967
|
if (!options || !Array.isArray(options.pages) || options.pages.length === 0) throw new Error("deck(): pages must be a list with at least one page: { pages: [{ name, duration, stops, sequences }] }");
|
|
3964
|
-
|
|
3968
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("deck()", options, DECK_KEYS);
|
|
3965
3969
|
const { pages, transition, ...movieOptions } = options;
|
|
3966
3970
|
pages.forEach((p, i) => {
|
|
3967
3971
|
if (!p || typeof p !== "object") throw new Error(`deck(): pages[${i}] must be an object`);
|
|
3968
|
-
|
|
3972
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions(`deck() pages[${i}]`, p, PAGE_KEYS);
|
|
3969
3973
|
if (!(typeof p.duration === "number" && Number.isFinite(p.duration) && p.duration > 0)) throw new Error(`deck(): pages[${i}].duration must be a positive number of seconds, got ${String(p.duration)}`);
|
|
3970
3974
|
if (!Array.isArray(p.sequences)) throw new Error(`deck(): pages[${i}].sequences must be a list of layers (it may be empty), got ${typeof p.sequences}`);
|
|
3971
3975
|
});
|
|
@@ -3985,7 +3989,7 @@ function deck(options) {
|
|
|
3985
3989
|
const label = page.name ? `"${page.name}"` : `pages[${i}]`;
|
|
3986
3990
|
const isLast = i === pages.length - 1;
|
|
3987
3991
|
const entries = (page.stops ?? [isLast ? page.duration : page.duration - overlap]).map((e, k) => {
|
|
3988
|
-
if (e && typeof e === "object")
|
|
3992
|
+
if (e && typeof e === "object") chunkUZTKEYFP_cjs.warnUnknownOptions(`deck() page ${label} stops[${k}]`, e, ["at", "pdf"]);
|
|
3989
3993
|
return typeof e === "object" && e !== null ? e : { at: e };
|
|
3990
3994
|
});
|
|
3991
3995
|
const local = entries.map((e) => e.at);
|
|
@@ -4019,7 +4023,7 @@ var round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
|
4019
4023
|
|
|
4020
4024
|
// src/transforms/withFade.ts
|
|
4021
4025
|
function withFade(spec, opts) {
|
|
4022
|
-
|
|
4026
|
+
chunkUZTKEYFP_cjs.warnUnknownOptions("withFade()", opts, ["in", "out"]);
|
|
4023
4027
|
if (opts.in != null && opts.in > 0) {
|
|
4024
4028
|
spec.initial = { ...spec.initial ?? {}, alpha: 0 };
|
|
4025
4029
|
const kf = { at: 0, to: { alpha: 1 }, duration: opts.in };
|
|
@@ -4039,19 +4043,19 @@ function withFade(spec, opts) {
|
|
|
4039
4043
|
|
|
4040
4044
|
Object.defineProperty(exports, "noise", {
|
|
4041
4045
|
enumerable: true,
|
|
4042
|
-
get: function () { return
|
|
4046
|
+
get: function () { return chunkIFZOI3JQ_cjs.noise; }
|
|
4043
4047
|
});
|
|
4044
4048
|
Object.defineProperty(exports, "rand", {
|
|
4045
4049
|
enumerable: true,
|
|
4046
|
-
get: function () { return
|
|
4050
|
+
get: function () { return chunkIFZOI3JQ_cjs.rand; }
|
|
4047
4051
|
});
|
|
4048
4052
|
Object.defineProperty(exports, "random", {
|
|
4049
4053
|
enumerable: true,
|
|
4050
|
-
get: function () { return
|
|
4054
|
+
get: function () { return chunkIFZOI3JQ_cjs.random; }
|
|
4051
4055
|
});
|
|
4052
4056
|
Object.defineProperty(exports, "registerSequenceType", {
|
|
4053
4057
|
enumerable: true,
|
|
4054
|
-
get: function () { return
|
|
4058
|
+
get: function () { return chunkIFZOI3JQ_cjs.registerSequenceType; }
|
|
4055
4059
|
});
|
|
4056
4060
|
exports.Movie = Movie;
|
|
4057
4061
|
exports.animateText = animateText;
|