pixi-effects 0.9.0 → 0.11.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 +36 -0
- package/README.md +6 -6
- package/ai/SKILL.md +4 -3
- package/ai/reference/cheatsheet.md +17 -6
- package/ai/reference/pitfalls.md +3 -3
- package/ai/reference/recipes.md +141 -11
- package/ai/template.html +11 -8
- package/ai/tools/render.mjs +14 -5
- package/dist/{Base-CSIulyIq.d.cts → Base-CwUxTfja.d.cts} +1 -1
- package/dist/{Base-DVgwyIUj.d.ts → Base-CyvSLoCP.d.ts} +1 -1
- package/dist/Composition-7TEKHZNQ.cjs +14 -0
- package/dist/{Composition-CM62XJKT.cjs.map → Composition-7TEKHZNQ.cjs.map} +1 -1
- package/dist/Composition-HIISJAX2.js +5 -0
- package/dist/{Composition-RJDSQYTV.js.map → Composition-HIISJAX2.js.map} +1 -1
- package/dist/Controller.cjs +34 -0
- package/dist/Controller.cjs.map +1 -1
- package/dist/Controller.d.cts +12 -2
- package/dist/Controller.d.ts +12 -2
- package/dist/Controller.js +34 -0
- package/dist/Controller.js.map +1 -1
- package/dist/{Movie-qGHp15c_.d.cts → Movie-DSSNOF3T.d.cts} +61 -2
- package/dist/{Movie-QMlFyHkf.d.ts → Movie-nzmWsxWX.d.ts} +61 -2
- package/dist/{chunk-O4AJYUPK.js → chunk-3IPDNC3E.js} +90 -14
- package/dist/chunk-3IPDNC3E.js.map +1 -0
- package/dist/{chunk-AGMNSJJH.cjs → chunk-6NWJLVCA.cjs} +196 -12
- package/dist/chunk-6NWJLVCA.cjs.map +1 -0
- package/dist/{chunk-FNKSXBKB.js → chunk-C6QHKYC5.js} +193 -14
- package/dist/chunk-C6QHKYC5.js.map +1 -0
- package/dist/{chunk-PDBDDGG5.cjs → chunk-F7NCHS6Q.cjs} +108 -32
- package/dist/chunk-F7NCHS6Q.cjs.map +1 -0
- package/dist/index.cjs +542 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +303 -5
- package/dist/index.d.ts +303 -5
- package/dist/index.js +511 -27
- package/dist/index.js.map +1 -1
- package/dist/loader.css +110 -0
- package/dist/three.cjs +5 -5
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +1 -1
- package/dist/{types-oJijbn-K.d.ts → types-BXu28nJj.d.cts} +26 -2
- package/dist/{types-oJijbn-K.d.cts → types-BXu28nJj.d.ts} +26 -2
- package/docs/api.md +16 -1
- package/docs/dsl.md +137 -2
- package/llms-full.txt +318 -26
- package/package.json +5 -2
- package/dist/Composition-CM62XJKT.cjs +0 -14
- package/dist/Composition-RJDSQYTV.js +0 -5
- package/dist/chunk-AGMNSJJH.cjs.map +0 -1
- package/dist/chunk-FNKSXBKB.js.map +0 -1
- package/dist/chunk-O4AJYUPK.js.map +0 -1
- package/dist/chunk-PDBDDGG5.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FrameEvent, I as InspectOptions, c as InspectReport, L as LayerInfo, M as Movie,
|
|
2
|
-
import { S as Sequence } from './Base-
|
|
3
|
-
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, b as SequenceCommon } from './types-
|
|
4
|
-
export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioSequenceSpec, f as AudioSfxSpec, g as ChromaKeyFilterSpec, h as CircleShapeSpec, i as CompositionSequenceSpec, j as CompositionSpec, k as CrossfadeTransition, l as CustomFilterSpec, D as DipTransition, m as DissolveTransition, E as EllipseShapeSpec, n as Expr, F as FilterSpec, G as GradientSpec, o as IrisTransition,
|
|
1
|
+
export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FrameEvent, I as InspectOptions, c as InspectReport, L as LayerInfo, d as LoaderOption, M as MotionBlurOptions, e as MotionBlurSpec, f as Movie, g as MovieErrorEvent, h as MovieOptions, P as ProgressEvent, R as RenderOptions, S as SnapshotOptions, i as SoundMeasure, T as TimelineData, j as TimelineHtmlOptions, k as TimelineRow, l as TimelineSvgOptions, m as TimelineTransition, V as VolumeEvent, n as dismissLoader, o as failLoader, r as resolveLoader } from './Movie-DSSNOF3T.cjs';
|
|
2
|
+
import { S as Sequence } from './Base-CwUxTfja.cjs';
|
|
3
|
+
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, b as SequenceCommon } from './types-BXu28nJj.cjs';
|
|
4
|
+
export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioSequenceSpec, f as AudioSfxSpec, g as ChromaKeyFilterSpec, h as CircleShapeSpec, i as CompositionSequenceSpec, j as CompositionSpec, k as CrossfadeTransition, l as CustomFilterSpec, D as DipTransition, m as DissolveTransition, E as EllipseShapeSpec, n as Expr, F as FilterSpec, G as GradientSpec, o as IrisTransition, L as LineShapeSpec, N as NullSequenceSpec, P as PathShapeSpec, p as PolygonShapeSpec, q as PropValue, r as Props, R as RectShapeSpec, s as SfxKnobs, t as SfxOptions, u as SfxPreset, v as SfxVoice, w as ShapeSequenceSpec, x as SlideTransition, y as TransitionCommon, z as TransitionSpec, V as VideoSequenceSpec, W as WipeTransition, Z as ZoomTransition } from './types-BXu28nJj.cjs';
|
|
5
5
|
import 'pixi.js';
|
|
6
6
|
import 'gsap';
|
|
7
7
|
|
|
@@ -162,6 +162,304 @@ interface OrbitOptions {
|
|
|
162
162
|
*/
|
|
163
163
|
declare function orbit(opts: OrbitOptions): CameraSequenceSpec;
|
|
164
164
|
|
|
165
|
+
type Range = number | [number, number];
|
|
166
|
+
interface ParticlesOptions {
|
|
167
|
+
/** How many particles. Required. */
|
|
168
|
+
count: number;
|
|
169
|
+
/** When the first one can be born, in composition seconds. Default 0. */
|
|
170
|
+
at?: number;
|
|
171
|
+
/** Births are spread over this many seconds (0, the default, is a burst: all at once). */
|
|
172
|
+
emit?: number;
|
|
173
|
+
/** How long each lives, in seconds: a number or `[min, max]`. Required. */
|
|
174
|
+
life: Range;
|
|
175
|
+
/** Where they start: the centre `x`, `y`, and optionally a `width` / `height` to spread over (snow: `{ x: 640, y: -20, width: 1280 }`). Required. */
|
|
176
|
+
area: {
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
width?: number;
|
|
180
|
+
height?: number;
|
|
181
|
+
};
|
|
182
|
+
/** Direction of the launch, degrees: 0 is right, 90 down, −90 up. A number or `[min, max]`. Default `[0, 360]`. */
|
|
183
|
+
angle?: Range;
|
|
184
|
+
/** Launch speed in px per second. Default `[100, 300]`. */
|
|
185
|
+
speed?: Range;
|
|
186
|
+
/** Acceleration down, px/s² (negative floats up). Default 0. */
|
|
187
|
+
gravity?: number;
|
|
188
|
+
/** Acceleration sideways, px/s². Default 0. */
|
|
189
|
+
wind?: number;
|
|
190
|
+
/** Air drag per second: they slow toward a terminal speed. Default 0. */
|
|
191
|
+
drag?: number;
|
|
192
|
+
/** A smooth side-to-side wobble: up to about ±`amp` px, `freq` wobbles per second (default 1). Snow, leaves, embers. */
|
|
193
|
+
sway?: {
|
|
194
|
+
amp: number;
|
|
195
|
+
freq?: number;
|
|
196
|
+
};
|
|
197
|
+
/** Radius in px (a square's half-side): a number or `[min, max]`. Default `[3, 6]`. */
|
|
198
|
+
size?: Range;
|
|
199
|
+
/** Scale over the life, `[start, end]` (`[1, 0]` shrinks away). Default none. */
|
|
200
|
+
scale?: [number, number];
|
|
201
|
+
/** Alpha ramps in seconds: `in` from transparent at birth, `out` back to transparent at the end of the life. */
|
|
202
|
+
fade?: {
|
|
203
|
+
in?: number;
|
|
204
|
+
out?: number;
|
|
205
|
+
};
|
|
206
|
+
/** Fill colours, picked at random for each particle. Default white. */
|
|
207
|
+
colors?: string[];
|
|
208
|
+
/** `'circle'` (default), `'rect'` (a square) or `'star'`. */
|
|
209
|
+
shape?: 'circle' | 'rect' | 'star';
|
|
210
|
+
/** Turning speed in degrees per second (a number or `[min, max]`; they also start at a random angle). Default none. */
|
|
211
|
+
spin?: Range;
|
|
212
|
+
/** Another seed is another burst. Default 0. */
|
|
213
|
+
seed?: number;
|
|
214
|
+
/** Layers are named `<name>-0`, `<name>-1`, … (default `'particle'`). */
|
|
215
|
+
name?: string;
|
|
216
|
+
/** `'add'` makes overlapping particles glow. */
|
|
217
|
+
blendMode?: string;
|
|
218
|
+
/** Use this layer (any type: an image, a text) for every particle instead of a shape; its keyframes are kept. */
|
|
219
|
+
template?: SequenceSpec;
|
|
220
|
+
/** Samples per second of a curved path (gravity, wind, drag, sway): straight steps between them. Default 20. */
|
|
221
|
+
sampleRate?: number;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Particles as plain layers: a burst, a fountain, snow, confetti, sparks. Each one is a layer with its own seeded start,
|
|
225
|
+
* velocity, size, colour and life, and a path baked into keyframes (so playback, seeking and export agree), living only
|
|
226
|
+
* while it is alive. Spread the result into `sequences`.
|
|
227
|
+
*
|
|
228
|
+
* ```js
|
|
229
|
+
* ...particles({ count: 80, at: 2, life: [0.8, 1.6], area: { x: 640, y: 400 }, speed: [150, 450], gravity: 500,
|
|
230
|
+
* size: [3, 7], colors: ['#ffd166', '#ff6b9d', '#4cc9f0'], fade: { out: 0.4 }, blendMode: 'add' })
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* A particle with no gravity, wind, drag or sway is one straight tween; a curved path is sampled `sampleRate` times a second.
|
|
234
|
+
*/
|
|
235
|
+
declare function particles(opts: ParticlesOptions): SequenceSpec[];
|
|
236
|
+
|
|
237
|
+
interface FollowPathOptions {
|
|
238
|
+
/** The route, as SVG path data in the same canvas coordinates the layer's `x` / `y` use. Several sub-paths are walked in order. */
|
|
239
|
+
d: string;
|
|
240
|
+
/** Start, in seconds from the start of the layer. Default 0. */
|
|
241
|
+
at?: number;
|
|
242
|
+
/** How long the trip takes, in seconds. Required. */
|
|
243
|
+
duration: number;
|
|
244
|
+
/** GSAP ease for the progress along the path (default `'none'`: constant speed). */
|
|
245
|
+
ease?: string;
|
|
246
|
+
/** Where on the path to start and stop, as fractions 0–1 of its length (default 0 → 1). `from: 1, to: 0` goes backwards. */
|
|
247
|
+
from?: number;
|
|
248
|
+
to?: number;
|
|
249
|
+
/** Turn the layer to face the way it is going (keyframes `rotation`, in degrees). Default false. */
|
|
250
|
+
orient?: boolean;
|
|
251
|
+
/** With `orient`: degrees added to the heading (`-90` for an image that points up). Default 0. */
|
|
252
|
+
rotate?: number;
|
|
253
|
+
/** Samples per second: set it to your movie's `frameRate` so the layer is exactly on the path at every frame. Default 30. */
|
|
254
|
+
frameRate?: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* A layer travelling along an SVG path, as keyframes for `x` and `y` (and `rotation` with `orient`). Put the result in a
|
|
258
|
+
* layer's `keyframes`; the layer's own `x` / `y` are the points of the path, so give circles and shapes their centre there
|
|
259
|
+
* and text `anchorX: 0.5, anchorY: 0.5`.
|
|
260
|
+
*
|
|
261
|
+
* The path is walked by arc length (so the speed is even whatever the curve) and sampled once per frame as short straight
|
|
262
|
+
* steps, which keeps the layer on the path at every rendered frame when `frameRate` matches the movie's.
|
|
263
|
+
*
|
|
264
|
+
* ```js
|
|
265
|
+
* { type: 'shape', shape: 'circle', radius: 12, initial: { fillColor: '#ffd166' },
|
|
266
|
+
* keyframes: followPath({ d: 'M 100 600 C 300 100 900 100 1180 600', duration: 4, ease: 'power2.inOut', frameRate: 30 }) }
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
declare function followPath(opts: FollowPathOptions): Keyframe[];
|
|
270
|
+
|
|
271
|
+
interface StaggerOptions {
|
|
272
|
+
/** Seconds between neighbours (the farthest one waits `each` × its distance). Default 0.1. Not together with `amount`. */
|
|
273
|
+
each?: number;
|
|
274
|
+
/** Seconds from the first to the last, however many there are. Not together with `each`. */
|
|
275
|
+
amount?: number;
|
|
276
|
+
/**
|
|
277
|
+
* Where the wave starts: `'start'` (default), `'end'`, `'center'` (outward), `'edges'` (inward), `'random'` (a seeded
|
|
278
|
+
* shuffle of the same delays), or the index of one item.
|
|
279
|
+
*/
|
|
280
|
+
from?: 'start' | 'end' | 'center' | 'edges' | 'random' | number;
|
|
281
|
+
/** `[columns, rows]`: the items fill a grid row by row and the wave travels by straight-line distance across it. */
|
|
282
|
+
grid?: [number, number];
|
|
283
|
+
/** GSAP ease that reshapes the spread (default `'none'`: even steps). The first stays at 0, the last at the full spread. */
|
|
284
|
+
ease?: string;
|
|
285
|
+
/** For `from: 'random'`: another seed is another order. Default 0. */
|
|
286
|
+
seed?: number;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Delays for a wave of items, in seconds, in the style of GSAP's `stagger`.
|
|
290
|
+
*
|
|
291
|
+
* stagger(6, { each: 0.08 }) // [0, 0.08, 0.16, …] use: `at: 1 + d[i]`
|
|
292
|
+
* stagger(letters, { each: 0.05, from: 'center' }) // the same layers with their `at` pushed back
|
|
293
|
+
*
|
|
294
|
+
* Given a layer array it returns new layers whose `at` is shifted by their delay; the originals are not touched.
|
|
295
|
+
* Everything is a pure function of the options (`from: 'random'` is seeded), so playback and export agree.
|
|
296
|
+
*/
|
|
297
|
+
declare function stagger(count: number, options?: StaggerOptions): number[];
|
|
298
|
+
declare function stagger<T extends {
|
|
299
|
+
at?: number;
|
|
300
|
+
}>(layers: readonly T[], options?: StaggerOptions): T[];
|
|
301
|
+
|
|
302
|
+
/** Where a piece starts (`from`), as offsets in x / y and absolute values for the rest, and how it gets to its resting place. */
|
|
303
|
+
declare const PRESETS: {
|
|
304
|
+
readonly rise: {
|
|
305
|
+
readonly from: {
|
|
306
|
+
readonly y: 40;
|
|
307
|
+
readonly alpha: 0;
|
|
308
|
+
};
|
|
309
|
+
readonly duration: 0.5;
|
|
310
|
+
readonly ease: "back.out(2)";
|
|
311
|
+
};
|
|
312
|
+
readonly drop: {
|
|
313
|
+
readonly from: {
|
|
314
|
+
readonly y: -50;
|
|
315
|
+
readonly alpha: 0;
|
|
316
|
+
};
|
|
317
|
+
readonly duration: 0.7;
|
|
318
|
+
readonly ease: "bounce.out";
|
|
319
|
+
};
|
|
320
|
+
readonly fade: {
|
|
321
|
+
readonly from: {
|
|
322
|
+
readonly alpha: 0;
|
|
323
|
+
};
|
|
324
|
+
readonly duration: 0.5;
|
|
325
|
+
readonly ease: "power1.out";
|
|
326
|
+
};
|
|
327
|
+
readonly pop: {
|
|
328
|
+
readonly from: {
|
|
329
|
+
readonly scale: 0;
|
|
330
|
+
readonly alpha: 0;
|
|
331
|
+
};
|
|
332
|
+
readonly duration: 0.45;
|
|
333
|
+
readonly ease: "back.out(2.4)";
|
|
334
|
+
};
|
|
335
|
+
readonly zoom: {
|
|
336
|
+
readonly from: {
|
|
337
|
+
readonly scale: 2.5;
|
|
338
|
+
readonly alpha: 0;
|
|
339
|
+
};
|
|
340
|
+
readonly duration: 0.6;
|
|
341
|
+
readonly ease: "power3.out";
|
|
342
|
+
};
|
|
343
|
+
readonly slide: {
|
|
344
|
+
readonly from: {
|
|
345
|
+
readonly x: -60;
|
|
346
|
+
readonly alpha: 0;
|
|
347
|
+
};
|
|
348
|
+
readonly duration: 0.5;
|
|
349
|
+
readonly ease: "power3.out";
|
|
350
|
+
};
|
|
351
|
+
readonly spin: {
|
|
352
|
+
readonly from: {
|
|
353
|
+
readonly rotation: -90;
|
|
354
|
+
readonly scale: 0;
|
|
355
|
+
readonly alpha: 0;
|
|
356
|
+
};
|
|
357
|
+
readonly duration: 0.6;
|
|
358
|
+
readonly ease: "back.out(1.7)";
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
type TextPreset = keyof typeof PRESETS;
|
|
362
|
+
interface AnimateTextTween {
|
|
363
|
+
/** Start from this preset and change what you give below. */
|
|
364
|
+
preset?: TextPreset;
|
|
365
|
+
/** The hidden state: `x` / `y` are offsets from the resting place, everything else (`alpha`, `scale`, `rotation`, …) is absolute. */
|
|
366
|
+
from?: Record<string, number>;
|
|
367
|
+
/** The resting state, for properties that have none of their own (`alpha` 1, `scale` 1, `rotation` 0 and the place are known). */
|
|
368
|
+
to?: Record<string, number>;
|
|
369
|
+
/** Seconds each piece takes. */
|
|
370
|
+
duration?: number;
|
|
371
|
+
/** GSAP ease. */
|
|
372
|
+
ease?: string;
|
|
373
|
+
}
|
|
374
|
+
interface AnimateTextOptions {
|
|
375
|
+
/** What a piece is: a character (default), a word or a line. */
|
|
376
|
+
by?: 'chars' | 'words' | 'lines';
|
|
377
|
+
/** Where the text goes: `x` is its left edge, or its centre / right edge with `align`. */
|
|
378
|
+
x?: number;
|
|
379
|
+
/** Top of the first line. */
|
|
380
|
+
y?: number;
|
|
381
|
+
align?: 'left' | 'center' | 'right';
|
|
382
|
+
/** Layers are named `<name>-0`, `<name>-1`, … (default `'text'`). */
|
|
383
|
+
name?: string;
|
|
384
|
+
/** When the first piece starts, in composition seconds. Default 0. */
|
|
385
|
+
at?: number;
|
|
386
|
+
/** Seconds from `at` until every piece is gone, the last one included. Required. */
|
|
387
|
+
duration: number;
|
|
388
|
+
/** How a piece arrives: a preset (`'rise'` default, `'drop'`, `'fade'`, `'pop'`, `'zoom'`, `'slide'`, `'spin'`), your own tween, or `false` for none. */
|
|
389
|
+
in?: TextPreset | AnimateTextTween | false;
|
|
390
|
+
/** How a piece leaves, in the same wave (the entrance backwards, eased the other way). Default none. */
|
|
391
|
+
out?: TextPreset | AnimateTextTween | false;
|
|
392
|
+
/** The wave: see {@link stagger}. Default `{ each: 0.04 }`. */
|
|
393
|
+
stagger?: StaggerOptions;
|
|
394
|
+
/** A seeded drift between the entrance and the exit, each piece its own: `{ y: 4, rotation: 1 }` (amounts), `freq` (default 1 target per second), `seed`. */
|
|
395
|
+
idle?: {
|
|
396
|
+
x?: number;
|
|
397
|
+
y?: number;
|
|
398
|
+
rotation?: number;
|
|
399
|
+
scale?: number;
|
|
400
|
+
freq?: number;
|
|
401
|
+
seed?: number;
|
|
402
|
+
};
|
|
403
|
+
/** Style changes for one piece (a colour for the first letter): merged over `style`. */
|
|
404
|
+
styleFor?: (piece: TextPiece) => MeasureStyle;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Per-character, per-word or per-line text animation in one call: one text layer per piece, laid out exactly like the
|
|
408
|
+
* whole text, each entering (and optionally leaving) in a wave. It is `splitText` + `stagger` + a preset, so the result
|
|
409
|
+
* is plain layers you can spread into `sequences`, add to, or change.
|
|
410
|
+
*
|
|
411
|
+
* ```js
|
|
412
|
+
* ...animateText('Hello world', style, { x: 640, y: 300, align: 'center', at: 0.5, duration: 5,
|
|
413
|
+
* in: 'rise', out: 'fade', stagger: { each: 0.05, from: 'center' } })
|
|
414
|
+
* ```
|
|
415
|
+
*
|
|
416
|
+
* Pieces rotate and scale about their own centre. All pieces are gone at `at + duration`.
|
|
417
|
+
*/
|
|
418
|
+
declare function animateText(text: string, style: MeasureStyle, options: AnimateTextOptions): TextSequenceSpec[];
|
|
419
|
+
|
|
420
|
+
interface WiggleProp {
|
|
421
|
+
/** The value the property rests at: a number or an expression (`'W/2'`). The wiggle starts and ends here. */
|
|
422
|
+
around: number | string;
|
|
423
|
+
/** How far it strays from `around` (same unit as the property). */
|
|
424
|
+
amp: number;
|
|
425
|
+
}
|
|
426
|
+
interface WiggleOptions {
|
|
427
|
+
/** Start, in seconds from the start of the layer. Default 0. */
|
|
428
|
+
at?: number;
|
|
429
|
+
/** How long it shakes, in seconds. Required. */
|
|
430
|
+
duration: number;
|
|
431
|
+
/** New random targets per second. Default 3 (a drift); 8 and up reads as a shake. */
|
|
432
|
+
freq?: number;
|
|
433
|
+
/** Another seed is another take of the same shake. Default 0. */
|
|
434
|
+
seed?: number;
|
|
435
|
+
/** GSAP ease between targets. Default `'sine.inOut'`; `'none'` gives straight, jittery lines. */
|
|
436
|
+
ease?: string;
|
|
437
|
+
/** The properties to move, each independently: `{ x: { around: 960, amp: 6 }, rotation: { around: 0, amp: 1.5 } }`. */
|
|
438
|
+
props: Record<string, WiggleProp>;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* A seeded wiggle as keyframes: put the result in a layer's `keyframes`
|
|
442
|
+
* (spread it next to others: `keyframes: [...wiggle({ … }), { at: 4, to: … }]`).
|
|
443
|
+
*
|
|
444
|
+
* Expressions are evaluated once when the layer is built, so a wiggle cannot
|
|
445
|
+
* be an expression; it is baked into ordinary keyframes instead. The targets
|
|
446
|
+
* come from the seed, so playback, seeking and export all agree. The last step
|
|
447
|
+
* returns every property to `around`, so the layer is not left offset.
|
|
448
|
+
*/
|
|
449
|
+
declare function wiggle(opts: WiggleOptions): Keyframe[];
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Seeded randomness. Everything here is a pure function of its inputs (no
|
|
453
|
+
* wall clock, no `Math.random`), so playback, seeking and export always
|
|
454
|
+
* produce the same pixels.
|
|
455
|
+
*/
|
|
456
|
+
/** The same seed always gives the same number in [0, 1). */
|
|
457
|
+
declare function rand(seed: number): number;
|
|
458
|
+
/** A repeatable stream of numbers in [0, 1): `const r = random(7); r(); r(); …` */
|
|
459
|
+
declare function random(seed: number): () => number;
|
|
460
|
+
/** Smooth 1-D noise in [-1, 1]: continuous in `x`, a different curve for every `seed`. */
|
|
461
|
+
declare function noise(x: number, seed?: number): number;
|
|
462
|
+
|
|
165
463
|
interface WithFadeOptions {
|
|
166
464
|
/** Fade-in duration (seconds), at the start of the sequence. */
|
|
167
465
|
in?: number;
|
|
@@ -196,4 +494,4 @@ interface WithFadeOptions {
|
|
|
196
494
|
*/
|
|
197
495
|
declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
|
|
198
496
|
|
|
199
|
-
export { CameraSequenceSpec, ImageSequenceSpec, type KenBurnsOptions, type MeasureStyle, type OrbitOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type TextPiece, type TextSize, type WithFadeOptions, kenBurns, measureText, orbit, registerSequenceType, splitText, withFade };
|
|
497
|
+
export { type AnimateTextOptions, type AnimateTextTween, CameraSequenceSpec, type FollowPathOptions, ImageSequenceSpec, type KenBurnsOptions, Keyframe, type MeasureStyle, type OrbitOptions, type ParticlesOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type StaggerOptions, type TextPiece, type TextPreset, TextSequenceSpec, type TextSize, type WiggleOptions, type WiggleProp, type WithFadeOptions, animateText, followPath, kenBurns, measureText, noise, orbit, particles, rand, random, registerSequenceType, splitText, stagger, wiggle, withFade };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FrameEvent, I as InspectOptions, c as InspectReport, L as LayerInfo, M as Movie,
|
|
2
|
-
import { S as Sequence } from './Base-
|
|
3
|
-
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, b as SequenceCommon } from './types-
|
|
4
|
-
export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioSequenceSpec, f as AudioSfxSpec, g as ChromaKeyFilterSpec, h as CircleShapeSpec, i as CompositionSequenceSpec, j as CompositionSpec, k as CrossfadeTransition, l as CustomFilterSpec, D as DipTransition, m as DissolveTransition, E as EllipseShapeSpec, n as Expr, F as FilterSpec, G as GradientSpec, o as IrisTransition,
|
|
1
|
+
export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FrameEvent, I as InspectOptions, c as InspectReport, L as LayerInfo, d as LoaderOption, M as MotionBlurOptions, e as MotionBlurSpec, f as Movie, g as MovieErrorEvent, h as MovieOptions, P as ProgressEvent, R as RenderOptions, S as SnapshotOptions, i as SoundMeasure, T as TimelineData, j as TimelineHtmlOptions, k as TimelineRow, l as TimelineSvgOptions, m as TimelineTransition, V as VolumeEvent, n as dismissLoader, o as failLoader, r as resolveLoader } from './Movie-nzmWsxWX.js';
|
|
2
|
+
import { S as Sequence } from './Base-CyvSLoCP.js';
|
|
3
|
+
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, b as SequenceCommon } from './types-BXu28nJj.js';
|
|
4
|
+
export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioSequenceSpec, f as AudioSfxSpec, g as ChromaKeyFilterSpec, h as CircleShapeSpec, i as CompositionSequenceSpec, j as CompositionSpec, k as CrossfadeTransition, l as CustomFilterSpec, D as DipTransition, m as DissolveTransition, E as EllipseShapeSpec, n as Expr, F as FilterSpec, G as GradientSpec, o as IrisTransition, L as LineShapeSpec, N as NullSequenceSpec, P as PathShapeSpec, p as PolygonShapeSpec, q as PropValue, r as Props, R as RectShapeSpec, s as SfxKnobs, t as SfxOptions, u as SfxPreset, v as SfxVoice, w as ShapeSequenceSpec, x as SlideTransition, y as TransitionCommon, z as TransitionSpec, V as VideoSequenceSpec, W as WipeTransition, Z as ZoomTransition } from './types-BXu28nJj.js';
|
|
5
5
|
import 'pixi.js';
|
|
6
6
|
import 'gsap';
|
|
7
7
|
|
|
@@ -162,6 +162,304 @@ interface OrbitOptions {
|
|
|
162
162
|
*/
|
|
163
163
|
declare function orbit(opts: OrbitOptions): CameraSequenceSpec;
|
|
164
164
|
|
|
165
|
+
type Range = number | [number, number];
|
|
166
|
+
interface ParticlesOptions {
|
|
167
|
+
/** How many particles. Required. */
|
|
168
|
+
count: number;
|
|
169
|
+
/** When the first one can be born, in composition seconds. Default 0. */
|
|
170
|
+
at?: number;
|
|
171
|
+
/** Births are spread over this many seconds (0, the default, is a burst: all at once). */
|
|
172
|
+
emit?: number;
|
|
173
|
+
/** How long each lives, in seconds: a number or `[min, max]`. Required. */
|
|
174
|
+
life: Range;
|
|
175
|
+
/** Where they start: the centre `x`, `y`, and optionally a `width` / `height` to spread over (snow: `{ x: 640, y: -20, width: 1280 }`). Required. */
|
|
176
|
+
area: {
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
width?: number;
|
|
180
|
+
height?: number;
|
|
181
|
+
};
|
|
182
|
+
/** Direction of the launch, degrees: 0 is right, 90 down, −90 up. A number or `[min, max]`. Default `[0, 360]`. */
|
|
183
|
+
angle?: Range;
|
|
184
|
+
/** Launch speed in px per second. Default `[100, 300]`. */
|
|
185
|
+
speed?: Range;
|
|
186
|
+
/** Acceleration down, px/s² (negative floats up). Default 0. */
|
|
187
|
+
gravity?: number;
|
|
188
|
+
/** Acceleration sideways, px/s². Default 0. */
|
|
189
|
+
wind?: number;
|
|
190
|
+
/** Air drag per second: they slow toward a terminal speed. Default 0. */
|
|
191
|
+
drag?: number;
|
|
192
|
+
/** A smooth side-to-side wobble: up to about ±`amp` px, `freq` wobbles per second (default 1). Snow, leaves, embers. */
|
|
193
|
+
sway?: {
|
|
194
|
+
amp: number;
|
|
195
|
+
freq?: number;
|
|
196
|
+
};
|
|
197
|
+
/** Radius in px (a square's half-side): a number or `[min, max]`. Default `[3, 6]`. */
|
|
198
|
+
size?: Range;
|
|
199
|
+
/** Scale over the life, `[start, end]` (`[1, 0]` shrinks away). Default none. */
|
|
200
|
+
scale?: [number, number];
|
|
201
|
+
/** Alpha ramps in seconds: `in` from transparent at birth, `out` back to transparent at the end of the life. */
|
|
202
|
+
fade?: {
|
|
203
|
+
in?: number;
|
|
204
|
+
out?: number;
|
|
205
|
+
};
|
|
206
|
+
/** Fill colours, picked at random for each particle. Default white. */
|
|
207
|
+
colors?: string[];
|
|
208
|
+
/** `'circle'` (default), `'rect'` (a square) or `'star'`. */
|
|
209
|
+
shape?: 'circle' | 'rect' | 'star';
|
|
210
|
+
/** Turning speed in degrees per second (a number or `[min, max]`; they also start at a random angle). Default none. */
|
|
211
|
+
spin?: Range;
|
|
212
|
+
/** Another seed is another burst. Default 0. */
|
|
213
|
+
seed?: number;
|
|
214
|
+
/** Layers are named `<name>-0`, `<name>-1`, … (default `'particle'`). */
|
|
215
|
+
name?: string;
|
|
216
|
+
/** `'add'` makes overlapping particles glow. */
|
|
217
|
+
blendMode?: string;
|
|
218
|
+
/** Use this layer (any type: an image, a text) for every particle instead of a shape; its keyframes are kept. */
|
|
219
|
+
template?: SequenceSpec;
|
|
220
|
+
/** Samples per second of a curved path (gravity, wind, drag, sway): straight steps between them. Default 20. */
|
|
221
|
+
sampleRate?: number;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Particles as plain layers: a burst, a fountain, snow, confetti, sparks. Each one is a layer with its own seeded start,
|
|
225
|
+
* velocity, size, colour and life, and a path baked into keyframes (so playback, seeking and export agree), living only
|
|
226
|
+
* while it is alive. Spread the result into `sequences`.
|
|
227
|
+
*
|
|
228
|
+
* ```js
|
|
229
|
+
* ...particles({ count: 80, at: 2, life: [0.8, 1.6], area: { x: 640, y: 400 }, speed: [150, 450], gravity: 500,
|
|
230
|
+
* size: [3, 7], colors: ['#ffd166', '#ff6b9d', '#4cc9f0'], fade: { out: 0.4 }, blendMode: 'add' })
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* A particle with no gravity, wind, drag or sway is one straight tween; a curved path is sampled `sampleRate` times a second.
|
|
234
|
+
*/
|
|
235
|
+
declare function particles(opts: ParticlesOptions): SequenceSpec[];
|
|
236
|
+
|
|
237
|
+
interface FollowPathOptions {
|
|
238
|
+
/** The route, as SVG path data in the same canvas coordinates the layer's `x` / `y` use. Several sub-paths are walked in order. */
|
|
239
|
+
d: string;
|
|
240
|
+
/** Start, in seconds from the start of the layer. Default 0. */
|
|
241
|
+
at?: number;
|
|
242
|
+
/** How long the trip takes, in seconds. Required. */
|
|
243
|
+
duration: number;
|
|
244
|
+
/** GSAP ease for the progress along the path (default `'none'`: constant speed). */
|
|
245
|
+
ease?: string;
|
|
246
|
+
/** Where on the path to start and stop, as fractions 0–1 of its length (default 0 → 1). `from: 1, to: 0` goes backwards. */
|
|
247
|
+
from?: number;
|
|
248
|
+
to?: number;
|
|
249
|
+
/** Turn the layer to face the way it is going (keyframes `rotation`, in degrees). Default false. */
|
|
250
|
+
orient?: boolean;
|
|
251
|
+
/** With `orient`: degrees added to the heading (`-90` for an image that points up). Default 0. */
|
|
252
|
+
rotate?: number;
|
|
253
|
+
/** Samples per second: set it to your movie's `frameRate` so the layer is exactly on the path at every frame. Default 30. */
|
|
254
|
+
frameRate?: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* A layer travelling along an SVG path, as keyframes for `x` and `y` (and `rotation` with `orient`). Put the result in a
|
|
258
|
+
* layer's `keyframes`; the layer's own `x` / `y` are the points of the path, so give circles and shapes their centre there
|
|
259
|
+
* and text `anchorX: 0.5, anchorY: 0.5`.
|
|
260
|
+
*
|
|
261
|
+
* The path is walked by arc length (so the speed is even whatever the curve) and sampled once per frame as short straight
|
|
262
|
+
* steps, which keeps the layer on the path at every rendered frame when `frameRate` matches the movie's.
|
|
263
|
+
*
|
|
264
|
+
* ```js
|
|
265
|
+
* { type: 'shape', shape: 'circle', radius: 12, initial: { fillColor: '#ffd166' },
|
|
266
|
+
* keyframes: followPath({ d: 'M 100 600 C 300 100 900 100 1180 600', duration: 4, ease: 'power2.inOut', frameRate: 30 }) }
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
declare function followPath(opts: FollowPathOptions): Keyframe[];
|
|
270
|
+
|
|
271
|
+
interface StaggerOptions {
|
|
272
|
+
/** Seconds between neighbours (the farthest one waits `each` × its distance). Default 0.1. Not together with `amount`. */
|
|
273
|
+
each?: number;
|
|
274
|
+
/** Seconds from the first to the last, however many there are. Not together with `each`. */
|
|
275
|
+
amount?: number;
|
|
276
|
+
/**
|
|
277
|
+
* Where the wave starts: `'start'` (default), `'end'`, `'center'` (outward), `'edges'` (inward), `'random'` (a seeded
|
|
278
|
+
* shuffle of the same delays), or the index of one item.
|
|
279
|
+
*/
|
|
280
|
+
from?: 'start' | 'end' | 'center' | 'edges' | 'random' | number;
|
|
281
|
+
/** `[columns, rows]`: the items fill a grid row by row and the wave travels by straight-line distance across it. */
|
|
282
|
+
grid?: [number, number];
|
|
283
|
+
/** GSAP ease that reshapes the spread (default `'none'`: even steps). The first stays at 0, the last at the full spread. */
|
|
284
|
+
ease?: string;
|
|
285
|
+
/** For `from: 'random'`: another seed is another order. Default 0. */
|
|
286
|
+
seed?: number;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Delays for a wave of items, in seconds, in the style of GSAP's `stagger`.
|
|
290
|
+
*
|
|
291
|
+
* stagger(6, { each: 0.08 }) // [0, 0.08, 0.16, …] use: `at: 1 + d[i]`
|
|
292
|
+
* stagger(letters, { each: 0.05, from: 'center' }) // the same layers with their `at` pushed back
|
|
293
|
+
*
|
|
294
|
+
* Given a layer array it returns new layers whose `at` is shifted by their delay; the originals are not touched.
|
|
295
|
+
* Everything is a pure function of the options (`from: 'random'` is seeded), so playback and export agree.
|
|
296
|
+
*/
|
|
297
|
+
declare function stagger(count: number, options?: StaggerOptions): number[];
|
|
298
|
+
declare function stagger<T extends {
|
|
299
|
+
at?: number;
|
|
300
|
+
}>(layers: readonly T[], options?: StaggerOptions): T[];
|
|
301
|
+
|
|
302
|
+
/** Where a piece starts (`from`), as offsets in x / y and absolute values for the rest, and how it gets to its resting place. */
|
|
303
|
+
declare const PRESETS: {
|
|
304
|
+
readonly rise: {
|
|
305
|
+
readonly from: {
|
|
306
|
+
readonly y: 40;
|
|
307
|
+
readonly alpha: 0;
|
|
308
|
+
};
|
|
309
|
+
readonly duration: 0.5;
|
|
310
|
+
readonly ease: "back.out(2)";
|
|
311
|
+
};
|
|
312
|
+
readonly drop: {
|
|
313
|
+
readonly from: {
|
|
314
|
+
readonly y: -50;
|
|
315
|
+
readonly alpha: 0;
|
|
316
|
+
};
|
|
317
|
+
readonly duration: 0.7;
|
|
318
|
+
readonly ease: "bounce.out";
|
|
319
|
+
};
|
|
320
|
+
readonly fade: {
|
|
321
|
+
readonly from: {
|
|
322
|
+
readonly alpha: 0;
|
|
323
|
+
};
|
|
324
|
+
readonly duration: 0.5;
|
|
325
|
+
readonly ease: "power1.out";
|
|
326
|
+
};
|
|
327
|
+
readonly pop: {
|
|
328
|
+
readonly from: {
|
|
329
|
+
readonly scale: 0;
|
|
330
|
+
readonly alpha: 0;
|
|
331
|
+
};
|
|
332
|
+
readonly duration: 0.45;
|
|
333
|
+
readonly ease: "back.out(2.4)";
|
|
334
|
+
};
|
|
335
|
+
readonly zoom: {
|
|
336
|
+
readonly from: {
|
|
337
|
+
readonly scale: 2.5;
|
|
338
|
+
readonly alpha: 0;
|
|
339
|
+
};
|
|
340
|
+
readonly duration: 0.6;
|
|
341
|
+
readonly ease: "power3.out";
|
|
342
|
+
};
|
|
343
|
+
readonly slide: {
|
|
344
|
+
readonly from: {
|
|
345
|
+
readonly x: -60;
|
|
346
|
+
readonly alpha: 0;
|
|
347
|
+
};
|
|
348
|
+
readonly duration: 0.5;
|
|
349
|
+
readonly ease: "power3.out";
|
|
350
|
+
};
|
|
351
|
+
readonly spin: {
|
|
352
|
+
readonly from: {
|
|
353
|
+
readonly rotation: -90;
|
|
354
|
+
readonly scale: 0;
|
|
355
|
+
readonly alpha: 0;
|
|
356
|
+
};
|
|
357
|
+
readonly duration: 0.6;
|
|
358
|
+
readonly ease: "back.out(1.7)";
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
type TextPreset = keyof typeof PRESETS;
|
|
362
|
+
interface AnimateTextTween {
|
|
363
|
+
/** Start from this preset and change what you give below. */
|
|
364
|
+
preset?: TextPreset;
|
|
365
|
+
/** The hidden state: `x` / `y` are offsets from the resting place, everything else (`alpha`, `scale`, `rotation`, …) is absolute. */
|
|
366
|
+
from?: Record<string, number>;
|
|
367
|
+
/** The resting state, for properties that have none of their own (`alpha` 1, `scale` 1, `rotation` 0 and the place are known). */
|
|
368
|
+
to?: Record<string, number>;
|
|
369
|
+
/** Seconds each piece takes. */
|
|
370
|
+
duration?: number;
|
|
371
|
+
/** GSAP ease. */
|
|
372
|
+
ease?: string;
|
|
373
|
+
}
|
|
374
|
+
interface AnimateTextOptions {
|
|
375
|
+
/** What a piece is: a character (default), a word or a line. */
|
|
376
|
+
by?: 'chars' | 'words' | 'lines';
|
|
377
|
+
/** Where the text goes: `x` is its left edge, or its centre / right edge with `align`. */
|
|
378
|
+
x?: number;
|
|
379
|
+
/** Top of the first line. */
|
|
380
|
+
y?: number;
|
|
381
|
+
align?: 'left' | 'center' | 'right';
|
|
382
|
+
/** Layers are named `<name>-0`, `<name>-1`, … (default `'text'`). */
|
|
383
|
+
name?: string;
|
|
384
|
+
/** When the first piece starts, in composition seconds. Default 0. */
|
|
385
|
+
at?: number;
|
|
386
|
+
/** Seconds from `at` until every piece is gone, the last one included. Required. */
|
|
387
|
+
duration: number;
|
|
388
|
+
/** How a piece arrives: a preset (`'rise'` default, `'drop'`, `'fade'`, `'pop'`, `'zoom'`, `'slide'`, `'spin'`), your own tween, or `false` for none. */
|
|
389
|
+
in?: TextPreset | AnimateTextTween | false;
|
|
390
|
+
/** How a piece leaves, in the same wave (the entrance backwards, eased the other way). Default none. */
|
|
391
|
+
out?: TextPreset | AnimateTextTween | false;
|
|
392
|
+
/** The wave: see {@link stagger}. Default `{ each: 0.04 }`. */
|
|
393
|
+
stagger?: StaggerOptions;
|
|
394
|
+
/** A seeded drift between the entrance and the exit, each piece its own: `{ y: 4, rotation: 1 }` (amounts), `freq` (default 1 target per second), `seed`. */
|
|
395
|
+
idle?: {
|
|
396
|
+
x?: number;
|
|
397
|
+
y?: number;
|
|
398
|
+
rotation?: number;
|
|
399
|
+
scale?: number;
|
|
400
|
+
freq?: number;
|
|
401
|
+
seed?: number;
|
|
402
|
+
};
|
|
403
|
+
/** Style changes for one piece (a colour for the first letter): merged over `style`. */
|
|
404
|
+
styleFor?: (piece: TextPiece) => MeasureStyle;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Per-character, per-word or per-line text animation in one call: one text layer per piece, laid out exactly like the
|
|
408
|
+
* whole text, each entering (and optionally leaving) in a wave. It is `splitText` + `stagger` + a preset, so the result
|
|
409
|
+
* is plain layers you can spread into `sequences`, add to, or change.
|
|
410
|
+
*
|
|
411
|
+
* ```js
|
|
412
|
+
* ...animateText('Hello world', style, { x: 640, y: 300, align: 'center', at: 0.5, duration: 5,
|
|
413
|
+
* in: 'rise', out: 'fade', stagger: { each: 0.05, from: 'center' } })
|
|
414
|
+
* ```
|
|
415
|
+
*
|
|
416
|
+
* Pieces rotate and scale about their own centre. All pieces are gone at `at + duration`.
|
|
417
|
+
*/
|
|
418
|
+
declare function animateText(text: string, style: MeasureStyle, options: AnimateTextOptions): TextSequenceSpec[];
|
|
419
|
+
|
|
420
|
+
interface WiggleProp {
|
|
421
|
+
/** The value the property rests at: a number or an expression (`'W/2'`). The wiggle starts and ends here. */
|
|
422
|
+
around: number | string;
|
|
423
|
+
/** How far it strays from `around` (same unit as the property). */
|
|
424
|
+
amp: number;
|
|
425
|
+
}
|
|
426
|
+
interface WiggleOptions {
|
|
427
|
+
/** Start, in seconds from the start of the layer. Default 0. */
|
|
428
|
+
at?: number;
|
|
429
|
+
/** How long it shakes, in seconds. Required. */
|
|
430
|
+
duration: number;
|
|
431
|
+
/** New random targets per second. Default 3 (a drift); 8 and up reads as a shake. */
|
|
432
|
+
freq?: number;
|
|
433
|
+
/** Another seed is another take of the same shake. Default 0. */
|
|
434
|
+
seed?: number;
|
|
435
|
+
/** GSAP ease between targets. Default `'sine.inOut'`; `'none'` gives straight, jittery lines. */
|
|
436
|
+
ease?: string;
|
|
437
|
+
/** The properties to move, each independently: `{ x: { around: 960, amp: 6 }, rotation: { around: 0, amp: 1.5 } }`. */
|
|
438
|
+
props: Record<string, WiggleProp>;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* A seeded wiggle as keyframes: put the result in a layer's `keyframes`
|
|
442
|
+
* (spread it next to others: `keyframes: [...wiggle({ … }), { at: 4, to: … }]`).
|
|
443
|
+
*
|
|
444
|
+
* Expressions are evaluated once when the layer is built, so a wiggle cannot
|
|
445
|
+
* be an expression; it is baked into ordinary keyframes instead. The targets
|
|
446
|
+
* come from the seed, so playback, seeking and export all agree. The last step
|
|
447
|
+
* returns every property to `around`, so the layer is not left offset.
|
|
448
|
+
*/
|
|
449
|
+
declare function wiggle(opts: WiggleOptions): Keyframe[];
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Seeded randomness. Everything here is a pure function of its inputs (no
|
|
453
|
+
* wall clock, no `Math.random`), so playback, seeking and export always
|
|
454
|
+
* produce the same pixels.
|
|
455
|
+
*/
|
|
456
|
+
/** The same seed always gives the same number in [0, 1). */
|
|
457
|
+
declare function rand(seed: number): number;
|
|
458
|
+
/** A repeatable stream of numbers in [0, 1): `const r = random(7); r(); r(); …` */
|
|
459
|
+
declare function random(seed: number): () => number;
|
|
460
|
+
/** Smooth 1-D noise in [-1, 1]: continuous in `x`, a different curve for every `seed`. */
|
|
461
|
+
declare function noise(x: number, seed?: number): number;
|
|
462
|
+
|
|
165
463
|
interface WithFadeOptions {
|
|
166
464
|
/** Fade-in duration (seconds), at the start of the sequence. */
|
|
167
465
|
in?: number;
|
|
@@ -196,4 +494,4 @@ interface WithFadeOptions {
|
|
|
196
494
|
*/
|
|
197
495
|
declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
|
|
198
496
|
|
|
199
|
-
export { CameraSequenceSpec, ImageSequenceSpec, type KenBurnsOptions, type MeasureStyle, type OrbitOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type TextPiece, type TextSize, type WithFadeOptions, kenBurns, measureText, orbit, registerSequenceType, splitText, withFade };
|
|
497
|
+
export { type AnimateTextOptions, type AnimateTextTween, CameraSequenceSpec, type FollowPathOptions, ImageSequenceSpec, type KenBurnsOptions, Keyframe, type MeasureStyle, type OrbitOptions, type ParticlesOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type StaggerOptions, type TextPiece, type TextPreset, TextSequenceSpec, type TextSize, type WiggleOptions, type WiggleProp, type WithFadeOptions, animateText, followPath, kenBurns, measureText, noise, orbit, particles, rand, random, registerSequenceType, splitText, stagger, wiggle, withFade };
|