pixi-effects 0.18.0 → 0.18.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 +6 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/reference/cheatsheet.md +1 -1
- package/ai/reference/pitfalls.md +1 -1
- package/ai/template.html +5 -5
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/loader.css +1 -1
- package/llms-full.txt +2 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -419,7 +419,7 @@ interface AnimateTextOptions {
|
|
|
419
419
|
duration: number;
|
|
420
420
|
/** How a piece arrives: a preset (`'rise'` default, `'drop'`, `'fade'`, `'pop'`, `'zoom'`, `'slide'`, `'spin'`), your own tween, or `false` for none. */
|
|
421
421
|
in?: TextPreset | AnimateTextTween | false;
|
|
422
|
-
/** How a piece leaves, in the same wave (the entrance backwards, eased the other way). Default none. */
|
|
422
|
+
/** How a piece leaves, in the same wave (the entrance backwards, eased the other way). It leaves from the END of the layer (`at + duration`) and has no `at` of its own: to be gone at time T, set `duration` to T − `at`. Default none. */
|
|
423
423
|
out?: TextPreset | AnimateTextTween | false;
|
|
424
424
|
/** The wave: see {@link stagger}. Default `{ each: 0.04 }`. */
|
|
425
425
|
stagger?: StaggerOptions;
|
package/dist/index.d.ts
CHANGED
|
@@ -419,7 +419,7 @@ interface AnimateTextOptions {
|
|
|
419
419
|
duration: number;
|
|
420
420
|
/** How a piece arrives: a preset (`'rise'` default, `'drop'`, `'fade'`, `'pop'`, `'zoom'`, `'slide'`, `'spin'`), your own tween, or `false` for none. */
|
|
421
421
|
in?: TextPreset | AnimateTextTween | false;
|
|
422
|
-
/** How a piece leaves, in the same wave (the entrance backwards, eased the other way). Default none. */
|
|
422
|
+
/** How a piece leaves, in the same wave (the entrance backwards, eased the other way). It leaves from the END of the layer (`at + duration`) and has no `at` of its own: to be gone at time T, set `duration` to T − `at`. Default none. */
|
|
423
423
|
out?: TextPreset | AnimateTextTween | false;
|
|
424
424
|
/** The wave: see {@link stagger}. Default `{ each: 0.04 }`. */
|
|
425
425
|
stagger?: StaggerOptions;
|
package/dist/index.js
CHANGED
|
@@ -3403,6 +3403,8 @@ function wiggle(opts) {
|
|
|
3403
3403
|
}
|
|
3404
3404
|
|
|
3405
3405
|
// src/presets/animateText.ts
|
|
3406
|
+
var TWEEN_KEYS = ["preset", "from", "to", "duration", "ease"];
|
|
3407
|
+
var TIME_KEYS = ["at", "delay", "start", "begin", "time"];
|
|
3406
3408
|
var KEYS5 = ["by", "x", "y", "align", "name", "at", "duration", "in", "out", "stagger", "idle", "styleFor"];
|
|
3407
3409
|
var PRESETS = {
|
|
3408
3410
|
rise: { from: { y: 40, alpha: 0 }, duration: 0.5, ease: "back.out(2)" },
|
|
@@ -3486,6 +3488,14 @@ function animateText(text, style, options) {
|
|
|
3486
3488
|
}
|
|
3487
3489
|
function resolveTween(spec, which) {
|
|
3488
3490
|
const t = typeof spec === "string" ? { preset: spec } : spec;
|
|
3491
|
+
if (typeof spec === "object" && spec) {
|
|
3492
|
+
for (const key of Object.keys(spec)) {
|
|
3493
|
+
if (TWEEN_KEYS.includes(key)) continue;
|
|
3494
|
+
if (TIME_KEYS.includes(key)) {
|
|
3495
|
+
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)"}`);
|
|
3496
|
+
} else warnUnknownOptions(`animateText() ${which}`, { [key]: 1 }, TWEEN_KEYS);
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3489
3499
|
if (t.preset !== void 0 && !(t.preset in PRESETS)) {
|
|
3490
3500
|
const guess = suggestName(String(t.preset), PRESET_NAMES);
|
|
3491
3501
|
throw new Error(`animateText(): ${which} "${t.preset}" is not a preset${guess ? `; did you mean "${guess}"?` : ""} (presets: ${PRESET_NAMES.map((n) => `"${n}"`).join(", ")})`);
|