motionary 8.6.0 → 8.7.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 CHANGED
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [8.7.0] - 2026-10-09
11
+
12
+ ### Added
13
+ - **2 new components (8.7)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
14
+ - `<usa-gyro-card>` — 3D card that tilts with the phone's gyroscope (`deviceorientation`, iOS permission asked on first tap) and with the pointer on desktop; moving glare, `[data-depth]` layers float at different depths; `max`, `glare`; `tilt(rx, ry)`, `wobble()`, `source`; `usa:tilt` { rx, ry, source }.
15
+ - `<usa-gesture-sticker>` — multi-touch sticker: one finger drags, two fingers pinch-scale and twist-rotate simultaneously, lifted shadow while held, springy settle; wheel / Shift + wheel; arrows, + / −, [ / ], 0; `min`, `max`; `x`, `y`, `scale`, `angle`, `transformTo()`, `reset()`; `usa:transform`.
16
+ - **Gestures 3.0 pack — `motionary/fx/gesture`** (= `motionary/components/fx-gesture`, `registerGesture3Pack()`, also in `registerEffectPacks()`): `swipe-hint` (attention), `pinch-hint` (attention), `tilt-wobble` (attention), `depth-in` (enter). `pinchScale()`, `pinchAngle()`, `orientationToTilt()`.
17
+ - Showcase: 4 new gallery cards with copyable code, live demos and live Store thumbnails.
18
+
19
+ ### Accessibility
20
+ - The sticker is a focusable `group` (roledescription "sticker") whose label explains the gestures; every gesture has a keyboard equivalent. The gyro card keeps your content readable and the glare is `aria-hidden`. Reduced motion: the gyro card stays flat, the sticker moves without spring, the hints and wobble do nothing, `depth-in` just shows.
21
+
22
+ ### Fixed
23
+ - the gallery id `fx-depth` is taken by the 6.5 depth card → the 8.7 card is `fx-depth-in`.
24
+ - `orientationToTilt()` returned `-0` for a device at rest (beta = rest angle) — the tilt is now normalised to `0` (no `-0` in `usa:tilt` details / CSS vars).
25
+ - the gyro card only moved with a real gyroscope or a mouse over it, so its gallery card and Store thumbnail sat still — added `wobble()` (a short tilt sweep, skipped under reduced motion) and a "Wobble" button in the gallery / Store demo.
26
+
10
27
  ## [8.6.0] - 2026-10-09
11
28
 
12
29
  ### Added
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+
3
+ var registry = require('../chunks/registry-BVklOepd.cjs');
4
+ require('../chunks/base-DoRUZBy-.cjs');
5
+
6
+ /** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */
7
+ function pinchScale(a1, a2, b1, b2) {
8
+ const d0 = Math.hypot(a2.x - a1.x, a2.y - a1.y);
9
+ const d1 = Math.hypot(b2.x - b1.x, b2.y - b1.y);
10
+ return d0 > 0 ? d1 / d0 : 1;
11
+ }
12
+ /** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */
13
+ function pinchAngle(a1, a2, b1, b2) {
14
+ const r = Math.atan2(b2.y - b1.y, b2.x - b1.x) - Math.atan2(a2.y - a1.y, a2.x - a1.x);
15
+ let d = (r * 180) / Math.PI;
16
+ while (d > 180)
17
+ d -= 360;
18
+ while (d < -180)
19
+ d += 360;
20
+ return Math.round(d * 10) / 10;
21
+ }
22
+ /** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */
23
+ function orientationToTilt(beta, gamma, max = 15, rest = 40) {
24
+ const c = (v) => Math.max(-max, Math.min(max, v));
25
+ return { rx: Math.round(c(-(beta - rest) / 2) * 10) / 10 + 0, ry: Math.round(c(gamma / 2) * 10) / 10 + 0 }; // + 0: no -0
26
+ }
27
+ const finger = (host, ctx) => {
28
+ if (getComputedStyle(host).position === 'static') {
29
+ const prev = host.style.position;
30
+ host.style.position = 'relative';
31
+ ctx.onCleanup(() => (host.style.position = prev));
32
+ }
33
+ const f = document.createElement('span');
34
+ f.setAttribute('aria-hidden', 'true');
35
+ Object.assign(f.style, { position: 'absolute', left: '50%', top: '50%', width: '26px', height: '26px', margin: '-13px 0 0 -13px', borderRadius: '50%', background: 'rgba(255,255,255,.75)', boxShadow: '0 0 0 2px rgba(15,23,42,.35), 0 4px 10px rgba(15,23,42,.3)', pointerEvents: 'none', zIndex: '2' });
36
+ host.appendChild(f);
37
+ ctx.onCleanup(() => f.remove());
38
+ return f;
39
+ };
40
+ const GESTURE3_FX = [
41
+ {
42
+ name: 'swipe-hint',
43
+ kind: 'attention',
44
+ description: 'A ghost fingertip swipes across the element and the element nudges along, teaching "swipe me" (`direction`).',
45
+ defaults: { direction: 'left', duration: 1200 },
46
+ run: (el, o, ctx) => {
47
+ if (ctx.reduced)
48
+ return;
49
+ const s = o.direction === 'right' ? 1 : -1;
50
+ const f = finger(el, ctx);
51
+ const a = ctx.animate(f, [{ transform: `translateX(${-s * 30}px) scale(.6)`, opacity: 0 }, { transform: `translateX(${-s * 30}px) scale(1)`, opacity: 1, offset: 0.2 }, { transform: `translateX(${s * 40}px) scale(1)`, opacity: 1, offset: 0.7 }, { transform: `translateX(${s * 50}px) scale(.6)`, opacity: 0 }], { duration: o.duration, easing: 'ease-in-out' });
52
+ const b = ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: `translateX(${s * 18}px)`, offset: 0.65 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' });
53
+ const end = () => f.remove();
54
+ return Promise.all([a?.finished.catch(() => undefined), b?.finished.catch(() => undefined)]).then(end, end);
55
+ },
56
+ },
57
+ {
58
+ name: 'pinch-hint',
59
+ kind: 'attention',
60
+ description: 'Two ghost fingertips pinch out and the element zooms with them, teaching "pinch to zoom".',
61
+ defaults: { duration: 1300 },
62
+ run: (el, o, ctx) => {
63
+ if (ctx.reduced)
64
+ return;
65
+ const f1 = finger(el, ctx);
66
+ const f2 = finger(el, ctx);
67
+ const k = (dx, dy) => [{ transform: 'translate(0,0) scale(.6)', opacity: 0 }, { transform: `translate(${dx * 0.3}px,${dy * 0.3}px)`, opacity: 1, offset: 0.2 }, { transform: `translate(${dx}px,${dy}px)`, opacity: 1, offset: 0.7 }, { transform: `translate(${dx}px,${dy}px) scale(.6)`, opacity: 0 }];
68
+ const runs = [ctx.animate(f1, k(-26, -18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(f2, k(26, 18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: 'scale(1.12)', offset: 0.7 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' })];
69
+ const end = () => (f1.remove(), f2.remove());
70
+ return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(end, end);
71
+ },
72
+ },
73
+ {
74
+ name: 'tilt-wobble',
75
+ kind: 'attention',
76
+ description: 'A 3D wobble as if the phone was tilted.',
77
+ defaults: { duration: 900 },
78
+ run: (el, o, ctx) => {
79
+ if (ctx.reduced)
80
+ return;
81
+ return ctx.animate(el, [{ transform: 'perspective(600px)' }, { transform: 'perspective(600px) rotateY(14deg) rotateX(-6deg)', offset: 0.25 }, { transform: 'perspective(600px) rotateY(-10deg) rotateX(5deg)', offset: 0.55 }, { transform: 'perspective(600px) rotateY(4deg)', offset: 0.8 }, { transform: 'perspective(600px)' }], { duration: o.duration, easing: 'ease-in-out' })?.finished.catch(() => undefined);
82
+ },
83
+ },
84
+ {
85
+ name: 'depth-in',
86
+ kind: 'enter',
87
+ description: 'Children fly in from different depths (`data-depth`, default their order), like parallax layers settling (`stagger`).',
88
+ defaults: { duration: 800, stagger: 90 },
89
+ run: (el, o, ctx) => {
90
+ if (ctx.reduced)
91
+ return;
92
+ const kids = Array.from(el.children);
93
+ const list = kids.length ? kids : [el];
94
+ return Promise.all(list.map((c, i) => {
95
+ const d = Number(c.dataset?.depth) || i + 1;
96
+ return ctx.animate(c, [{ transform: `perspective(700px) translateZ(${ -120 * d}px) translateY(${10 * d}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * (Number(o.stagger) || 0), easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined);
97
+ })).then(() => undefined);
98
+ },
99
+ },
100
+ ];
101
+ /** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */
102
+ function registerGesture3Pack() {
103
+ registry.registerEffects(GESTURE3_FX);
104
+ }
105
+
106
+ exports.GESTURE3_FX = GESTURE3_FX;
107
+ exports.orientationToTilt = orientationToTilt;
108
+ exports.pinchAngle = pinchAngle;
109
+ exports.pinchScale = pinchScale;
110
+ exports.registerGesture3Pack = registerGesture3Pack;
111
+ //# sourceMappingURL=fx-gesture.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-gesture.cjs","sources":["../../src/components/fx2/gesture3.ts"],"sourcesContent":["/**\n * 8.7 — Gestures 3.0 pack (`motionary/fx/gesture`, also `motionary/components/fx-gesture`):\n *\n * - `swipe-hint` (attention) — a ghost fingertip swipes across the element\n * and the element nudges along, teaching \"swipe me\" (`direction` left|right).\n * - `pinch-hint` (attention) — two ghost fingertips pinch out and the\n * element zooms with them, teaching \"pinch to zoom\".\n * - `tilt-wobble` (attention) — a 3D wobble as if the phone was tilted.\n * - `depth-in` (enter) — children fly in from different depths (by\n * `data-depth`, default their order), like parallax layers settling.\n *\n * Reduced motion: depth-in just shows, the hints and wobble do nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\ntype Pt = { x: number; y: number };\n/** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */\nexport function pinchScale(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number {\n const d0 = Math.hypot(a2.x - a1.x, a2.y - a1.y);\n const d1 = Math.hypot(b2.x - b1.x, b2.y - b1.y);\n return d0 > 0 ? d1 / d0 : 1;\n}\n/** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */\nexport function pinchAngle(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number {\n const r = Math.atan2(b2.y - b1.y, b2.x - b1.x) - Math.atan2(a2.y - a1.y, a2.x - a1.x);\n let d = (r * 180) / Math.PI;\n while (d > 180) d -= 360;\n while (d < -180) d += 360;\n return Math.round(d * 10) / 10;\n}\n/** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */\nexport function orientationToTilt(beta: number, gamma: number, max = 15, rest = 40): { rx: number; ry: number } {\n const c = (v: number) => Math.max(-max, Math.min(max, v));\n return { rx: Math.round(c(-(beta - rest) / 2) * 10) / 10 + 0, ry: Math.round(c(gamma / 2) * 10) / 10 + 0 }; // + 0: no -0\n}\n\nconst finger = (host: HTMLElement, ctx: EffectContext) => {\n if (getComputedStyle(host).position === 'static') {\n const prev = host.style.position;\n host.style.position = 'relative';\n ctx.onCleanup(() => (host.style.position = prev));\n }\n const f = document.createElement('span');\n f.setAttribute('aria-hidden', 'true');\n Object.assign(f.style, { position: 'absolute', left: '50%', top: '50%', width: '26px', height: '26px', margin: '-13px 0 0 -13px', borderRadius: '50%', background: 'rgba(255,255,255,.75)', boxShadow: '0 0 0 2px rgba(15,23,42,.35), 0 4px 10px rgba(15,23,42,.3)', pointerEvents: 'none', zIndex: '2' });\n host.appendChild(f);\n ctx.onCleanup(() => f.remove());\n return f;\n};\n\nexport const GESTURE3_FX: EffectDefinition[] = [\n {\n name: 'swipe-hint',\n kind: 'attention',\n description: 'A ghost fingertip swipes across the element and the element nudges along, teaching \"swipe me\" (`direction`).',\n defaults: { direction: 'left', duration: 1200 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const s = o.direction === 'right' ? 1 : -1;\n const f = finger(el, ctx);\n const a = ctx.animate(f, [{ transform: `translateX(${-s * 30}px) scale(.6)`, opacity: 0 }, { transform: `translateX(${-s * 30}px) scale(1)`, opacity: 1, offset: 0.2 }, { transform: `translateX(${s * 40}px) scale(1)`, opacity: 1, offset: 0.7 }, { transform: `translateX(${s * 50}px) scale(.6)`, opacity: 0 }], { duration: o.duration, easing: 'ease-in-out' });\n const b = ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: `translateX(${s * 18}px)`, offset: 0.65 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' });\n const end = () => f.remove();\n return Promise.all([a?.finished.catch(() => undefined), b?.finished.catch(() => undefined)]).then(end, end);\n },\n },\n {\n name: 'pinch-hint',\n kind: 'attention',\n description: 'Two ghost fingertips pinch out and the element zooms with them, teaching \"pinch to zoom\".',\n defaults: { duration: 1300 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const f1 = finger(el, ctx);\n const f2 = finger(el, ctx);\n const k = (dx: number, dy: number): Keyframe[] => [{ transform: 'translate(0,0) scale(.6)', opacity: 0 }, { transform: `translate(${dx * 0.3}px,${dy * 0.3}px)`, opacity: 1, offset: 0.2 }, { transform: `translate(${dx}px,${dy}px)`, opacity: 1, offset: 0.7 }, { transform: `translate(${dx}px,${dy}px) scale(.6)`, opacity: 0 }];\n const runs = [ctx.animate(f1, k(-26, -18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(f2, k(26, 18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: 'scale(1.12)', offset: 0.7 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' })];\n const end = () => (f1.remove(), f2.remove());\n return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(end, end);\n },\n },\n {\n name: 'tilt-wobble',\n kind: 'attention',\n description: 'A 3D wobble as if the phone was tilted.',\n defaults: { duration: 900 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n return ctx.animate(el, [{ transform: 'perspective(600px)' }, { transform: 'perspective(600px) rotateY(14deg) rotateX(-6deg)', offset: 0.25 }, { transform: 'perspective(600px) rotateY(-10deg) rotateX(5deg)', offset: 0.55 }, { transform: 'perspective(600px) rotateY(4deg)', offset: 0.8 }, { transform: 'perspective(600px)' }], { duration: o.duration, easing: 'ease-in-out' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'depth-in',\n kind: 'enter',\n description: 'Children fly in from different depths (`data-depth`, default their order), like parallax layers settling (`stagger`).',\n defaults: { duration: 800, stagger: 90 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const kids = Array.from(el.children) as HTMLElement[];\n const list = kids.length ? kids : [el];\n return Promise.all(\n list.map((c, i) => {\n const d = Number(c.dataset?.depth) || i + 1;\n return ctx.animate(c, [{ transform: `perspective(700px) translateZ(${-120 * d}px) translateY(${10 * d}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * (Number(o.stagger) || 0), easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n })\n ).then(() => undefined);\n },\n },\n];\n\n/** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */\nexport function registerGesture3Pack(): void {\n registerEffects(GESTURE3_FX);\n}\n"],"names":["registerEffects"],"mappings":";;;;;AAiBA;AACM,SAAU,UAAU,CAAC,EAAM,EAAE,EAAM,EAAE,EAAM,EAAE,EAAM,EAAA;IACvD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC/C,IAAA,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAC7B;AACA;AACM,SAAU,UAAU,CAAC,EAAM,EAAE,EAAM,EAAE,EAAM,EAAE,EAAM,EA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CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC;YACtT,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC;QACzB,CAAC;AACF,KAAA;;AAGH;SACgB,oBAAoB,GAAA;IAClCA,wBAAe,CAAC,WAAW,CAAC;AAC9B;;;;;;;;"}
@@ -0,0 +1,75 @@
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
+ * 8.7 — Gestures 3.0 pack (`motionary/fx/gesture`, also `motionary/components/fx-gesture`):
46
+ *
47
+ * - `swipe-hint` (attention) — a ghost fingertip swipes across the element
48
+ * and the element nudges along, teaching "swipe me" (`direction` left|right).
49
+ * - `pinch-hint` (attention) — two ghost fingertips pinch out and the
50
+ * element zooms with them, teaching "pinch to zoom".
51
+ * - `tilt-wobble` (attention) — a 3D wobble as if the phone was tilted.
52
+ * - `depth-in` (enter) — children fly in from different depths (by
53
+ * `data-depth`, default their order), like parallax layers settling.
54
+ *
55
+ * Reduced motion: depth-in just shows, the hints and wobble do nothing.
56
+ */
57
+
58
+ type Pt = {
59
+ x: number;
60
+ y: number;
61
+ };
62
+ /** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */
63
+ declare function pinchScale(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number;
64
+ /** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */
65
+ declare function pinchAngle(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number;
66
+ /** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */
67
+ declare function orientationToTilt(beta: number, gamma: number, max?: number, rest?: number): {
68
+ rx: number;
69
+ ry: number;
70
+ };
71
+ declare const GESTURE3_FX: EffectDefinition[];
72
+ /** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */
73
+ declare function registerGesture3Pack(): void;
74
+
75
+ export { GESTURE3_FX, orientationToTilt, pinchAngle, pinchScale, registerGesture3Pack };
@@ -0,0 +1,75 @@
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
+ * 8.7 — Gestures 3.0 pack (`motionary/fx/gesture`, also `motionary/components/fx-gesture`):
46
+ *
47
+ * - `swipe-hint` (attention) — a ghost fingertip swipes across the element
48
+ * and the element nudges along, teaching "swipe me" (`direction` left|right).
49
+ * - `pinch-hint` (attention) — two ghost fingertips pinch out and the
50
+ * element zooms with them, teaching "pinch to zoom".
51
+ * - `tilt-wobble` (attention) — a 3D wobble as if the phone was tilted.
52
+ * - `depth-in` (enter) — children fly in from different depths (by
53
+ * `data-depth`, default their order), like parallax layers settling.
54
+ *
55
+ * Reduced motion: depth-in just shows, the hints and wobble do nothing.
56
+ */
57
+
58
+ type Pt = {
59
+ x: number;
60
+ y: number;
61
+ };
62
+ /** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */
63
+ declare function pinchScale(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number;
64
+ /** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */
65
+ declare function pinchAngle(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number;
66
+ /** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */
67
+ declare function orientationToTilt(beta: number, gamma: number, max?: number, rest?: number): {
68
+ rx: number;
69
+ ry: number;
70
+ };
71
+ declare const GESTURE3_FX: EffectDefinition[];
72
+ /** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */
73
+ declare function registerGesture3Pack(): void;
74
+
75
+ export { GESTURE3_FX, orientationToTilt, pinchAngle, pinchScale, registerGesture3Pack };
@@ -0,0 +1,105 @@
1
+ import { registerEffects } from '../chunks/registry-CnO7ZVPK.js';
2
+ import '../chunks/base-CLuqlLfG.js';
3
+
4
+ /** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */
5
+ function pinchScale(a1, a2, b1, b2) {
6
+ const d0 = Math.hypot(a2.x - a1.x, a2.y - a1.y);
7
+ const d1 = Math.hypot(b2.x - b1.x, b2.y - b1.y);
8
+ return d0 > 0 ? d1 / d0 : 1;
9
+ }
10
+ /** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */
11
+ function pinchAngle(a1, a2, b1, b2) {
12
+ const r = Math.atan2(b2.y - b1.y, b2.x - b1.x) - Math.atan2(a2.y - a1.y, a2.x - a1.x);
13
+ let d = (r * 180) / Math.PI;
14
+ while (d > 180)
15
+ d -= 360;
16
+ while (d < -180)
17
+ d += 360;
18
+ return Math.round(d * 10) / 10;
19
+ }
20
+ /** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */
21
+ function orientationToTilt(beta, gamma, max = 15, rest = 40) {
22
+ const c = (v) => Math.max(-max, Math.min(max, v));
23
+ return { rx: Math.round(c(-(beta - rest) / 2) * 10) / 10 + 0, ry: Math.round(c(gamma / 2) * 10) / 10 + 0 }; // + 0: no -0
24
+ }
25
+ const finger = (host, ctx) => {
26
+ if (getComputedStyle(host).position === 'static') {
27
+ const prev = host.style.position;
28
+ host.style.position = 'relative';
29
+ ctx.onCleanup(() => (host.style.position = prev));
30
+ }
31
+ const f = document.createElement('span');
32
+ f.setAttribute('aria-hidden', 'true');
33
+ Object.assign(f.style, { position: 'absolute', left: '50%', top: '50%', width: '26px', height: '26px', margin: '-13px 0 0 -13px', borderRadius: '50%', background: 'rgba(255,255,255,.75)', boxShadow: '0 0 0 2px rgba(15,23,42,.35), 0 4px 10px rgba(15,23,42,.3)', pointerEvents: 'none', zIndex: '2' });
34
+ host.appendChild(f);
35
+ ctx.onCleanup(() => f.remove());
36
+ return f;
37
+ };
38
+ const GESTURE3_FX = [
39
+ {
40
+ name: 'swipe-hint',
41
+ kind: 'attention',
42
+ description: 'A ghost fingertip swipes across the element and the element nudges along, teaching "swipe me" (`direction`).',
43
+ defaults: { direction: 'left', duration: 1200 },
44
+ run: (el, o, ctx) => {
45
+ if (ctx.reduced)
46
+ return;
47
+ const s = o.direction === 'right' ? 1 : -1;
48
+ const f = finger(el, ctx);
49
+ const a = ctx.animate(f, [{ transform: `translateX(${-s * 30}px) scale(.6)`, opacity: 0 }, { transform: `translateX(${-s * 30}px) scale(1)`, opacity: 1, offset: 0.2 }, { transform: `translateX(${s * 40}px) scale(1)`, opacity: 1, offset: 0.7 }, { transform: `translateX(${s * 50}px) scale(.6)`, opacity: 0 }], { duration: o.duration, easing: 'ease-in-out' });
50
+ const b = ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: `translateX(${s * 18}px)`, offset: 0.65 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' });
51
+ const end = () => f.remove();
52
+ return Promise.all([a?.finished.catch(() => undefined), b?.finished.catch(() => undefined)]).then(end, end);
53
+ },
54
+ },
55
+ {
56
+ name: 'pinch-hint',
57
+ kind: 'attention',
58
+ description: 'Two ghost fingertips pinch out and the element zooms with them, teaching "pinch to zoom".',
59
+ defaults: { duration: 1300 },
60
+ run: (el, o, ctx) => {
61
+ if (ctx.reduced)
62
+ return;
63
+ const f1 = finger(el, ctx);
64
+ const f2 = finger(el, ctx);
65
+ const k = (dx, dy) => [{ transform: 'translate(0,0) scale(.6)', opacity: 0 }, { transform: `translate(${dx * 0.3}px,${dy * 0.3}px)`, opacity: 1, offset: 0.2 }, { transform: `translate(${dx}px,${dy}px)`, opacity: 1, offset: 0.7 }, { transform: `translate(${dx}px,${dy}px) scale(.6)`, opacity: 0 }];
66
+ const runs = [ctx.animate(f1, k(-26, -18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(f2, k(26, 18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: 'scale(1.12)', offset: 0.7 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' })];
67
+ const end = () => (f1.remove(), f2.remove());
68
+ return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(end, end);
69
+ },
70
+ },
71
+ {
72
+ name: 'tilt-wobble',
73
+ kind: 'attention',
74
+ description: 'A 3D wobble as if the phone was tilted.',
75
+ defaults: { duration: 900 },
76
+ run: (el, o, ctx) => {
77
+ if (ctx.reduced)
78
+ return;
79
+ return ctx.animate(el, [{ transform: 'perspective(600px)' }, { transform: 'perspective(600px) rotateY(14deg) rotateX(-6deg)', offset: 0.25 }, { transform: 'perspective(600px) rotateY(-10deg) rotateX(5deg)', offset: 0.55 }, { transform: 'perspective(600px) rotateY(4deg)', offset: 0.8 }, { transform: 'perspective(600px)' }], { duration: o.duration, easing: 'ease-in-out' })?.finished.catch(() => undefined);
80
+ },
81
+ },
82
+ {
83
+ name: 'depth-in',
84
+ kind: 'enter',
85
+ description: 'Children fly in from different depths (`data-depth`, default their order), like parallax layers settling (`stagger`).',
86
+ defaults: { duration: 800, stagger: 90 },
87
+ run: (el, o, ctx) => {
88
+ if (ctx.reduced)
89
+ return;
90
+ const kids = Array.from(el.children);
91
+ const list = kids.length ? kids : [el];
92
+ return Promise.all(list.map((c, i) => {
93
+ const d = Number(c.dataset?.depth) || i + 1;
94
+ return ctx.animate(c, [{ transform: `perspective(700px) translateZ(${ -120 * d}px) translateY(${10 * d}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * (Number(o.stagger) || 0), easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined);
95
+ })).then(() => undefined);
96
+ },
97
+ },
98
+ ];
99
+ /** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */
100
+ function registerGesture3Pack() {
101
+ registerEffects(GESTURE3_FX);
102
+ }
103
+
104
+ export { GESTURE3_FX, orientationToTilt, pinchAngle, pinchScale, registerGesture3Pack };
105
+ //# sourceMappingURL=fx-gesture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-gesture.js","sources":["../../src/components/fx2/gesture3.ts"],"sourcesContent":["/**\n * 8.7 — Gestures 3.0 pack (`motionary/fx/gesture`, also `motionary/components/fx-gesture`):\n *\n * - `swipe-hint` (attention) — a ghost fingertip swipes across the element\n * and the element nudges along, teaching \"swipe me\" (`direction` left|right).\n * - `pinch-hint` (attention) — two ghost fingertips pinch out and the\n * element zooms with them, teaching \"pinch to zoom\".\n * - `tilt-wobble` (attention) — a 3D wobble as if the phone was tilted.\n * - `depth-in` (enter) — children fly in from different depths (by\n * `data-depth`, default their order), like parallax layers settling.\n *\n * Reduced motion: depth-in just shows, the hints and wobble do nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\ntype Pt = { x: number; y: number };\n/** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */\nexport function pinchScale(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number {\n const d0 = Math.hypot(a2.x - a1.x, a2.y - a1.y);\n const d1 = Math.hypot(b2.x - b1.x, b2.y - b1.y);\n return d0 > 0 ? d1 / d0 : 1;\n}\n/** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */\nexport function pinchAngle(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number {\n const r = Math.atan2(b2.y - b1.y, b2.x - b1.x) - Math.atan2(a2.y - a1.y, a2.x - a1.x);\n let d = (r * 180) / Math.PI;\n while (d > 180) d -= 360;\n while (d < -180) d += 360;\n return Math.round(d * 10) / 10;\n}\n/** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */\nexport function orientationToTilt(beta: number, gamma: number, max = 15, rest = 40): { rx: number; ry: number } {\n const c = (v: number) => Math.max(-max, Math.min(max, v));\n return { rx: Math.round(c(-(beta - rest) / 2) * 10) / 10 + 0, ry: Math.round(c(gamma / 2) * 10) / 10 + 0 }; // + 0: no -0\n}\n\nconst finger = (host: HTMLElement, ctx: EffectContext) => {\n if (getComputedStyle(host).position === 'static') {\n const prev = host.style.position;\n host.style.position = 'relative';\n ctx.onCleanup(() => (host.style.position = prev));\n }\n const f = document.createElement('span');\n f.setAttribute('aria-hidden', 'true');\n Object.assign(f.style, { position: 'absolute', left: '50%', top: '50%', width: '26px', height: '26px', margin: '-13px 0 0 -13px', borderRadius: '50%', background: 'rgba(255,255,255,.75)', boxShadow: '0 0 0 2px rgba(15,23,42,.35), 0 4px 10px rgba(15,23,42,.3)', pointerEvents: 'none', zIndex: '2' });\n host.appendChild(f);\n ctx.onCleanup(() => f.remove());\n return f;\n};\n\nexport const GESTURE3_FX: EffectDefinition[] = [\n {\n name: 'swipe-hint',\n kind: 'attention',\n description: 'A ghost fingertip swipes across the element and the element nudges along, teaching \"swipe me\" (`direction`).',\n defaults: { direction: 'left', duration: 1200 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const s = o.direction === 'right' ? 1 : -1;\n const f = finger(el, ctx);\n const a = ctx.animate(f, [{ transform: `translateX(${-s * 30}px) scale(.6)`, opacity: 0 }, { transform: `translateX(${-s * 30}px) scale(1)`, opacity: 1, offset: 0.2 }, { transform: `translateX(${s * 40}px) scale(1)`, opacity: 1, offset: 0.7 }, { transform: `translateX(${s * 50}px) scale(.6)`, opacity: 0 }], { duration: o.duration, easing: 'ease-in-out' });\n const b = ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: `translateX(${s * 18}px)`, offset: 0.65 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' });\n const end = () => f.remove();\n return Promise.all([a?.finished.catch(() => undefined), b?.finished.catch(() => undefined)]).then(end, end);\n },\n },\n {\n name: 'pinch-hint',\n kind: 'attention',\n description: 'Two ghost fingertips pinch out and the element zooms with them, teaching \"pinch to zoom\".',\n defaults: { duration: 1300 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const f1 = finger(el, ctx);\n const f2 = finger(el, ctx);\n const k = (dx: number, dy: number): Keyframe[] => [{ transform: 'translate(0,0) scale(.6)', opacity: 0 }, { transform: `translate(${dx * 0.3}px,${dy * 0.3}px)`, opacity: 1, offset: 0.2 }, { transform: `translate(${dx}px,${dy}px)`, opacity: 1, offset: 0.7 }, { transform: `translate(${dx}px,${dy}px) scale(.6)`, opacity: 0 }];\n const runs = [ctx.animate(f1, k(-26, -18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(f2, k(26, 18), { duration: o.duration, easing: 'ease-in-out' }), ctx.animate(el, [{ transform: 'none' }, { transform: 'none', offset: 0.2 }, { transform: 'scale(1.12)', offset: 0.7 }, { transform: 'none' }], { duration: o.duration, easing: 'ease-in-out' })];\n const end = () => (f1.remove(), f2.remove());\n return Promise.all(runs.map((r) => r?.finished.catch(() => undefined))).then(end, end);\n },\n },\n {\n name: 'tilt-wobble',\n kind: 'attention',\n description: 'A 3D wobble as if the phone was tilted.',\n defaults: { duration: 900 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n return ctx.animate(el, [{ transform: 'perspective(600px)' }, { transform: 'perspective(600px) rotateY(14deg) rotateX(-6deg)', offset: 0.25 }, { transform: 'perspective(600px) rotateY(-10deg) rotateX(5deg)', offset: 0.55 }, { transform: 'perspective(600px) rotateY(4deg)', offset: 0.8 }, { transform: 'perspective(600px)' }], { duration: o.duration, easing: 'ease-in-out' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'depth-in',\n kind: 'enter',\n description: 'Children fly in from different depths (`data-depth`, default their order), like parallax layers settling (`stagger`).',\n defaults: { duration: 800, stagger: 90 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const kids = Array.from(el.children) as HTMLElement[];\n const list = kids.length ? kids : [el];\n return Promise.all(\n list.map((c, i) => {\n const d = Number(c.dataset?.depth) || i + 1;\n return ctx.animate(c, [{ transform: `perspective(700px) translateZ(${-120 * d}px) translateY(${10 * d}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * (Number(o.stagger) || 0), easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n })\n ).then(() => undefined);\n },\n },\n];\n\n/** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */\nexport function registerGesture3Pack(): void {\n registerEffects(GESTURE3_FX);\n}\n"],"names":[],"mappings":";;;AAiBA;AACM,SAAU,UAAU,CAAC,EAAM,EAAE,EAAM,EAAE,EAAM,EAAE,EAAM,EAAA;IACvD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC/C,IAAA,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAC7B;AACA;AACM,SAAU,UAAU,CAAC,EAAM,EAAE,EAAM,EAAE,EAAM,EAAE,EAAM,EAAA;AACvD,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrF,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE;IAC3B,OAAO,CAAC,GAAG,GAAG;QAAE,CAAC,IAAI,GAAG;IACxB,OAAO,CAAC,GAAG,IAAI;QAAE,CAAC,IAAI,GAAG;IACzB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;AAChC;AACA;AACM,SAAU,iBAAiB,CAAC,IAAY,EAAE,KAAa,EAAE,G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AC,QAAQ,CAAkB;AACrD,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC;AACtC,YAAA,OAAO,OAAO,CAAC,GAAG,CAChB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAI;AAChB,gBAAA,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AAC3C,gBAAA,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,iCAAiC,KAAI,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA,GAAA,CAAK,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC;YACtT,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC;QACzB,CAAC;AACF,KAAA;;AAGH;SACgB,oBAAoB,GAAA;IAClC,eAAe,CAAC,WAAW,CAAC;AAC9B;;;;"}
@@ -24,6 +24,7 @@ var components_fxOrganic = require('./fx-organic.cjs');
24
24
  var components_fxCyber = require('./fx-cyber.cjs');
25
25
  var components_fxPaper = require('./fx-paper.cjs');
26
26
  var components_fxSurface = require('./fx-surface.cjs');
27
+ var components_fxGesture = require('./fx-gesture.cjs');
27
28
  require('../chunks/registry-BVklOepd.cjs');
28
29
  require('../chunks/base-DoRUZBy-.cjs');
29
30
  require('../chunks/generative-BHIj-NU0.cjs');
@@ -55,6 +56,7 @@ const EFFECT_PACKS = {
55
56
  cyber: components_fxCyber.CYBER_FX,
56
57
  paper: components_fxPaper.PAPER_FX,
57
58
  surface: components_fxSurface.SURFACE_FX,
59
+ gesture3: components_fxGesture.GESTURE3_FX,
58
60
  };
59
61
  /** Register every 6.x effect pack (idempotent). */
60
62
  function registerEffectPacks() {
@@ -81,6 +83,7 @@ function registerEffectPacks() {
81
83
  components_fxCyber.registerCyberPack();
82
84
  components_fxPaper.registerPaperPack();
83
85
  components_fxSurface.registerSurfacePack();
86
+ components_fxGesture.registerGesture3Pack();
84
87
  }
85
88
 
86
89
  exports.EFFECT_PACK_FORMAT = components_marketplace.EFFECT_PACK_FORMAT;
@@ -167,6 +170,11 @@ exports.SURFACE_FX = components_fxSurface.SURFACE_FX;
167
170
  exports.SURFACE_THEMES = components_fxSurface.SURFACE_THEMES;
168
171
  exports.applySurfaceTheme = components_fxSurface.applySurfaceTheme;
169
172
  exports.registerSurfacePack = components_fxSurface.registerSurfacePack;
173
+ exports.GESTURE3_FX = components_fxGesture.GESTURE3_FX;
174
+ exports.orientationToTilt = components_fxGesture.orientationToTilt;
175
+ exports.pinchAngle = components_fxGesture.pinchAngle;
176
+ exports.pinchScale = components_fxGesture.pinchScale;
177
+ exports.registerGesture3Pack = components_fxGesture.registerGesture3Pack;
170
178
  exports.EFFECT_PACKS = EFFECT_PACKS;
171
179
  exports.registerEffectPacks = registerEffectPacks;
172
180
  //# 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';\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\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};\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}\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","registerGpuPack","registerTextPack","registerLightPack","register3dPack","registerMorphPack","registerTransitionsPack","registerWeatherPack","registerPhysicsPack","registerFocusPack","registerMusicPack","registerChartPack","registerShopPack","registerSocialPack","registerGamePack","registerGeoPack","registerFormPack","registerAiPack","registerFestivalPack","registerRetroPack","registerOrganicPack","registerCyberPack","registerPaperPack","registerSurfacePack"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA;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;;AAGrB;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;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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';\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\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};\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}\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","registerGpuPack","registerTextPack","registerLightPack","register3dPack","registerMorphPack","registerTransitionsPack","registerWeatherPack","registerPhysicsPack","registerFocusPack","registerMusicPack","registerChartPack","registerShopPack","registerSocialPack","registerGamePack","registerGeoPack","registerFormPack","registerAiPack","registerFestivalPack","registerRetroPack","registerOrganicPack","registerCyberPack","registerPaperPack","registerSurfacePack","registerGesture3Pack"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA;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,IA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,EAAE;AACnB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,yCAAoB,EAAE;AACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -725,6 +725,37 @@ declare const SURFACE_FX: EffectDefinition[];
725
725
  /** Register neon-ignite, neon-pulse, glass-frost and neu-press (8.6). */
726
726
  declare function registerSurfacePack(): void;
727
727
 
728
+ /**
729
+ * 8.7 — Gestures 3.0 pack (`motionary/fx/gesture`, also `motionary/components/fx-gesture`):
730
+ *
731
+ * - `swipe-hint` (attention) — a ghost fingertip swipes across the element
732
+ * and the element nudges along, teaching "swipe me" (`direction` left|right).
733
+ * - `pinch-hint` (attention) — two ghost fingertips pinch out and the
734
+ * element zooms with them, teaching "pinch to zoom".
735
+ * - `tilt-wobble` (attention) — a 3D wobble as if the phone was tilted.
736
+ * - `depth-in` (enter) — children fly in from different depths (by
737
+ * `data-depth`, default their order), like parallax layers settling.
738
+ *
739
+ * Reduced motion: depth-in just shows, the hints and wobble do nothing.
740
+ */
741
+
742
+ type Pt = {
743
+ x: number;
744
+ y: number;
745
+ };
746
+ /** Scale factor of a two-finger pinch from start points (a1, a2) to current points (b1, b2) (8.7). */
747
+ declare function pinchScale(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number;
748
+ /** Rotation in degrees of a two-finger twist from (a1, a2) to (b1, b2) (8.7). */
749
+ declare function pinchAngle(a1: Pt, a2: Pt, b1: Pt, b2: Pt): number;
750
+ /** Device orientation (beta front/back, gamma left/right, in degrees) → card tilt { rx, ry } clamped to ±max (8.7). */
751
+ declare function orientationToTilt(beta: number, gamma: number, max?: number, rest?: number): {
752
+ rx: number;
753
+ ry: number;
754
+ };
755
+ declare const GESTURE3_FX: EffectDefinition[];
756
+ /** Register swipe-hint, pinch-hint, tilt-wobble and depth-in (8.7). */
757
+ declare function registerGesture3Pack(): void;
758
+
728
759
  /**
729
760
  * 5.5 — generative backgrounds on Canvas 2D, registered through
730
761
  * `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
@@ -834,5 +865,5 @@ declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
834
865
  /** Register every 6.x effect pack (idempotent). */
835
866
  declare function registerEffectPacks(): void;
836
867
 
837
- export { AI_FX, CHART_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GEO_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applySurfaceTheme, arcPath, blobRadius, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, glslToWgsl, loadEffectPack, musicSample, packManifest, pageTransition, paperRandom, parseFigure, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGeoPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, roughLine, routeLength, samplePath, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule };
868
+ 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, 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, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, roughLine, routeLength, samplePath, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule };
838
869
  export type { EffectPackManifest, ShaderSpec };