pixi-effects 0.48.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-BOLWGT2R.js +7 -0
- package/dist/{Composition-ZCRJHBB5.js.map → Composition-BOLWGT2R.js.map} +1 -1
- package/dist/Composition-ZZEOEETS.cjs +16 -0
- package/dist/{Composition-PMWLJQPI.cjs.map → Composition-ZZEOEETS.cjs.map} +1 -1
- package/dist/{Spans-KTUPDFSR.cjs → Spans-MWYFG7RI.cjs} +9 -9
- package/dist/{Spans-KTUPDFSR.cjs.map → Spans-MWYFG7RI.cjs.map} +1 -1
- package/dist/{Spans-FMAVPATS.js → Spans-PGXRMD6J.js} +4 -4
- package/dist/{Spans-FMAVPATS.js.map → Spans-PGXRMD6J.js.map} +1 -1
- package/dist/{chunk-UI7CEUTP.js → chunk-AJWUCFGM.js} +3 -3
- package/dist/{chunk-UI7CEUTP.js.map → chunk-AJWUCFGM.js.map} +1 -1
- package/dist/{chunk-GX2WQV4A.js → chunk-IY5YTIK3.js} +15 -10
- package/dist/chunk-IY5YTIK3.js.map +1 -0
- package/dist/{chunk-4PYVHLIK.js → chunk-L3MEZZAV.js} +17 -14
- package/dist/chunk-L3MEZZAV.js.map +1 -0
- package/dist/{chunk-NGK4E536.cjs → chunk-L3XC464G.cjs} +56 -51
- package/dist/chunk-L3XC464G.cjs.map +1 -0
- package/dist/{chunk-OGLRSR6C.cjs → chunk-M2LFQY2E.cjs} +63 -63
- package/dist/{chunk-OGLRSR6C.cjs.map → chunk-M2LFQY2E.cjs.map} +1 -1
- package/dist/{chunk-ECLBZV4N.cjs → chunk-V3VBHSK6.cjs} +17 -14
- package/dist/chunk-V3VBHSK6.cjs.map +1 -0
- package/dist/index.cjs +33 -33
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.js +3 -3
- package/dist/three.cjs +5 -5
- package/dist/three.js +1 -1
- package/llms-full.txt +2 -2
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/pitfalls.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-PMWLJQPI.cjs +0 -16
- package/dist/Composition-ZCRJHBB5.js +0 -7
- package/dist/chunk-4PYVHLIK.js.map +0 -1
- package/dist/chunk-ECLBZV4N.cjs.map +0 -1
- package/dist/chunk-GX2WQV4A.js.map +0 -1
- package/dist/chunk-NGK4E536.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkM2LFQY2E_cjs = require('./chunk-M2LFQY2E.cjs');
|
|
4
4
|
var chunkVQXZ2NOI_cjs = require('./chunk-VQXZ2NOI.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkV3VBHSK6_cjs = require('./chunk-V3VBHSK6.cjs');
|
|
6
6
|
var chunkZAHCGFGC_cjs = require('./chunk-ZAHCGFGC.cjs');
|
|
7
7
|
var chunkWYR2AU4W_cjs = require('./chunk-WYR2AU4W.cjs');
|
|
8
8
|
var chunkNGJXVJB7_cjs = require('./chunk-NGJXVJB7.cjs');
|
|
@@ -1268,8 +1268,8 @@ function expandTransitions(spec) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
const transitions = out.transitions;
|
|
1270
1270
|
const sequences = out.sequences ?? [];
|
|
1271
|
-
const remap = out.duration !== void 0 ?
|
|
1272
|
-
const parentDuration = remap ?
|
|
1271
|
+
const remap = out.duration !== void 0 ? chunkV3VBHSK6_cjs.timeRemapOf(out) : null;
|
|
1272
|
+
const parentDuration = remap ? chunkV3VBHSK6_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1273
1273
|
const compW = out.width;
|
|
1274
1274
|
const compH = out.height;
|
|
1275
1275
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1337,16 +1337,16 @@ function expandTransitions(spec) {
|
|
|
1337
1337
|
if (toUses > 1) {
|
|
1338
1338
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1339
1339
|
}
|
|
1340
|
-
const tStart =
|
|
1340
|
+
const tStart = chunkV3VBHSK6_cjs.resolveAt(t.at, parentDuration);
|
|
1341
1341
|
const tEnd = tStart + t.duration;
|
|
1342
1342
|
const fromSeq = fromEntry.seq;
|
|
1343
|
-
const fromStart =
|
|
1343
|
+
const fromStart = chunkV3VBHSK6_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1344
1344
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1345
1345
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1346
1346
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1347
1347
|
}
|
|
1348
1348
|
const toSeq = toEntry.seq;
|
|
1349
|
-
const toStart =
|
|
1349
|
+
const toStart = chunkV3VBHSK6_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1350
1350
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1351
1351
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1352
1352
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1406,7 +1406,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1406
1406
|
delete inner.at;
|
|
1407
1407
|
delete inner.duration;
|
|
1408
1408
|
const m = inner.mask;
|
|
1409
|
-
const carriesMatte = m !== void 0 &&
|
|
1409
|
+
const carriesMatte = m !== void 0 && chunkM2LFQY2E_cjs.maskSourceOf(m).kind === "refs";
|
|
1410
1410
|
if (carriesMatte) delete inner.mask;
|
|
1411
1411
|
return {
|
|
1412
1412
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1676,7 +1676,7 @@ function canvasReport(root) {
|
|
|
1676
1676
|
const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its ${kind === "three" ? "update or render threw" : "draw threw"}, or the layer failed to build): ${kind === "three" ? "the warning above says why" : "it shows a magenta checkerboard there; the warning above says why"}, so the layer cannot be called deterministic` : differs.length ? `${name} does not draw the same picture for the same time (checked at ${differs.map(describeDiff).join(", ")}; drawn in two orders after one draw that was thrown away): ` + (kind === "three" ? "usually its update uses Math.random, Date.now, a clock, or state that builds up from call to call: a mixer advanced with mixer.update(dt) is one (pose a clip with mixer.setTime(t), or threeGltf(url).pose(t)), and so is a value moved by the time since the last call. A skinned model of your own (not loaded by threeGltf) that moves and casts a shadow does it too: three culls a skinned mesh by a bounding sphere that does not follow it, so set mesh.frustumCulled = false. Set every object from t, so playback, a seek and an export agree" : "usually its draw uses Math.random, Date.now or state that outlives the call (a value it keeps from the last call), so playback, a seek and an export would not agree: use info.random() (seeded) and derive everything from t. If it uses none of these, look at the canvases it draws from: make sprites and masks with info.canvas(w, h) (not document.createElement) and draw them into the picture before the strokes that depend on them") : "";
|
|
1677
1677
|
out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
|
|
1678
1678
|
}
|
|
1679
|
-
if (seq instanceof
|
|
1679
|
+
if (seq instanceof chunkM2LFQY2E_cjs.CompositionSequence) walk3(seq);
|
|
1680
1680
|
};
|
|
1681
1681
|
const walk3 = (comp) => {
|
|
1682
1682
|
for (const { seq } of comp.layers()) {
|
|
@@ -1728,8 +1728,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1728
1728
|
let length = 0;
|
|
1729
1729
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1730
1730
|
else if (kf.duration === "auto") {
|
|
1731
|
-
const sp =
|
|
1732
|
-
length = sp ? Math.round(
|
|
1731
|
+
const sp = chunkV3VBHSK6_cjs.parseSpring(kf.ease);
|
|
1732
|
+
length = sp ? Math.round(chunkV3VBHSK6_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1733
1733
|
}
|
|
1734
1734
|
if (!(length > 0)) continue;
|
|
1735
1735
|
const kat = kf.at ?? 0;
|
|
@@ -1809,7 +1809,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1809
1809
|
if (motion.ever) hasMotion.add(info);
|
|
1810
1810
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1811
1811
|
const maskTarget = seq.maskSequence?.target;
|
|
1812
|
-
const maskSrc =
|
|
1812
|
+
const maskSrc = chunkM2LFQY2E_cjs.maskSourceOf(seq.spec.mask);
|
|
1813
1813
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1814
1814
|
const m = maskTarget.getBounds();
|
|
1815
1815
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1818,7 +1818,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1818
1818
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1819
1819
|
if (group) scene.set(info, group);
|
|
1820
1820
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1821
|
-
if (seq instanceof
|
|
1821
|
+
if (seq instanceof chunkM2LFQY2E_cjs.CompositionSequence) walk3(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero, parentAlpha * alpha);
|
|
1822
1822
|
});
|
|
1823
1823
|
};
|
|
1824
1824
|
walk3(root, "", false, true);
|
|
@@ -1990,12 +1990,12 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1990
1990
|
const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1991
1991
|
const visible = parentVisible && alive && alpha > 0;
|
|
1992
1992
|
if (!visible) {
|
|
1993
|
-
if (seq instanceof
|
|
1993
|
+
if (seq instanceof chunkM2LFQY2E_cjs.CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
|
|
1994
1994
|
return;
|
|
1995
1995
|
}
|
|
1996
|
-
const isComposition = seq instanceof
|
|
1996
|
+
const isComposition = seq instanceof chunkM2LFQY2E_cjs.CompositionSequence;
|
|
1997
1997
|
if (isComposition && !threeD) {
|
|
1998
|
-
const gm = seq.maskSequence?.target, gs =
|
|
1998
|
+
const gm = seq.maskSequence?.target, gs = chunkM2LFQY2E_cjs.maskSourceOf(seq.spec.mask);
|
|
1999
1999
|
if (gm && gs.kind === "inline" && !gs.invert && !inMask(gm, at)) return;
|
|
2000
2000
|
walk3(seq, path + "/", visible, at, orderBase, via);
|
|
2001
2001
|
return;
|
|
@@ -2051,7 +2051,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2051
2051
|
}
|
|
2052
2052
|
if (!hit) return;
|
|
2053
2053
|
const maskTarget = seq.maskSequence?.target;
|
|
2054
|
-
const maskSrc =
|
|
2054
|
+
const maskSrc = chunkM2LFQY2E_cjs.maskSourceOf(seq.spec.mask);
|
|
2055
2055
|
if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !(maskSrc.kind === "inline" ? inMask(maskTarget, point) : inside(maskTarget.getBounds(), point))) return;
|
|
2056
2056
|
found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
|
|
2057
2057
|
});
|
|
@@ -2061,7 +2061,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2061
2061
|
const path = hiddenSources.get(f.source);
|
|
2062
2062
|
if (path === void 0) continue;
|
|
2063
2063
|
const g = f.source.target.toGlobal({ x: f.at.x * f.source.intrinsicWidth, y: f.at.y * f.source.intrinsicHeight });
|
|
2064
|
-
const sm = f.source.maskSequence?.target, ss =
|
|
2064
|
+
const sm = f.source.maskSequence?.target, ss = chunkM2LFQY2E_cjs.maskSourceOf(f.source.spec.mask);
|
|
2065
2065
|
if (sm && ss.kind === "inline" && !ss.invert && !inMask(sm, g)) continue;
|
|
2066
2066
|
walk3(f.source, path + "/", true, g, f.order, f.via);
|
|
2067
2067
|
}
|
|
@@ -2097,7 +2097,7 @@ function walk(root, visit) {
|
|
|
2097
2097
|
visit(seq);
|
|
2098
2098
|
const mask = seq.maskSequence;
|
|
2099
2099
|
if (mask) visit(mask);
|
|
2100
|
-
if (seq instanceof
|
|
2100
|
+
if (seq instanceof chunkM2LFQY2E_cjs.CompositionSequence) walk(seq, visit);
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
2103
|
function reusePoolOf(old) {
|
|
@@ -2198,7 +2198,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2198
2198
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2199
2199
|
function detailOf(seq) {
|
|
2200
2200
|
const s = seq.spec;
|
|
2201
|
-
const spans =
|
|
2201
|
+
const spans = chunkV3VBHSK6_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2202
2202
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2203
2203
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2204
2204
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2214,10 +2214,10 @@ function walk2(comp, parentStart, parentEnd, depth, prefix, rows, transitions, l
|
|
|
2214
2214
|
const start = parentStart + (seq.at ?? 0);
|
|
2215
2215
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2216
2216
|
const span = end - start;
|
|
2217
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2217
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkV3VBHSK6_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2218
2218
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2219
2219
|
const inner = [];
|
|
2220
|
-
const isComp = seq instanceof
|
|
2220
|
+
const isComp = seq instanceof chunkM2LFQY2E_cjs.CompositionSequence;
|
|
2221
2221
|
if (isComp) {
|
|
2222
2222
|
const label = seq.remapLabel();
|
|
2223
2223
|
walk2(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2376,7 +2376,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2376
2376
|
}
|
|
2377
2377
|
|
|
2378
2378
|
// src/core/vars.ts
|
|
2379
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2379
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkV3VBHSK6_cjs.EXPRESSION_NAMES];
|
|
2380
2380
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2381
2381
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2382
2382
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2920,8 +2920,8 @@ var Movie = class {
|
|
|
2920
2920
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2921
2921
|
this._posterFrame = poster.frame;
|
|
2922
2922
|
this.background = options.background ?? "#000000";
|
|
2923
|
-
this.timeline =
|
|
2924
|
-
|
|
2923
|
+
this.timeline = chunkV3VBHSK6_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2924
|
+
chunkV3VBHSK6_cjs.lengthen(this.timeline, this.duration);
|
|
2925
2925
|
const baseAppOptions = {
|
|
2926
2926
|
width: this.width,
|
|
2927
2927
|
height: this.height,
|
|
@@ -3020,7 +3020,7 @@ var Movie = class {
|
|
|
3020
3020
|
height: sizeWins ? height : spec.height ?? height,
|
|
3021
3021
|
duration: spec.duration ?? this.duration
|
|
3022
3022
|
} : void 0;
|
|
3023
|
-
await
|
|
3023
|
+
await chunkV3VBHSK6_cjs.ensureFilterLibrary(seededComposition);
|
|
3024
3024
|
if (chunkWYR2AU4W_cjs.usesAdvancedBlend(seededComposition)) await chunkWYR2AU4W_cjs.enableAdvancedBlend(this.app.renderer);
|
|
3025
3025
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
3026
3026
|
const rootSeqSpec = {
|
|
@@ -3031,7 +3031,7 @@ var Movie = class {
|
|
|
3031
3031
|
...userComposition
|
|
3032
3032
|
};
|
|
3033
3033
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
3034
|
-
const sequence = new
|
|
3034
|
+
const sequence = new chunkM2LFQY2E_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
3035
3035
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
3036
3036
|
try {
|
|
3037
3037
|
await sequence.build();
|
|
@@ -3170,8 +3170,8 @@ var Movie = class {
|
|
|
3170
3170
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
3171
3171
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged, reusePoolOf(this._rootSequence));
|
|
3172
3172
|
alive();
|
|
3173
|
-
const timeline =
|
|
3174
|
-
|
|
3173
|
+
const timeline = chunkV3VBHSK6_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
3174
|
+
chunkV3VBHSK6_cjs.lengthen(timeline, this.duration);
|
|
3175
3175
|
sequence.bindTimeline(timeline);
|
|
3176
3176
|
const hadSound = this.audioBuffer !== null;
|
|
3177
3177
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3888,12 +3888,17 @@ var Movie = class {
|
|
|
3888
3888
|
async destroy() {
|
|
3889
3889
|
safeRun(() => this.pause());
|
|
3890
3890
|
this._timeFilters = [];
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3891
|
+
const unmute = muteBoundTextureWarning();
|
|
3892
|
+
try {
|
|
3893
|
+
safeRun(() => this._rootSequence?.destroy());
|
|
3894
|
+
this._rootSequence = null;
|
|
3895
|
+
safeRun(() => this.timeline?.kill());
|
|
3896
|
+
this.timeline = null;
|
|
3897
|
+
safeRun(() => this.app?.destroy(true, { children: true, texture: true }));
|
|
3898
|
+
this.app = null;
|
|
3899
|
+
} finally {
|
|
3900
|
+
unmute();
|
|
3901
|
+
}
|
|
3897
3902
|
this.audioBuffer = null;
|
|
3898
3903
|
this._audioSources = [];
|
|
3899
3904
|
this._mixStats = null;
|
|
@@ -3946,7 +3951,7 @@ function countLayers(spec) {
|
|
|
3946
3951
|
n += 1 + countLayers(s);
|
|
3947
3952
|
const spans = s.spans;
|
|
3948
3953
|
if (Array.isArray(spans)) n += spans.length;
|
|
3949
|
-
const src =
|
|
3954
|
+
const src = chunkM2LFQY2E_cjs.maskSourceOf(mask);
|
|
3950
3955
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3951
3956
|
}
|
|
3952
3957
|
return n;
|
|
@@ -4035,8 +4040,8 @@ function splitVertical(text, style, ts, right, top, align, by) {
|
|
|
4035
4040
|
|
|
4036
4041
|
// src/presets/_ease.ts
|
|
4037
4042
|
function parseEase2(name) {
|
|
4038
|
-
|
|
4039
|
-
return
|
|
4043
|
+
chunkV3VBHSK6_cjs.checkEase(name, "a preset");
|
|
4044
|
+
return chunkV3VBHSK6_cjs.parseEase(name);
|
|
4040
4045
|
}
|
|
4041
4046
|
|
|
4042
4047
|
// src/presets/kenBurns.ts
|
|
@@ -4171,17 +4176,17 @@ function orbit(opts) {
|
|
|
4171
4176
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
4172
4177
|
}
|
|
4173
4178
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
4174
|
-
const fixedR = opts.radius ??
|
|
4179
|
+
const fixedR = opts.radius ?? chunkV3VBHSK6_cjs.homeDistance(height, fov ?? chunkV3VBHSK6_cjs.DEFAULT_FOV);
|
|
4175
4180
|
const start = opts.start ?? -degrees / 2;
|
|
4176
4181
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
4177
4182
|
const easeFn = parseEase2(ease);
|
|
4178
4183
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
4179
4184
|
const pos = (i) => {
|
|
4180
4185
|
const p = i / steps;
|
|
4181
|
-
const a = (start + degrees * easeFn(p)) *
|
|
4186
|
+
const a = (start + degrees * easeFn(p)) * chunkV3VBHSK6_cjs.DEG;
|
|
4182
4187
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
4183
4188
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
4184
|
-
const R =
|
|
4189
|
+
const R = chunkV3VBHSK6_cjs.homeDistance(height, f);
|
|
4185
4190
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
4186
4191
|
};
|
|
4187
4192
|
const keyframes = [];
|
|
@@ -4236,7 +4241,7 @@ function particles(opts) {
|
|
|
4236
4241
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
4237
4242
|
const out = [];
|
|
4238
4243
|
for (let i = 0; i < count; i++) {
|
|
4239
|
-
const r =
|
|
4244
|
+
const r = chunkV3VBHSK6_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
4240
4245
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
4241
4246
|
const born = at + r() * emit;
|
|
4242
4247
|
const lifetime = pick(life);
|
|
@@ -4249,7 +4254,7 @@ function particles(opts) {
|
|
|
4249
4254
|
const turn = spin ? pick(spin) : 0;
|
|
4250
4255
|
const startAngle = spin ? r() * 360 : 0;
|
|
4251
4256
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
4252
|
-
const n0 = sway ?
|
|
4257
|
+
const n0 = sway ? chunkV3VBHSK6_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
4253
4258
|
const at_ = (t) => {
|
|
4254
4259
|
const axis = (p0, v0, acc) => {
|
|
4255
4260
|
if (drag > 0) {
|
|
@@ -4258,7 +4263,7 @@ function particles(opts) {
|
|
|
4258
4263
|
}
|
|
4259
4264
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
4260
4265
|
};
|
|
4261
|
-
const sw = sway ? swayAmp * (
|
|
4266
|
+
const sw = sway ? swayAmp * (chunkV3VBHSK6_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
4262
4267
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
4263
4268
|
};
|
|
4264
4269
|
const kfs = [];
|
|
@@ -4320,7 +4325,7 @@ function followPath(opts) {
|
|
|
4320
4325
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
4321
4326
|
const segments = [];
|
|
4322
4327
|
let total = 0;
|
|
4323
|
-
for (const line of
|
|
4328
|
+
for (const line of chunkV3VBHSK6_cjs.flattenSvgPath(d)) {
|
|
4324
4329
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
4325
4330
|
for (let i = 2; i < p.length; i += 2) {
|
|
4326
4331
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4373,7 +4378,7 @@ function followPath(opts) {
|
|
|
4373
4378
|
// src/core/pathSample.ts
|
|
4374
4379
|
function samplePath(d) {
|
|
4375
4380
|
if (typeof d !== "string" || d.trim() === "") throw new Error('samplePath(): d must be SVG path data, e.g. "M 40 300 C 200 20 400 20 560 300"');
|
|
4376
|
-
const lines =
|
|
4381
|
+
const lines = chunkV3VBHSK6_cjs.flattenSvgPath(d);
|
|
4377
4382
|
const segments = [];
|
|
4378
4383
|
let length = 0;
|
|
4379
4384
|
for (const line of lines) {
|
|
@@ -4404,7 +4409,7 @@ function samplePath(d) {
|
|
|
4404
4409
|
return { x: g.x0 + (g.x1 - g.x0) * t, y: g.y0 + (g.y1 - g.y0) * t, angle: Math.atan2(g.y1 - g.y0, g.x1 - g.x0) };
|
|
4405
4410
|
},
|
|
4406
4411
|
trim(start = 0, end = 1) {
|
|
4407
|
-
return
|
|
4412
|
+
return chunkV3VBHSK6_cjs.trimPolylines(lines, start, end).map((l) => l.closed ? [...l.pts, l.pts[0], l.pts[1]] : l.pts);
|
|
4408
4413
|
}
|
|
4409
4414
|
};
|
|
4410
4415
|
}
|
|
@@ -4515,7 +4520,7 @@ function distances(n, from, grid, seed) {
|
|
|
4515
4520
|
if (n === 0) return [];
|
|
4516
4521
|
if (from === "random") {
|
|
4517
4522
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4518
|
-
const r =
|
|
4523
|
+
const r = chunkV3VBHSK6_cjs.random(seed);
|
|
4519
4524
|
for (let i = n - 1; i > 0; i--) {
|
|
4520
4525
|
const j = Math.floor(r() * (i + 1));
|
|
4521
4526
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4577,7 +4582,7 @@ function wiggle(opts) {
|
|
|
4577
4582
|
to[n] = p.around;
|
|
4578
4583
|
return;
|
|
4579
4584
|
}
|
|
4580
|
-
const off = (
|
|
4585
|
+
const off = (chunkV3VBHSK6_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4581
4586
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4582
4587
|
});
|
|
4583
4588
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -5048,5 +5053,5 @@ exports.splitText = splitText;
|
|
|
5048
5053
|
exports.stagger = stagger;
|
|
5049
5054
|
exports.wiggle = wiggle;
|
|
5050
5055
|
exports.withFade = withFade;
|
|
5051
|
-
//# sourceMappingURL=chunk-
|
|
5052
|
-
//# sourceMappingURL=chunk-
|
|
5056
|
+
//# sourceMappingURL=chunk-L3XC464G.cjs.map
|
|
5057
|
+
//# sourceMappingURL=chunk-L3XC464G.cjs.map
|