use-scroll-animate 8.9.0 → 9.1.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 +2 -2
- package/README_ja.md +2 -2
- package/README_zh.md +2 -2
- package/dist/chunks/manifest-B08-vo9G.cjs +81 -0
- package/dist/chunks/manifest-B08-vo9G.cjs.map +1 -0
- package/dist/chunks/manifest-PJ0h8RS_.js +76 -0
- package/dist/chunks/manifest-PJ0h8RS_.js.map +1 -0
- package/dist/components/dsl.cjs +210 -0
- package/dist/components/dsl.cjs.map +1 -0
- package/dist/components/dsl.d.cts +76 -0
- package/dist/components/dsl.d.ts +76 -0
- package/dist/components/dsl.js +203 -0
- package/dist/components/dsl.js.map +1 -0
- package/dist/components/effects.cjs +6 -29
- package/dist/components/effects.cjs.map +1 -1
- package/dist/components/effects.d.cts +3 -14
- package/dist/components/effects.d.ts +3 -14
- package/dist/components/effects.js +8 -27
- package/dist/components/effects.js.map +1 -1
- package/dist/components/fx-cinema.cjs +100 -0
- package/dist/components/fx-cinema.cjs.map +1 -0
- package/dist/components/fx-cinema.d.cts +70 -0
- package/dist/components/fx-cinema.d.ts +70 -0
- package/dist/components/fx-cinema.js +95 -0
- package/dist/components/fx-cinema.js.map +1 -0
- package/dist/components/fx2.cjs +12 -5
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +25 -1
- package/dist/components/fx2.d.ts +25 -1
- package/dist/components/fx2.js +6 -2
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/marketplace.cjs +82 -71
- package/dist/components/marketplace.cjs.map +1 -1
- package/dist/components/marketplace.d.cts +33 -2
- package/dist/components/marketplace.d.ts +33 -2
- package/dist/components/marketplace.js +74 -68
- package/dist/components/marketplace.js.map +1 -1
- package/dist/components/widgets.cjs +481 -198
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +131 -2
- package/dist/components/widgets.d.ts +131 -2
- package/dist/components/widgets.js +479 -200
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +12 -14
- package/docs/components.md +48 -5
- package/docs/deprecations.md +1 -1
- package/docs/upgrading-9.md +11 -1
- package/package.json +51 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registry = require('../chunks/registry-BVklOepd.cjs');
|
|
4
|
+
require('../chunks/base-DoRUZBy-.cjs');
|
|
5
|
+
|
|
6
|
+
const CAMERA_MOVES = ['dolly-in', 'dolly-out', 'pan-left', 'pan-right', 'tilt-up', 'tilt-down', 'zoom-in', 'zoom-out', 'orbit'];
|
|
7
|
+
/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */
|
|
8
|
+
function cameraFrame(move, p, strength = 1) {
|
|
9
|
+
const t = Math.min(1, Math.max(0, p));
|
|
10
|
+
const k = Math.min(2, Math.max(0, strength));
|
|
11
|
+
const f = (n) => Math.round(n * 1000) / 1000;
|
|
12
|
+
switch (move) {
|
|
13
|
+
case 'dolly-in':
|
|
14
|
+
return `scale(${f(1 + 0.18 * k * t)})`;
|
|
15
|
+
case 'dolly-out':
|
|
16
|
+
return `scale(${f(1 + 0.18 * k * (1 - t))})`;
|
|
17
|
+
case 'pan-left':
|
|
18
|
+
return `scale(${f(1 + 0.12 * k)}) translateX(${f(6 * k - 12 * k * t)}%)`;
|
|
19
|
+
case 'pan-right':
|
|
20
|
+
return `scale(${f(1 + 0.12 * k)}) translateX(${f(-6 * k + 12 * k * t)}%)`;
|
|
21
|
+
case 'tilt-up':
|
|
22
|
+
return `scale(${f(1 + 0.12 * k)}) translateY(${f(-6 * k + 12 * k * t)}%)`;
|
|
23
|
+
case 'tilt-down':
|
|
24
|
+
return `scale(${f(1 + 0.12 * k)}) translateY(${f(6 * k - 12 * k * t)}%)`;
|
|
25
|
+
case 'zoom-in':
|
|
26
|
+
return `scale(${f(1 + 0.4 * k * t * t)})`;
|
|
27
|
+
case 'zoom-out':
|
|
28
|
+
return `scale(${f(1 + 0.4 * k * (1 - t) * (1 - t))})`;
|
|
29
|
+
case 'orbit':
|
|
30
|
+
return `perspective(900px) rotateY(${f(-12 * k + 24 * k * t)}deg) scale(${f(1 + 0.08 * k)})`;
|
|
31
|
+
default:
|
|
32
|
+
return 'none';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const fade = (el, ctx) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 })?.finished.catch(() => undefined);
|
|
36
|
+
const CINEMA_FX = [
|
|
37
|
+
{
|
|
38
|
+
name: 'dolly-in',
|
|
39
|
+
kind: 'enter',
|
|
40
|
+
description: 'A slow camera push: starts slightly large and soft, settles sharp (`duration`).',
|
|
41
|
+
defaults: { duration: 1600 },
|
|
42
|
+
run: (el, o, ctx) => {
|
|
43
|
+
if (ctx.reduced)
|
|
44
|
+
return fade(el, ctx);
|
|
45
|
+
return ctx.animate(el, [{ transform: 'scale(1.14)', filter: 'blur(6px)', opacity: 0 }, { opacity: 1, offset: 0.3 }, { transform: 'scale(1)', filter: 'blur(0)', opacity: 1 }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.16,.84,.3,1)', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'pan-reveal',
|
|
50
|
+
kind: 'enter',
|
|
51
|
+
description: 'The camera pans across the element while a wipe uncovers it (`from`).',
|
|
52
|
+
defaults: { from: 'left', duration: 1200 },
|
|
53
|
+
run: (el, o, ctx) => {
|
|
54
|
+
if (ctx.reduced)
|
|
55
|
+
return fade(el, ctx);
|
|
56
|
+
const r = o.from === 'right';
|
|
57
|
+
return ctx.animate(el, [{ clipPath: r ? 'inset(0 0 0 100%)' : 'inset(0 100% 0 0)', transform: `translateX(${r ? 4 : -4}%) scale(1.06)` }, { clipPath: 'inset(0 0 0 0)', transform: 'none' }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.65,0,.35,1)', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'letterbox',
|
|
62
|
+
kind: 'enter',
|
|
63
|
+
description: 'Cinema bars slide in, hold, then open up to reveal the element (`hold`).',
|
|
64
|
+
defaults: { duration: 1400, hold: 0.35 },
|
|
65
|
+
run: (el, o, ctx) => {
|
|
66
|
+
if (ctx.reduced)
|
|
67
|
+
return fade(el, ctx);
|
|
68
|
+
const h = Math.min(0.8, Math.max(0, Number(o.hold) || 0));
|
|
69
|
+
const a = 0.25;
|
|
70
|
+
const b = Math.min(0.95, a + h);
|
|
71
|
+
return ctx.animate(el, [{ clipPath: 'inset(50% 0 50% 0)', opacity: 0.6 }, { clipPath: 'inset(12% 0 12% 0)', opacity: 1, offset: a }, { clipPath: 'inset(12% 0 12% 0)', offset: b }, { clipPath: 'inset(0 0 0 0)' }], { duration: o.duration, delay: o.delay, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'rack-focus',
|
|
76
|
+
kind: 'attention',
|
|
77
|
+
description: "Focus pulls from the element's first child to the rest and back, like racking focus between subjects.",
|
|
78
|
+
defaults: { duration: 1800 },
|
|
79
|
+
run: (el, o, ctx) => {
|
|
80
|
+
if (ctx.reduced)
|
|
81
|
+
return;
|
|
82
|
+
const kids = Array.from(el.children);
|
|
83
|
+
if (kids.length < 2)
|
|
84
|
+
return ctx.animate(el, [{ filter: 'blur(0)' }, { filter: 'blur(4px)', offset: 0.5 }, { filter: 'blur(0)' }], { duration: o.duration })?.finished.catch(() => undefined);
|
|
85
|
+
const [first, ...rest] = kids;
|
|
86
|
+
const runs = [ctx.animate(first, [{ filter: 'blur(0)' }, { filter: 'blur(5px)', offset: 0.35 }, { filter: 'blur(5px)', offset: 0.65 }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }), ...rest.map((k) => ctx.animate(k, [{ filter: 'blur(5px)' }, { filter: 'blur(0)', offset: 0.35 }, { filter: 'blur(0)', offset: 0.65 }, { filter: 'blur(5px)' }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }))];
|
|
87
|
+
return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(() => undefined);
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */
|
|
92
|
+
function registerCinemaPack() {
|
|
93
|
+
registry.registerEffects(CINEMA_FX);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
exports.CAMERA_MOVES = CAMERA_MOVES;
|
|
97
|
+
exports.CINEMA_FX = CINEMA_FX;
|
|
98
|
+
exports.cameraFrame = cameraFrame;
|
|
99
|
+
exports.registerCinemaPack = registerCinemaPack;
|
|
100
|
+
//# sourceMappingURL=fx-cinema.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-cinema.cjs","sources":["../../src/components/fx2/cinema.ts"],"sourcesContent":["/**\n * 9.1 — Cinematic pack (`motionary/fx/cinema`, also `motionary/components/fx-cinema`):\n *\n * - `dolly-in` (enter) — a slow camera push: the element starts slightly\n * large and soft and settles sharp, like a dolly shot (`duration`).\n * - `pan-reveal` (enter) — the camera pans across the element while a\n * wipe uncovers it (`from` left|right).\n * - `letterbox` (enter) — cinema bars slide in, hold, then open up to\n * reveal the element (`hold`).\n * - `rack-focus` (attention) — focus pulls from the element's first child\n * to the rest and back, like a focus puller racking between subjects.\n *\n * `cameraFrame(move, p)` gives the transform of a camera move at progress\n * 0–1 (used by `<usa-scene>`). Reduced motion: entrances fade, rack-focus\n * does nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\nexport const CAMERA_MOVES = ['dolly-in', 'dolly-out', 'pan-left', 'pan-right', 'tilt-up', 'tilt-down', 'zoom-in', 'zoom-out', 'orbit'] as const;\nexport type CameraMove = (typeof CAMERA_MOVES)[number];\n\n/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */\nexport function cameraFrame(move: string, p: number, strength = 1): string {\n const t = Math.min(1, Math.max(0, p));\n const k = Math.min(2, Math.max(0, strength));\n const f = (n: number) => Math.round(n * 1000) / 1000;\n switch (move) {\n case 'dolly-in':\n return `scale(${f(1 + 0.18 * k * t)})`;\n case 'dolly-out':\n return `scale(${f(1 + 0.18 * k * (1 - t))})`;\n case 'pan-left':\n return `scale(${f(1 + 0.12 * k)}) translateX(${f(6 * k - 12 * k * t)}%)`;\n case 'pan-right':\n return `scale(${f(1 + 0.12 * k)}) translateX(${f(-6 * k + 12 * k * t)}%)`;\n case 'tilt-up':\n return `scale(${f(1 + 0.12 * k)}) translateY(${f(-6 * k + 12 * k * t)}%)`;\n case 'tilt-down':\n return `scale(${f(1 + 0.12 * k)}) translateY(${f(6 * k - 12 * k * t)}%)`;\n case 'zoom-in':\n return `scale(${f(1 + 0.4 * k * t * t)})`;\n case 'zoom-out':\n return `scale(${f(1 + 0.4 * k * (1 - t) * (1 - t))})`;\n case 'orbit':\n return `perspective(900px) rotateY(${f(-12 * k + 24 * k * t)}deg) scale(${f(1 + 0.08 * k)})`;\n default:\n return 'none';\n }\n}\n\nconst fade = (el: HTMLElement, ctx: EffectContext) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 })?.finished.catch(() => undefined);\n\nexport const CINEMA_FX: EffectDefinition[] = [\n {\n name: 'dolly-in',\n kind: 'enter',\n description: 'A slow camera push: starts slightly large and soft, settles sharp (`duration`).',\n defaults: { duration: 1600 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n return ctx.animate(el, [{ transform: 'scale(1.14)', filter: 'blur(6px)', opacity: 0 }, { opacity: 1, offset: 0.3 }, { transform: 'scale(1)', filter: 'blur(0)', opacity: 1 }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.16,.84,.3,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'pan-reveal',\n kind: 'enter',\n description: 'The camera pans across the element while a wipe uncovers it (`from`).',\n defaults: { from: 'left', duration: 1200 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n const r = o.from === 'right';\n return ctx.animate(el, [{ clipPath: r ? 'inset(0 0 0 100%)' : 'inset(0 100% 0 0)', transform: `translateX(${r ? 4 : -4}%) scale(1.06)` }, { clipPath: 'inset(0 0 0 0)', transform: 'none' }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.65,0,.35,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'letterbox',\n kind: 'enter',\n description: 'Cinema bars slide in, hold, then open up to reveal the element (`hold`).',\n defaults: { duration: 1400, hold: 0.35 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n const h = Math.min(0.8, Math.max(0, Number(o.hold) || 0));\n const a = 0.25;\n const b = Math.min(0.95, a + h);\n return ctx.animate(el, [{ clipPath: 'inset(50% 0 50% 0)', opacity: 0.6 }, { clipPath: 'inset(12% 0 12% 0)', opacity: 1, offset: a }, { clipPath: 'inset(12% 0 12% 0)', offset: b }, { clipPath: 'inset(0 0 0 0)' }], { duration: o.duration, delay: o.delay, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'rack-focus',\n kind: 'attention',\n description: \"Focus pulls from the element's first child to the rest and back, like racking focus between subjects.\",\n defaults: { duration: 1800 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const kids = Array.from(el.children) as HTMLElement[];\n if (kids.length < 2) return ctx.animate(el, [{ filter: 'blur(0)' }, { filter: 'blur(4px)', offset: 0.5 }, { filter: 'blur(0)' }], { duration: o.duration })?.finished.catch(() => undefined);\n const [first, ...rest] = kids;\n const runs = [ctx.animate(first, [{ filter: 'blur(0)' }, { filter: 'blur(5px)', offset: 0.35 }, { filter: 'blur(5px)', offset: 0.65 }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }), ...rest.map((k) => ctx.animate(k, [{ filter: 'blur(5px)' }, { filter: 'blur(0)', offset: 0.35 }, { filter: 'blur(0)', offset: 0.65 }, { filter: 'blur(5px)' }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }))];\n return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(() => undefined);\n },\n },\n];\n\n/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */\nexport function registerCinemaPack(): void {\n registerEffects(CINEMA_FX);\n}\n"],"names":["registerEffects"],"mappings":";;;;;MAmBa,YAAY,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO;AAGrI;AACM,SAAU,WAAW,CAAC,IAAY,EAAE,CAAS,EAAE,QAAQ,GAAG,CAAC,EAAA;AAC/D,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5C,IAAA,MAAM,CAAC,GAAG,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI;IACpD,QAAQ,IAAI;AACV,QAAA,KAAK,UAAU;AACb,YAA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AAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;AAC1b,YAAA,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC;QAC/F,CAAC;AACF,KAAA;;AAGH;SACgB,kBAAkB,GAAA;IAChCA,wBAAe,CAAC,SAAS,CAAC;AAC5B;;;;;;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
|
|
2
|
+
type Cleanup = () => void;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 5.0 — unified plugin-style effect registration. Every effect (built-in or
|
|
6
|
+
* yours) is a plain object registered once and played the same way:
|
|
7
|
+
* `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
|
|
8
|
+
* `<usa-fx effect="name" trigger="click">`. Effects get a context that
|
|
9
|
+
* already applies reduced motion, motion sensitivity, intensity and the
|
|
10
|
+
* animation budget.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
|
|
14
|
+
type EffectKind = (typeof EFFECT_KINDS)[number];
|
|
15
|
+
interface EffectContext {
|
|
16
|
+
/** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
|
|
17
|
+
readonly reduced: boolean;
|
|
18
|
+
readonly sensitivity: MotionSensitivity;
|
|
19
|
+
/** The triggering event (pointer position for click effects), if any. */
|
|
20
|
+
readonly event?: Event;
|
|
21
|
+
/** `el.animate()` with the library's motion rules (may return `null`). */
|
|
22
|
+
animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
|
|
23
|
+
/** Register teardown for long-running effects (loops, listeners). */
|
|
24
|
+
onCleanup(fn: Cleanup): void;
|
|
25
|
+
}
|
|
26
|
+
interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
|
|
27
|
+
/** Unique, kebab-case. */
|
|
28
|
+
name: string;
|
|
29
|
+
kind: EffectKind;
|
|
30
|
+
/** One line for docs and the gallery. */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Option defaults (merged under the caller's options). */
|
|
33
|
+
defaults?: Partial<O>;
|
|
34
|
+
/**
|
|
35
|
+
* Under reduced motion: `'skip'` (do nothing — default for loop, background
|
|
36
|
+
* and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
|
|
37
|
+
* effect degrades itself — default for everything else).
|
|
38
|
+
*/
|
|
39
|
+
reduced?: 'skip' | 'run';
|
|
40
|
+
/** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
|
|
41
|
+
run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 9.1 — Cinematic pack (`motionary/fx/cinema`, also `motionary/components/fx-cinema`):
|
|
46
|
+
*
|
|
47
|
+
* - `dolly-in` (enter) — a slow camera push: the element starts slightly
|
|
48
|
+
* large and soft and settles sharp, like a dolly shot (`duration`).
|
|
49
|
+
* - `pan-reveal` (enter) — the camera pans across the element while a
|
|
50
|
+
* wipe uncovers it (`from` left|right).
|
|
51
|
+
* - `letterbox` (enter) — cinema bars slide in, hold, then open up to
|
|
52
|
+
* reveal the element (`hold`).
|
|
53
|
+
* - `rack-focus` (attention) — focus pulls from the element's first child
|
|
54
|
+
* to the rest and back, like a focus puller racking between subjects.
|
|
55
|
+
*
|
|
56
|
+
* `cameraFrame(move, p)` gives the transform of a camera move at progress
|
|
57
|
+
* 0–1 (used by `<usa-scene>`). Reduced motion: entrances fade, rack-focus
|
|
58
|
+
* does nothing.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
declare const CAMERA_MOVES: readonly ["dolly-in", "dolly-out", "pan-left", "pan-right", "tilt-up", "tilt-down", "zoom-in", "zoom-out", "orbit"];
|
|
62
|
+
type CameraMove = (typeof CAMERA_MOVES)[number];
|
|
63
|
+
/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */
|
|
64
|
+
declare function cameraFrame(move: string, p: number, strength?: number): string;
|
|
65
|
+
declare const CINEMA_FX: EffectDefinition[];
|
|
66
|
+
/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */
|
|
67
|
+
declare function registerCinemaPack(): void;
|
|
68
|
+
|
|
69
|
+
export { CAMERA_MOVES, CINEMA_FX, cameraFrame, registerCinemaPack };
|
|
70
|
+
export type { CameraMove };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
|
|
2
|
+
type Cleanup = () => void;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 5.0 — unified plugin-style effect registration. Every effect (built-in or
|
|
6
|
+
* yours) is a plain object registered once and played the same way:
|
|
7
|
+
* `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
|
|
8
|
+
* `<usa-fx effect="name" trigger="click">`. Effects get a context that
|
|
9
|
+
* already applies reduced motion, motion sensitivity, intensity and the
|
|
10
|
+
* animation budget.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
|
|
14
|
+
type EffectKind = (typeof EFFECT_KINDS)[number];
|
|
15
|
+
interface EffectContext {
|
|
16
|
+
/** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
|
|
17
|
+
readonly reduced: boolean;
|
|
18
|
+
readonly sensitivity: MotionSensitivity;
|
|
19
|
+
/** The triggering event (pointer position for click effects), if any. */
|
|
20
|
+
readonly event?: Event;
|
|
21
|
+
/** `el.animate()` with the library's motion rules (may return `null`). */
|
|
22
|
+
animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
|
|
23
|
+
/** Register teardown for long-running effects (loops, listeners). */
|
|
24
|
+
onCleanup(fn: Cleanup): void;
|
|
25
|
+
}
|
|
26
|
+
interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
|
|
27
|
+
/** Unique, kebab-case. */
|
|
28
|
+
name: string;
|
|
29
|
+
kind: EffectKind;
|
|
30
|
+
/** One line for docs and the gallery. */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Option defaults (merged under the caller's options). */
|
|
33
|
+
defaults?: Partial<O>;
|
|
34
|
+
/**
|
|
35
|
+
* Under reduced motion: `'skip'` (do nothing — default for loop, background
|
|
36
|
+
* and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
|
|
37
|
+
* effect degrades itself — default for everything else).
|
|
38
|
+
*/
|
|
39
|
+
reduced?: 'skip' | 'run';
|
|
40
|
+
/** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
|
|
41
|
+
run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 9.1 — Cinematic pack (`motionary/fx/cinema`, also `motionary/components/fx-cinema`):
|
|
46
|
+
*
|
|
47
|
+
* - `dolly-in` (enter) — a slow camera push: the element starts slightly
|
|
48
|
+
* large and soft and settles sharp, like a dolly shot (`duration`).
|
|
49
|
+
* - `pan-reveal` (enter) — the camera pans across the element while a
|
|
50
|
+
* wipe uncovers it (`from` left|right).
|
|
51
|
+
* - `letterbox` (enter) — cinema bars slide in, hold, then open up to
|
|
52
|
+
* reveal the element (`hold`).
|
|
53
|
+
* - `rack-focus` (attention) — focus pulls from the element's first child
|
|
54
|
+
* to the rest and back, like a focus puller racking between subjects.
|
|
55
|
+
*
|
|
56
|
+
* `cameraFrame(move, p)` gives the transform of a camera move at progress
|
|
57
|
+
* 0–1 (used by `<usa-scene>`). Reduced motion: entrances fade, rack-focus
|
|
58
|
+
* does nothing.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
declare const CAMERA_MOVES: readonly ["dolly-in", "dolly-out", "pan-left", "pan-right", "tilt-up", "tilt-down", "zoom-in", "zoom-out", "orbit"];
|
|
62
|
+
type CameraMove = (typeof CAMERA_MOVES)[number];
|
|
63
|
+
/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */
|
|
64
|
+
declare function cameraFrame(move: string, p: number, strength?: number): string;
|
|
65
|
+
declare const CINEMA_FX: EffectDefinition[];
|
|
66
|
+
/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */
|
|
67
|
+
declare function registerCinemaPack(): void;
|
|
68
|
+
|
|
69
|
+
export { CAMERA_MOVES, CINEMA_FX, cameraFrame, registerCinemaPack };
|
|
70
|
+
export type { CameraMove };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { registerEffects } from '../chunks/registry-CnO7ZVPK.js';
|
|
2
|
+
import '../chunks/base-CLuqlLfG.js';
|
|
3
|
+
|
|
4
|
+
const CAMERA_MOVES = ['dolly-in', 'dolly-out', 'pan-left', 'pan-right', 'tilt-up', 'tilt-down', 'zoom-in', 'zoom-out', 'orbit'];
|
|
5
|
+
/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */
|
|
6
|
+
function cameraFrame(move, p, strength = 1) {
|
|
7
|
+
const t = Math.min(1, Math.max(0, p));
|
|
8
|
+
const k = Math.min(2, Math.max(0, strength));
|
|
9
|
+
const f = (n) => Math.round(n * 1000) / 1000;
|
|
10
|
+
switch (move) {
|
|
11
|
+
case 'dolly-in':
|
|
12
|
+
return `scale(${f(1 + 0.18 * k * t)})`;
|
|
13
|
+
case 'dolly-out':
|
|
14
|
+
return `scale(${f(1 + 0.18 * k * (1 - t))})`;
|
|
15
|
+
case 'pan-left':
|
|
16
|
+
return `scale(${f(1 + 0.12 * k)}) translateX(${f(6 * k - 12 * k * t)}%)`;
|
|
17
|
+
case 'pan-right':
|
|
18
|
+
return `scale(${f(1 + 0.12 * k)}) translateX(${f(-6 * k + 12 * k * t)}%)`;
|
|
19
|
+
case 'tilt-up':
|
|
20
|
+
return `scale(${f(1 + 0.12 * k)}) translateY(${f(-6 * k + 12 * k * t)}%)`;
|
|
21
|
+
case 'tilt-down':
|
|
22
|
+
return `scale(${f(1 + 0.12 * k)}) translateY(${f(6 * k - 12 * k * t)}%)`;
|
|
23
|
+
case 'zoom-in':
|
|
24
|
+
return `scale(${f(1 + 0.4 * k * t * t)})`;
|
|
25
|
+
case 'zoom-out':
|
|
26
|
+
return `scale(${f(1 + 0.4 * k * (1 - t) * (1 - t))})`;
|
|
27
|
+
case 'orbit':
|
|
28
|
+
return `perspective(900px) rotateY(${f(-12 * k + 24 * k * t)}deg) scale(${f(1 + 0.08 * k)})`;
|
|
29
|
+
default:
|
|
30
|
+
return 'none';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const fade = (el, ctx) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 })?.finished.catch(() => undefined);
|
|
34
|
+
const CINEMA_FX = [
|
|
35
|
+
{
|
|
36
|
+
name: 'dolly-in',
|
|
37
|
+
kind: 'enter',
|
|
38
|
+
description: 'A slow camera push: starts slightly large and soft, settles sharp (`duration`).',
|
|
39
|
+
defaults: { duration: 1600 },
|
|
40
|
+
run: (el, o, ctx) => {
|
|
41
|
+
if (ctx.reduced)
|
|
42
|
+
return fade(el, ctx);
|
|
43
|
+
return ctx.animate(el, [{ transform: 'scale(1.14)', filter: 'blur(6px)', opacity: 0 }, { opacity: 1, offset: 0.3 }, { transform: 'scale(1)', filter: 'blur(0)', opacity: 1 }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.16,.84,.3,1)', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'pan-reveal',
|
|
48
|
+
kind: 'enter',
|
|
49
|
+
description: 'The camera pans across the element while a wipe uncovers it (`from`).',
|
|
50
|
+
defaults: { from: 'left', duration: 1200 },
|
|
51
|
+
run: (el, o, ctx) => {
|
|
52
|
+
if (ctx.reduced)
|
|
53
|
+
return fade(el, ctx);
|
|
54
|
+
const r = o.from === 'right';
|
|
55
|
+
return ctx.animate(el, [{ clipPath: r ? 'inset(0 0 0 100%)' : 'inset(0 100% 0 0)', transform: `translateX(${r ? 4 : -4}%) scale(1.06)` }, { clipPath: 'inset(0 0 0 0)', transform: 'none' }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.65,0,.35,1)', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'letterbox',
|
|
60
|
+
kind: 'enter',
|
|
61
|
+
description: 'Cinema bars slide in, hold, then open up to reveal the element (`hold`).',
|
|
62
|
+
defaults: { duration: 1400, hold: 0.35 },
|
|
63
|
+
run: (el, o, ctx) => {
|
|
64
|
+
if (ctx.reduced)
|
|
65
|
+
return fade(el, ctx);
|
|
66
|
+
const h = Math.min(0.8, Math.max(0, Number(o.hold) || 0));
|
|
67
|
+
const a = 0.25;
|
|
68
|
+
const b = Math.min(0.95, a + h);
|
|
69
|
+
return ctx.animate(el, [{ clipPath: 'inset(50% 0 50% 0)', opacity: 0.6 }, { clipPath: 'inset(12% 0 12% 0)', opacity: 1, offset: a }, { clipPath: 'inset(12% 0 12% 0)', offset: b }, { clipPath: 'inset(0 0 0 0)' }], { duration: o.duration, delay: o.delay, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'rack-focus',
|
|
74
|
+
kind: 'attention',
|
|
75
|
+
description: "Focus pulls from the element's first child to the rest and back, like racking focus between subjects.",
|
|
76
|
+
defaults: { duration: 1800 },
|
|
77
|
+
run: (el, o, ctx) => {
|
|
78
|
+
if (ctx.reduced)
|
|
79
|
+
return;
|
|
80
|
+
const kids = Array.from(el.children);
|
|
81
|
+
if (kids.length < 2)
|
|
82
|
+
return ctx.animate(el, [{ filter: 'blur(0)' }, { filter: 'blur(4px)', offset: 0.5 }, { filter: 'blur(0)' }], { duration: o.duration })?.finished.catch(() => undefined);
|
|
83
|
+
const [first, ...rest] = kids;
|
|
84
|
+
const runs = [ctx.animate(first, [{ filter: 'blur(0)' }, { filter: 'blur(5px)', offset: 0.35 }, { filter: 'blur(5px)', offset: 0.65 }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }), ...rest.map((k) => ctx.animate(k, [{ filter: 'blur(5px)' }, { filter: 'blur(0)', offset: 0.35 }, { filter: 'blur(0)', offset: 0.65 }, { filter: 'blur(5px)' }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }))];
|
|
85
|
+
return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(() => undefined);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */
|
|
90
|
+
function registerCinemaPack() {
|
|
91
|
+
registerEffects(CINEMA_FX);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { CAMERA_MOVES, CINEMA_FX, cameraFrame, registerCinemaPack };
|
|
95
|
+
//# sourceMappingURL=fx-cinema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-cinema.js","sources":["../../src/components/fx2/cinema.ts"],"sourcesContent":["/**\n * 9.1 — Cinematic pack (`motionary/fx/cinema`, also `motionary/components/fx-cinema`):\n *\n * - `dolly-in` (enter) — a slow camera push: the element starts slightly\n * large and soft and settles sharp, like a dolly shot (`duration`).\n * - `pan-reveal` (enter) — the camera pans across the element while a\n * wipe uncovers it (`from` left|right).\n * - `letterbox` (enter) — cinema bars slide in, hold, then open up to\n * reveal the element (`hold`).\n * - `rack-focus` (attention) — focus pulls from the element's first child\n * to the rest and back, like a focus puller racking between subjects.\n *\n * `cameraFrame(move, p)` gives the transform of a camera move at progress\n * 0–1 (used by `<usa-scene>`). Reduced motion: entrances fade, rack-focus\n * does nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\nexport const CAMERA_MOVES = ['dolly-in', 'dolly-out', 'pan-left', 'pan-right', 'tilt-up', 'tilt-down', 'zoom-in', 'zoom-out', 'orbit'] as const;\nexport type CameraMove = (typeof CAMERA_MOVES)[number];\n\n/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */\nexport function cameraFrame(move: string, p: number, strength = 1): string {\n const t = Math.min(1, Math.max(0, p));\n const k = Math.min(2, Math.max(0, strength));\n const f = (n: number) => Math.round(n * 1000) / 1000;\n switch (move) {\n case 'dolly-in':\n return `scale(${f(1 + 0.18 * k * t)})`;\n case 'dolly-out':\n return `scale(${f(1 + 0.18 * k * (1 - t))})`;\n case 'pan-left':\n return `scale(${f(1 + 0.12 * k)}) translateX(${f(6 * k - 12 * k * t)}%)`;\n case 'pan-right':\n return `scale(${f(1 + 0.12 * k)}) translateX(${f(-6 * k + 12 * k * t)}%)`;\n case 'tilt-up':\n return `scale(${f(1 + 0.12 * k)}) translateY(${f(-6 * k + 12 * k * t)}%)`;\n case 'tilt-down':\n return `scale(${f(1 + 0.12 * k)}) translateY(${f(6 * k - 12 * k * t)}%)`;\n case 'zoom-in':\n return `scale(${f(1 + 0.4 * k * t * t)})`;\n case 'zoom-out':\n return `scale(${f(1 + 0.4 * k * (1 - t) * (1 - t))})`;\n case 'orbit':\n return `perspective(900px) rotateY(${f(-12 * k + 24 * k * t)}deg) scale(${f(1 + 0.08 * k)})`;\n default:\n return 'none';\n }\n}\n\nconst fade = (el: HTMLElement, ctx: EffectContext) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 })?.finished.catch(() => undefined);\n\nexport const CINEMA_FX: EffectDefinition[] = [\n {\n name: 'dolly-in',\n kind: 'enter',\n description: 'A slow camera push: starts slightly large and soft, settles sharp (`duration`).',\n defaults: { duration: 1600 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n return ctx.animate(el, [{ transform: 'scale(1.14)', filter: 'blur(6px)', opacity: 0 }, { opacity: 1, offset: 0.3 }, { transform: 'scale(1)', filter: 'blur(0)', opacity: 1 }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.16,.84,.3,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'pan-reveal',\n kind: 'enter',\n description: 'The camera pans across the element while a wipe uncovers it (`from`).',\n defaults: { from: 'left', duration: 1200 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n const r = o.from === 'right';\n return ctx.animate(el, [{ clipPath: r ? 'inset(0 0 0 100%)' : 'inset(0 100% 0 0)', transform: `translateX(${r ? 4 : -4}%) scale(1.06)` }, { clipPath: 'inset(0 0 0 0)', transform: 'none' }], { duration: o.duration, delay: o.delay, easing: 'cubic-bezier(.65,0,.35,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'letterbox',\n kind: 'enter',\n description: 'Cinema bars slide in, hold, then open up to reveal the element (`hold`).',\n defaults: { duration: 1400, hold: 0.35 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n const h = Math.min(0.8, Math.max(0, Number(o.hold) || 0));\n const a = 0.25;\n const b = Math.min(0.95, a + h);\n return ctx.animate(el, [{ clipPath: 'inset(50% 0 50% 0)', opacity: 0.6 }, { clipPath: 'inset(12% 0 12% 0)', opacity: 1, offset: a }, { clipPath: 'inset(12% 0 12% 0)', offset: b }, { clipPath: 'inset(0 0 0 0)' }], { duration: o.duration, delay: o.delay, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'rack-focus',\n kind: 'attention',\n description: \"Focus pulls from the element's first child to the rest and back, like racking focus between subjects.\",\n defaults: { duration: 1800 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const kids = Array.from(el.children) as HTMLElement[];\n if (kids.length < 2) return ctx.animate(el, [{ filter: 'blur(0)' }, { filter: 'blur(4px)', offset: 0.5 }, { filter: 'blur(0)' }], { duration: o.duration })?.finished.catch(() => undefined);\n const [first, ...rest] = kids;\n const runs = [ctx.animate(first, [{ filter: 'blur(0)' }, { filter: 'blur(5px)', offset: 0.35 }, { filter: 'blur(5px)', offset: 0.65 }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }), ...rest.map((k) => ctx.animate(k, [{ filter: 'blur(5px)' }, { filter: 'blur(0)', offset: 0.35 }, { filter: 'blur(0)', offset: 0.65 }, { filter: 'blur(5px)' }, { filter: 'blur(0)' }], { duration: o.duration, easing: 'ease-in-out' }))];\n return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(() => undefined);\n },\n },\n];\n\n/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */\nexport function registerCinemaPack(): void {\n registerEffects(CINEMA_FX);\n}\n"],"names":[],"mappings":";;;MAmBa,YAAY,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO;AAGrI;AACM,SAAU,WAAW,CAAC,IAAY,EAAE,CAAS,EAAE,QAAQ,GAAG,CAAC,EAAA;AAC/D,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC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AAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;AAC1b,YAAA,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC;QAC/F,CAAC;AACF,KAAA;;AAGH;SACgB,kBAAkB,GAAA;IAChC,eAAe,CAAC,SAAS,CAAC;AAC5B;;;;"}
|
package/dist/components/fx2.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var manifest = require('../chunks/manifest-B08-vo9G.cjs');
|
|
4
4
|
var components_fxGpu = require('../chunks/gpu-CcdA2D2i.cjs');
|
|
5
5
|
var components_fxText = require('./fx-text.cjs');
|
|
6
6
|
var components_fxLight = require('./fx-light.cjs');
|
|
@@ -26,6 +26,7 @@ var components_fxPaper = require('./fx-paper.cjs');
|
|
|
26
26
|
var components_fxSurface = require('./fx-surface.cjs');
|
|
27
27
|
var components_fxGesture = require('./fx-gesture.cjs');
|
|
28
28
|
var components_fxSpatial = require('./fx-spatial.cjs');
|
|
29
|
+
var components_fxCinema = require('./fx-cinema.cjs');
|
|
29
30
|
require('../chunks/registry-BVklOepd.cjs');
|
|
30
31
|
require('../chunks/base-DoRUZBy-.cjs');
|
|
31
32
|
require('../chunks/generative-BHIj-NU0.cjs');
|
|
@@ -59,6 +60,7 @@ const EFFECT_PACKS = {
|
|
|
59
60
|
surface: components_fxSurface.SURFACE_FX,
|
|
60
61
|
gesture3: components_fxGesture.GESTURE3_FX,
|
|
61
62
|
spatial: components_fxSpatial.SPATIAL_FX,
|
|
63
|
+
cinema: components_fxCinema.CINEMA_FX,
|
|
62
64
|
};
|
|
63
65
|
/** Register every 6.x effect pack (idempotent). */
|
|
64
66
|
function registerEffectPacks() {
|
|
@@ -87,12 +89,13 @@ function registerEffectPacks() {
|
|
|
87
89
|
components_fxSurface.registerSurfacePack();
|
|
88
90
|
components_fxGesture.registerGesture3Pack();
|
|
89
91
|
components_fxSpatial.registerSpatialPack();
|
|
92
|
+
components_fxCinema.registerCinemaPack();
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
exports.EFFECT_PACK_FORMAT =
|
|
93
|
-
exports.loadEffectPack =
|
|
94
|
-
exports.packManifest =
|
|
95
|
-
exports.validateManifest =
|
|
95
|
+
exports.EFFECT_PACK_FORMAT = manifest.EFFECT_PACK_FORMAT;
|
|
96
|
+
exports.loadEffectPack = manifest.loadEffectPack;
|
|
97
|
+
exports.packManifest = manifest.packManifest;
|
|
98
|
+
exports.validateManifest = manifest.validateManifest;
|
|
96
99
|
exports.GLSL_HEAD = components_fxGpu.GLSL_HEAD;
|
|
97
100
|
exports.GPU_FX = components_fxGpu.GPU_FX;
|
|
98
101
|
exports.WGSL_HEAD = components_fxGpu.WGSL_HEAD;
|
|
@@ -182,6 +185,10 @@ exports.SPATIAL_FX = components_fxSpatial.SPATIAL_FX;
|
|
|
182
185
|
exports.registerSpatialPack = components_fxSpatial.registerSpatialPack;
|
|
183
186
|
exports.xrSupport = components_fxSpatial.xrSupport;
|
|
184
187
|
exports.yawToOffset = components_fxSpatial.yawToOffset;
|
|
188
|
+
exports.CAMERA_MOVES = components_fxCinema.CAMERA_MOVES;
|
|
189
|
+
exports.CINEMA_FX = components_fxCinema.CINEMA_FX;
|
|
190
|
+
exports.cameraFrame = components_fxCinema.cameraFrame;
|
|
191
|
+
exports.registerCinemaPack = components_fxCinema.registerCinemaPack;
|
|
185
192
|
exports.EFFECT_PACKS = EFFECT_PACKS;
|
|
186
193
|
exports.registerEffectPacks = registerEffectPacks;
|
|
187
194
|
//# sourceMappingURL=fx2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx2.cjs","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from './manifest';\nexport type { EffectPackManifest } from './manifest';\nimport { GPU_FX, registerGpuPack } from './gpu';\nimport { TEXT3_FX, registerTextPack, splitChars } from './text3';\nimport { LIGHT_FX, registerLightPack, trackPointer } from './light';\nimport { DEPTH3_FX, register3dPack } from './depth3';\nimport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath } from './morph2';\nimport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions } from './transitions2';\nimport { WEATHER_FX, registerWeatherPack, skyAt } from './weather';\nimport { PHYSICS2_FX, registerPhysicsPack, VerletWorld } from './physics2';\nimport { FOCUS_FX, registerFocusPack } from './focus';\nimport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample } from './music';\nimport { CHART_FX, registerChartPack, parseFigure } from './chart';\nimport { SHOP_FX, registerShopPack, arcPath } from './shop';\nimport { SOCIAL_FX, registerSocialPack, fanAngles } from './social';\nimport { GAME_FX, registerGamePack, throwPath } from './game';\nimport { GEO_FX, registerGeoPack, routeLength } from './geo';\nimport { FORM_FX, registerFormPack, shakeFrames } from './form';\nimport { AI_FX, registerAiPack, splitWords } from './ai';\nimport { FESTIVAL_FX, registerFestivalPack, sparkVectors } from './festival';\nimport { RETRO_FX, registerRetroPack, pixelSteps } from './retro2';\nimport { ORGANIC_FX, registerOrganicPack, blobRadius } from './organic';\nimport { CYBER_FX, registerCyberPack, decodeFrame } from './cyber';\nimport { PAPER_FX, registerPaperPack, roughLine, paperRandom } from './paper';\nimport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme } from './themefx';\nimport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt } from './gesture3';\nimport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport } from './spatial';\n\nexport { GPU_FX, registerGpuPack, TEXT3_FX, registerTextPack, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport { supportsWebGPU, glslToWgsl, wgslModule, webgpuBackground, WGSL_HEAD } from './webgpu';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightPack, trackPointer };\n\nexport { DEPTH3_FX, register3dPack };\n\nexport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath };\n\nexport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions };\n\nexport { WEATHER_FX, registerWeatherPack, skyAt };\n\nexport { PHYSICS2_FX, registerPhysicsPack, VerletWorld };\n\nexport { FOCUS_FX, registerFocusPack };\n\nexport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample };\n\nexport { CHART_FX, registerChartPack, parseFigure };\n\nexport { SHOP_FX, registerShopPack, arcPath };\n\nexport { SOCIAL_FX, registerSocialPack, fanAngles };\n\nexport { GAME_FX, registerGamePack, throwPath };\n\nexport { GEO_FX, registerGeoPack, routeLength };\n\nexport { FORM_FX, registerFormPack, shakeFrames };\n\nexport { AI_FX, registerAiPack, splitWords };\n\nexport { FESTIVAL_FX, registerFestivalPack, sparkVectors };\n\nexport { RETRO_FX, registerRetroPack, pixelSteps };\n\nexport { ORGANIC_FX, registerOrganicPack, blobRadius };\n\nexport { CYBER_FX, registerCyberPack, decodeFrame };\n\nexport { PAPER_FX, registerPaperPack, roughLine, paperRandom };\n\nexport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme };\n\nexport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt };\n\nexport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport };\n\n/** The 6.x effect packs by name. */\nexport const EFFECT_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n transitions: TRANSITIONS2_FX,\n weather: WEATHER_FX,\n physics: PHYSICS2_FX,\n focus: FOCUS_FX,\n music: MUSIC_FX,\n chart: CHART_FX,\n shop: SHOP_FX,\n social: SOCIAL_FX,\n game: GAME_FX,\n geo: GEO_FX,\n form: FORM_FX,\n ai: AI_FX,\n festival: FESTIVAL_FX,\n retro: RETRO_FX,\n organic: ORGANIC_FX,\n cyber: CYBER_FX,\n paper: PAPER_FX,\n surface: SURFACE_FX,\n gesture3: GESTURE3_FX,\n spatial: SPATIAL_FX,\n};\n\n/** Register every 6.x effect pack (idempotent). */\nexport function registerEffectPacks(): void {\n registerGpuPack();\n registerTextPack();\n registerLightPack();\n register3dPack();\n registerMorphPack();\n registerTransitionsPack();\n registerWeatherPack();\n registerPhysicsPack();\n registerFocusPack();\n registerMusicPack();\n registerChartPack();\n registerShopPack();\n registerSocialPack();\n registerGamePack();\n registerGeoPack();\n registerFormPack();\n registerAiPack();\n registerFestivalPack();\n registerRetroPack();\n registerOrganicPack();\n registerCyberPack();\n registerPaperPack();\n registerSurfacePack();\n registerGesture3Pack();\n registerSpatialPack();\n}\n\n\n"],"names":["GPU_FX","TEXT3_FX","LIGHT_FX","DEPTH3_FX","MORPH2_FX","TRANSITIONS2_FX","WEATHER_FX","PHYSICS2_FX","FOCUS_FX","MUSIC_FX","CHART_FX","SHOP_FX","SOCIAL_FX","GAME_FX","GEO_FX","FORM_FX","AI_FX","FESTIVAL_FX","RETRO_FX","ORGANIC_FX","CYBER_FX","PAPER_FX","SURFACE_FX","GESTURE3_FX","SPATIAL_FX","registerGpuPack","registerTextPack","registerLightPack","register3dPack","registerMorphPack","registerTransitionsPack","registerWeatherPack","registerPhysicsPack","registerFocusPack","registerMusicPack","registerChartPack","registerShopPack","registerSocialPack","registerGamePack","registerGeoPack","registerFormPack","registerAiPack","registerFestivalPack","registerRetroPack","registerOrganicPack","registerCyberPack","registerPaperPack","registerSurfacePack","registerGesture3Pack","registerSpatialPack"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fx2.cjs","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from './manifest';\nexport type { EffectPackManifest } from './manifest';\nimport { GPU_FX, registerGpuPack } from './gpu';\nimport { TEXT3_FX, registerTextPack, splitChars } from './text3';\nimport { LIGHT_FX, registerLightPack, trackPointer } from './light';\nimport { DEPTH3_FX, register3dPack } from './depth3';\nimport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath } from './morph2';\nimport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions } from './transitions2';\nimport { WEATHER_FX, registerWeatherPack, skyAt } from './weather';\nimport { PHYSICS2_FX, registerPhysicsPack, VerletWorld } from './physics2';\nimport { FOCUS_FX, registerFocusPack } from './focus';\nimport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample } from './music';\nimport { CHART_FX, registerChartPack, parseFigure } from './chart';\nimport { SHOP_FX, registerShopPack, arcPath } from './shop';\nimport { SOCIAL_FX, registerSocialPack, fanAngles } from './social';\nimport { GAME_FX, registerGamePack, throwPath } from './game';\nimport { GEO_FX, registerGeoPack, routeLength } from './geo';\nimport { FORM_FX, registerFormPack, shakeFrames } from './form';\nimport { AI_FX, registerAiPack, splitWords } from './ai';\nimport { FESTIVAL_FX, registerFestivalPack, sparkVectors } from './festival';\nimport { RETRO_FX, registerRetroPack, pixelSteps } from './retro2';\nimport { ORGANIC_FX, registerOrganicPack, blobRadius } from './organic';\nimport { CYBER_FX, registerCyberPack, decodeFrame } from './cyber';\nimport { PAPER_FX, registerPaperPack, roughLine, paperRandom } from './paper';\nimport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme } from './themefx';\nimport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt } from './gesture3';\nimport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport } from './spatial';\nimport { CINEMA_FX, registerCinemaPack, cameraFrame, CAMERA_MOVES } from './cinema';\n\nexport { GPU_FX, registerGpuPack, TEXT3_FX, registerTextPack, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport { supportsWebGPU, glslToWgsl, wgslModule, webgpuBackground, WGSL_HEAD } from './webgpu';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightPack, trackPointer };\n\nexport { DEPTH3_FX, register3dPack };\n\nexport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath };\n\nexport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions };\n\nexport { WEATHER_FX, registerWeatherPack, skyAt };\n\nexport { PHYSICS2_FX, registerPhysicsPack, VerletWorld };\n\nexport { FOCUS_FX, registerFocusPack };\n\nexport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample };\n\nexport { CHART_FX, registerChartPack, parseFigure };\n\nexport { SHOP_FX, registerShopPack, arcPath };\n\nexport { SOCIAL_FX, registerSocialPack, fanAngles };\n\nexport { GAME_FX, registerGamePack, throwPath };\n\nexport { GEO_FX, registerGeoPack, routeLength };\n\nexport { FORM_FX, registerFormPack, shakeFrames };\n\nexport { AI_FX, registerAiPack, splitWords };\n\nexport { FESTIVAL_FX, registerFestivalPack, sparkVectors };\n\nexport { RETRO_FX, registerRetroPack, pixelSteps };\n\nexport { ORGANIC_FX, registerOrganicPack, blobRadius };\n\nexport { CYBER_FX, registerCyberPack, decodeFrame };\n\nexport { PAPER_FX, registerPaperPack, roughLine, paperRandom };\n\nexport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme };\n\nexport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt };\n\nexport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport };\n\nexport { CINEMA_FX, registerCinemaPack, cameraFrame, CAMERA_MOVES };\n\n/** The 6.x effect packs by name. */\nexport const EFFECT_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n transitions: TRANSITIONS2_FX,\n weather: WEATHER_FX,\n physics: PHYSICS2_FX,\n focus: FOCUS_FX,\n music: MUSIC_FX,\n chart: CHART_FX,\n shop: SHOP_FX,\n social: SOCIAL_FX,\n game: GAME_FX,\n geo: GEO_FX,\n form: FORM_FX,\n ai: AI_FX,\n festival: FESTIVAL_FX,\n retro: RETRO_FX,\n organic: ORGANIC_FX,\n cyber: CYBER_FX,\n paper: PAPER_FX,\n surface: SURFACE_FX,\n gesture3: GESTURE3_FX,\n spatial: SPATIAL_FX,\n cinema: CINEMA_FX,\n};\n\n/** Register every 6.x effect pack (idempotent). */\nexport function registerEffectPacks(): void {\n registerGpuPack();\n registerTextPack();\n registerLightPack();\n register3dPack();\n registerMorphPack();\n registerTransitionsPack();\n registerWeatherPack();\n registerPhysicsPack();\n registerFocusPack();\n registerMusicPack();\n registerChartPack();\n registerShopPack();\n registerSocialPack();\n registerGamePack();\n registerGeoPack();\n registerFormPack();\n registerAiPack();\n registerFestivalPack();\n registerRetroPack();\n registerOrganicPack();\n registerCyberPack();\n registerPaperPack();\n registerSurfacePack();\n registerGesture3Pack();\n registerSpatialPack();\n registerCinemaPack();\n}\n\n\n"],"names":["GPU_FX","TEXT3_FX","LIGHT_FX","DEPTH3_FX","MORPH2_FX","TRANSITIONS2_FX","WEATHER_FX","PHYSICS2_FX","FOCUS_FX","MUSIC_FX","CHART_FX","SHOP_FX","SOCIAL_FX","GAME_FX","GEO_FX","FORM_FX","AI_FX","FESTIVAL_FX","RETRO_FX","ORGANIC_FX","CYBER_FX","PAPER_FX","SURFACE_FX","GESTURE3_FX","SPATIAL_FX","CINEMA_FX","registerGpuPack","registerTextPack","registerLightPack","register3dPack","registerMorphPack","registerTransitionsPack","registerWeatherPack","registerPhysicsPack","registerFocusPack","registerMusicPack","registerChartPack","registerShopPack","registerSocialPack","registerGamePack","registerGeoPack","registerFormPack","registerAiPack","registerFestivalPack","registerRetroPack","registerOrganicPack","registerCyberPack","registerPaperPack","registerSurfacePack","registerGesture3Pack","registerSpatialPack","registerCinemaPack"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA;AACO,MAAM,YAAY,GAAuC;AAC9D,IAAA,GAAG,EAAEA,uBAAM;AACX,IAAA,IAAI,EAAEC,0BAAQ;AACd,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,yBAAS;AAChB,IAAA,KAAK,EAAEC,4BAAS;AAChB,IAAA,WAAW,EAAEC,wCAAe;AAC5B,IAAA,OAAO,EAAEC,+BAAU;AACnB,IAAA,OAAO,EAAEC,gCAAW;AACpB,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,IAAI,EAAEC,yBAAO;AACb,IAAA,MAAM,EAAEC,6BAAS;AACjB,IAAA,IAAI,EAAEC,yBAAO;AACb,IAAA,GAAG,EAAEC,uBAAM;AACX,IAAA,IAAI,EAAEC,yBAAO;AACb,IAAA,EAAE,EAAEC,qBAAK;AACT,IAAA,QAAQ,EAAEC,iCAAW;AACrB,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,OAAO,EAAEC,+BAAU;AACnB,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,OAAO,EAAEC,+BAAU;AACnB,IAAA,QAAQ,EAAEC,gCAAW;AACrB,IAAA,OAAO,EAAEC,+BAAU;AACnB,IAAA,MAAM,EAAEC,6BAAS;;AAGnB;SACgB,mBAAmB,GAAA;AACjC,IAAAC,gCAAe,EAAE;AACjB,IAAAC,kCAAgB,EAAE;AAClB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,8BAAc,EAAE;AAChB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,gDAAuB,EAAE;AACzB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,kCAAgB,EAAE;AAClB,IAAAC,sCAAkB,EAAE;AACpB,IAAAC,kCAAgB,EAAE;AAClB,IAAAC,gCAAe,EAAE;AACjB,IAAAC,kCAAgB,EAAE;AAClB,IAAAC,8BAAc,EAAE;AAChB,IAAAC,0CAAoB,EAAE;AACtB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,yCAAoB,EAAE;AACtB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,sCAAkB,EAAE;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -780,6 +780,30 @@ declare const SPATIAL_FX: EffectDefinition[];
|
|
|
780
780
|
/** Register portal-open, orbit-in, spatial-float and depth-pop (8.8). */
|
|
781
781
|
declare function registerSpatialPack(): void;
|
|
782
782
|
|
|
783
|
+
/**
|
|
784
|
+
* 9.1 — Cinematic pack (`motionary/fx/cinema`, also `motionary/components/fx-cinema`):
|
|
785
|
+
*
|
|
786
|
+
* - `dolly-in` (enter) — a slow camera push: the element starts slightly
|
|
787
|
+
* large and soft and settles sharp, like a dolly shot (`duration`).
|
|
788
|
+
* - `pan-reveal` (enter) — the camera pans across the element while a
|
|
789
|
+
* wipe uncovers it (`from` left|right).
|
|
790
|
+
* - `letterbox` (enter) — cinema bars slide in, hold, then open up to
|
|
791
|
+
* reveal the element (`hold`).
|
|
792
|
+
* - `rack-focus` (attention) — focus pulls from the element's first child
|
|
793
|
+
* to the rest and back, like a focus puller racking between subjects.
|
|
794
|
+
*
|
|
795
|
+
* `cameraFrame(move, p)` gives the transform of a camera move at progress
|
|
796
|
+
* 0–1 (used by `<usa-scene>`). Reduced motion: entrances fade, rack-focus
|
|
797
|
+
* does nothing.
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
declare const CAMERA_MOVES: readonly ["dolly-in", "dolly-out", "pan-left", "pan-right", "tilt-up", "tilt-down", "zoom-in", "zoom-out", "orbit"];
|
|
801
|
+
/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */
|
|
802
|
+
declare function cameraFrame(move: string, p: number, strength?: number): string;
|
|
803
|
+
declare const CINEMA_FX: EffectDefinition[];
|
|
804
|
+
/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */
|
|
805
|
+
declare function registerCinemaPack(): void;
|
|
806
|
+
|
|
783
807
|
/**
|
|
784
808
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
785
809
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -889,5 +913,5 @@ declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
|
889
913
|
/** Register every 6.x effect pack (idempotent). */
|
|
890
914
|
declare function registerEffectPacks(): void;
|
|
891
915
|
|
|
892
|
-
export { AI_FX, CHART_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GESTURE3_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applySurfaceTheme, arcPath, blobRadius, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, glslToWgsl, loadEffectPack, musicSample, orientationToTilt, packManifest, pageTransition, paperRandom, parseFigure, pinchAngle, pinchScale, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, roughLine, routeLength, samplePath, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule, xrSupport, yawToOffset };
|
|
916
|
+
export { AI_FX, CAMERA_MOVES, CHART_FX, CINEMA_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GESTURE3_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applySurfaceTheme, arcPath, blobRadius, cameraFrame, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, glslToWgsl, loadEffectPack, musicSample, orientationToTilt, packManifest, pageTransition, paperRandom, parseFigure, pinchAngle, pinchScale, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, roughLine, routeLength, samplePath, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule, xrSupport, yawToOffset };
|
|
893
917
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.d.ts
CHANGED
|
@@ -780,6 +780,30 @@ declare const SPATIAL_FX: EffectDefinition[];
|
|
|
780
780
|
/** Register portal-open, orbit-in, spatial-float and depth-pop (8.8). */
|
|
781
781
|
declare function registerSpatialPack(): void;
|
|
782
782
|
|
|
783
|
+
/**
|
|
784
|
+
* 9.1 — Cinematic pack (`motionary/fx/cinema`, also `motionary/components/fx-cinema`):
|
|
785
|
+
*
|
|
786
|
+
* - `dolly-in` (enter) — a slow camera push: the element starts slightly
|
|
787
|
+
* large and soft and settles sharp, like a dolly shot (`duration`).
|
|
788
|
+
* - `pan-reveal` (enter) — the camera pans across the element while a
|
|
789
|
+
* wipe uncovers it (`from` left|right).
|
|
790
|
+
* - `letterbox` (enter) — cinema bars slide in, hold, then open up to
|
|
791
|
+
* reveal the element (`hold`).
|
|
792
|
+
* - `rack-focus` (attention) — focus pulls from the element's first child
|
|
793
|
+
* to the rest and back, like a focus puller racking between subjects.
|
|
794
|
+
*
|
|
795
|
+
* `cameraFrame(move, p)` gives the transform of a camera move at progress
|
|
796
|
+
* 0–1 (used by `<usa-scene>`). Reduced motion: entrances fade, rack-focus
|
|
797
|
+
* does nothing.
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
declare const CAMERA_MOVES: readonly ["dolly-in", "dolly-out", "pan-left", "pan-right", "tilt-up", "tilt-down", "zoom-in", "zoom-out", "orbit"];
|
|
801
|
+
/** Transform of camera `move` at progress `p` (0–1, clamped), `strength` 0–2 (9.1). */
|
|
802
|
+
declare function cameraFrame(move: string, p: number, strength?: number): string;
|
|
803
|
+
declare const CINEMA_FX: EffectDefinition[];
|
|
804
|
+
/** Register dolly-in, pan-reveal, letterbox and rack-focus (9.1). */
|
|
805
|
+
declare function registerCinemaPack(): void;
|
|
806
|
+
|
|
783
807
|
/**
|
|
784
808
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
785
809
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -889,5 +913,5 @@ declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
|
889
913
|
/** Register every 6.x effect pack (idempotent). */
|
|
890
914
|
declare function registerEffectPacks(): void;
|
|
891
915
|
|
|
892
|
-
export { AI_FX, CHART_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GESTURE3_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applySurfaceTheme, arcPath, blobRadius, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, glslToWgsl, loadEffectPack, musicSample, orientationToTilt, packManifest, pageTransition, paperRandom, parseFigure, pinchAngle, pinchScale, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, roughLine, routeLength, samplePath, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule, xrSupport, yawToOffset };
|
|
916
|
+
export { AI_FX, CAMERA_MOVES, CHART_FX, CINEMA_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GESTURE3_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applySurfaceTheme, arcPath, blobRadius, cameraFrame, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, glslToWgsl, loadEffectPack, musicSample, orientationToTilt, packManifest, pageTransition, paperRandom, parseFigure, pinchAngle, pinchScale, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, roughLine, routeLength, samplePath, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule, xrSupport, yawToOffset };
|
|
893
917
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EFFECT_PACK_FORMAT, loadEffectPack, packManifest, validateManifest } from '
|
|
1
|
+
export { E as EFFECT_PACK_FORMAT, l as loadEffectPack, p as packManifest, v as validateManifest } from '../chunks/manifest-PJ0h8RS_.js';
|
|
2
2
|
import { G as GPU_FX, r as registerGpuPack } from '../chunks/gpu-CB8frFOD.js';
|
|
3
3
|
export { a as GLSL_HEAD, W as WGSL_HEAD, f as fieldFallback, g as glslToWgsl, s as shaderBackground, b as supportsWebGL2, c as supportsWebGPU, w as webgpuBackground, d as wgslModule } from '../chunks/gpu-CB8frFOD.js';
|
|
4
4
|
import { TEXT3_FX, registerTextPack } from './fx-text.js';
|
|
@@ -47,6 +47,8 @@ import { GESTURE3_FX, registerGesture3Pack } from './fx-gesture.js';
|
|
|
47
47
|
export { orientationToTilt, pinchAngle, pinchScale } from './fx-gesture.js';
|
|
48
48
|
import { SPATIAL_FX, registerSpatialPack } from './fx-spatial.js';
|
|
49
49
|
export { xrSupport, yawToOffset } from './fx-spatial.js';
|
|
50
|
+
import { CINEMA_FX, registerCinemaPack } from './fx-cinema.js';
|
|
51
|
+
export { CAMERA_MOVES, cameraFrame } from './fx-cinema.js';
|
|
50
52
|
import '../chunks/registry-CnO7ZVPK.js';
|
|
51
53
|
import '../chunks/base-CLuqlLfG.js';
|
|
52
54
|
import '../chunks/generative-2LhxG5BJ.js';
|
|
@@ -80,6 +82,7 @@ const EFFECT_PACKS = {
|
|
|
80
82
|
surface: SURFACE_FX,
|
|
81
83
|
gesture3: GESTURE3_FX,
|
|
82
84
|
spatial: SPATIAL_FX,
|
|
85
|
+
cinema: CINEMA_FX,
|
|
83
86
|
};
|
|
84
87
|
/** Register every 6.x effect pack (idempotent). */
|
|
85
88
|
function registerEffectPacks() {
|
|
@@ -108,7 +111,8 @@ function registerEffectPacks() {
|
|
|
108
111
|
registerSurfacePack();
|
|
109
112
|
registerGesture3Pack();
|
|
110
113
|
registerSpatialPack();
|
|
114
|
+
registerCinemaPack();
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
export { AI_FX, CHART_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GESTURE3_FX, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, TEXT3_FX, TRANSITIONS2_FX, WEATHER_FX, register3dPack, registerAiPack, registerChartPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack };
|
|
117
|
+
export { AI_FX, CHART_FX, CINEMA_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GESTURE3_FX, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, TEXT3_FX, TRANSITIONS2_FX, WEATHER_FX, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack };
|
|
114
118
|
//# sourceMappingURL=fx2.js.map
|