use-scroll-animate 8.5.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,39 @@ 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
+
27
+ ## [8.6.0] - 2026-10-09
28
+
29
+ ### Added
30
+ - **Theme system (8.6)** — five surface themes (`light`, `dark`, `neon`, `glass`, `neu` / neumorphism) driven by a `data-usa-surface` attribute; `SURFACE_THEMES`, `applySurfaceTheme(name, target?)`.
31
+ - **2 new components (8.6)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
32
+ - `<usa-theme-switcher>` — segmented theme switcher: sets `data-usa-surface` on `target` (default `<html>`), sliding pill, circular View-Transition wipe from the click point (page-level), `themes`, `value`, `persist` (localStorage key); `usa:change` { theme }.
33
+ - `<usa-theme-surface>` — themeable card that follows the nearest `data-usa-surface` (or its own `theme`): neon glow edge that pulses, frosted glass with a sheen, soft neumorphic relief that presses; cross-fades on theme change; `theme`; `usa:theme` { theme }.
34
+ - **Surface theme pack — `motionary/fx/surface`** (= `motionary/components/fx-surface`, `registerSurfacePack()`, also in `registerEffectPacks()`): `neon-ignite` (enter), `neon-pulse` (loop), `glass-frost` (enter), `neu-press` (attention). Names chosen not to override the existing 3.x `neon-flicker` theme effect.
35
+ - Showcase: 4 new gallery cards with copyable code, live demos and live Store thumbnails.
36
+
37
+ ### Accessibility
38
+ - Theme switcher is a labelled `radiogroup` of `radio`s with roving tabindex and arrow keys; the swatches are `aria-hidden`. Theme surfaces keep your content and text contrast in every theme. Reduced motion: the switch is instant (no wipe, no pill slide), the neon / sheen loops stop, `neon-ignite` / `glass-frost` just show, `neon-pulse` is skipped, `neu-press` does nothing.
39
+
40
+ ### Fixed
41
+ - the 5.8 theme packs (applyTheme / <usa-theme>) already own the `data-usa-theme` attribute, so the 8.6 surface themes use `data-usa-surface` instead (no clash with neon/paper/glass/retro/brutalist motion themes); effect names neon-ignite (not the 5.8 neon-flicker) and 8.5 paper-unfold (not 5.8 paper-fold) avoid overriding existing effects.
42
+
10
43
  ## [8.5.0] - 2026-10-09
11
44
 
12
45
  ### 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,EAAA;AACvD,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE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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":[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tC,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;;;;"}
@@ -0,0 +1,89 @@
1
+ 'use strict';
2
+
3
+ var registry = require('../chunks/registry-BVklOepd.cjs');
4
+ require('../chunks/base-DoRUZBy-.cjs');
5
+
6
+ /** The built-in surface themes of the 8.6 theme system. */
7
+ const SURFACE_THEMES = ['light', 'dark', 'neon', 'glass', 'neu'];
8
+ /** Set `data-usa-surface` on `target` (default `<html>`) and return the theme actually applied (unknown → `light`) (8.6). */
9
+ function applySurfaceTheme(name, target = typeof document !== 'undefined' ? document.documentElement : null) {
10
+ const t = (SURFACE_THEMES.includes(name) ? name : 'light');
11
+ target?.setAttribute('data-usa-surface', t);
12
+ return t;
13
+ }
14
+ const glow = (c, k) => `0 0 ${4 * k}px ${c}, 0 0 ${12 * k}px ${c}`;
15
+ const SURFACE_FX = [
16
+ {
17
+ name: 'neon-ignite',
18
+ kind: 'enter',
19
+ description: 'The element powers on like a neon tube — stuttering flickers, then a steady glow (`color`).',
20
+ defaults: { color: '#f0abfc', duration: 1100 },
21
+ run: (el, o, ctx) => {
22
+ if (ctx.reduced)
23
+ return;
24
+ const on = { opacity: 1, textShadow: glow(o.color, 1), filter: 'brightness(1.15)' };
25
+ const off = { opacity: 0.15, textShadow: 'none', filter: 'brightness(.6)' };
26
+ return ctx.animate(el, [{ ...off, offset: 0 }, { ...on, offset: 0.1 }, { ...off, offset: 0.14 }, { ...on, offset: 0.3 }, { ...off, offset: 0.34 }, { ...off, offset: 0.5 }, { ...on, offset: 0.56 }, { ...on, textShadow: glow(o.color, 1.6), offset: 0.8 }, { opacity: 1, textShadow: glow(o.color, 1), filter: 'none', offset: 1 }], { duration: o.duration, fill: 'backwards' })?.finished.catch(() => undefined);
27
+ },
28
+ },
29
+ {
30
+ name: 'neon-pulse',
31
+ kind: 'loop',
32
+ description: 'A slow breathing neon glow until the cleanup runs (`color`).',
33
+ defaults: { color: '#22d3ee', duration: 2200 },
34
+ run: (el, o, ctx) => {
35
+ if (ctx.reduced)
36
+ return;
37
+ const a = ctx.animate(el, [{ boxShadow: glow(o.color, 0.6) }, { boxShadow: glow(o.color, 1.6) }, { boxShadow: glow(o.color, 0.6) }], { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });
38
+ return () => a?.cancel();
39
+ },
40
+ },
41
+ {
42
+ name: 'glass-frost',
43
+ kind: 'enter',
44
+ description: 'Frosted glass condenses: blur and transparency settle into a crisp glass panel, with a shine passing over it.',
45
+ defaults: { duration: 1000 },
46
+ run: (el, o, ctx) => {
47
+ if (ctx.reduced)
48
+ return;
49
+ const runs = [];
50
+ runs.push(ctx.animate(el, [{ opacity: 0, filter: 'blur(12px)', transform: 'scale(.96)' }, { opacity: 1, filter: 'blur(0)', transform: 'none' }], { duration: o.duration, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined));
51
+ if (getComputedStyle(el).position === 'static') {
52
+ const prev = el.style.position;
53
+ el.style.position = 'relative';
54
+ ctx.onCleanup(() => (el.style.position = prev));
55
+ }
56
+ const s = document.createElement('span');
57
+ s.setAttribute('aria-hidden', 'true');
58
+ Object.assign(s.style, { position: 'absolute', inset: '0', pointerEvents: 'none', borderRadius: 'inherit', background: 'linear-gradient(110deg,transparent 30%,rgba(255,255,255,.55) 50%,transparent 70%)', backgroundSize: '250% 100%' });
59
+ el.appendChild(s);
60
+ ctx.onCleanup(() => s.remove());
61
+ const sh = ctx.animate(s, [{ backgroundPosition: '120% 0' }, { backgroundPosition: '-60% 0' }], { duration: o.duration * 0.9, delay: o.duration * 0.4, easing: 'ease-in-out', fill: 'backwards' });
62
+ runs.push(sh ? sh.finished.then(() => s.remove(), () => s.remove()) : (s.remove(), undefined));
63
+ return Promise.all(runs).then(() => undefined);
64
+ },
65
+ },
66
+ {
67
+ name: 'neu-press',
68
+ kind: 'attention',
69
+ description: 'A soft neumorphic press: the raised shadow flips to an inset one and pops back.',
70
+ defaults: { duration: 450 },
71
+ run: (el, o, ctx) => {
72
+ if (ctx.reduced)
73
+ return;
74
+ const up = '6px 6px 12px rgba(163,177,198,.7), -6px -6px 12px rgba(255,255,255,.9)';
75
+ const down = 'inset 4px 4px 8px rgba(163,177,198,.8), inset -4px -4px 8px rgba(255,255,255,.9)';
76
+ return ctx.animate(el, [{ boxShadow: up, transform: 'none' }, { boxShadow: down, transform: 'scale(.97)', offset: 0.4 }, { boxShadow: up, transform: 'none' }], { duration: o.duration, easing: 'ease-out' })?.finished.catch(() => undefined);
77
+ },
78
+ },
79
+ ];
80
+ /** Register neon-ignite, neon-pulse, glass-frost and neu-press (8.6). */
81
+ function registerSurfacePack() {
82
+ registry.registerEffects(SURFACE_FX);
83
+ }
84
+
85
+ exports.SURFACE_FX = SURFACE_FX;
86
+ exports.SURFACE_THEMES = SURFACE_THEMES;
87
+ exports.applySurfaceTheme = applySurfaceTheme;
88
+ exports.registerSurfacePack = registerSurfacePack;
89
+ //# sourceMappingURL=fx-surface.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-surface.cjs","sources":["../../src/components/fx2/themefx.ts"],"sourcesContent":["/**\n * 8.6 — Surface theme pack (`motionary/fx/surface`, also `motionary/components/fx-surface`):\n *\n * - `neon-ignite` (enter) — the element powers on like a neon tube: a few\n * stuttering flickers, then a steady glow (`color`).\n * - `neon-pulse` (loop) — a slow breathing neon glow; the cleanup stops it\n * (`color`).\n * - `glass-frost` (enter) — frosted glass condenses: blur and transparency\n * settle into a crisp glass panel, with a shine passing over it.\n * - `neu-press` (attention) — a soft neumorphic press: the raised shadow\n * flips to an inset one and pops back.\n *\n * Reduced motion: neon-ignite / glass-frost just show, neon-pulse is\n * skipped, neu-press does nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\n/** The built-in surface themes of the 8.6 theme system. */\nexport const SURFACE_THEMES = ['light', 'dark', 'neon', 'glass', 'neu'] as const;\nexport type SurfaceTheme = (typeof SURFACE_THEMES)[number];\n\n/** Set `data-usa-surface` on `target` (default `<html>`) and return the theme actually applied (unknown → `light`) (8.6). */\nexport function applySurfaceTheme(name: string, target: Element | null = typeof document !== 'undefined' ? document.documentElement : null): SurfaceTheme {\n const t = ((SURFACE_THEMES as readonly string[]).includes(name) ? name : 'light') as SurfaceTheme;\n target?.setAttribute('data-usa-surface', t);\n return t;\n}\n\nconst glow = (c: string, k: number) => `0 0 ${4 * k}px ${c}, 0 0 ${12 * k}px ${c}`;\n\nexport const SURFACE_FX: EffectDefinition[] = [\n {\n name: 'neon-ignite',\n kind: 'enter',\n description: 'The element powers on like a neon tube — stuttering flickers, then a steady glow (`color`).',\n defaults: { color: '#f0abfc', duration: 1100 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const on = { opacity: 1, textShadow: glow(o.color, 1), filter: 'brightness(1.15)' };\n const off = { opacity: 0.15, textShadow: 'none', filter: 'brightness(.6)' };\n return ctx.animate(el, [{ ...off, offset: 0 }, { ...on, offset: 0.1 }, { ...off, offset: 0.14 }, { ...on, offset: 0.3 }, { ...off, offset: 0.34 }, { ...off, offset: 0.5 }, { ...on, offset: 0.56 }, { ...on, textShadow: glow(o.color, 1.6), offset: 0.8 }, { opacity: 1, textShadow: glow(o.color, 1), filter: 'none', offset: 1 }], { duration: o.duration, fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'neon-pulse',\n kind: 'loop',\n description: 'A slow breathing neon glow until the cleanup runs (`color`).',\n defaults: { color: '#22d3ee', duration: 2200 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const a = ctx.animate(el, [{ boxShadow: glow(o.color, 0.6) }, { boxShadow: glow(o.color, 1.6) }, { boxShadow: glow(o.color, 0.6) }], { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });\n return () => a?.cancel();\n },\n },\n {\n name: 'glass-frost',\n kind: 'enter',\n description: 'Frosted glass condenses: blur and transparency settle into a crisp glass panel, with a shine passing over it.',\n defaults: { duration: 1000 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const runs: (Promise<unknown> | undefined)[] = [];\n runs.push(ctx.animate(el, [{ opacity: 0, filter: 'blur(12px)', transform: 'scale(.96)' }, { opacity: 1, filter: 'blur(0)', transform: 'none' }], { duration: o.duration, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined));\n if (getComputedStyle(el).position === 'static') {\n const prev = el.style.position;\n el.style.position = 'relative';\n ctx.onCleanup(() => (el.style.position = prev));\n }\n const s = document.createElement('span');\n s.setAttribute('aria-hidden', 'true');\n Object.assign(s.style, { position: 'absolute', inset: '0', pointerEvents: 'none', borderRadius: 'inherit', background: 'linear-gradient(110deg,transparent 30%,rgba(255,255,255,.55) 50%,transparent 70%)', backgroundSize: '250% 100%' });\n el.appendChild(s);\n ctx.onCleanup(() => s.remove());\n const sh = ctx.animate(s, [{ backgroundPosition: '120% 0' }, { backgroundPosition: '-60% 0' }], { duration: o.duration * 0.9, delay: o.duration * 0.4, easing: 'ease-in-out', fill: 'backwards' });\n runs.push(sh ? sh.finished.then(() => s.remove(), () => s.remove()) : (s.remove(), undefined));\n return Promise.all(runs).then(() => undefined);\n },\n },\n {\n name: 'neu-press',\n kind: 'attention',\n description: 'A soft neumorphic press: the raised shadow flips to an inset one and pops back.',\n defaults: { duration: 450 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const up = '6px 6px 12px rgba(163,177,198,.7), -6px -6px 12px rgba(255,255,255,.9)';\n const down = 'inset 4px 4px 8px rgba(163,177,198,.8), inset -4px -4px 8px rgba(255,255,255,.9)';\n return ctx.animate(el, [{ boxShadow: up, transform: 'none' }, { boxShadow: down, transform: 'scale(.97)', offset: 0.4 }, { boxShadow: up, transform: 'none' }], { duration: o.duration, easing: 'ease-out' })?.finished.catch(() => undefined);\n },\n },\n];\n\n/** Register neon-ignite, neon-pulse, glass-frost and neu-press (8.6). */\nexport function registerSurfacePack(): void {\n registerEffects(SURFACE_FX);\n}\n"],"names":["registerEffects"],"mappings":";;;;;AAkBA;AACO,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK;AAGtE;SACgB,iBAAiB,CAAC,IAAY,EAAE,MAAA,GAAyB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,EAAA;AACxI,IAAA,MAAM,CAAC,IAAK,cAAoC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAiB;AACjG,IAAA,MAAM,EAAE,YAAY,CAAC,kBAAkB,EAA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