motionary 8.6.0 → 8.8.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 +29 -0
- package/dist/components/fx-gesture.cjs +111 -0
- package/dist/components/fx-gesture.cjs.map +1 -0
- package/dist/components/fx-gesture.d.cts +75 -0
- package/dist/components/fx-gesture.d.ts +75 -0
- package/dist/components/fx-gesture.js +105 -0
- package/dist/components/fx-gesture.js.map +1 -0
- package/dist/components/fx-spatial.cjs +100 -0
- package/dist/components/fx-spatial.cjs.map +1 -0
- package/dist/components/fx-spatial.d.cts +68 -0
- package/dist/components/fx-spatial.d.ts +68 -0
- package/dist/components/fx-spatial.js +95 -0
- package/dist/components/fx-spatial.js.map +1 -0
- package/dist/components/fx2.cjs +15 -0
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +56 -1
- package/dist/components/fx2.d.ts +56 -1
- package/dist/components/fx2.js +9 -1
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/widgets.cjs +545 -149
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +72 -2
- package/dist/components/widgets.d.ts +72 -2
- package/dist/components/widgets.js +542 -150
- package/dist/components/widgets.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/components.md +42 -0
- package/package.json +41 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [8.8.0] - 2026-10-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **2 new components (8.8)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
|
|
14
|
+
- `<usa-panorama>` — 360° panorama viewer: drag / swipe to look around with inertia, slow `autorotate` (°/s, `0` off, pauses on hover / focus), ← / → keys, compass, built-in procedural landscape when no `src`; "View in XR" badge when WebXR immersive sessions are offered (`usa:xr` { mode }, `usa:xr-request`); `yaw`, `lookAt(deg)`; `usa:look` { yaw }.
|
|
15
|
+
- `<usa-spatial-card>` — spatial-computing window: frosted glass floating in depth, gaze highlight following the pointer, `[data-depth]` layers, `[slot=ornament]` bar below the window; eases forward on hover / focus, sinks on press; `active`; `usa:focus-depth` { active }.
|
|
16
|
+
- **XR / spatial pack — `motionary/fx/spatial`** (= `motionary/components/fx-spatial`, `registerSpatialPack()`, also in `registerEffectPacks()`): `portal-open` (enter), `orbit-in` (enter), `spatial-float` (loop), `depth-pop` (attention). `yawToOffset()`, `xrSupport()` (WebXR session detection).
|
|
17
|
+
- Showcase: 4 new gallery cards with copyable code, live demos and live Store thumbnails.
|
|
18
|
+
|
|
19
|
+
### Accessibility
|
|
20
|
+
- The panorama is a focusable `img` (roledescription "panorama") with your `label`; ← / → look around; auto-rotate pauses while hovered or focused. The spatial card keeps its content in reading order, the gaze layer is `aria-hidden`. Reduced motion: no auto-rotate, inertia or depth transitions; `portal-open` / `orbit-in` just show, `spatial-float` is skipped, `depth-pop` does nothing.
|
|
21
|
+
|
|
22
|
+
## [8.7.0] - 2026-10-09
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **2 new components (8.7)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
|
|
26
|
+
- `<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 }.
|
|
27
|
+
- `<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`.
|
|
28
|
+
- **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()`.
|
|
29
|
+
- Showcase: 4 new gallery cards with copyable code, live demos and live Store thumbnails.
|
|
30
|
+
|
|
31
|
+
### Accessibility
|
|
32
|
+
- 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.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- the gallery id `fx-depth` is taken by the 6.5 depth card → the 8.7 card is `fx-depth-in`.
|
|
36
|
+
- `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).
|
|
37
|
+
- 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.
|
|
38
|
+
|
|
10
39
|
## [8.6.0] - 2026-10-09
|
|
11
40
|
|
|
12
41
|
### 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,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AI,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;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;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O,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,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registry = require('../chunks/registry-BVklOepd.cjs');
|
|
4
|
+
require('../chunks/base-DoRUZBy-.cjs');
|
|
5
|
+
|
|
6
|
+
/** Horizontal background offset (px) of a 360° panorama `width` px wide for a `yaw` in degrees (wraps) (8.8). */
|
|
7
|
+
function yawToOffset(yaw, width) {
|
|
8
|
+
if (!width)
|
|
9
|
+
return 0;
|
|
10
|
+
const y = ((yaw % 360) + 360) % 360;
|
|
11
|
+
return -Math.round((y / 360) * width * 100) / 100;
|
|
12
|
+
}
|
|
13
|
+
/** Which WebXR session the browser offers: `'immersive-vr'`, `'immersive-ar'`, `'inline'` or `'none'` (8.8). */
|
|
14
|
+
async function xrSupport() {
|
|
15
|
+
const xr = typeof navigator !== 'undefined' ? navigator.xr : undefined;
|
|
16
|
+
if (!xr?.isSessionSupported)
|
|
17
|
+
return 'none';
|
|
18
|
+
for (const m of ['immersive-vr', 'immersive-ar', 'inline']) {
|
|
19
|
+
try {
|
|
20
|
+
if (await xr.isSessionSupported(m))
|
|
21
|
+
return m;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
/* blocked by policy */
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return 'none';
|
|
28
|
+
}
|
|
29
|
+
const SPATIAL_FX = [
|
|
30
|
+
{
|
|
31
|
+
name: 'portal-open',
|
|
32
|
+
kind: 'enter',
|
|
33
|
+
description: 'The element opens like a portal: a ring of light expands and the content comes through from depth (`color`).',
|
|
34
|
+
defaults: { color: '#a78bfa', duration: 1100 },
|
|
35
|
+
run: (el, o, ctx) => {
|
|
36
|
+
if (ctx.reduced)
|
|
37
|
+
return;
|
|
38
|
+
if (getComputedStyle(el).position === 'static') {
|
|
39
|
+
const prev = el.style.position;
|
|
40
|
+
el.style.position = 'relative';
|
|
41
|
+
ctx.onCleanup(() => (el.style.position = prev));
|
|
42
|
+
}
|
|
43
|
+
const ring = document.createElement('span');
|
|
44
|
+
ring.setAttribute('aria-hidden', 'true');
|
|
45
|
+
Object.assign(ring.style, { position: 'absolute', left: '50%', top: '50%', width: '20px', height: '20px', margin: '-10px 0 0 -10px', borderRadius: '50%', border: `3px solid ${o.color}`, boxShadow: `0 0 18px 4px ${o.color}, inset 0 0 12px ${o.color}`, pointerEvents: 'none' });
|
|
46
|
+
el.appendChild(ring);
|
|
47
|
+
ctx.onCleanup(() => ring.remove());
|
|
48
|
+
const big = Math.max(el.offsetWidth, el.offsetHeight, 80) / 10;
|
|
49
|
+
const a = ctx.animate(ring, [{ transform: 'scale(0)', opacity: 1 }, { transform: `scale(${big})`, opacity: 0.9, offset: 0.6 }, { transform: `scale(${big * 1.2})`, opacity: 0 }], { duration: o.duration, easing: 'cubic-bezier(.2,.8,.2,1)' });
|
|
50
|
+
const b = ctx.animate(el, [{ clipPath: 'circle(0% at 50% 50%)', transform: 'perspective(700px) translateZ(-200px)' }, { clipPath: 'circle(75% at 50% 50%)', transform: 'none' }], { duration: o.duration, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' });
|
|
51
|
+
const end = () => ring.remove();
|
|
52
|
+
return Promise.all([a?.finished.catch(() => undefined), b?.finished.catch(() => undefined)]).then(end, end);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'orbit-in',
|
|
57
|
+
kind: 'enter',
|
|
58
|
+
description: 'The element swings in around the vertical axis like a spatial window placed beside you (`from`).',
|
|
59
|
+
defaults: { from: 'left', duration: 900 },
|
|
60
|
+
run: (el, o, ctx) => {
|
|
61
|
+
if (ctx.reduced)
|
|
62
|
+
return;
|
|
63
|
+
const s = o.from === 'right' ? 1 : -1;
|
|
64
|
+
return ctx.animate(el, [{ transform: `perspective(900px) translateX(${s * 60}%) rotateY(${-s * 70}deg) translateZ(-120px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, easing: 'cubic-bezier(.2,.9,.25,1)', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'spatial-float',
|
|
69
|
+
kind: 'loop',
|
|
70
|
+
description: 'A gentle floating in depth with a breathing shadow, until the cleanup runs.',
|
|
71
|
+
defaults: { duration: 4200 },
|
|
72
|
+
run: (el, o, ctx) => {
|
|
73
|
+
if (ctx.reduced)
|
|
74
|
+
return;
|
|
75
|
+
const a = ctx.animate(el, [{ transform: 'perspective(800px) translateZ(0) translateY(0)', boxShadow: '0 14px 30px -18px rgba(15,23,42,.5)' }, { transform: 'perspective(800px) translateZ(24px) translateY(-6px)', boxShadow: '0 30px 50px -22px rgba(15,23,42,.45)' }, { transform: 'perspective(800px) translateZ(0) translateY(0)', boxShadow: '0 14px 30px -18px rgba(15,23,42,.5)' }], { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });
|
|
76
|
+
return () => a?.cancel();
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'depth-pop',
|
|
81
|
+
kind: 'attention',
|
|
82
|
+
description: 'The element pops forward towards the viewer and settles back.',
|
|
83
|
+
defaults: { duration: 600 },
|
|
84
|
+
run: (el, o, ctx) => {
|
|
85
|
+
if (ctx.reduced)
|
|
86
|
+
return;
|
|
87
|
+
return ctx.animate(el, [{ transform: 'perspective(700px) translateZ(0)' }, { transform: 'perspective(700px) translateZ(90px)', filter: 'brightness(1.1)', offset: 0.35 }, { transform: 'perspective(700px) translateZ(-10px)', offset: 0.7 }, { transform: 'perspective(700px) translateZ(0)' }], { duration: o.duration, easing: 'ease-out' })?.finished.catch(() => undefined);
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
/** Register portal-open, orbit-in, spatial-float and depth-pop (8.8). */
|
|
92
|
+
function registerSpatialPack() {
|
|
93
|
+
registry.registerEffects(SPATIAL_FX);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
exports.SPATIAL_FX = SPATIAL_FX;
|
|
97
|
+
exports.registerSpatialPack = registerSpatialPack;
|
|
98
|
+
exports.xrSupport = xrSupport;
|
|
99
|
+
exports.yawToOffset = yawToOffset;
|
|
100
|
+
//# sourceMappingURL=fx-spatial.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-spatial.cjs","sources":["../../src/components/fx2/spatial.ts"],"sourcesContent":["/**\n * 8.8 — XR / spatial pack (`motionary/fx/spatial`, also `motionary/components/fx-spatial`):\n *\n * - `portal-open` (enter) — the element opens like a portal: a ring of\n * light expands and the content comes through from depth (`color`).\n * - `orbit-in` (enter) — the element swings in around the vertical axis\n * like a spatial window placed beside you (`from` left|right).\n * - `spatial-float` (loop) — a gentle floating in depth with a breathing\n * shadow; the cleanup stops it.\n * - `depth-pop` (attention) — the element pops forward towards the viewer\n * and settles back.\n *\n * Reduced motion: portal-open / orbit-in just show, spatial-float is\n * skipped, depth-pop does nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\n/** Horizontal background offset (px) of a 360° panorama `width` px wide for a `yaw` in degrees (wraps) (8.8). */\nexport function yawToOffset(yaw: number, width: number): number {\n if (!width) return 0;\n const y = ((yaw % 360) + 360) % 360;\n return -Math.round((y / 360) * width * 100) / 100;\n}\n\n/** Which WebXR session the browser offers: `'immersive-vr'`, `'immersive-ar'`, `'inline'` or `'none'` (8.8). */\nexport async function xrSupport(): Promise<'immersive-vr' | 'immersive-ar' | 'inline' | 'none'> {\n const xr = typeof navigator !== 'undefined' ? (navigator as any).xr : undefined;\n if (!xr?.isSessionSupported) return 'none';\n for (const m of ['immersive-vr', 'immersive-ar', 'inline'] as const) {\n try {\n if (await xr.isSessionSupported(m)) return m;\n } catch {\n /* blocked by policy */\n }\n }\n return 'none';\n}\n\nexport const SPATIAL_FX: EffectDefinition[] = [\n {\n name: 'portal-open',\n kind: 'enter',\n description: 'The element opens like a portal: a ring of light expands and the content comes through from depth (`color`).',\n defaults: { color: '#a78bfa', duration: 1100 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\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 ring = document.createElement('span');\n ring.setAttribute('aria-hidden', 'true');\n Object.assign(ring.style, { position: 'absolute', left: '50%', top: '50%', width: '20px', height: '20px', margin: '-10px 0 0 -10px', borderRadius: '50%', border: `3px solid ${o.color}`, boxShadow: `0 0 18px 4px ${o.color}, inset 0 0 12px ${o.color}`, pointerEvents: 'none' });\n el.appendChild(ring);\n ctx.onCleanup(() => ring.remove());\n const big = Math.max(el.offsetWidth, el.offsetHeight, 80) / 10;\n const a = ctx.animate(ring, [{ transform: 'scale(0)', opacity: 1 }, { transform: `scale(${big})`, opacity: 0.9, offset: 0.6 }, { transform: `scale(${big * 1.2})`, opacity: 0 }], { duration: o.duration, easing: 'cubic-bezier(.2,.8,.2,1)' });\n const b = ctx.animate(el, [{ clipPath: 'circle(0% at 50% 50%)', transform: 'perspective(700px) translateZ(-200px)' }, { clipPath: 'circle(75% at 50% 50%)', transform: 'none' }], { duration: o.duration, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' });\n const end = () => ring.remove();\n return Promise.all([a?.finished.catch(() => undefined), b?.finished.catch(() => undefined)]).then(end, end);\n },\n },\n {\n name: 'orbit-in',\n kind: 'enter',\n description: 'The element swings in around the vertical axis like a spatial window placed beside you (`from`).',\n defaults: { from: 'left', duration: 900 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const s = o.from === 'right' ? 1 : -1;\n return ctx.animate(el, [{ transform: `perspective(900px) translateX(${s * 60}%) rotateY(${-s * 70}deg) translateZ(-120px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, easing: 'cubic-bezier(.2,.9,.25,1)', fill: 'backwards' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'spatial-float',\n kind: 'loop',\n description: 'A gentle floating in depth with a breathing shadow, until the cleanup runs.',\n defaults: { duration: 4200 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const a = ctx.animate(el, [{ transform: 'perspective(800px) translateZ(0) translateY(0)', boxShadow: '0 14px 30px -18px rgba(15,23,42,.5)' }, { transform: 'perspective(800px) translateZ(24px) translateY(-6px)', boxShadow: '0 30px 50px -22px rgba(15,23,42,.45)' }, { transform: 'perspective(800px) translateZ(0) translateY(0)', boxShadow: '0 14px 30px -18px rgba(15,23,42,.5)' }], { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });\n return () => a?.cancel();\n },\n },\n {\n name: 'depth-pop',\n kind: 'attention',\n description: 'The element pops forward towards the viewer and settles back.',\n defaults: { duration: 600 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n return ctx.animate(el, [{ transform: 'perspective(700px) translateZ(0)' }, { transform: 'perspective(700px) translateZ(90px)', filter: 'brightness(1.1)', offset: 0.35 }, { transform: 'perspective(700px) translateZ(-10px)', offset: 0.7 }, { transform: 'perspective(700px) translateZ(0)' }], { duration: o.duration, easing: 'ease-out' })?.finished.catch(() => undefined);\n },\n },\n];\n\n/** Register portal-open, orbit-in, spatial-float and depth-pop (8.8). */\nexport function registerSpatialPack(): void {\n registerEffects(SPATIAL_FX);\n}\n"],"names":["registerEffects"],"mappings":";;;;;AAkBA;AACM,SAAU,WAAW,CAAC,GAAW,EAAE,KAAa,EAAA;AACpD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,CAAC;AACpB,IAAA,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG;AACnC,IAAA,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG;AACnD;AAEA;AACO,eAAe,SAAS,GAAA;AAC7B,IAAA,MAAM,EAAE,GAAG,OAAO,SAAS,KAAK,WAAW,GAAI,SAAiB,CAAC,EAAE,GAAG,SAAS;IAC/E,IAAI,CAAC,EAAE,EAAE,kBAAkB;AAAE,QAAA,OAAO,MAAM;IAC1C,KAAK,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,CAAU,EAAE;AACnE,QAAA,IAAI;AACF,YAAA,IAAI,MAAM,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAAE,gBAAA,OAAO,CAAC;QAC9C;AAAE,QAAA,MAAM;;QAER;IACF;AACA,IAAA,OAAO,MAAM;AACf;AAEO,MAAM,UAAU,GAAuB;AAC5C,IAAA;AACE,QAAA,IAAI,EAAE,aAAa;AACnB,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,WAAW,EAAE,8GAA8G;QAC3H,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,I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