pixi-effects 0.31.0 → 0.32.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 +18 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/render.mjs +19 -2
- package/dist/{Base-jRiMHcWT.d.ts → Base-CXsMdmJB.d.ts} +1 -1
- package/dist/{Base-BKagtWc0.d.cts → Base-pNq6sVGl.d.cts} +1 -1
- package/dist/Composition-LNMKWXSL.cjs +16 -0
- package/dist/{Composition-V2XYSW6P.cjs.map → Composition-LNMKWXSL.cjs.map} +1 -1
- package/dist/Composition-RF7QOEXT.js +7 -0
- package/dist/{Composition-DQCPJPFE.js.map → Composition-RF7QOEXT.js.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie-BH81stkb.d.cts → Movie-CL6SsAWe.d.cts} +1 -1
- package/dist/{Movie-CfFPItoL.d.ts → Movie-f0tQG9y5.d.ts} +1 -1
- package/dist/Spans-NQGKVMR5.cjs +55 -0
- package/dist/Spans-NQGKVMR5.cjs.map +1 -0
- package/dist/Spans-SDXABOV6.js +53 -0
- package/dist/Spans-SDXABOV6.js.map +1 -0
- package/dist/{blendModes-RIVZXL5A.js → blendModes-MVRLG3T7.js} +4 -4
- package/dist/{blendModes-RIVZXL5A.js.map → blendModes-MVRLG3T7.js.map} +1 -1
- package/dist/{blendModes-ETMYWATF.cjs → blendModes-VTKDXWEN.cjs} +5 -5
- package/dist/{blendModes-ETMYWATF.cjs.map → blendModes-VTKDXWEN.cjs.map} +1 -1
- package/dist/{chunk-MMTESMJ5.js → chunk-AW5NPDE4.js} +1363 -1151
- package/dist/chunk-AW5NPDE4.js.map +1 -0
- package/dist/{chunk-RCVZX2JP.js → chunk-C5BNHVKK.js} +36 -3
- package/dist/chunk-C5BNHVKK.js.map +1 -0
- package/dist/{chunk-L73KRFXI.cjs → chunk-CRUDOKSD.cjs} +91 -91
- package/dist/chunk-CRUDOKSD.cjs.map +1 -0
- package/dist/{chunk-BGMCZA36.js → chunk-D5BFQVKL.js} +6 -6
- package/dist/chunk-D5BFQVKL.js.map +1 -0
- package/dist/{chunk-LYOKH7KE.cjs → chunk-FCGYJCVO.cjs} +36 -3
- package/dist/chunk-FCGYJCVO.cjs.map +1 -0
- package/dist/{chunk-UTIBYMIO.js → chunk-FCMOREIS.js} +10 -6
- package/dist/chunk-FCMOREIS.js.map +1 -0
- package/dist/{chunk-X3WHETQ3.cjs → chunk-K3MAEKFM.cjs} +42 -38
- package/dist/chunk-K3MAEKFM.cjs.map +1 -0
- package/dist/{chunk-4KB3GUEK.js → chunk-QFNS6BFL.js} +4 -4
- package/dist/{chunk-4KB3GUEK.js.map → chunk-QFNS6BFL.js.map} +1 -1
- package/dist/{chunk-DJ5B7IKT.cjs → chunk-QHDN6TF5.cjs} +1377 -1161
- package/dist/chunk-QHDN6TF5.cjs.map +1 -0
- package/dist/{chunk-2DXPTKQZ.cjs → chunk-Z437UWI4.cjs} +5 -5
- package/dist/{chunk-2DXPTKQZ.cjs.map → chunk-Z437UWI4.cjs.map} +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/loader.css +1 -1
- package/dist/present.cjs +5 -5
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +5 -5
- package/dist/three.cjs +6 -6
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +2 -2
- package/dist/{types-CK_crNAI.d.ts → types-CavnUvd5.d.cts} +26 -1
- package/dist/{types-CK_crNAI.d.cts → types-CavnUvd5.d.ts} +26 -1
- package/docs/dsl.md +14 -4
- package/llms-full.txt +19 -8
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -2
- package/skills/pixi-effects/reference/pitfalls.md +2 -2
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-DQCPJPFE.js +0 -7
- package/dist/Composition-V2XYSW6P.cjs +0 -16
- package/dist/chunk-BGMCZA36.js.map +0 -1
- package/dist/chunk-DJ5B7IKT.cjs.map +0 -1
- package/dist/chunk-L73KRFXI.cjs.map +0 -1
- package/dist/chunk-LYOKH7KE.cjs.map +0 -1
- package/dist/chunk-MMTESMJ5.js.map +0 -1
- package/dist/chunk-RCVZX2JP.js.map +0 -1
- package/dist/chunk-UTIBYMIO.js.map +0 -1
- package/dist/chunk-X3WHETQ3.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkCRUDOKSD_cjs = require('./chunk-CRUDOKSD.cjs');
|
|
4
|
+
var chunkQHDN6TF5_cjs = require('./chunk-QHDN6TF5.cjs');
|
|
5
|
+
var chunkZ437UWI4_cjs = require('./chunk-Z437UWI4.cjs');
|
|
6
|
+
var chunkFCGYJCVO_cjs = require('./chunk-FCGYJCVO.cjs');
|
|
7
7
|
var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
8
8
|
var pixi_js = require('pixi.js');
|
|
9
9
|
var mediabunny = require('mediabunny');
|
|
@@ -1485,8 +1485,8 @@ function expandTransitions(spec) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
const transitions = out.transitions;
|
|
1487
1487
|
const sequences = out.sequences ?? [];
|
|
1488
|
-
const remap = out.duration !== void 0 ?
|
|
1489
|
-
const parentDuration = remap ?
|
|
1488
|
+
const remap = out.duration !== void 0 ? chunkQHDN6TF5_cjs.timeRemapOf(out) : null;
|
|
1489
|
+
const parentDuration = remap ? chunkQHDN6TF5_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1490
1490
|
const compW = out.width;
|
|
1491
1491
|
const compH = out.height;
|
|
1492
1492
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1554,16 +1554,16 @@ function expandTransitions(spec) {
|
|
|
1554
1554
|
if (toUses > 1) {
|
|
1555
1555
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1556
1556
|
}
|
|
1557
|
-
const tStart =
|
|
1557
|
+
const tStart = chunkQHDN6TF5_cjs.resolveAt(t.at, parentDuration);
|
|
1558
1558
|
const tEnd = tStart + t.duration;
|
|
1559
1559
|
const fromSeq = fromEntry.seq;
|
|
1560
|
-
const fromStart =
|
|
1560
|
+
const fromStart = chunkQHDN6TF5_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1561
1561
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1562
1562
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1563
1563
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1564
1564
|
}
|
|
1565
1565
|
const toSeq = toEntry.seq;
|
|
1566
|
-
const toStart =
|
|
1566
|
+
const toStart = chunkQHDN6TF5_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1567
1567
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1568
1568
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1569
1569
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1623,7 +1623,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1623
1623
|
delete inner.at;
|
|
1624
1624
|
delete inner.duration;
|
|
1625
1625
|
const m = inner.mask;
|
|
1626
|
-
const carriesMatte = m !== void 0 &&
|
|
1626
|
+
const carriesMatte = m !== void 0 && chunkCRUDOKSD_cjs.maskSourceOf(m).kind === "refs";
|
|
1627
1627
|
if (carriesMatte) delete inner.mask;
|
|
1628
1628
|
return {
|
|
1629
1629
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1925,9 +1925,9 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1925
1925
|
onCanvas = inter === 0 && area > 0 ? "none" : inter >= area - 1e-6 ? "full" : "partial";
|
|
1926
1926
|
if (area === 0) onCanvas = "none";
|
|
1927
1927
|
}
|
|
1928
|
-
const keys =
|
|
1928
|
+
const keys = chunkFCGYJCVO_cjs.collectPropKeys(seq.spec);
|
|
1929
1929
|
const carried = carriers.some((c) => {
|
|
1930
|
-
const k =
|
|
1930
|
+
const k = chunkFCGYJCVO_cjs.collectPropKeys(c.spec);
|
|
1931
1931
|
return (c.spec.keyframes ?? []).length > 0 && (k.has("x") || k.has("y") || k.has("rotation") || k.has("scale"));
|
|
1932
1932
|
});
|
|
1933
1933
|
const moving = parentMoving || carried || (seq.spec.keyframes ?? []).length > 0 && (keys.has("x") || keys.has("y"));
|
|
@@ -1942,7 +1942,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1942
1942
|
layers.push(info);
|
|
1943
1943
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1944
1944
|
const maskTarget = seq.maskSequence?.target;
|
|
1945
|
-
const maskSrc =
|
|
1945
|
+
const maskSrc = chunkCRUDOKSD_cjs.maskSourceOf(seq.spec.mask);
|
|
1946
1946
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1947
1947
|
const m = maskTarget.getBounds();
|
|
1948
1948
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1951,7 +1951,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1951
1951
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1952
1952
|
if (group) scene.set(info, group);
|
|
1953
1953
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1954
|
-
if (seq instanceof
|
|
1954
|
+
if (seq instanceof chunkCRUDOKSD_cjs.CompositionSequence) walk2(seq, prefix + label + "/", insideThreeD || threeD, visible, group, moving, zero);
|
|
1955
1955
|
});
|
|
1956
1956
|
};
|
|
1957
1957
|
walk2(root, "", false, true);
|
|
@@ -1998,6 +1998,8 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
1998
1998
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
1999
1999
|
function detailOf(seq) {
|
|
2000
2000
|
const s = seq.spec;
|
|
2001
|
+
const spans = chunkQHDN6TF5_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2002
|
+
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2001
2003
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2002
2004
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
2003
2005
|
if (typeof s.sfx === "string") return `sfx \u201C${s.sfx}\u201D`;
|
|
@@ -2012,10 +2014,10 @@ function walk(comp, parentStart, parentEnd, depth, prefix, rows, transitions, lo
|
|
|
2012
2014
|
const start = parentStart + (seq.at ?? 0);
|
|
2013
2015
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2014
2016
|
const span = end - start;
|
|
2015
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2017
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkQHDN6TF5_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2016
2018
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2017
2019
|
const inner = [];
|
|
2018
|
-
const isComp = seq instanceof
|
|
2020
|
+
const isComp = seq instanceof chunkCRUDOKSD_cjs.CompositionSequence;
|
|
2019
2021
|
if (isComp) {
|
|
2020
2022
|
const label = seq.remapLabel();
|
|
2021
2023
|
walk(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2174,7 +2176,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2174
2176
|
}
|
|
2175
2177
|
|
|
2176
2178
|
// src/core/vars.ts
|
|
2177
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2179
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkQHDN6TF5_cjs.EXPRESSION_NAMES];
|
|
2178
2180
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2179
2181
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2180
2182
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2707,8 +2709,8 @@ var Movie = class {
|
|
|
2707
2709
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2708
2710
|
this._posterFrame = poster.frame;
|
|
2709
2711
|
this.background = options.background ?? "#000000";
|
|
2710
|
-
this.timeline =
|
|
2711
|
-
|
|
2712
|
+
this.timeline = chunkQHDN6TF5_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2713
|
+
chunkQHDN6TF5_cjs.lengthen(this.timeline, this.duration);
|
|
2712
2714
|
const baseAppOptions = {
|
|
2713
2715
|
width: this.width,
|
|
2714
2716
|
height: this.height,
|
|
@@ -2802,8 +2804,8 @@ var Movie = class {
|
|
|
2802
2804
|
height: sizeWins ? height : spec.height ?? height,
|
|
2803
2805
|
duration: spec.duration ?? this.duration
|
|
2804
2806
|
} : void 0;
|
|
2805
|
-
await
|
|
2806
|
-
if (
|
|
2807
|
+
await chunkQHDN6TF5_cjs.ensureFilterLibrary(seededComposition);
|
|
2808
|
+
if (chunkZ437UWI4_cjs.usesAdvancedBlend(seededComposition)) await chunkZ437UWI4_cjs.enableAdvancedBlend(this.app.renderer);
|
|
2807
2809
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
2808
2810
|
const rootSeqSpec = {
|
|
2809
2811
|
type: "composition",
|
|
@@ -2813,7 +2815,7 @@ var Movie = class {
|
|
|
2813
2815
|
...userComposition
|
|
2814
2816
|
};
|
|
2815
2817
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
2816
|
-
const sequence = new
|
|
2818
|
+
const sequence = new chunkCRUDOKSD_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
2817
2819
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
2818
2820
|
try {
|
|
2819
2821
|
await sequence.build();
|
|
@@ -2949,8 +2951,8 @@ var Movie = class {
|
|
|
2949
2951
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
2950
2952
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged);
|
|
2951
2953
|
alive();
|
|
2952
|
-
const timeline =
|
|
2953
|
-
|
|
2954
|
+
const timeline = chunkQHDN6TF5_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2955
|
+
chunkQHDN6TF5_cjs.lengthen(timeline, this.duration);
|
|
2954
2956
|
sequence.bindTimeline(timeline);
|
|
2955
2957
|
const hadSound = this.audioBuffer !== null;
|
|
2956
2958
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3590,7 +3592,9 @@ function countLayers(spec) {
|
|
|
3590
3592
|
for (const s of spec?.sequences ?? []) {
|
|
3591
3593
|
const mask = s.mask;
|
|
3592
3594
|
n += 1 + countLayers(s);
|
|
3593
|
-
const
|
|
3595
|
+
const spans = s.spans;
|
|
3596
|
+
if (Array.isArray(spans)) n += spans.length;
|
|
3597
|
+
const src = chunkCRUDOKSD_cjs.maskSourceOf(mask);
|
|
3594
3598
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3595
3599
|
}
|
|
3596
3600
|
return n;
|
|
@@ -3648,8 +3652,8 @@ function splitText(text, style = {}, opts = {}) {
|
|
|
3648
3652
|
|
|
3649
3653
|
// src/presets/_ease.ts
|
|
3650
3654
|
function parseEase2(name) {
|
|
3651
|
-
|
|
3652
|
-
return
|
|
3655
|
+
chunkQHDN6TF5_cjs.checkEase(name, "a preset");
|
|
3656
|
+
return chunkQHDN6TF5_cjs.parseEase(name);
|
|
3653
3657
|
}
|
|
3654
3658
|
|
|
3655
3659
|
// src/presets/kenBurns.ts
|
|
@@ -3784,17 +3788,17 @@ function orbit(opts) {
|
|
|
3784
3788
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
3785
3789
|
}
|
|
3786
3790
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
3787
|
-
const fixedR = opts.radius ??
|
|
3791
|
+
const fixedR = opts.radius ?? chunkQHDN6TF5_cjs.homeDistance(height, fov ?? chunkQHDN6TF5_cjs.DEFAULT_FOV);
|
|
3788
3792
|
const start = opts.start ?? -degrees / 2;
|
|
3789
3793
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
3790
3794
|
const easeFn = parseEase2(ease);
|
|
3791
3795
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
3792
3796
|
const pos = (i) => {
|
|
3793
3797
|
const p = i / steps;
|
|
3794
|
-
const a = (start + degrees * easeFn(p)) *
|
|
3798
|
+
const a = (start + degrees * easeFn(p)) * chunkQHDN6TF5_cjs.DEG;
|
|
3795
3799
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
3796
3800
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
3797
|
-
const R =
|
|
3801
|
+
const R = chunkQHDN6TF5_cjs.homeDistance(height, f);
|
|
3798
3802
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
3799
3803
|
};
|
|
3800
3804
|
const keyframes = [];
|
|
@@ -3849,7 +3853,7 @@ function particles(opts) {
|
|
|
3849
3853
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
3850
3854
|
const out = [];
|
|
3851
3855
|
for (let i = 0; i < count; i++) {
|
|
3852
|
-
const r =
|
|
3856
|
+
const r = chunkQHDN6TF5_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
3853
3857
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
3854
3858
|
const born = at + r() * emit;
|
|
3855
3859
|
const lifetime = pick(life);
|
|
@@ -3862,7 +3866,7 @@ function particles(opts) {
|
|
|
3862
3866
|
const turn = spin ? pick(spin) : 0;
|
|
3863
3867
|
const startAngle = spin ? r() * 360 : 0;
|
|
3864
3868
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
3865
|
-
const n0 = sway ?
|
|
3869
|
+
const n0 = sway ? chunkQHDN6TF5_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
3866
3870
|
const at_ = (t) => {
|
|
3867
3871
|
const axis = (p0, v0, acc) => {
|
|
3868
3872
|
if (drag > 0) {
|
|
@@ -3871,7 +3875,7 @@ function particles(opts) {
|
|
|
3871
3875
|
}
|
|
3872
3876
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
3873
3877
|
};
|
|
3874
|
-
const sw = sway ? swayAmp * (
|
|
3878
|
+
const sw = sway ? swayAmp * (chunkQHDN6TF5_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
3875
3879
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
3876
3880
|
};
|
|
3877
3881
|
const kfs = [];
|
|
@@ -3933,7 +3937,7 @@ function followPath(opts) {
|
|
|
3933
3937
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
3934
3938
|
const segments = [];
|
|
3935
3939
|
let total = 0;
|
|
3936
|
-
for (const line of
|
|
3940
|
+
for (const line of chunkQHDN6TF5_cjs.flattenSvgPath(d)) {
|
|
3937
3941
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
3938
3942
|
for (let i = 2; i < p.length; i += 2) {
|
|
3939
3943
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4087,7 +4091,7 @@ function distances(n, from, grid, seed) {
|
|
|
4087
4091
|
if (n === 0) return [];
|
|
4088
4092
|
if (from === "random") {
|
|
4089
4093
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4090
|
-
const r =
|
|
4094
|
+
const r = chunkQHDN6TF5_cjs.random(seed);
|
|
4091
4095
|
for (let i = n - 1; i > 0; i--) {
|
|
4092
4096
|
const j = Math.floor(r() * (i + 1));
|
|
4093
4097
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4149,7 +4153,7 @@ function wiggle(opts) {
|
|
|
4149
4153
|
to[n] = p.around;
|
|
4150
4154
|
return;
|
|
4151
4155
|
}
|
|
4152
|
-
const off = (
|
|
4156
|
+
const off = (chunkQHDN6TF5_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4153
4157
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4154
4158
|
});
|
|
4155
4159
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4607,5 +4611,5 @@ exports.splitText = splitText;
|
|
|
4607
4611
|
exports.stagger = stagger;
|
|
4608
4612
|
exports.wiggle = wiggle;
|
|
4609
4613
|
exports.withFade = withFade;
|
|
4610
|
-
//# sourceMappingURL=chunk-
|
|
4611
|
-
//# sourceMappingURL=chunk-
|
|
4614
|
+
//# sourceMappingURL=chunk-K3MAEKFM.cjs.map
|
|
4615
|
+
//# sourceMappingURL=chunk-K3MAEKFM.cjs.map
|