use-scroll-animate 6.5.0 → 6.6.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.
@@ -0,0 +1,287 @@
1
+ import { c as registerEffects } from '../chunks/registry-Bu5NrAyA.js';
2
+ import { a as all } from '../chunks/shared-CkKHWrtJ.js';
3
+ import '../chunks/base-DchG4q_S.js';
4
+
5
+ const NS = 'http://www.w3.org/2000/svg';
6
+ const raf = (f) => (typeof requestAnimationFrame === 'function' ? requestAnimationFrame(f) : 0);
7
+ const caf = (h) => {
8
+ if (h && typeof cancelAnimationFrame === 'function')
9
+ cancelAnimationFrame(h);
10
+ };
11
+ /** Sample `d` into `n` points (needs SVG geometry support; `null` without it). */
12
+ function samplePath(d, n = 64) {
13
+ const p = document.createElementNS(NS, 'path');
14
+ p.setAttribute('d', d);
15
+ const svg = document.createElementNS(NS, 'svg');
16
+ svg.setAttribute('aria-hidden', 'true');
17
+ svg.style.cssText = 'position:absolute;width:0;height:0;overflow:hidden';
18
+ svg.appendChild(p);
19
+ document.body.appendChild(svg);
20
+ try {
21
+ if (typeof p.getTotalLength !== 'function')
22
+ return null;
23
+ const L = p.getTotalLength();
24
+ if (!L)
25
+ return null;
26
+ const out = [];
27
+ for (let i = 0; i < n; i++) {
28
+ const pt = p.getPointAtLength((i / n) * L);
29
+ out.push([pt.x, pt.y]);
30
+ }
31
+ return out;
32
+ }
33
+ catch {
34
+ return null;
35
+ }
36
+ finally {
37
+ svg.remove();
38
+ }
39
+ }
40
+ /** Points → closed path `d`. */
41
+ const pointsToPath = (pts) => (pts.length ? `M${pts.map(([x, y]) => `${x.toFixed(2)} ${y.toFixed(2)}`).join('L')}Z` : '');
42
+ /** Rotate `b` so its start point is the one closest to `a[0]` (less twisting). */
43
+ function align(a, b) {
44
+ let best = 0;
45
+ let bd = Infinity;
46
+ for (let i = 0; i < b.length; i++) {
47
+ const d = (b[i][0] - a[0][0]) ** 2 + (b[i][1] - a[0][1]) ** 2;
48
+ if (d < bd) {
49
+ bd = d;
50
+ best = i;
51
+ }
52
+ }
53
+ return b.slice(best).concat(b.slice(0, best));
54
+ }
55
+ const ease = (t) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);
56
+ const MORPH2_FX = [
57
+ {
58
+ name: 'path-morph',
59
+ kind: 'loop',
60
+ description: 'An SVG `<path>` flows between shapes (`paths`: `d` strings; `duration` per shape, `hold` ms). Shapes are resampled, so any two paths morph.',
61
+ defaults: { paths: [], duration: 1200, hold: 600, points: 72 },
62
+ run: (el, o) => {
63
+ const path = (el.localName === 'path' ? el : el.querySelector('path'));
64
+ if (!path)
65
+ return;
66
+ const ds = [path.getAttribute('d') || '', ...(o.paths || [])].filter(Boolean);
67
+ const shapes = ds.map((d) => samplePath(d, o.points)).filter(Boolean);
68
+ if (shapes.length < 2)
69
+ return;
70
+ for (let i = 1; i < shapes.length; i++)
71
+ shapes[i] = align(shapes[i - 1], shapes[i]);
72
+ const orig = path.getAttribute('d');
73
+ let i = 0;
74
+ let t0 = performance.now();
75
+ let h = 0;
76
+ const tick = (now) => {
77
+ const a = shapes[i % shapes.length];
78
+ const b = shapes[(i + 1) % shapes.length];
79
+ const k = Math.min(1, Math.max(0, (now - t0) / o.duration));
80
+ const e = ease(k);
81
+ path.setAttribute('d', pointsToPath(a.map(([x, y], j) => [x + (b[j][0] - x) * e, y + (b[j][1] - y) * e])));
82
+ if (now - t0 > o.duration + o.hold) {
83
+ i++;
84
+ t0 = now;
85
+ }
86
+ h = raf(tick);
87
+ };
88
+ h = raf(tick);
89
+ return () => {
90
+ caf(h);
91
+ if (orig !== null)
92
+ path.setAttribute('d', orig);
93
+ };
94
+ },
95
+ },
96
+ {
97
+ name: 'blob-button',
98
+ kind: 'hover',
99
+ reduced: 'run',
100
+ description: 'A liquid blob behind the element wobbles and bulges toward the pointer (persistent; `color`, `wobble` 0–1, `bulge` px).',
101
+ defaults: { color: '#7c5cff', wobble: 0.5, bulge: 10, points: 10 },
102
+ run: (el, o, ctx) => {
103
+ if (getComputedStyle(el).position === 'static')
104
+ el.style.position = 'relative';
105
+ const prevZ = el.style.isolation;
106
+ el.style.isolation = 'isolate';
107
+ const svg = document.createElementNS(NS, 'svg');
108
+ svg.setAttribute('aria-hidden', 'true');
109
+ svg.setAttribute('width', '100%');
110
+ svg.setAttribute('height', '100%');
111
+ svg.style.cssText = 'position:absolute;inset:-14px;width:calc(100% + 28px);height:calc(100% + 28px);z-index:-1;pointer-events:none;overflow:visible';
112
+ const path = document.createElementNS(NS, 'path');
113
+ path.setAttribute('fill', o.color);
114
+ svg.appendChild(path);
115
+ el.prepend(svg);
116
+ const n = Math.max(6, o.points | 0);
117
+ let px = 0.5;
118
+ let py = 0.5;
119
+ let hover = 0;
120
+ let target = 0;
121
+ let h = 0;
122
+ const t0 = performance.now();
123
+ const draw = (now) => {
124
+ const w = el.offsetWidth + 28 || 128;
125
+ const hh = el.offsetHeight + 28 || 72;
126
+ const t = ctx.reduced ? 0 : (now - t0) / 1000;
127
+ hover += (target - hover) * 0.12;
128
+ const pts = [];
129
+ for (let i = 0; i < n; i++) {
130
+ const a = (i / n) * Math.PI * 2;
131
+ const cx = Math.cos(a);
132
+ const cy = Math.sin(a);
133
+ const toward = Math.max(0, cx * (px - 0.5) * 2 + cy * (py - 0.5) * 2);
134
+ const r = 1 + (ctx.reduced ? 0 : o.wobble * 0.06 * Math.sin(t * 2.2 + i * 1.7)) + (toward * o.bulge * hover) / Math.min(w, hh);
135
+ pts.push([w / 2 + cx * (w / 2 - 12) * r, hh / 2 + cy * (hh / 2 - 12) * r]);
136
+ }
137
+ // smooth closed curve through the points (Catmull-Rom → cubic Bézier)
138
+ let d = `M${pts[0][0].toFixed(1)} ${pts[0][1].toFixed(1)}`;
139
+ for (let i = 0; i < n; i++) {
140
+ const p0 = pts[(i - 1 + n) % n];
141
+ const p1 = pts[i];
142
+ const p2 = pts[(i + 1) % n];
143
+ const p3 = pts[(i + 2) % n];
144
+ d += `C${(p1[0] + (p2[0] - p0[0]) / 6).toFixed(1)} ${(p1[1] + (p2[1] - p0[1]) / 6).toFixed(1)} ${(p2[0] - (p3[0] - p1[0]) / 6).toFixed(1)} ${(p2[1] - (p3[1] - p1[1]) / 6).toFixed(1)} ${p2[0].toFixed(1)} ${p2[1].toFixed(1)}`;
145
+ }
146
+ path.setAttribute('d', d + 'Z');
147
+ h = !ctx.reduced && (target || Math.abs(hover) > 0.01 || o.wobble) ? raf(draw) : 0;
148
+ };
149
+ const kick = () => {
150
+ if (!h)
151
+ h = raf(draw);
152
+ };
153
+ const move = (e) => {
154
+ const r = el.getBoundingClientRect();
155
+ px = r.width ? (e.clientX - r.left) / r.width : 0.5;
156
+ py = r.height ? (e.clientY - r.top) / r.height : 0.5;
157
+ target = 1;
158
+ kick();
159
+ };
160
+ const leave = () => {
161
+ target = 0;
162
+ kick();
163
+ };
164
+ draw(t0);
165
+ el.addEventListener('pointermove', move);
166
+ el.addEventListener('pointerleave', leave);
167
+ return () => {
168
+ caf(h);
169
+ el.removeEventListener('pointermove', move);
170
+ el.removeEventListener('pointerleave', leave);
171
+ svg.remove();
172
+ el.style.isolation = prevZ;
173
+ };
174
+ },
175
+ },
176
+ {
177
+ name: 'stroke-draw',
178
+ kind: 'enter',
179
+ description: 'Every stroke of an inline SVG draws itself, staggered, then the fills fade in (`duration`, `stagger`).',
180
+ defaults: { duration: 1200, stagger: 120 },
181
+ run: (el, o, ctx) => {
182
+ const shapes = Array.from(el.querySelectorAll('path, line, polyline, polygon, circle, ellipse, rect'));
183
+ return all(shapes.map((s, i) => {
184
+ let L = 0;
185
+ try {
186
+ L = typeof s.getTotalLength === 'function' ? s.getTotalLength() : 0;
187
+ }
188
+ catch {
189
+ L = 0;
190
+ }
191
+ if (ctx.reduced || !L)
192
+ return ctx.animate(s, [{ opacity: 0 }, { opacity: 1 }], { duration: 300, delay: i * 40, fill: 'backwards' });
193
+ const fill = getComputedStyle(s).fillOpacity || '1';
194
+ return ctx.animate(s, [
195
+ { strokeDasharray: `${L}`, strokeDashoffset: `${L}`, fillOpacity: 0 },
196
+ { strokeDasharray: `${L}`, strokeDashoffset: '0', fillOpacity: 0, offset: 0.75 },
197
+ { strokeDasharray: `${L}`, strokeDashoffset: '0', fillOpacity: fill },
198
+ ], { duration: o.duration, delay: i * o.stagger, easing: 'ease-in-out', fill: 'backwards' });
199
+ }));
200
+ },
201
+ },
202
+ {
203
+ name: 'noise-reveal',
204
+ kind: 'enter',
205
+ description: 'The element condenses out of SVG turbulence — displacement and blur settle to zero (`duration`, `strength`). An SVG-filter transition.',
206
+ defaults: { duration: 1100, strength: 60 },
207
+ run: (el, o, ctx) => {
208
+ if (ctx.reduced)
209
+ return ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 });
210
+ const id = `usa-noise-${Math.random().toString(36).slice(2, 8)}`;
211
+ const svg = document.createElementNS(NS, 'svg');
212
+ svg.setAttribute('aria-hidden', 'true');
213
+ svg.setAttribute('width', '0');
214
+ svg.setAttribute('height', '0');
215
+ svg.style.cssText = 'position:absolute;width:0;height:0;overflow:hidden';
216
+ svg.innerHTML = `<filter id="${id}" x="-20%" y="-20%" width="140%" height="140%"><feTurbulence type="fractalNoise" baseFrequency="0.035" numOctaves="2" result="n"/><feDisplacementMap in="SourceGraphic" in2="n" scale="${o.strength}" xChannelSelector="R" yChannelSelector="G"/><feGaussianBlur stdDeviation="0"/></filter>`;
217
+ document.body.appendChild(svg);
218
+ const disp = svg.querySelector('feDisplacementMap');
219
+ const blur = svg.querySelector('feGaussianBlur');
220
+ const prev = el.style.filter;
221
+ el.style.filter = `url(#${id})`;
222
+ const fade = ctx.animate(el, [{ opacity: 0 }, { opacity: 1, offset: 0.4 }, { opacity: 1 }], { duration: o.duration, easing: 'ease-out' });
223
+ const t0 = performance.now();
224
+ return new Promise((done) => {
225
+ const end = () => {
226
+ el.style.filter = prev;
227
+ svg.remove();
228
+ done();
229
+ };
230
+ const tick = (now) => {
231
+ const k = Math.min(1, (now - t0) / o.duration);
232
+ const e = 1 - Math.pow(1 - k, 3);
233
+ disp?.setAttribute('scale', ((1 - e) * o.strength).toFixed(2));
234
+ blur?.setAttribute('stdDeviation', ((1 - e) * 4).toFixed(2));
235
+ if (k < 1)
236
+ raf(tick);
237
+ else
238
+ end();
239
+ };
240
+ if (!raf(tick))
241
+ (fade ? fade.finished.then(end, end) : end());
242
+ });
243
+ },
244
+ },
245
+ {
246
+ name: 'icon-swap',
247
+ kind: 'click',
248
+ description: 'Cycles through the element\'s child icons with a gooey morph — blur, scale and rotate crossfade (`duration`). The visible icon is the only one not `aria-hidden`.',
249
+ defaults: { duration: 420 },
250
+ run: (el, o, ctx) => {
251
+ const icons = Array.from(el.children);
252
+ if (icons.length < 2)
253
+ return null;
254
+ if (!el.dataset.usaSwap) {
255
+ el.dataset.usaSwap = '0';
256
+ el.style.display = el.style.display || 'inline-grid';
257
+ icons.forEach((ic, i) => {
258
+ ic.style.gridArea = '1 / 1';
259
+ ic.style.opacity = i ? '0' : '1';
260
+ ic.setAttribute('aria-hidden', String(i !== 0));
261
+ });
262
+ }
263
+ const cur = Number(el.dataset.usaSwap) || 0;
264
+ const nxt = (cur + 1) % icons.length;
265
+ el.dataset.usaSwap = String(nxt);
266
+ const a = icons[cur];
267
+ const b = icons[nxt];
268
+ a.setAttribute('aria-hidden', 'true');
269
+ b.setAttribute('aria-hidden', 'false');
270
+ a.style.opacity = '0';
271
+ b.style.opacity = '1';
272
+ if (ctx.reduced)
273
+ return all([ctx.animate(a, [{ opacity: 1 }, { opacity: 0 }], { duration: 150 }), ctx.animate(b, [{ opacity: 0 }, { opacity: 1 }], { duration: 150 })]);
274
+ return all([
275
+ ctx.animate(a, [{ opacity: 1, transform: 'none', filter: 'blur(0)' }, { opacity: 0, transform: 'scale(.3) rotate(-90deg)', filter: 'blur(6px)' }], { duration: o.duration, easing: 'cubic-bezier(.5,0,.75,0)' }),
276
+ ctx.animate(b, [{ opacity: 0, transform: 'scale(.3) rotate(90deg)', filter: 'blur(6px)' }, { opacity: 1, transform: 'scale(1.15) rotate(-8deg)', filter: 'blur(0)', offset: 0.7 }, { opacity: 1, transform: 'none', filter: 'blur(0)' }], { duration: o.duration * 1.3, easing: 'cubic-bezier(.2,.8,.3,1.2)' }),
277
+ ]);
278
+ },
279
+ },
280
+ ];
281
+ /** Register the 6.6 morph & SVG pack (idempotent). */
282
+ function registerMorphEffects2() {
283
+ registerEffects(MORPH2_FX);
284
+ }
285
+
286
+ export { MORPH2_FX, pointsToPath, registerMorphEffects2, samplePath };
287
+ //# sourceMappingURL=fx-morph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-morph.js","sources":["../../src/components/fx2/morph2.ts"],"sourcesContent":["/**\n * 6.6 — Morph & SVG 2.0 (`motionary/components/fx-morph`), registered\n * through `registerEffect()`:\n *\n * - `path-morph` (loop) — an SVG `<path>` flows between shapes (`paths`, any\n * number of `d` strings): both shapes are resampled to the same number of\n * points, so paths with different commands still morph smoothly.\n * - `blob-button` (hover, persistent) — a liquid blob behind the element\n * wobbles and bulges toward the pointer.\n * - `stroke-draw` (enter) — every stroke in an inline SVG draws itself,\n * staggered, then the fills fade in.\n * - `noise-reveal` (enter) — the element condenses out of SVG turbulence\n * (displacement + blur) — an SVG-filter transition.\n * - `icon-swap` (click) — cycles through the element's child icons with a\n * gooey morph (blur + scale + rotate crossfade).\n *\n * Reduced motion: no loops / wobble; enter effects and swaps fade.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\nimport { all } from '../effects/shared';\n\nconst NS = 'http://www.w3.org/2000/svg';\nconst raf = (f: FrameRequestCallback): number => (typeof requestAnimationFrame === 'function' ? requestAnimationFrame(f) : 0);\nconst caf = (h: number): void => {\n if (h && typeof cancelAnimationFrame === 'function') cancelAnimationFrame(h);\n};\n\n/** Sample `d` into `n` points (needs SVG geometry support; `null` without it). */\nexport function samplePath(d: string, n = 64): [number, number][] | null {\n const p = document.createElementNS(NS, 'path') as SVGPathElement;\n p.setAttribute('d', d);\n const svg = document.createElementNS(NS, 'svg');\n svg.setAttribute('aria-hidden', 'true');\n svg.style.cssText = 'position:absolute;width:0;height:0;overflow:hidden';\n svg.appendChild(p);\n document.body.appendChild(svg);\n try {\n if (typeof p.getTotalLength !== 'function') return null;\n const L = p.getTotalLength();\n if (!L) return null;\n const out: [number, number][] = [];\n for (let i = 0; i < n; i++) {\n const pt = p.getPointAtLength((i / n) * L);\n out.push([pt.x, pt.y]);\n }\n return out;\n } catch {\n return null;\n } finally {\n svg.remove();\n }\n}\n\n/** Points → closed path `d`. */\nexport const pointsToPath = (pts: [number, number][]): string => (pts.length ? `M${pts.map(([x, y]) => `${x.toFixed(2)} ${y.toFixed(2)}`).join('L')}Z` : '');\n\n/** Rotate `b` so its start point is the one closest to `a[0]` (less twisting). */\nfunction align(a: [number, number][], b: [number, number][]): [number, number][] {\n let best = 0;\n let bd = Infinity;\n for (let i = 0; i < b.length; i++) {\n const d = (b[i][0] - a[0][0]) ** 2 + (b[i][1] - a[0][1]) ** 2;\n if (d < bd) {\n bd = d;\n best = i;\n }\n }\n return b.slice(best).concat(b.slice(0, best));\n}\n\nconst ease = (t: number) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);\n\nexport const MORPH2_FX: EffectDefinition[] = [\n {\n name: 'path-morph',\n kind: 'loop',\n description: 'An SVG `<path>` flows between shapes (`paths`: `d` strings; `duration` per shape, `hold` ms). Shapes are resampled, so any two paths morph.',\n defaults: { paths: [] as string[], duration: 1200, hold: 600, points: 72 },\n run: (el: HTMLElement, o: any) => {\n const path = ((el as Element).localName === 'path' ? el : el.querySelector('path')) as unknown as SVGPathElement | null;\n if (!path) return;\n const ds: string[] = [path.getAttribute('d') || '', ...(o.paths || [])].filter(Boolean);\n const shapes = ds.map((d) => samplePath(d, o.points)).filter(Boolean) as [number, number][][];\n if (shapes.length < 2) return;\n for (let i = 1; i < shapes.length; i++) shapes[i] = align(shapes[i - 1], shapes[i]);\n const orig = path.getAttribute('d');\n let i = 0;\n let t0 = performance.now();\n let h = 0;\n const tick = (now: number) => {\n const a = shapes[i % shapes.length];\n const b = shapes[(i + 1) % shapes.length];\n const k = Math.min(1, Math.max(0, (now - t0) / o.duration));\n const e = ease(k);\n path.setAttribute('d', pointsToPath(a.map(([x, y], j) => [x + (b[j][0] - x) * e, y + (b[j][1] - y) * e])));\n if (now - t0 > o.duration + o.hold) {\n i++;\n t0 = now;\n }\n h = raf(tick);\n };\n h = raf(tick);\n return () => {\n caf(h);\n if (orig !== null) path.setAttribute('d', orig);\n };\n },\n },\n {\n name: 'blob-button',\n kind: 'hover',\n reduced: 'run',\n description: 'A liquid blob behind the element wobbles and bulges toward the pointer (persistent; `color`, `wobble` 0–1, `bulge` px).',\n defaults: { color: '#7c5cff', wobble: 0.5, bulge: 10, points: 10 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (getComputedStyle(el).position === 'static') el.style.position = 'relative';\n const prevZ = el.style.isolation;\n el.style.isolation = 'isolate';\n const svg = document.createElementNS(NS, 'svg');\n svg.setAttribute('aria-hidden', 'true');\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', '100%');\n svg.style.cssText = 'position:absolute;inset:-14px;width:calc(100% + 28px);height:calc(100% + 28px);z-index:-1;pointer-events:none;overflow:visible';\n const path = document.createElementNS(NS, 'path');\n path.setAttribute('fill', o.color);\n svg.appendChild(path);\n el.prepend(svg);\n const n = Math.max(6, o.points | 0);\n let px = 0.5;\n let py = 0.5;\n let hover = 0;\n let target = 0;\n let h = 0;\n const t0 = performance.now();\n const draw = (now: number) => {\n const w = el.offsetWidth + 28 || 128;\n const hh = el.offsetHeight + 28 || 72;\n const t = ctx.reduced ? 0 : (now - t0) / 1000;\n hover += (target - hover) * 0.12;\n const pts: [number, number][] = [];\n for (let i = 0; i < n; i++) {\n const a = (i / n) * Math.PI * 2;\n const cx = Math.cos(a);\n const cy = Math.sin(a);\n const toward = Math.max(0, cx * (px - 0.5) * 2 + cy * (py - 0.5) * 2);\n const r = 1 + (ctx.reduced ? 0 : o.wobble * 0.06 * Math.sin(t * 2.2 + i * 1.7)) + (toward * o.bulge * hover) / Math.min(w, hh);\n pts.push([w / 2 + cx * (w / 2 - 12) * r, hh / 2 + cy * (hh / 2 - 12) * r]);\n }\n // smooth closed curve through the points (Catmull-Rom → cubic Bézier)\n let d = `M${pts[0][0].toFixed(1)} ${pts[0][1].toFixed(1)}`;\n for (let i = 0; i < n; i++) {\n const p0 = pts[(i - 1 + n) % n];\n const p1 = pts[i];\n const p2 = pts[(i + 1) % n];\n const p3 = pts[(i + 2) % n];\n d += `C${(p1[0] + (p2[0] - p0[0]) / 6).toFixed(1)} ${(p1[1] + (p2[1] - p0[1]) / 6).toFixed(1)} ${(p2[0] - (p3[0] - p1[0]) / 6).toFixed(1)} ${(p2[1] - (p3[1] - p1[1]) / 6).toFixed(1)} ${p2[0].toFixed(1)} ${p2[1].toFixed(1)}`;\n }\n path.setAttribute('d', d + 'Z');\n h = !ctx.reduced && (target || Math.abs(hover) > 0.01 || o.wobble) ? raf(draw) : 0;\n };\n const kick = () => {\n if (!h) h = raf(draw);\n };\n const move = (e: PointerEvent) => {\n const r = el.getBoundingClientRect();\n px = r.width ? (e.clientX - r.left) / r.width : 0.5;\n py = r.height ? (e.clientY - r.top) / r.height : 0.5;\n target = 1;\n kick();\n };\n const leave = () => {\n target = 0;\n kick();\n };\n draw(t0);\n el.addEventListener('pointermove', move);\n el.addEventListener('pointerleave', leave);\n return () => {\n caf(h);\n el.removeEventListener('pointermove', move);\n el.removeEventListener('pointerleave', leave);\n svg.remove();\n el.style.isolation = prevZ;\n };\n },\n },\n {\n name: 'stroke-draw',\n kind: 'enter',\n description: 'Every stroke of an inline SVG draws itself, staggered, then the fills fade in (`duration`, `stagger`).',\n defaults: { duration: 1200, stagger: 120 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const shapes = Array.from(el.querySelectorAll<SVGGeometryElement>('path, line, polyline, polygon, circle, ellipse, rect'));\n return all(shapes.map((s, i) => {\n let L = 0;\n try {\n L = typeof s.getTotalLength === 'function' ? s.getTotalLength() : 0;\n } catch {\n L = 0;\n }\n if (ctx.reduced || !L) return ctx.animate(s, [{ opacity: 0 }, { opacity: 1 }], { duration: 300, delay: i * 40, fill: 'backwards' });\n const fill = getComputedStyle(s).fillOpacity || '1';\n return ctx.animate(s, [\n { strokeDasharray: `${L}`, strokeDashoffset: `${L}`, fillOpacity: 0 },\n { strokeDasharray: `${L}`, strokeDashoffset: '0', fillOpacity: 0, offset: 0.75 },\n { strokeDasharray: `${L}`, strokeDashoffset: '0', fillOpacity: fill },\n ], { duration: o.duration, delay: i * o.stagger, easing: 'ease-in-out', fill: 'backwards' });\n }));\n },\n },\n {\n name: 'noise-reveal',\n kind: 'enter',\n description: 'The element condenses out of SVG turbulence — displacement and blur settle to zero (`duration`, `strength`). An SVG-filter transition.',\n defaults: { duration: 1100, strength: 60 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 });\n const id = `usa-noise-${Math.random().toString(36).slice(2, 8)}`;\n const svg = document.createElementNS(NS, 'svg');\n svg.setAttribute('aria-hidden', 'true');\n svg.setAttribute('width', '0');\n svg.setAttribute('height', '0');\n svg.style.cssText = 'position:absolute;width:0;height:0;overflow:hidden';\n svg.innerHTML = `<filter id=\"${id}\" x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\"><feTurbulence type=\"fractalNoise\" baseFrequency=\"0.035\" numOctaves=\"2\" result=\"n\"/><feDisplacementMap in=\"SourceGraphic\" in2=\"n\" scale=\"${o.strength}\" xChannelSelector=\"R\" yChannelSelector=\"G\"/><feGaussianBlur stdDeviation=\"0\"/></filter>`;\n document.body.appendChild(svg);\n const disp = svg.querySelector('feDisplacementMap');\n const blur = svg.querySelector('feGaussianBlur');\n const prev = el.style.filter;\n el.style.filter = `url(#${id})`;\n const fade = ctx.animate(el, [{ opacity: 0 }, { opacity: 1, offset: 0.4 }, { opacity: 1 }], { duration: o.duration, easing: 'ease-out' });\n const t0 = performance.now();\n return new Promise<void>((done) => {\n const end = () => {\n el.style.filter = prev;\n svg.remove();\n done();\n };\n const tick = (now: number) => {\n const k = Math.min(1, (now - t0) / o.duration);\n const e = 1 - Math.pow(1 - k, 3);\n disp?.setAttribute('scale', ((1 - e) * o.strength).toFixed(2));\n blur?.setAttribute('stdDeviation', ((1 - e) * 4).toFixed(2));\n if (k < 1) raf(tick);\n else end();\n };\n if (!raf(tick)) (fade ? fade.finished.then(end, end) : end());\n });\n },\n },\n {\n name: 'icon-swap',\n kind: 'click',\n description: 'Cycles through the element\\'s child icons with a gooey morph — blur, scale and rotate crossfade (`duration`). The visible icon is the only one not `aria-hidden`.',\n defaults: { duration: 420 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const icons = Array.from(el.children) as HTMLElement[];\n if (icons.length < 2) return null;\n if (!el.dataset.usaSwap) {\n el.dataset.usaSwap = '0';\n el.style.display = el.style.display || 'inline-grid';\n icons.forEach((ic, i) => {\n ic.style.gridArea = '1 / 1';\n ic.style.opacity = i ? '0' : '1';\n ic.setAttribute('aria-hidden', String(i !== 0));\n });\n }\n const cur = Number(el.dataset.usaSwap) || 0;\n const nxt = (cur + 1) % icons.length;\n el.dataset.usaSwap = String(nxt);\n const a = icons[cur];\n const b = icons[nxt];\n a.setAttribute('aria-hidden', 'true');\n b.setAttribute('aria-hidden', 'false');\n a.style.opacity = '0';\n b.style.opacity = '1';\n if (ctx.reduced) return all([ctx.animate(a, [{ opacity: 1 }, { opacity: 0 }], { duration: 150 }), ctx.animate(b, [{ opacity: 0 }, { opacity: 1 }], { duration: 150 })]);\n return all([\n ctx.animate(a, [{ opacity: 1, transform: 'none', filter: 'blur(0)' }, { opacity: 0, transform: 'scale(.3) rotate(-90deg)', filter: 'blur(6px)' }], { duration: o.duration, easing: 'cubic-bezier(.5,0,.75,0)' }),\n ctx.animate(b, [{ opacity: 0, transform: 'scale(.3) rotate(90deg)', filter: 'blur(6px)' }, { opacity: 1, transform: 'scale(1.15) rotate(-8deg)', filter: 'blur(0)', offset: 0.7 }, { opacity: 1, transform: 'none', filter: 'blur(0)' }], { duration: o.duration * 1.3, easing: 'cubic-bezier(.2,.8,.3,1.2)' }),\n ]);\n },\n },\n];\n\n/** Register the 6.6 morph & SVG pack (idempotent). */\nexport function registerMorphEffects2(): void {\n registerEffects(MORPH2_FX);\n}\n"],"names":[],"mappings":";;;;AAsBA,MAAM,EAAE,GAAG,4BAA4B;AACvC,MAAM,GAAG,GAAG,CAAC,CAAuB,MAAc,OAAO,qBAAqB,KAAK,UAAU,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7H,MAAM,GAAG,GAAG,CAAC,CAAS,KAAU;AAC9B,IAAA,IAAI,CAAC,IAAI,OAAO,oBAAoB,KAAK,UAAU;QAAE,oBAAoB,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;SACgB,UAAU,CAAC,CAAS,EAAE,CAAC,GAAG,EAAE,EAAA;IAC1C,MAAM,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,EAAE,MAAM,CAAmB;AAChE,IAAA,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IACtB,MAAM,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC;AAC/C,IAAA,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;AACvC,IAAA,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,oDAAoD;AACxE,IAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AAClB,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;AAC9B,IAAA,IAAI;AACF,QAAA,IAAI,OAAO,CAAC,CAAC,cAAc,KAAK,UAAU;AAAE,YA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,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AACvK,YAAA,OAAO,GAAG,CAAC;gBACT,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC;AAChN,gBAAA,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,GAAG,GAAG,EAAE,MAAM,EAAE,4BAA4B,EAAE,CAAC;AAChT,aAAA,CAAC;QACJ,CAAC;AACF,KAAA;;AAGH;SACgB,qBAAqB,GAAA;IACnC,eAAe,CAAC,SAAS,CAAC;AAC5B;;;;"}
@@ -4,6 +4,7 @@ var components_fxGpu = require('../chunks/gpu-BBRLgEzM.cjs');
4
4
  var components_fxText = require('./fx-text.cjs');
5
5
  var components_fxLight = require('./fx-light.cjs');
6
6
  var components_fx3d = require('./fx-3d.cjs');
7
+ var components_fxMorph = require('./fx-morph.cjs');
7
8
  require('../chunks/registry-DehBVRDV.cjs');
8
9
  require('../chunks/base-BaQV-2ha.cjs');
9
10
  require('../chunks/generative-BHIj-NU0.cjs');
@@ -15,6 +16,7 @@ const FX2_PACKS = {
15
16
  text: components_fxText.TEXT3_FX,
16
17
  light: components_fxLight.LIGHT_FX,
17
18
  depth: components_fx3d.DEPTH3_FX,
19
+ morph: components_fxMorph.MORPH2_FX,
18
20
  };
19
21
  /** Register every 6.x pack (idempotent). */
20
22
  function registerFx2() {
@@ -22,6 +24,7 @@ function registerFx2() {
22
24
  components_fxText.registerTextEffects3();
23
25
  components_fxLight.registerLightEffects();
24
26
  components_fx3d.register3dEffects();
27
+ components_fxMorph.registerMorphEffects2();
25
28
  }
26
29
 
27
30
  exports.GLSL_HEAD = components_fxGpu.GLSL_HEAD;
@@ -38,6 +41,10 @@ exports.registerLightEffects = components_fxLight.registerLightEffects;
38
41
  exports.trackPointer = components_fxLight.trackPointer;
39
42
  exports.DEPTH3_FX = components_fx3d.DEPTH3_FX;
40
43
  exports.register3dEffects = components_fx3d.register3dEffects;
44
+ exports.MORPH2_FX = components_fxMorph.MORPH2_FX;
45
+ exports.pointsToPath = components_fxMorph.pointsToPath;
46
+ exports.registerMorphEffects2 = components_fxMorph.registerMorphEffects2;
47
+ exports.samplePath = components_fxMorph.samplePath;
41
48
  exports.FX2_PACKS = FX2_PACKS;
42
49
  exports.registerFx2 = registerFx2;
43
50
  //# sourceMappingURL=fx2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fx2.cjs","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { GPU_FX, registerGpuEffects } from './gpu';\nimport { TEXT3_FX, registerTextEffects3, splitChars } from './text3';\nimport { LIGHT_FX, registerLightEffects, trackPointer } from './light';\nimport { DEPTH3_FX, register3dEffects } from './depth3';\n\nexport { GPU_FX, registerGpuEffects, TEXT3_FX, registerTextEffects3, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightEffects, trackPointer };\n\nexport { DEPTH3_FX, register3dEffects };\n\n/** The 6.x effect packs by name. */\nexport const FX2_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n};\n\n/** Register every 6.x pack (idempotent). */\nexport function registerFx2(): void {\n registerGpuEffects();\n registerTextEffects3();\n registerLightEffects();\n register3dEffects();\n}\n"],"names":["GPU_FX","TEXT3_FX","LIGHT_FX","DEPTH3_FX","registerGpuEffects","registerTextEffects3","registerLightEffects","register3dEffects"],"mappings":";;;;;;;;;;;AAmBA;AACO,MAAM,SAAS,GAAuC;AAC3D,IAAA,GAAG,EAAEA,uBAAM;AACX,IAAA,IAAI,EAAEC,0BAAQ;AACd,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,yBAAS;;AAGlB;SACgB,WAAW,GAAA;AACzB,IAAAC,mCAAkB,EAAE;AACpB,IAAAC,sCAAoB,EAAE;AACtB,IAAAC,uCAAoB,EAAE;AACtB,IAAAC,iCAAiB,EAAE;AACrB;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fx2.cjs","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { GPU_FX, registerGpuEffects } from './gpu';\nimport { TEXT3_FX, registerTextEffects3, splitChars } from './text3';\nimport { LIGHT_FX, registerLightEffects, trackPointer } from './light';\nimport { DEPTH3_FX, register3dEffects } from './depth3';\nimport { MORPH2_FX, registerMorphEffects2, samplePath, pointsToPath } from './morph2';\n\nexport { GPU_FX, registerGpuEffects, TEXT3_FX, registerTextEffects3, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightEffects, trackPointer };\n\nexport { DEPTH3_FX, register3dEffects };\n\nexport { MORPH2_FX, registerMorphEffects2, samplePath, pointsToPath };\n\n/** The 6.x effect packs by name. */\nexport const FX2_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n};\n\n/** Register every 6.x pack (idempotent). */\nexport function registerFx2(): void {\n registerGpuEffects();\n registerTextEffects3();\n registerLightEffects();\n register3dEffects();\n registerMorphEffects2();\n}\n"],"names":["GPU_FX","TEXT3_FX","LIGHT_FX","DEPTH3_FX","MORPH2_FX","registerGpuEffects","registerTextEffects3","registerLightEffects","register3dEffects","registerMorphEffects2"],"mappings":";;;;;;;;;;;;AAsBA;AACO,MAAM,SAAS,GAAuC;AAC3D,IAAA,GAAG,EAAEA,uBAAM;AACX,IAAA,IAAI,EAAEC,0BAAQ;AACd,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,yBAAS;AAChB,IAAA,KAAK,EAAEC,4BAAS;;AAGlB;SACgB,WAAW,GAAA;AACzB,IAAAC,mCAAkB,EAAE;AACpB,IAAAC,sCAAoB,EAAE;AACtB,IAAAC,uCAAoB,EAAE;AACtB,IAAAC,iCAAiB,EAAE;AACnB,IAAAC,wCAAqB,EAAE;AACzB;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -137,6 +137,33 @@ declare const DEPTH3_FX: EffectDefinition[];
137
137
  /** Register the 6.5 3D pack (idempotent). */
138
138
  declare function register3dEffects(): void;
139
139
 
140
+ /**
141
+ * 6.6 — Morph & SVG 2.0 (`motionary/components/fx-morph`), registered
142
+ * through `registerEffect()`:
143
+ *
144
+ * - `path-morph` (loop) — an SVG `<path>` flows between shapes (`paths`, any
145
+ * number of `d` strings): both shapes are resampled to the same number of
146
+ * points, so paths with different commands still morph smoothly.
147
+ * - `blob-button` (hover, persistent) — a liquid blob behind the element
148
+ * wobbles and bulges toward the pointer.
149
+ * - `stroke-draw` (enter) — every stroke in an inline SVG draws itself,
150
+ * staggered, then the fills fade in.
151
+ * - `noise-reveal` (enter) — the element condenses out of SVG turbulence
152
+ * (displacement + blur) — an SVG-filter transition.
153
+ * - `icon-swap` (click) — cycles through the element's child icons with a
154
+ * gooey morph (blur + scale + rotate crossfade).
155
+ *
156
+ * Reduced motion: no loops / wobble; enter effects and swaps fade.
157
+ */
158
+
159
+ /** Sample `d` into `n` points (needs SVG geometry support; `null` without it). */
160
+ declare function samplePath(d: string, n?: number): [number, number][] | null;
161
+ /** Points → closed path `d`. */
162
+ declare const pointsToPath: (pts: [number, number][]) => string;
163
+ declare const MORPH2_FX: EffectDefinition[];
164
+ /** Register the 6.6 morph & SVG pack (idempotent). */
165
+ declare function registerMorphEffects2(): void;
166
+
140
167
  /**
141
168
  * 5.5 — generative backgrounds on Canvas 2D, registered through
142
169
  * `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
@@ -209,5 +236,5 @@ declare const FX2_PACKS: Record<string, EffectDefinition[]>;
209
236
  /** Register every 6.x pack (idempotent). */
210
237
  declare function registerFx2(): void;
211
238
 
212
- export { DEPTH3_FX, FX2_PACKS, GLSL_HEAD, GPU_FX, LIGHT_FX, TEXT3_FX, fieldFallback, register3dEffects, registerFx2, registerGpuEffects, registerLightEffects, registerTextEffects3, shaderBackground, splitChars, supportsWebGL2, trackPointer };
239
+ export { DEPTH3_FX, FX2_PACKS, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, TEXT3_FX, fieldFallback, pointsToPath, register3dEffects, registerFx2, registerGpuEffects, registerLightEffects, registerMorphEffects2, registerTextEffects3, samplePath, shaderBackground, splitChars, supportsWebGL2, trackPointer };
213
240
  export type { ShaderSpec };
@@ -137,6 +137,33 @@ declare const DEPTH3_FX: EffectDefinition[];
137
137
  /** Register the 6.5 3D pack (idempotent). */
138
138
  declare function register3dEffects(): void;
139
139
 
140
+ /**
141
+ * 6.6 — Morph & SVG 2.0 (`motionary/components/fx-morph`), registered
142
+ * through `registerEffect()`:
143
+ *
144
+ * - `path-morph` (loop) — an SVG `<path>` flows between shapes (`paths`, any
145
+ * number of `d` strings): both shapes are resampled to the same number of
146
+ * points, so paths with different commands still morph smoothly.
147
+ * - `blob-button` (hover, persistent) — a liquid blob behind the element
148
+ * wobbles and bulges toward the pointer.
149
+ * - `stroke-draw` (enter) — every stroke in an inline SVG draws itself,
150
+ * staggered, then the fills fade in.
151
+ * - `noise-reveal` (enter) — the element condenses out of SVG turbulence
152
+ * (displacement + blur) — an SVG-filter transition.
153
+ * - `icon-swap` (click) — cycles through the element's child icons with a
154
+ * gooey morph (blur + scale + rotate crossfade).
155
+ *
156
+ * Reduced motion: no loops / wobble; enter effects and swaps fade.
157
+ */
158
+
159
+ /** Sample `d` into `n` points (needs SVG geometry support; `null` without it). */
160
+ declare function samplePath(d: string, n?: number): [number, number][] | null;
161
+ /** Points → closed path `d`. */
162
+ declare const pointsToPath: (pts: [number, number][]) => string;
163
+ declare const MORPH2_FX: EffectDefinition[];
164
+ /** Register the 6.6 morph & SVG pack (idempotent). */
165
+ declare function registerMorphEffects2(): void;
166
+
140
167
  /**
141
168
  * 5.5 — generative backgrounds on Canvas 2D, registered through
142
169
  * `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
@@ -209,5 +236,5 @@ declare const FX2_PACKS: Record<string, EffectDefinition[]>;
209
236
  /** Register every 6.x pack (idempotent). */
210
237
  declare function registerFx2(): void;
211
238
 
212
- export { DEPTH3_FX, FX2_PACKS, GLSL_HEAD, GPU_FX, LIGHT_FX, TEXT3_FX, fieldFallback, register3dEffects, registerFx2, registerGpuEffects, registerLightEffects, registerTextEffects3, shaderBackground, splitChars, supportsWebGL2, trackPointer };
239
+ export { DEPTH3_FX, FX2_PACKS, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, TEXT3_FX, fieldFallback, pointsToPath, register3dEffects, registerFx2, registerGpuEffects, registerLightEffects, registerMorphEffects2, registerTextEffects3, samplePath, shaderBackground, splitChars, supportsWebGL2, trackPointer };
213
240
  export type { ShaderSpec };
@@ -5,6 +5,8 @@ export { splitChars } from './fx-text.js';
5
5
  import { LIGHT_FX, registerLightEffects } from './fx-light.js';
6
6
  export { trackPointer } from './fx-light.js';
7
7
  import { DEPTH3_FX, register3dEffects } from './fx-3d.js';
8
+ import { MORPH2_FX, registerMorphEffects2 } from './fx-morph.js';
9
+ export { pointsToPath, samplePath } from './fx-morph.js';
8
10
  import '../chunks/registry-Bu5NrAyA.js';
9
11
  import '../chunks/base-DchG4q_S.js';
10
12
  import '../chunks/generative-2LhxG5BJ.js';
@@ -16,6 +18,7 @@ const FX2_PACKS = {
16
18
  text: TEXT3_FX,
17
19
  light: LIGHT_FX,
18
20
  depth: DEPTH3_FX,
21
+ morph: MORPH2_FX,
19
22
  };
20
23
  /** Register every 6.x pack (idempotent). */
21
24
  function registerFx2() {
@@ -23,7 +26,8 @@ function registerFx2() {
23
26
  registerTextEffects3();
24
27
  registerLightEffects();
25
28
  register3dEffects();
29
+ registerMorphEffects2();
26
30
  }
27
31
 
28
- export { DEPTH3_FX, FX2_PACKS, GPU_FX, LIGHT_FX, TEXT3_FX, register3dEffects, registerFx2, registerGpuEffects, registerLightEffects, registerTextEffects3 };
32
+ export { DEPTH3_FX, FX2_PACKS, GPU_FX, LIGHT_FX, MORPH2_FX, TEXT3_FX, register3dEffects, registerFx2, registerGpuEffects, registerLightEffects, registerMorphEffects2, registerTextEffects3 };
29
33
  //# sourceMappingURL=fx2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fx2.js","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { GPU_FX, registerGpuEffects } from './gpu';\nimport { TEXT3_FX, registerTextEffects3, splitChars } from './text3';\nimport { LIGHT_FX, registerLightEffects, trackPointer } from './light';\nimport { DEPTH3_FX, register3dEffects } from './depth3';\n\nexport { GPU_FX, registerGpuEffects, TEXT3_FX, registerTextEffects3, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightEffects, trackPointer };\n\nexport { DEPTH3_FX, register3dEffects };\n\n/** The 6.x effect packs by name. */\nexport const FX2_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n};\n\n/** Register every 6.x pack (idempotent). */\nexport function registerFx2(): void {\n registerGpuEffects();\n registerTextEffects3();\n registerLightEffects();\n register3dEffects();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmBA;AACO,MAAM,SAAS,GAAuC;AAC3D,IAAA,GAAG,EAAE,MAAM;AACX,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,SAAS;;AAGlB;SACgB,WAAW,GAAA;AACzB,IAAA,kBAAkB,EAAE;AACpB,IAAA,oBAAoB,EAAE;AACtB,IAAA,oBAAoB,EAAE;AACtB,IAAA,iBAAiB,EAAE;AACrB;;;;"}
1
+ {"version":3,"file":"fx2.js","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { GPU_FX, registerGpuEffects } from './gpu';\nimport { TEXT3_FX, registerTextEffects3, splitChars } from './text3';\nimport { LIGHT_FX, registerLightEffects, trackPointer } from './light';\nimport { DEPTH3_FX, register3dEffects } from './depth3';\nimport { MORPH2_FX, registerMorphEffects2, samplePath, pointsToPath } from './morph2';\n\nexport { GPU_FX, registerGpuEffects, TEXT3_FX, registerTextEffects3, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightEffects, trackPointer };\n\nexport { DEPTH3_FX, register3dEffects };\n\nexport { MORPH2_FX, registerMorphEffects2, samplePath, pointsToPath };\n\n/** The 6.x effect packs by name. */\nexport const FX2_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n};\n\n/** Register every 6.x pack (idempotent). */\nexport function registerFx2(): void {\n registerGpuEffects();\n registerTextEffects3();\n registerLightEffects();\n register3dEffects();\n registerMorphEffects2();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBA;AACO,MAAM,SAAS,GAAuC;AAC3D,IAAA,GAAG,EAAE,MAAM;AACX,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,KAAK,EAAE,SAAS;;AAGlB;SACgB,WAAW,GAAA;AACzB,IAAA,kBAAkB,EAAE;AACpB,IAAA,oBAAoB,EAAE;AACtB,IAAA,oBAAoB,EAAE;AACtB,IAAA,iBAAiB,EAAE;AACnB,IAAA,qBAAqB,EAAE;AACzB;;;;"}