use-scroll-animate 6.1.1 → 6.3.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 +33 -0
- package/dist/chunks/{base-Yno7N2eC.js → base-DchG4q_S.js} +2 -2
- package/dist/chunks/{base-Yno7N2eC.js.map → base-DchG4q_S.js.map} +1 -1
- package/dist/chunks/{core-BIOaYdgN.js → core-D2vF8kZb.js} +2 -2
- package/dist/chunks/{core-BIOaYdgN.js.map → core-D2vF8kZb.js.map} +1 -1
- package/dist/chunks/{core-CUGCsMsJ.js → core-DVyTlo9Q.js} +2 -2
- package/dist/chunks/{core-CUGCsMsJ.js.map → core-DVyTlo9Q.js.map} +1 -1
- package/dist/chunks/{fx-BqDeFywO.js → fx-DUMVKSvg.js} +2 -2
- package/dist/chunks/{fx-BqDeFywO.js.map → fx-DUMVKSvg.js.map} +1 -1
- package/dist/chunks/generative-BHIj-NU0.cjs +295 -0
- package/dist/chunks/generative-BHIj-NU0.cjs.map +1 -0
- package/dist/chunks/generative-BRUZaIsX.js +290 -0
- package/dist/chunks/generative-BRUZaIsX.js.map +1 -0
- package/dist/chunks/gpu-BBRLgEzM.cjs +388 -0
- package/dist/chunks/gpu-BBRLgEzM.cjs.map +1 -0
- package/dist/chunks/gpu-XHWzeNb5.js +381 -0
- package/dist/chunks/gpu-XHWzeNb5.js.map +1 -0
- package/dist/chunks/registry-Bu5NrAyA.js +121 -0
- package/dist/chunks/registry-Bu5NrAyA.js.map +1 -0
- package/dist/chunks/registry-DehBVRDV.cjs +131 -0
- package/dist/chunks/registry-DehBVRDV.cjs.map +1 -0
- package/dist/chunks/shared-eweTlzxv.js +50 -0
- package/dist/chunks/shared-eweTlzxv.js.map +1 -0
- package/dist/chunks/shared-jkgRH-Hx.cjs +58 -0
- package/dist/chunks/shared-jkgRH-Hx.cjs.map +1 -0
- package/dist/chunks/{spring-DfQO5USi.js → spring-BhoT09Qb.js} +2 -2
- package/dist/chunks/{spring-DfQO5USi.js.map → spring-BhoT09Qb.js.map} +1 -1
- package/dist/chunks/{variants-VNscPeTD.js → variants-C_hv_s23.js} +2 -2
- package/dist/chunks/{variants-VNscPeTD.js.map → variants-C_hv_s23.js.map} +1 -1
- package/dist/components/a11y.js +2 -2
- package/dist/components/angular.cjs +1 -0
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.js +7 -6
- package/dist/components/angular.js.map +1 -1
- package/dist/components/background.js +2 -2
- package/dist/components/bridge.js +1 -1
- package/dist/components/cards.js +2 -2
- package/dist/components/click.js +3 -3
- package/dist/components/depth.js +3 -3
- package/dist/components/effects.cjs +72 -403
- package/dist/components/effects.cjs.map +1 -1
- package/dist/components/effects.js +9 -339
- package/dist/components/effects.js.map +1 -1
- package/dist/components/feedback.js +1 -1
- package/dist/components/fx-gpu.cjs +13 -0
- package/dist/components/fx-gpu.cjs.map +1 -0
- package/dist/components/fx-gpu.d.cts +63 -0
- package/dist/components/fx-gpu.d.ts +63 -0
- package/dist/components/fx-gpu.js +6 -0
- package/dist/components/fx-gpu.js.map +1 -0
- package/dist/components/fx-text.cjs +267 -0
- package/dist/components/fx-text.cjs.map +1 -0
- package/dist/components/fx-text.d.cts +70 -0
- package/dist/components/fx-text.d.ts +70 -0
- package/dist/components/fx-text.js +263 -0
- package/dist/components/fx-text.js.map +1 -0
- package/dist/components/fx.cjs +13 -133
- package/dist/components/fx.cjs.map +1 -1
- package/dist/components/fx.js +6 -125
- package/dist/components/fx.js.map +1 -1
- package/dist/components/fx2.cjs +32 -0
- package/dist/components/fx2.cjs.map +1 -0
- package/dist/components/fx2.d.cts +162 -0
- package/dist/components/fx2.d.ts +162 -0
- package/dist/components/fx2.js +22 -0
- package/dist/components/fx2.js.map +1 -0
- package/dist/components/gesture.js +4 -4
- package/dist/components/interaction.js +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/lite.cjs +5 -9
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +5 -9
- package/dist/components/lite.js.map +1 -1
- package/dist/components/packs.js +1 -1
- package/dist/components/page.js +3 -3
- package/dist/components/perf.js +2 -2
- package/dist/components/physics.js +3 -3
- package/dist/components/reveal.js +1 -1
- package/dist/components/solid.cjs +1 -0
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.js +7 -6
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +1 -0
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.js +7 -6
- package/dist/components/svelte.js.map +1 -1
- package/dist/components/svg.js +1 -1
- package/dist/components/text.js +2 -2
- package/dist/components/timeline.js +3 -3
- package/dist/components/transitions.js +1 -1
- package/dist/components/ui.js +4 -4
- package/dist/components/vue.cjs +1 -0
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.js +7 -6
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +1174 -0
- package/dist/components/widgets.cjs.map +1 -0
- package/dist/components/widgets.d.cts +206 -0
- package/dist/components/widgets.d.ts +206 -0
- package/dist/components/widgets.js +1155 -0
- package/dist/components/widgets.js.map +1 -0
- package/dist/components.cjs +10 -9
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +10 -9
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/widgets.umd.js +2 -0
- package/dist/widgets.umd.js.map +1 -0
- package/docs/ROADMAP.md +10 -11
- package/docs/components.md +61 -0
- package/package.json +41 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { c as registerEffects } from '../chunks/registry-Bu5NrAyA.js';
|
|
2
|
+
import { u as srText } from '../chunks/base-DchG4q_S.js';
|
|
3
|
+
import { a as all, r as rand, f as fxLayer, s as spawn } from '../chunks/shared-eweTlzxv.js';
|
|
4
|
+
|
|
5
|
+
/** Split `el`'s text into `aria-hidden` inline-block characters (idempotent). Returns them. */
|
|
6
|
+
function splitChars(el) {
|
|
7
|
+
if (el.dataset.usaChars)
|
|
8
|
+
return Array.from(el.querySelectorAll(':scope > .usa-ch'));
|
|
9
|
+
const text = el.textContent || '';
|
|
10
|
+
el.textContent = '';
|
|
11
|
+
for (const ch of Array.from(text)) {
|
|
12
|
+
const s = document.createElement('span');
|
|
13
|
+
s.className = 'usa-ch';
|
|
14
|
+
s.setAttribute('aria-hidden', 'true');
|
|
15
|
+
s.style.cssText = 'display:inline-block;white-space:pre';
|
|
16
|
+
s.textContent = ch;
|
|
17
|
+
el.appendChild(s);
|
|
18
|
+
}
|
|
19
|
+
el.appendChild(srText(text.trim()));
|
|
20
|
+
el.dataset.usaChars = '1';
|
|
21
|
+
return Array.from(el.querySelectorAll(':scope > .usa-ch'));
|
|
22
|
+
}
|
|
23
|
+
const raf = (fn) => (typeof requestAnimationFrame === 'function' ? requestAnimationFrame(fn) : 0);
|
|
24
|
+
const caf = (h) => {
|
|
25
|
+
if (h && typeof cancelAnimationFrame === 'function')
|
|
26
|
+
cancelAnimationFrame(h);
|
|
27
|
+
};
|
|
28
|
+
let fid = 0;
|
|
29
|
+
const TEXT3_FX = [
|
|
30
|
+
{
|
|
31
|
+
name: 'liquid-text',
|
|
32
|
+
kind: 'loop',
|
|
33
|
+
description: 'The text ripples like liquid: an animated SVG turbulence + displacement filter (`strength`, `speed`).',
|
|
34
|
+
defaults: { strength: 7, speed: 1 },
|
|
35
|
+
run: (el, o) => {
|
|
36
|
+
const id = `usa-liquid-${++fid}`;
|
|
37
|
+
const ns = 'http://www.w3.org/2000/svg';
|
|
38
|
+
const svg = document.createElementNS(ns, 'svg');
|
|
39
|
+
svg.setAttribute('aria-hidden', 'true');
|
|
40
|
+
svg.setAttribute('width', '0');
|
|
41
|
+
svg.setAttribute('height', '0');
|
|
42
|
+
svg.style.cssText = 'position:absolute;width:0;height:0;overflow:hidden';
|
|
43
|
+
svg.innerHTML = `<filter id="${id}" x="-10%" y="-20%" width="120%" height="140%"><feTurbulence type="fractalNoise" baseFrequency="0.012 0.06" numOctaves="2" seed="3" result="n"/><feDisplacementMap in="SourceGraphic" in2="n" scale="${Number(o.strength) || 7}" xChannelSelector="R" yChannelSelector="G"/></filter>`;
|
|
44
|
+
document.body.appendChild(svg);
|
|
45
|
+
const turb = svg.querySelector('feTurbulence');
|
|
46
|
+
const prev = el.style.filter;
|
|
47
|
+
el.style.filter = `url(#${id})`;
|
|
48
|
+
let h = 0;
|
|
49
|
+
const t0 = performance.now();
|
|
50
|
+
const tick = (now) => {
|
|
51
|
+
const t = ((now - t0) / 1000) * (Number(o.speed) || 1);
|
|
52
|
+
turb?.setAttribute('baseFrequency', `${(0.012 + 0.004 * Math.sin(t * 1.3)).toFixed(4)} ${(0.06 + 0.02 * Math.cos(t)).toFixed(4)}`);
|
|
53
|
+
h = raf(tick);
|
|
54
|
+
};
|
|
55
|
+
h = raf(tick);
|
|
56
|
+
return () => {
|
|
57
|
+
caf(h);
|
|
58
|
+
el.style.filter = prev;
|
|
59
|
+
svg.remove();
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'neon-write',
|
|
65
|
+
kind: 'text',
|
|
66
|
+
description: 'Letters flicker on one by one like a neon sign being switched on, then keep a soft glow (`color`, `stagger`).',
|
|
67
|
+
defaults: { color: '#ff4fd8', stagger: 70, duration: 520 },
|
|
68
|
+
run: (el, o, ctx) => {
|
|
69
|
+
var _a;
|
|
70
|
+
const glow = `0 0 4px #fff,0 0 10px ${o.color},0 0 22px ${o.color},0 0 42px ${o.color}`;
|
|
71
|
+
el.style.textShadow = glow;
|
|
72
|
+
(_a = el.style).color || (_a.color = '#fff');
|
|
73
|
+
if (ctx.reduced)
|
|
74
|
+
return;
|
|
75
|
+
const cs = splitChars(el);
|
|
76
|
+
return all(cs.map((c, i) => ctx.animate(c, [
|
|
77
|
+
{ opacity: 0.08, textShadow: 'none' },
|
|
78
|
+
{ opacity: 1, textShadow: glow, offset: 0.2 },
|
|
79
|
+
{ opacity: 0.2, textShadow: 'none', offset: 0.32 },
|
|
80
|
+
{ opacity: 1, textShadow: glow, offset: 0.46 },
|
|
81
|
+
{ opacity: 0.55, offset: 0.6 },
|
|
82
|
+
{ opacity: 1, textShadow: glow },
|
|
83
|
+
], { duration: o.duration, delay: i * o.stagger + rand(0, 60), easing: 'steps(6, end)', fill: 'backwards' })));
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'particle-text',
|
|
88
|
+
kind: 'text',
|
|
89
|
+
description: 'Particles fly in from around the element and assemble into the glyphs, then hand over to the real text (`gap` px between samples, `duration`, `colors`).',
|
|
90
|
+
defaults: { gap: 3, duration: 1300, colors: ['#7c5cff', '#22d3ee', '#ff5c8a'], spread: 120 },
|
|
91
|
+
reduced: 'skip',
|
|
92
|
+
run: (el, o) => {
|
|
93
|
+
const cs = splitChars(el);
|
|
94
|
+
const r = el.getBoundingClientRect();
|
|
95
|
+
if (!r.width || !r.height)
|
|
96
|
+
return;
|
|
97
|
+
const pad = Number(o.spread) || 120;
|
|
98
|
+
const W = Math.ceil(r.width + pad * 2);
|
|
99
|
+
const H = Math.ceil(r.height + pad * 2);
|
|
100
|
+
const canvas = document.createElement('canvas');
|
|
101
|
+
canvas.setAttribute('aria-hidden', 'true');
|
|
102
|
+
canvas.width = W;
|
|
103
|
+
canvas.height = H;
|
|
104
|
+
canvas.style.cssText = `position:absolute;left:${r.left - pad}px;top:${r.top - pad}px;width:${W}px;height:${H}px`;
|
|
105
|
+
const g = canvas.getContext('2d');
|
|
106
|
+
if (!g)
|
|
107
|
+
return;
|
|
108
|
+
// rasterise each character where the browser laid it out
|
|
109
|
+
const cs0 = getComputedStyle(el);
|
|
110
|
+
g.font = `${cs0.fontStyle} ${cs0.fontWeight} ${cs0.fontSize} ${cs0.fontFamily}`;
|
|
111
|
+
g.textBaseline = 'middle';
|
|
112
|
+
g.fillStyle = '#000';
|
|
113
|
+
for (const c of cs) {
|
|
114
|
+
const b = c.getBoundingClientRect();
|
|
115
|
+
g.fillText(c.textContent || '', b.left - r.left + pad, b.top - r.top + pad + b.height / 2);
|
|
116
|
+
}
|
|
117
|
+
const img = g.getImageData(0, 0, W, H);
|
|
118
|
+
const gap = Math.max(2, Math.round(Number(o.gap) || 3));
|
|
119
|
+
const pts = [];
|
|
120
|
+
for (let y = 0; y < H; y += gap)
|
|
121
|
+
for (let x = 0; x < W; x += gap)
|
|
122
|
+
if (img.data[(y * W + x) * 4 + 3] > 128) {
|
|
123
|
+
const a = rand(0, Math.PI * 2);
|
|
124
|
+
const rr = rand(pad * 0.6, pad * 1.4);
|
|
125
|
+
pts.push({ x, y, sx: W / 2 + Math.cos(a) * (W / 2 + rr * 0.3), sy: H / 2 + Math.sin(a) * (H / 2 + rr * 0.3), c: o.colors[pts.length % o.colors.length], d: rand(0, 0.35) });
|
|
126
|
+
}
|
|
127
|
+
fxLayer().appendChild(canvas);
|
|
128
|
+
cs.forEach((c) => (c.style.opacity = '0'));
|
|
129
|
+
const t0 = performance.now();
|
|
130
|
+
const dur = Number(o.duration) || 1300;
|
|
131
|
+
return new Promise((done) => {
|
|
132
|
+
const finish = () => {
|
|
133
|
+
canvas.remove();
|
|
134
|
+
cs.forEach((c) => (c.style.opacity = ''));
|
|
135
|
+
done();
|
|
136
|
+
};
|
|
137
|
+
const tick = (now) => {
|
|
138
|
+
const k = (now - t0) / dur;
|
|
139
|
+
g.clearRect(0, 0, W, H);
|
|
140
|
+
for (const p of pts) {
|
|
141
|
+
const e = Math.min(1, Math.max(0, (k - p.d) / (1 - p.d)));
|
|
142
|
+
const q = 1 - Math.pow(1 - e, 3);
|
|
143
|
+
g.globalAlpha = k > 1 ? Math.max(0, 1 - (k - 1) * 4) : 0.25 + 0.75 * q;
|
|
144
|
+
g.fillStyle = p.c;
|
|
145
|
+
g.fillRect(p.sx + (p.x - p.sx) * q, p.sy + (p.y - p.sy) * q, gap - 0.5, gap - 0.5);
|
|
146
|
+
}
|
|
147
|
+
if (k > 1)
|
|
148
|
+
cs.forEach((c) => (c.style.opacity = String(Math.min(1, (k - 1) * 4))));
|
|
149
|
+
if (k < 1.25)
|
|
150
|
+
raf(tick);
|
|
151
|
+
else
|
|
152
|
+
finish();
|
|
153
|
+
};
|
|
154
|
+
if (!raf(tick))
|
|
155
|
+
finish();
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'glitch-text',
|
|
161
|
+
kind: 'text',
|
|
162
|
+
description: 'RGB-split slices of the text jump sideways for a moment (`duration`, `colors` of the two channels).',
|
|
163
|
+
defaults: { duration: 650, colors: ['#22d3ee', '#ff3d81'] },
|
|
164
|
+
run: (el, o, ctx) => {
|
|
165
|
+
if (ctx.reduced)
|
|
166
|
+
return ctx.animate(el, [{ opacity: 1 }, { opacity: 0.6 }, { opacity: 1 }], { duration: 200 });
|
|
167
|
+
if (getComputedStyle(el).position === 'static')
|
|
168
|
+
el.style.position = 'relative';
|
|
169
|
+
const text = el.textContent || '';
|
|
170
|
+
const steps = 8;
|
|
171
|
+
const mk = (color, dir) => {
|
|
172
|
+
const s = document.createElement('span');
|
|
173
|
+
s.setAttribute('aria-hidden', 'true');
|
|
174
|
+
s.textContent = text;
|
|
175
|
+
s.style.cssText = `position:absolute;inset:0;color:${color};mix-blend-mode:screen;pointer-events:none;white-space:inherit`;
|
|
176
|
+
el.appendChild(s);
|
|
177
|
+
const frames = [];
|
|
178
|
+
for (let i = 0; i <= steps; i++) {
|
|
179
|
+
const top = Math.round(rand(0, 80));
|
|
180
|
+
frames.push({ clipPath: `inset(${top}% 0 ${Math.max(0, 100 - top - rand(8, 30)).toFixed(0)}% 0)`, transform: `translateX(${(dir * rand(2, 9)).toFixed(1)}px)` });
|
|
181
|
+
}
|
|
182
|
+
frames.push({ clipPath: 'inset(50% 0 50% 0)', transform: 'none' });
|
|
183
|
+
const a = ctx.animate(s, frames, { duration: o.duration, easing: `steps(${steps}, end)` });
|
|
184
|
+
const rm = () => s.remove();
|
|
185
|
+
if (a)
|
|
186
|
+
a.finished.then(rm, rm);
|
|
187
|
+
else
|
|
188
|
+
rm();
|
|
189
|
+
return a;
|
|
190
|
+
};
|
|
191
|
+
return all([
|
|
192
|
+
mk(o.colors[0], -1),
|
|
193
|
+
mk(o.colors[1], 1),
|
|
194
|
+
ctx.animate(el, [{ transform: 'none' }, { transform: 'translate(-2px,1px) skewX(-4deg)' }, { transform: 'translate(2px,-1px)' }, { transform: 'skewX(3deg)' }, { transform: 'none' }], { duration: o.duration, easing: 'steps(5, end)' }),
|
|
195
|
+
]);
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'text-trail',
|
|
200
|
+
kind: 'cursor',
|
|
201
|
+
description: 'The letters of a word fall off the pointer as it moves over the element (persistent; `text`, `color`, `spacing` px).',
|
|
202
|
+
defaults: { text: 'MOTIONARY', color: '#7c5cff', spacing: 22, size: 18 },
|
|
203
|
+
run: (el, o, ctx) => {
|
|
204
|
+
const word = Array.from(String(o.text || '✦'));
|
|
205
|
+
let i = 0;
|
|
206
|
+
let lx = -1e4;
|
|
207
|
+
let ly = -1e4;
|
|
208
|
+
const move = (e) => {
|
|
209
|
+
if (Math.hypot(e.clientX - lx, e.clientY - ly) < o.spacing)
|
|
210
|
+
return;
|
|
211
|
+
lx = e.clientX;
|
|
212
|
+
ly = e.clientY;
|
|
213
|
+
const ch = word[i++ % word.length];
|
|
214
|
+
spawn(e.clientX - o.size / 2, e.clientY - o.size / 2, `font:800 ${o.size}px/1 system-ui,sans-serif;color:${o.color};text-shadow:0 2px 8px rgba(0,0,0,.25)`, ctx, [
|
|
215
|
+
{ transform: 'translateY(0) rotate(0) scale(1)', opacity: 1 },
|
|
216
|
+
{ transform: `translateY(${rand(30, 60).toFixed(0)}px) rotate(${rand(-60, 60).toFixed(0)}deg) scale(.6)`, opacity: 0 },
|
|
217
|
+
], { duration: rand(700, 1000), easing: 'cubic-bezier(.3,.1,.7,1)' }, ch);
|
|
218
|
+
};
|
|
219
|
+
el.addEventListener('pointermove', move);
|
|
220
|
+
return () => el.removeEventListener('pointermove', move);
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'font-breathe',
|
|
225
|
+
kind: 'loop',
|
|
226
|
+
description: 'A variable-font weight wave breathes through the text (`min` / `max` weight, `period` ms, `stagger`). Best with a variable font.',
|
|
227
|
+
defaults: { min: 200, max: 900, period: 2400, stagger: 90 },
|
|
228
|
+
run: (el, o, ctx) => {
|
|
229
|
+
const cs = splitChars(el);
|
|
230
|
+
const anims = cs.map((c, i) => ctx.animate(c, [
|
|
231
|
+
{ fontWeight: o.min, fontVariationSettings: `'wght' ${o.min}` },
|
|
232
|
+
{ fontWeight: o.max, fontVariationSettings: `'wght' ${o.max}` },
|
|
233
|
+
], { duration: o.period / 2, delay: i * o.stagger, iterations: Infinity, direction: 'alternate', easing: 'ease-in-out' }));
|
|
234
|
+
return () => anims.forEach((a) => a?.cancel());
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'flip-chars',
|
|
239
|
+
kind: 'text',
|
|
240
|
+
description: 'Every character flips up in 3D around its baseline, staggered (`stagger`, `duration`, `axis` x | y).',
|
|
241
|
+
defaults: { stagger: 45, duration: 700, axis: 'x' },
|
|
242
|
+
run: (el, o, ctx) => {
|
|
243
|
+
var _a;
|
|
244
|
+
const cs = splitChars(el);
|
|
245
|
+
(_a = el.style).perspective || (_a.perspective = '600px');
|
|
246
|
+
const rot = o.axis === 'y' ? 'rotateY' : 'rotateX';
|
|
247
|
+
return all(cs.map((c, i) => {
|
|
248
|
+
c.style.transformOrigin = '50% 70% -0.4em';
|
|
249
|
+
c.style.backfaceVisibility = 'hidden';
|
|
250
|
+
return ctx.reduced
|
|
251
|
+
? ctx.animate(c, [{ opacity: 0 }, { opacity: 1 }], { duration: 200, delay: i * 10, fill: 'backwards' })
|
|
252
|
+
: ctx.animate(c, [{ transform: `${rot}(-100deg)`, opacity: 0 }, { transform: `${rot}(12deg)`, opacity: 1, offset: 0.7 }, { transform: `${rot}(0)`, opacity: 1 }], { duration: o.duration, delay: i * o.stagger, easing: 'cubic-bezier(.2,.8,.3,1)', fill: 'backwards' });
|
|
253
|
+
}));
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
];
|
|
257
|
+
/** Register the 6.3 text pack (idempotent). */
|
|
258
|
+
function registerTextEffects3() {
|
|
259
|
+
registerEffects(TEXT3_FX);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export { TEXT3_FX, registerTextEffects3, splitChars };
|
|
263
|
+
//# sourceMappingURL=fx-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-text.js","sources":["../../src/components/fx2/text3.ts"],"sourcesContent":["/**\n * 6.3 — Text effects 3.0 (`motionary/components/fx-text`), registered through\n * `registerEffect()`:\n *\n * - `liquid-text` (loop) — the text ripples like liquid (animated SVG\n * turbulence + displacement filter).\n * - `neon-write` (text) — letters flicker on one by one like a neon sign\n * being switched on, then keep a soft glow.\n * - `particle-text` (text) — particles fly in from around the element and\n * assemble into the glyphs, then hand over to the real text.\n * - `glitch-text` (text) — RGB-split slices jump sideways for a moment.\n * - `text-trail` (cursor) — the letters of a word fall off the pointer.\n * - `font-breathe` (loop) — a variable-font weight wave breathes through the text.\n * - `flip-chars` (text) — every character flips up in 3D, staggered.\n *\n * Splitting keeps a visually hidden copy for screen readers (the animated\n * characters are `aria-hidden`). Reduced motion: loops and the trail are\n * skipped, one-shot effects show the final state without movement.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\nimport { srText } from '../base';\nimport { fxLayer, spawn, rand, all } from '../effects/shared';\n\n/** Split `el`'s text into `aria-hidden` inline-block characters (idempotent). Returns them. */\nexport function splitChars(el: HTMLElement): HTMLElement[] {\n if (el.dataset.usaChars) return Array.from(el.querySelectorAll<HTMLElement>(':scope > .usa-ch'));\n const text = el.textContent || '';\n el.textContent = '';\n for (const ch of Array.from(text)) {\n const s = document.createElement('span');\n s.className = 'usa-ch';\n s.setAttribute('aria-hidden', 'true');\n s.style.cssText = 'display:inline-block;white-space:pre';\n s.textContent = ch;\n el.appendChild(s);\n }\n el.appendChild(srText(text.trim()));\n el.dataset.usaChars = '1';\n return Array.from(el.querySelectorAll<HTMLElement>(':scope > .usa-ch'));\n}\n\nconst raf = (fn: FrameRequestCallback): number => (typeof requestAnimationFrame === 'function' ? requestAnimationFrame(fn) : 0);\nconst caf = (h: number): void => {\n if (h && typeof cancelAnimationFrame === 'function') cancelAnimationFrame(h);\n};\nlet fid = 0;\n\nexport const TEXT3_FX: EffectDefinition[] = [\n {\n name: 'liquid-text',\n kind: 'loop',\n description: 'The text ripples like liquid: an animated SVG turbulence + displacement filter (`strength`, `speed`).',\n defaults: { strength: 7, speed: 1 },\n run: (el: HTMLElement, o: any) => {\n const id = `usa-liquid-${++fid}`;\n const ns = 'http://www.w3.org/2000/svg';\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=\"-10%\" y=\"-20%\" width=\"120%\" height=\"140%\"><feTurbulence type=\"fractalNoise\" baseFrequency=\"0.012 0.06\" numOctaves=\"2\" seed=\"3\" result=\"n\"/><feDisplacementMap in=\"SourceGraphic\" in2=\"n\" scale=\"${Number(o.strength) || 7}\" xChannelSelector=\"R\" yChannelSelector=\"G\"/></filter>`;\n document.body.appendChild(svg);\n const turb = svg.querySelector('feTurbulence');\n const prev = el.style.filter;\n el.style.filter = `url(#${id})`;\n let h = 0;\n const t0 = performance.now();\n const tick = (now: number) => {\n const t = ((now - t0) / 1000) * (Number(o.speed) || 1);\n turb?.setAttribute('baseFrequency', `${(0.012 + 0.004 * Math.sin(t * 1.3)).toFixed(4)} ${(0.06 + 0.02 * Math.cos(t)).toFixed(4)}`);\n h = raf(tick);\n };\n h = raf(tick);\n return () => {\n caf(h);\n el.style.filter = prev;\n svg.remove();\n };\n },\n },\n {\n name: 'neon-write',\n kind: 'text',\n description: 'Letters flicker on one by one like a neon sign being switched on, then keep a soft glow (`color`, `stagger`).',\n defaults: { color: '#ff4fd8', stagger: 70, duration: 520 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const glow = `0 0 4px #fff,0 0 10px ${o.color},0 0 22px ${o.color},0 0 42px ${o.color}`;\n el.style.textShadow = glow;\n el.style.color ||= '#fff';\n if (ctx.reduced) return;\n const cs = splitChars(el);\n return all(cs.map((c, i) => ctx.animate(c, [\n { opacity: 0.08, textShadow: 'none' },\n { opacity: 1, textShadow: glow, offset: 0.2 },\n { opacity: 0.2, textShadow: 'none', offset: 0.32 },\n { opacity: 1, textShadow: glow, offset: 0.46 },\n { opacity: 0.55, offset: 0.6 },\n { opacity: 1, textShadow: glow },\n ], { duration: o.duration, delay: i * o.stagger + rand(0, 60), easing: 'steps(6, end)', fill: 'backwards' })));\n },\n },\n {\n name: 'particle-text',\n kind: 'text',\n description: 'Particles fly in from around the element and assemble into the glyphs, then hand over to the real text (`gap` px between samples, `duration`, `colors`).',\n defaults: { gap: 3, duration: 1300, colors: ['#7c5cff', '#22d3ee', '#ff5c8a'], spread: 120 },\n reduced: 'skip',\n run: (el: HTMLElement, o: any) => {\n const cs = splitChars(el);\n const r = el.getBoundingClientRect();\n if (!r.width || !r.height) return;\n const pad = Number(o.spread) || 120;\n const W = Math.ceil(r.width + pad * 2);\n const H = Math.ceil(r.height + pad * 2);\n const canvas = document.createElement('canvas');\n canvas.setAttribute('aria-hidden', 'true');\n canvas.width = W;\n canvas.height = H;\n canvas.style.cssText = `position:absolute;left:${r.left - pad}px;top:${r.top - pad}px;width:${W}px;height:${H}px`;\n const g = canvas.getContext('2d');\n if (!g) return;\n // rasterise each character where the browser laid it out\n const cs0 = getComputedStyle(el);\n g.font = `${cs0.fontStyle} ${cs0.fontWeight} ${cs0.fontSize} ${cs0.fontFamily}`;\n g.textBaseline = 'middle';\n g.fillStyle = '#000';\n for (const c of cs) {\n const b = c.getBoundingClientRect();\n g.fillText(c.textContent || '', b.left - r.left + pad, b.top - r.top + pad + b.height / 2);\n }\n const img = g.getImageData(0, 0, W, H);\n const gap = Math.max(2, Math.round(Number(o.gap) || 3));\n const pts: { x: number; y: number; sx: number; sy: number; c: string; d: number }[] = [];\n for (let y = 0; y < H; y += gap) for (let x = 0; x < W; x += gap) if (img.data[(y * W + x) * 4 + 3] > 128) {\n const a = rand(0, Math.PI * 2);\n const rr = rand(pad * 0.6, pad * 1.4);\n pts.push({ x, y, sx: W / 2 + Math.cos(a) * (W / 2 + rr * 0.3), sy: H / 2 + Math.sin(a) * (H / 2 + rr * 0.3), c: o.colors[pts.length % o.colors.length], d: rand(0, 0.35) });\n }\n fxLayer().appendChild(canvas);\n cs.forEach((c) => (c.style.opacity = '0'));\n const t0 = performance.now();\n const dur = Number(o.duration) || 1300;\n return new Promise<void>((done) => {\n const finish = () => {\n canvas.remove();\n cs.forEach((c) => (c.style.opacity = ''));\n done();\n };\n const tick = (now: number) => {\n const k = (now - t0) / dur;\n g.clearRect(0, 0, W, H);\n for (const p of pts) {\n const e = Math.min(1, Math.max(0, (k - p.d) / (1 - p.d)));\n const q = 1 - Math.pow(1 - e, 3);\n g.globalAlpha = k > 1 ? Math.max(0, 1 - (k - 1) * 4) : 0.25 + 0.75 * q;\n g.fillStyle = p.c;\n g.fillRect(p.sx + (p.x - p.sx) * q, p.sy + (p.y - p.sy) * q, gap - 0.5, gap - 0.5);\n }\n if (k > 1) cs.forEach((c) => (c.style.opacity = String(Math.min(1, (k - 1) * 4))));\n if (k < 1.25) raf(tick);\n else finish();\n };\n if (!raf(tick)) finish();\n });\n },\n },\n {\n name: 'glitch-text',\n kind: 'text',\n description: 'RGB-split slices of the text jump sideways for a moment (`duration`, `colors` of the two channels).',\n defaults: { duration: 650, colors: ['#22d3ee', '#ff3d81'] },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return ctx.animate(el, [{ opacity: 1 }, { opacity: 0.6 }, { opacity: 1 }], { duration: 200 });\n if (getComputedStyle(el).position === 'static') el.style.position = 'relative';\n const text = el.textContent || '';\n const steps = 8;\n const mk = (color: string, dir: number) => {\n const s = document.createElement('span');\n s.setAttribute('aria-hidden', 'true');\n s.textContent = text;\n s.style.cssText = `position:absolute;inset:0;color:${color};mix-blend-mode:screen;pointer-events:none;white-space:inherit`;\n el.appendChild(s);\n const frames: Keyframe[] = [];\n for (let i = 0; i <= steps; i++) {\n const top = Math.round(rand(0, 80));\n frames.push({ clipPath: `inset(${top}% 0 ${Math.max(0, 100 - top - rand(8, 30)).toFixed(0)}% 0)`, transform: `translateX(${(dir * rand(2, 9)).toFixed(1)}px)` });\n }\n frames.push({ clipPath: 'inset(50% 0 50% 0)', transform: 'none' });\n const a = ctx.animate(s, frames, { duration: o.duration, easing: `steps(${steps}, end)` });\n const rm = () => s.remove();\n if (a) a.finished.then(rm, rm);\n else rm();\n return a;\n };\n return all([\n mk(o.colors[0], -1),\n mk(o.colors[1], 1),\n ctx.animate(el, [{ transform: 'none' }, { transform: 'translate(-2px,1px) skewX(-4deg)' }, { transform: 'translate(2px,-1px)' }, { transform: 'skewX(3deg)' }, { transform: 'none' }], { duration: o.duration, easing: 'steps(5, end)' }),\n ]);\n },\n },\n {\n name: 'text-trail',\n kind: 'cursor',\n description: 'The letters of a word fall off the pointer as it moves over the element (persistent; `text`, `color`, `spacing` px).',\n defaults: { text: 'MOTIONARY', color: '#7c5cff', spacing: 22, size: 18 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const word = Array.from(String(o.text || '✦'));\n let i = 0;\n let lx = -1e4;\n let ly = -1e4;\n const move = (e: PointerEvent) => {\n if (Math.hypot(e.clientX - lx, e.clientY - ly) < o.spacing) return;\n lx = e.clientX;\n ly = e.clientY;\n const ch = word[i++ % word.length];\n spawn(e.clientX - o.size / 2, e.clientY - o.size / 2, `font:800 ${o.size}px/1 system-ui,sans-serif;color:${o.color};text-shadow:0 2px 8px rgba(0,0,0,.25)`, ctx, [\n { transform: 'translateY(0) rotate(0) scale(1)', opacity: 1 },\n { transform: `translateY(${rand(30, 60).toFixed(0)}px) rotate(${rand(-60, 60).toFixed(0)}deg) scale(.6)`, opacity: 0 },\n ], { duration: rand(700, 1000), easing: 'cubic-bezier(.3,.1,.7,1)' }, ch);\n };\n el.addEventListener('pointermove', move);\n return () => el.removeEventListener('pointermove', move);\n },\n },\n {\n name: 'font-breathe',\n kind: 'loop',\n description: 'A variable-font weight wave breathes through the text (`min` / `max` weight, `period` ms, `stagger`). Best with a variable font.',\n defaults: { min: 200, max: 900, period: 2400, stagger: 90 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const cs = splitChars(el);\n const anims = cs.map((c, i) => ctx.animate(c, [\n { fontWeight: o.min, fontVariationSettings: `'wght' ${o.min}` },\n { fontWeight: o.max, fontVariationSettings: `'wght' ${o.max}` },\n ], { duration: o.period / 2, delay: i * o.stagger, iterations: Infinity, direction: 'alternate', easing: 'ease-in-out' }));\n return () => anims.forEach((a) => a?.cancel());\n },\n },\n {\n name: 'flip-chars',\n kind: 'text',\n description: 'Every character flips up in 3D around its baseline, staggered (`stagger`, `duration`, `axis` x | y).',\n defaults: { stagger: 45, duration: 700, axis: 'x' },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const cs = splitChars(el);\n el.style.perspective ||= '600px';\n const rot = o.axis === 'y' ? 'rotateY' : 'rotateX';\n return all(cs.map((c, i) => {\n c.style.transformOrigin = '50% 70% -0.4em';\n c.style.backfaceVisibility = 'hidden';\n return ctx.reduced\n ? ctx.animate(c, [{ opacity: 0 }, { opacity: 1 }], { duration: 200, delay: i * 10, fill: 'backwards' })\n : ctx.animate(c, [{ transform: `${rot}(-100deg)`, opacity: 0 }, { transform: `${rot}(12deg)`, opacity: 1, offset: 0.7 }, { transform: `${rot}(0)`, opacity: 1 }], { duration: o.duration, delay: i * o.stagger, easing: 'cubic-bezier(.2,.8,.3,1)', fill: 'backwards' });\n }));\n },\n },\n];\n\n/** Register the 6.3 text pack (idempotent). */\nexport function registerTextEffects3(): void {\n registerEffects(TEXT3_FX);\n}\n\n"],"names":[],"mappings":";;;;AAwBA;AACM,SAAU,UAAU,CAAC,EAAe,EAAA;AACxC,IAAA,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAc,kBAAkB,CAAC,CAAC;AAChG,IAAA,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,IAAI,EAAE;AACjC,IAAA,EAAE,CAAC,WAAW,GAAG,EAAE;IACnB,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACjC,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;AACxC,QAAA,CAAC,CAAC,SAAS,GAAG,QAAQ;AACtB,QAAA,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;AACrC,QAAA,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,sCAAsC;AACxD,QAAA,CAAC,CAAC,WAAW,GAAG,EAAE;AAClB,QAAA,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IACnB;IACA,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AACnC,IAAA,EAAE,CAAC,OAAO,CAAC,QAAQ,GAAG,GAAG;IACzB,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAc,kBAAkB,CAAC,CAAC;AACzE;AAEA,MAAM,GAAG,GAAG,CAAC,EAAwB,MAAc,OAAO,qBAAqB,KAAK,UAAU,GAAG,qBAAqB,CAAC,EAAE,CA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'use strict';
|
|
2
2
|
|
|
3
3
|
var base = require('../chunks/base-BaQV-2ha.cjs');
|
|
4
|
+
var registry = require('../chunks/registry-DehBVRDV.cjs');
|
|
4
5
|
var core = require('../chunks/core-BGAyaY6L.cjs');
|
|
5
6
|
var fx = require('../chunks/fx-lBGVtQO1.cjs');
|
|
6
7
|
require('./tokens.cjs');
|
|
7
8
|
|
|
8
|
-
/**
|
|
9
|
-
* 5.0 — unified plugin-style effect registration. Every effect (built-in or
|
|
10
|
-
* yours) is a plain object registered once and played the same way:
|
|
11
|
-
* `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
|
|
12
|
-
* `<usa-fx effect="name" trigger="click">`. Effects get a context that
|
|
13
|
-
* already applies reduced motion, motion sensitivity, intensity and the
|
|
14
|
-
* animation budget.
|
|
15
|
-
*/
|
|
16
|
-
const EFFECT_KINDS = ['enter', 'exit', 'attention', 'click', 'hover', 'card', 'loop', 'page', 'background', 'text', 'cursor', 'scroll'];
|
|
17
|
-
const EFFECT_TRIGGERS = ['click', 'hover', 'enter', 'load', 'loop', 'manual'];
|
|
18
|
-
const registry = new Map();
|
|
19
|
-
/** Register an effect (throws on a duplicate name unless `override`). Returns an unregister function. */
|
|
20
|
-
function registerEffect(def, opts = {}) {
|
|
21
|
-
if (!/^[a-z][a-z0-9-]*$/.test(def.name))
|
|
22
|
-
throw new Error(`[motionary] invalid effect name "${def.name}"`);
|
|
23
|
-
if (!EFFECT_KINDS.includes(def.kind))
|
|
24
|
-
throw new Error(`[motionary] unknown effect kind "${def.kind}"`);
|
|
25
|
-
if (registry.has(def.name) && !opts.override)
|
|
26
|
-
throw new Error(`[motionary] effect "${def.name}" is already registered`);
|
|
27
|
-
registry.set(def.name, def);
|
|
28
|
-
return () => {
|
|
29
|
-
if (registry.get(def.name) === def)
|
|
30
|
-
registry.delete(def.name);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/** Register several effects at once (already-registered names are skipped). */
|
|
34
|
-
function registerEffects(defs) {
|
|
35
|
-
for (const d of defs)
|
|
36
|
-
if (!registry.has(d.name))
|
|
37
|
-
registerEffect(d);
|
|
38
|
-
}
|
|
39
|
-
const getEffect = (name) => registry.get(name);
|
|
40
|
-
const hasEffect = (name) => registry.has(name);
|
|
41
|
-
/** Registered effects (optionally of one kind), sorted by name. */
|
|
42
|
-
function listEffects(kind) {
|
|
43
|
-
return Array.from(registry.values())
|
|
44
|
-
.filter((d) => !kind || d.kind === kind)
|
|
45
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
46
|
-
}
|
|
47
|
-
const SKIP_BY_DEFAULT = ['loop', 'background', 'cursor'];
|
|
48
|
-
function context(event) {
|
|
49
|
-
const cleanups = [];
|
|
50
|
-
return {
|
|
51
|
-
reduced: base.prefersReducedMotion(),
|
|
52
|
-
sensitivity: base.getMotionSensitivity(),
|
|
53
|
-
event,
|
|
54
|
-
animate: base.animateWithMotion,
|
|
55
|
-
onCleanup: (fn) => cleanups.push(fn),
|
|
56
|
-
cleanups,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Play a registered effect once on `el`. Resolves when it finishes (or
|
|
61
|
-
* immediately for fire-and-forget effects). Unknown names reject.
|
|
62
|
-
*/
|
|
63
|
-
async function playEffect(el, name, options = {}, event) {
|
|
64
|
-
const def = registry.get(name);
|
|
65
|
-
if (!def)
|
|
66
|
-
throw new Error(`[motionary] unknown effect "${name}" — registered: ${Array.from(registry.keys()).join(', ')}`);
|
|
67
|
-
const ctx = context(event);
|
|
68
|
-
if (ctx.reduced && (def.reduced ?? (SKIP_BY_DEFAULT.includes(def.kind) ? 'skip' : 'run')) === 'skip')
|
|
69
|
-
return;
|
|
70
|
-
const out = def.run(el, { ...(def.defaults || {}), ...options }, ctx);
|
|
71
|
-
if (out && typeof out.finished?.then === 'function')
|
|
72
|
-
await out.finished.catch(() => undefined);
|
|
73
|
-
else if (out && typeof out.then === 'function')
|
|
74
|
-
await out;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Bind an effect to a trigger on `el`: `click`, `hover` (pointerenter / focus),
|
|
78
|
-
* `enter` (scrolls into view; `once` by default), `load` (now), `loop`
|
|
79
|
-
* (starts now, cleanup stops it) or `manual` (nothing). Returns an unbind.
|
|
80
|
-
*/
|
|
81
|
-
function bindEffect(el, name, options = {}) {
|
|
82
|
-
const { trigger = 'click', once, ...opts } = options;
|
|
83
|
-
const def = registry.get(name);
|
|
84
|
-
if (!def)
|
|
85
|
-
throw new Error(`[motionary] unknown effect "${name}"`);
|
|
86
|
-
const offs = [];
|
|
87
|
-
let current = null;
|
|
88
|
-
const fire = (e) => {
|
|
89
|
-
const ctx = context(e);
|
|
90
|
-
if (ctx.reduced && (def.reduced ?? (SKIP_BY_DEFAULT.includes(def.kind) ? 'skip' : 'run')) === 'skip')
|
|
91
|
-
return;
|
|
92
|
-
// A persistent effect (returns a cleanup) replaces its previous run instead of stacking.
|
|
93
|
-
current?.();
|
|
94
|
-
current = null;
|
|
95
|
-
const out = def.run(el, { ...(def.defaults || {}), ...opts }, ctx);
|
|
96
|
-
const stops = [...ctx.cleanups, ...(typeof out === 'function' ? [out] : [])];
|
|
97
|
-
if (stops.length)
|
|
98
|
-
current = () => stops.splice(0).forEach((f) => f());
|
|
99
|
-
};
|
|
100
|
-
offs.push(() => {
|
|
101
|
-
current?.();
|
|
102
|
-
current = null;
|
|
103
|
-
});
|
|
104
|
-
const on = (type, opt) => {
|
|
105
|
-
el.addEventListener(type, fire, opt);
|
|
106
|
-
offs.push(() => el.removeEventListener(type, fire, opt));
|
|
107
|
-
};
|
|
108
|
-
if (trigger === 'click')
|
|
109
|
-
on('click', { once: !!once });
|
|
110
|
-
else if (trigger === 'hover')
|
|
111
|
-
(on('pointerenter'), on('focusin'));
|
|
112
|
-
else if (trigger === 'load' || trigger === 'loop')
|
|
113
|
-
fire();
|
|
114
|
-
else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {
|
|
115
|
-
const io = new IntersectionObserver((entries) => {
|
|
116
|
-
for (const en of entries)
|
|
117
|
-
if (en.isIntersecting) {
|
|
118
|
-
fire();
|
|
119
|
-
if (once !== false)
|
|
120
|
-
io.disconnect();
|
|
121
|
-
}
|
|
122
|
-
}, { threshold: 0.15 });
|
|
123
|
-
io.observe(el);
|
|
124
|
-
offs.push(() => io.disconnect());
|
|
125
|
-
}
|
|
126
|
-
return () => offs.splice(0).reverse().forEach((f) => f());
|
|
127
|
-
}
|
|
128
|
-
|
|
129
9
|
function defineFx(tag = 'usa-fx') {
|
|
130
10
|
return base.defineElement(tag, (Base) => class UsaFx extends Base {
|
|
131
11
|
static get observedAttributes() {
|
|
@@ -143,7 +23,7 @@ function defineFx(tag = 'usa-fx') {
|
|
|
143
23
|
}
|
|
144
24
|
}
|
|
145
25
|
play() {
|
|
146
|
-
return playEffect(this.target, this.str('effect', 'pop'), this.opts()).catch(() => undefined);
|
|
26
|
+
return registry.playEffect(this.target, this.str('effect', 'pop'), this.opts()).catch(() => undefined);
|
|
147
27
|
}
|
|
148
28
|
mount() {
|
|
149
29
|
if (!this.style.display)
|
|
@@ -151,7 +31,7 @@ function defineFx(tag = 'usa-fx') {
|
|
|
151
31
|
const name = this.str('effect', 'pop');
|
|
152
32
|
const t = this.str('trigger', 'click');
|
|
153
33
|
try {
|
|
154
|
-
this.onCleanup(bindEffect(this.target, name, { ...this.opts(), trigger: EFFECT_TRIGGERS.includes(t) ? t : 'click', once: this.flag('once') }));
|
|
34
|
+
this.onCleanup(registry.bindEffect(this.target, name, { ...this.opts(), trigger: registry.EFFECT_TRIGGERS.includes(t) ? t : 'click', once: this.flag('once') }));
|
|
155
35
|
this.removeAttribute('data-unknown');
|
|
156
36
|
}
|
|
157
37
|
catch {
|
|
@@ -265,7 +145,7 @@ const BUILTIN_EFFECTS = [...enter, ...attention, ...click];
|
|
|
265
145
|
*/
|
|
266
146
|
/** Register the built-in effects (idempotent; `defineFxComponents()` calls it). */
|
|
267
147
|
function registerBuiltinEffects() {
|
|
268
|
-
registerEffects(BUILTIN_EFFECTS);
|
|
148
|
+
registry.registerEffects(BUILTIN_EFFECTS);
|
|
269
149
|
}
|
|
270
150
|
/** Register every component of this category under its default tag (+ the built-in effects). */
|
|
271
151
|
function defineFxComponents() {
|
|
@@ -273,17 +153,17 @@ function defineFxComponents() {
|
|
|
273
153
|
defineFx();
|
|
274
154
|
}
|
|
275
155
|
|
|
156
|
+
exports.EFFECT_KINDS = registry.EFFECT_KINDS;
|
|
157
|
+
exports.EFFECT_TRIGGERS = registry.EFFECT_TRIGGERS;
|
|
158
|
+
exports.bindEffect = registry.bindEffect;
|
|
159
|
+
exports.getEffect = registry.getEffect;
|
|
160
|
+
exports.hasEffect = registry.hasEffect;
|
|
161
|
+
exports.listEffects = registry.listEffects;
|
|
162
|
+
exports.playEffect = registry.playEffect;
|
|
163
|
+
exports.registerEffect = registry.registerEffect;
|
|
164
|
+
exports.registerEffects = registry.registerEffects;
|
|
276
165
|
exports.BUILTIN_EFFECTS = BUILTIN_EFFECTS;
|
|
277
|
-
exports.EFFECT_KINDS = EFFECT_KINDS;
|
|
278
|
-
exports.EFFECT_TRIGGERS = EFFECT_TRIGGERS;
|
|
279
|
-
exports.bindEffect = bindEffect;
|
|
280
166
|
exports.defineFx = defineFx;
|
|
281
167
|
exports.defineFxComponents = defineFxComponents;
|
|
282
|
-
exports.getEffect = getEffect;
|
|
283
|
-
exports.hasEffect = hasEffect;
|
|
284
|
-
exports.listEffects = listEffects;
|
|
285
|
-
exports.playEffect = playEffect;
|
|
286
168
|
exports.registerBuiltinEffects = registerBuiltinEffects;
|
|
287
|
-
exports.registerEffect = registerEffect;
|
|
288
|
-
exports.registerEffects = registerEffects;
|
|
289
169
|
//# sourceMappingURL=fx.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx.cjs","sources":["../../src/components/fx/registry.ts","../../src/components/fx/fx-el.ts","../../src/components/fx/builtins.ts","../../src/components/fx/index.ts"],"sourcesContent":["/**\n * 5.0 — unified plugin-style effect registration. Every effect (built-in or\n * yours) is a plain object registered once and played the same way:\n * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or\n * `<usa-fx effect=\"name\" trigger=\"click\">`. Effects get a context that\n * already applies reduced motion, motion sensitivity, intensity and the\n * animation budget.\n */\nimport { animateWithMotion, prefersReducedMotion, getMotionSensitivity, type MotionSensitivity, type Cleanup } from '../base';\n\nexport const EFFECT_KINDS = ['enter', 'exit', 'attention', 'click', 'hover', 'card', 'loop', 'page', 'background', 'text', 'cursor', 'scroll'] as const;\nexport type EffectKind = (typeof EFFECT_KINDS)[number];\n\nexport const EFFECT_TRIGGERS = ['click', 'hover', 'enter', 'load', 'loop', 'manual'] as const;\nexport type EffectTrigger = (typeof EFFECT_TRIGGERS)[number];\n\nexport interface EffectContext {\n /** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */\n readonly reduced: boolean;\n readonly sensitivity: MotionSensitivity;\n /** The triggering event (pointer position for click effects), if any. */\n readonly event?: Event;\n /** `el.animate()` with the library's motion rules (may return `null`). */\n animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;\n /** Register teardown for long-running effects (loops, listeners). */\n onCleanup(fn: Cleanup): void;\n}\n\nexport interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {\n /** Unique, kebab-case. */\n name: string;\n kind: EffectKind;\n /** One line for docs and the gallery. */\n description?: string;\n /** Option defaults (merged under the caller's options). */\n defaults?: Partial<O>;\n /**\n * Under reduced motion: `'skip'` (do nothing — default for loop, background\n * and cursor effects) or `'run'` (run with `ctx.reduced === true`, the\n * effect degrades itself — default for everything else).\n */\n reduced?: 'skip' | 'run';\n /** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */\n run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;\n}\n\nconst registry = new Map<string, EffectDefinition>();\n\n/** Register an effect (throws on a duplicate name unless `override`). Returns an unregister function. */\nexport function registerEffect<O extends Record<string, unknown>>(def: EffectDefinition<O>, opts: { override?: boolean } = {}): () => void {\n if (!/^[a-z][a-z0-9-]*$/.test(def.name)) throw new Error(`[motionary] invalid effect name \"${def.name}\"`);\n if (!EFFECT_KINDS.includes(def.kind)) throw new Error(`[motionary] unknown effect kind \"${def.kind}\"`);\n if (registry.has(def.name) && !opts.override) throw new Error(`[motionary] effect \"${def.name}\" is already registered`);\n registry.set(def.name, def as unknown as EffectDefinition);\n return () => {\n if (registry.get(def.name) === (def as unknown)) registry.delete(def.name);\n };\n}\n\n/** Register several effects at once (already-registered names are skipped). */\nexport function registerEffects(defs: EffectDefinition<any>[]): void {\n for (const d of defs) if (!registry.has(d.name)) registerEffect(d);\n}\n\nexport const getEffect = (name: string): EffectDefinition | undefined => registry.get(name);\nexport const hasEffect = (name: string): boolean => registry.has(name);\n/** Registered effects (optionally of one kind), sorted by name. */\nexport function listEffects(kind?: EffectKind): EffectDefinition[] {\n return Array.from(registry.values())\n .filter((d) => !kind || d.kind === kind)\n .sort((a, b) => a.name.localeCompare(b.name));\n}\n\nconst SKIP_BY_DEFAULT: EffectKind[] = ['loop', 'background', 'cursor'];\n\nfunction context(event?: Event): EffectContext & { cleanups: Cleanup[] } {\n const cleanups: Cleanup[] = [];\n return {\n reduced: prefersReducedMotion(),\n sensitivity: getMotionSensitivity(),\n event,\n animate: animateWithMotion,\n onCleanup: (fn) => cleanups.push(fn),\n cleanups,\n };\n}\n\n/**\n * Play a registered effect once on `el`. Resolves when it finishes (or\n * immediately for fire-and-forget effects). Unknown names reject.\n */\nexport async function playEffect(el: HTMLElement, name: string, options: Record<string, unknown> = {}, event?: Event): Promise<void> {\n const def = registry.get(name);\n if (!def) throw new Error(`[motionary] unknown effect \"${name}\" — registered: ${Array.from(registry.keys()).join(', ')}`);\n const ctx = context(event);\n if (ctx.reduced && (def.reduced ?? (SKIP_BY_DEFAULT.includes(def.kind) ? 'skip' : 'run')) === 'skip') return;\n const out = def.run(el, { ...(def.defaults || {}), ...options }, ctx);\n if (out && typeof (out as Animation).finished?.then === 'function') await (out as Animation).finished.catch(() => undefined);\n else if (out && typeof (out as Promise<unknown>).then === 'function') await out;\n}\n\n/**\n * Bind an effect to a trigger on `el`: `click`, `hover` (pointerenter / focus),\n * `enter` (scrolls into view; `once` by default), `load` (now), `loop`\n * (starts now, cleanup stops it) or `manual` (nothing). Returns an unbind.\n */\nexport function bindEffect(el: HTMLElement, name: string, options: Record<string, unknown> & { trigger?: EffectTrigger; once?: boolean } = {}): Cleanup {\n const { trigger = 'click', once, ...opts } = options;\n const def = registry.get(name);\n if (!def) throw new Error(`[motionary] unknown effect \"${name}\"`);\n const offs: Cleanup[] = [];\n let current: Cleanup | null = null;\n const fire = (e?: Event) => {\n const ctx = context(e);\n if (ctx.reduced && (def.reduced ?? (SKIP_BY_DEFAULT.includes(def.kind) ? 'skip' : 'run')) === 'skip') return;\n // A persistent effect (returns a cleanup) replaces its previous run instead of stacking.\n current?.();\n current = null;\n const out = def.run(el, { ...(def.defaults || {}), ...opts }, ctx);\n const stops = [...ctx.cleanups, ...(typeof out === 'function' ? [out as Cleanup] : [])];\n if (stops.length) current = () => stops.splice(0).forEach((f) => f());\n };\n offs.push(() => {\n current?.();\n current = null;\n });\n const on = (type: string, opt?: AddEventListenerOptions) => {\n el.addEventListener(type, fire, opt);\n offs.push(() => el.removeEventListener(type, fire, opt));\n };\n if (trigger === 'click') on('click', { once: !!once });\n else if (trigger === 'hover') (on('pointerenter'), on('focusin'));\n else if (trigger === 'load' || trigger === 'loop') fire();\n else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver((entries) => {\n for (const en of entries)\n if (en.isIntersecting) {\n fire();\n if (once !== false) io.disconnect();\n }\n }, { threshold: 0.15 });\n io.observe(el);\n offs.push(() => io.disconnect());\n }\n return () => offs.splice(0).reverse().forEach((f) => f());\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { bindEffect, playEffect, EFFECT_TRIGGERS, type EffectTrigger } from './registry';\n\n/**\n * `<usa-fx effect=\"pop\" trigger=\"click\">` — plays any registered effect\n * (`registerEffect()`) on its first element child (or itself with `self`).\n * `trigger`: `click` (default) · `hover` · `enter` · `load` · `loop` · `manual`;\n * `options` (JSON) is passed to the effect; `once`. Method `play()`.\n */\nexport interface UsaFxElement extends UsaElement {\n readonly target: HTMLElement;\n play(): Promise<void>;\n}\n\nexport function defineFx(tag = 'usa-fx'): CustomElementConstructor | undefined {\n return defineElement(tag, (Base) =>\n class UsaFx extends Base {\n static get observedAttributes(): string[] {\n return ['effect', 'trigger', 'options'];\n }\n get target(): HTMLElement {\n return this.flag('self') ? this : ((this.firstElementChild as HTMLElement) || this);\n }\n private opts(): Record<string, unknown> {\n try {\n return JSON.parse(this.str('options', '{}')) || {};\n } catch {\n return {};\n }\n }\n play(): Promise<void> {\n return playEffect(this.target, this.str('effect', 'pop'), this.opts()).catch(() => undefined);\n }\n mount(): void {\n if (!this.style.display) this.style.display = 'inline-block';\n const name = this.str('effect', 'pop');\n const t = this.str('trigger', 'click') as EffectTrigger;\n try {\n this.onCleanup(bindEffect(this.target, name, { ...this.opts(), trigger: EFFECT_TRIGGERS.includes(t) ? t : 'click', once: this.flag('once') }));\n this.removeAttribute('data-unknown');\n } catch {\n this.setAttribute('data-unknown', name); // not registered (yet)\n }\n }\n }\n );\n}\n","/**\n * 5.0 built-in effects, all registered through `registerEffect()`:\n * every timeline preset as an `enter` effect, attention seekers, and the\n * click effects (burst, confetti, shake, ripple).\n */\nimport { TIMELINE_PRESETS } from '../timeline/core';\nimport { burst, confetti, shake } from '../click/fx';\nimport type { EffectDefinition } from './registry';\n\nconst enter: EffectDefinition[] = Object.entries(TIMELINE_PRESETS).map(([name, frames]) => ({\n name,\n kind: 'enter' as const,\n description: `Entrance: ${name} (same keyframes as the timeline preset).`,\n defaults: { duration: 600, delay: 0, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' },\n run: (el: HTMLElement, o: any, ctx) => ctx.animate(el, ctx.reduced ? [{ opacity: 0 }, { opacity: 1 }] : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }),\n}));\n\nconst A = (name: string, description: string, frames: Keyframe[], duration = 700, easing = 'ease-in-out'): EffectDefinition => ({\n name,\n kind: 'attention',\n description,\n defaults: { duration, iterations: 1 },\n run: (el, o: any, ctx) => (ctx.reduced ? ctx.animate(el, [{ opacity: 1 }, { opacity: 0.6 }, { opacity: 1 }], { duration: 400 }) : ctx.animate(el, frames, { duration: o.duration, easing, iterations: o.iterations })),\n});\n\nconst attention: EffectDefinition[] = [\n A('pulse', 'Gentle scale pulse.', [{ transform: 'scale(1)' }, { transform: 'scale(1.08)' }, { transform: 'scale(1)' }], 600),\n A('pop', 'Quick overshoot pop.', [{ transform: 'scale(1)' }, { transform: 'scale(1.18)', offset: 0.4 }, { transform: 'scale(0.96)', offset: 0.7 }, { transform: 'scale(1)' }], 450, 'cubic-bezier(0.34, 1.56, 0.64, 1)'),\n A('jelly', 'Rubbery squash-and-stretch.', [{ transform: 'scale(1,1)' }, { transform: 'scale(1.25,0.75)', offset: 0.3 }, { transform: 'scale(0.75,1.25)', offset: 0.4 }, { transform: 'scale(1.15,0.85)', offset: 0.5 }, { transform: 'scale(0.95,1.05)', offset: 0.65 }, { transform: 'scale(1.05,0.95)', offset: 0.75 }, { transform: 'scale(1,1)' }], 900),\n A('wiggle', 'Playful rotate wiggle.', [{ transform: 'rotate(0)' }, { transform: 'rotate(-8deg)', offset: 0.2 }, { transform: 'rotate(7deg)', offset: 0.4 }, { transform: 'rotate(-5deg)', offset: 0.6 }, { transform: 'rotate(3deg)', offset: 0.8 }, { transform: 'rotate(0)' }], 650),\n A('heartbeat', 'Double-beat heart pulse.', [{ transform: 'scale(1)' }, { transform: 'scale(1.2)', offset: 0.14 }, { transform: 'scale(1)', offset: 0.28 }, { transform: 'scale(1.2)', offset: 0.42 }, { transform: 'scale(1)', offset: 0.7 }], 1100),\n A('bounce', 'Hop up and settle with a squash.', [{ transform: 'translateY(0) scale(1,1)' }, { transform: 'translateY(-22px) scale(0.95,1.05)', offset: 0.35 }, { transform: 'translateY(0) scale(1.08,0.92)', offset: 0.6 }, { transform: 'translateY(-6px) scale(1,1)', offset: 0.8 }, { transform: 'translateY(0) scale(1,1)' }], 800),\n A('flash', 'Two soft flashes (well under 3 per second).', [{ opacity: 1 }, { opacity: 0.25, offset: 0.25 }, { opacity: 1, offset: 0.5 }, { opacity: 0.25, offset: 0.75 }, { opacity: 1 }], 1400),\n A('tada', 'Scale + shake celebration.', [{ transform: 'scale(1) rotate(0)' }, { transform: 'scale(0.9) rotate(-3deg)', offset: 0.1 }, { transform: 'scale(1.1) rotate(3deg)', offset: 0.3 }, { transform: 'scale(1.1) rotate(-3deg)', offset: 0.5 }, { transform: 'scale(1.1) rotate(3deg)', offset: 0.7 }, { transform: 'scale(1) rotate(0)' }], 1000),\n];\n\nconst click: EffectDefinition[] = [\n {\n name: 'burst',\n kind: 'click',\n description: 'Particle burst from the click point (or `x` / `y`, or the element center).',\n defaults: { count: 12 },\n run: (el, o: any, ctx) => {\n if (ctx.reduced) return;\n const r = el.getBoundingClientRect();\n const e = ctx.event as PointerEvent | undefined;\n burst(o.x ?? e?.clientX ?? r.left + r.width / 2, o.y ?? e?.clientY ?? r.top + r.height / 2, o);\n },\n },\n {\n name: 'confetti',\n kind: 'click',\n description: 'Confetti cannon from the element.',\n defaults: { count: 80 },\n run: (el, o: any, ctx) => {\n if (ctx.reduced) return;\n const r = el.getBoundingClientRect();\n confetti({ x: r.left + r.width / 2, y: r.top + r.height / 2, ...o });\n },\n },\n {\n name: 'shake',\n kind: 'attention',\n description: 'Horizontal \"no\" shake (errors, wrong password).',\n defaults: { intensity: 8, duration: 480 },\n run: (el, o: any, ctx) => (ctx.reduced ? ctx.animate(el, [{ opacity: 1 }, { opacity: 0.5 }, { opacity: 1 }], { duration: 300 }) : shake(el, o.intensity, o.duration)),\n },\n {\n name: 'ripple',\n kind: 'click',\n description: 'Material-style ink ripple from the pointer.',\n defaults: { color: 'currentColor', duration: 600 },\n run: (el, o: any, ctx) => {\n if (ctx.reduced) return;\n const r = el.getBoundingClientRect();\n const e = ctx.event as PointerEvent | undefined;\n const d = Math.hypot(r.width, r.height) * 2;\n const dot = document.createElement('span');\n dot.setAttribute('aria-hidden', 'true');\n Object.assign(dot.style, { position: 'absolute', left: `${(e?.clientX ?? r.left + r.width / 2) - r.left - d / 2}px`, top: `${(e?.clientY ?? r.top + r.height / 2) - r.top - d / 2}px`, width: `${d}px`, height: `${d}px`, borderRadius: '50%', background: o.color, opacity: '0.25', pointerEvents: 'none' });\n if (getComputedStyle(el).position === 'static') el.style.position = 'relative';\n el.style.overflow ||= 'hidden';\n el.appendChild(dot);\n const a = ctx.animate(dot, [{ transform: 'scale(0)', opacity: 0.3 }, { transform: 'scale(1)', opacity: 0 }], { duration: o.duration, easing: 'ease-out' });\n const done = () => dot.remove();\n if (a) a.finished.then(done, done);\n else done();\n return a;\n },\n },\n];\n\n/** Every built-in 5.0 effect definition. */\nexport const BUILTIN_EFFECTS: EffectDefinition[] = [...enter, ...attention, ...click];\n","/**\n * motionary/components/fx — unified plugin-style effects (5.0).\n * `registerEffect({ name, kind, run })`, `playEffect(el, name)`,\n * `bindEffect(el, name, { trigger })`, `<usa-fx effect trigger>`. Built-ins:\n * every timeline preset (`enter`), `pulse` · `pop` · `jelly` · `wiggle` ·\n * `heartbeat` · `bounce` · `flash` · `tada` · `shake` (attention),\n * `burst` · `confetti` · `ripple` (click). More packs: `motionary/components/effects`.\n */\nimport { defineFx, type UsaFxElement } from './fx-el';\nimport { registerEffects } from './registry';\nimport { BUILTIN_EFFECTS } from './builtins';\n\nexport { defineFx };\nexport { registerEffect, registerEffects, playEffect, bindEffect, getEffect, hasEffect, listEffects, EFFECT_KINDS, EFFECT_TRIGGERS } from './registry';\nexport type { EffectDefinition, EffectContext, EffectKind, EffectTrigger } from './registry';\nexport { BUILTIN_EFFECTS };\nexport type { UsaFxElement };\n\n/** Register the built-in effects (idempotent; `defineFxComponents()` calls it). */\nexport function registerBuiltinEffects(): void {\n registerEffects(BUILTIN_EFFECTS);\n}\n\n/** Register every component of this category under its default tag (+ the built-in effects). */\nexport function defineFxComponents(): void {\n registerBuiltinEffects();\n defineFx();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-fx': UsaFxElement;\n }\n}\n"],"names":["prefersReducedMotion","getMotionSensitivity","animateWithMotion","defineElement","TIMELINE_PRESETS","burst","confetti","shake"],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAGI,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;AAGtI,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;AAiCnF,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA4B;AAEpD;SACgB,cAAc,CAAoC,GAAwB,EAAE,OAA+B,EAAE,EAAA;IAC3H,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,iCAAA,EAAoC,GAAG,CAAC,IAAI,CAAA,CAAA,CAAG,CAAC;IACzG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,iCAAA,EAAoC,GAAG,CAAC,IAAI,CAAA,CAAA,CAAG,CAAC;AACtG,IAAA,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,oBAAA,EAAuB,GAAG,CAAC,IAAI,CAAA,uBAAA,CAAyB,CA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,GAAG,UAAU;YAC9E,CAAA,EAAA,GAAA,EAAE,CAAC,KAAK,EAAC,QAAQ,KAAA,EAAA,CAAR,QAAQ,GAAK,QAAQ,CAAA;AAC9B,YAAA,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC;AACnB,YAAA,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;YAC1J,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE;AAC/B,YAAA,IAAI,CAAC;gBAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;;AAC7B,gBAAA,IAAI,EAAE;AACX,YAAA,OAAO,CAAC;QACV,CAAC;AACF,KAAA;CACF;AAED;AACO,MAAM,eAAe,GAAuB,CAAC,GAAG,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;;AC7FpF;;;;;;;AAOG;AAWH;SACgB,sBAAsB,GAAA;IACpC,eAAe,CAAC,eAAe,CAAC;AAClC;AAEA;SACgB,kBAAkB,GAAA;AAChC,IAAA,sBAAsB,EAAE;AACxB,IAAA,QAAQ,EAAE;AACZ;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"fx.cjs","sources":["../../src/components/fx/fx-el.ts","../../src/components/fx/builtins.ts","../../src/components/fx/index.ts"],"sourcesContent":["import { defineElement, type UsaElement } from '../base';\nimport { bindEffect, playEffect, EFFECT_TRIGGERS, type EffectTrigger } from './registry';\n\n/**\n * `<usa-fx effect=\"pop\" trigger=\"click\">` — plays any registered effect\n * (`registerEffect()`) on its first element child (or itself with `self`).\n * `trigger`: `click` (default) · `hover` · `enter` · `load` · `loop` · `manual`;\n * `options` (JSON) is passed to the effect; `once`. Method `play()`.\n */\nexport interface UsaFxElement extends UsaElement {\n readonly target: HTMLElement;\n play(): Promise<void>;\n}\n\nexport function defineFx(tag = 'usa-fx'): CustomElementConstructor | undefined {\n return defineElement(tag, (Base) =>\n class UsaFx extends Base {\n static get observedAttributes(): string[] {\n return ['effect', 'trigger', 'options'];\n }\n get target(): HTMLElement {\n return this.flag('self') ? this : ((this.firstElementChild as HTMLElement) || this);\n }\n private opts(): Record<string, unknown> {\n try {\n return JSON.parse(this.str('options', '{}')) || {};\n } catch {\n return {};\n }\n }\n play(): Promise<void> {\n return playEffect(this.target, this.str('effect', 'pop'), this.opts()).catch(() => undefined);\n }\n mount(): void {\n if (!this.style.display) this.style.display = 'inline-block';\n const name = this.str('effect', 'pop');\n const t = this.str('trigger', 'click') as EffectTrigger;\n try {\n this.onCleanup(bindEffect(this.target, name, { ...this.opts(), trigger: EFFECT_TRIGGERS.includes(t) ? t : 'click', once: this.flag('once') }));\n this.removeAttribute('data-unknown');\n } catch {\n this.setAttribute('data-unknown', name); // not registered (yet)\n }\n }\n }\n );\n}\n","/**\n * 5.0 built-in effects, all registered through `registerEffect()`:\n * every timeline preset as an `enter` effect, attention seekers, and the\n * click effects (burst, confetti, shake, ripple).\n */\nimport { TIMELINE_PRESETS } from '../timeline/core';\nimport { burst, confetti, shake } from '../click/fx';\nimport type { EffectDefinition } from './registry';\n\nconst enter: EffectDefinition[] = Object.entries(TIMELINE_PRESETS).map(([name, frames]) => ({\n name,\n kind: 'enter' as const,\n description: `Entrance: ${name} (same keyframes as the timeline preset).`,\n defaults: { duration: 600, delay: 0, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' },\n run: (el: HTMLElement, o: any, ctx) => ctx.animate(el, ctx.reduced ? [{ opacity: 0 }, { opacity: 1 }] : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }),\n}));\n\nconst A = (name: string, description: string, frames: Keyframe[], duration = 700, easing = 'ease-in-out'): EffectDefinition => ({\n name,\n kind: 'attention',\n description,\n defaults: { duration, iterations: 1 },\n run: (el, o: any, ctx) => (ctx.reduced ? ctx.animate(el, [{ opacity: 1 }, { opacity: 0.6 }, { opacity: 1 }], { duration: 400 }) : ctx.animate(el, frames, { duration: o.duration, easing, iterations: o.iterations })),\n});\n\nconst attention: EffectDefinition[] = [\n A('pulse', 'Gentle scale pulse.', [{ transform: 'scale(1)' }, { transform: 'scale(1.08)' }, { transform: 'scale(1)' }], 600),\n A('pop', 'Quick overshoot pop.', [{ transform: 'scale(1)' }, { transform: 'scale(1.18)', offset: 0.4 }, { transform: 'scale(0.96)', offset: 0.7 }, { transform: 'scale(1)' }], 450, 'cubic-bezier(0.34, 1.56, 0.64, 1)'),\n A('jelly', 'Rubbery squash-and-stretch.', [{ transform: 'scale(1,1)' }, { transform: 'scale(1.25,0.75)', offset: 0.3 }, { transform: 'scale(0.75,1.25)', offset: 0.4 }, { transform: 'scale(1.15,0.85)', offset: 0.5 }, { transform: 'scale(0.95,1.05)', offset: 0.65 }, { transform: 'scale(1.05,0.95)', offset: 0.75 }, { transform: 'scale(1,1)' }], 900),\n A('wiggle', 'Playful rotate wiggle.', [{ transform: 'rotate(0)' }, { transform: 'rotate(-8deg)', offset: 0.2 }, { transform: 'rotate(7deg)', offset: 0.4 }, { transform: 'rotate(-5deg)', offset: 0.6 }, { transform: 'rotate(3deg)', offset: 0.8 }, { transform: 'rotate(0)' }], 650),\n A('heartbeat', 'Double-beat heart pulse.', [{ transform: 'scale(1)' }, { transform: 'scale(1.2)', offset: 0.14 }, { transform: 'scale(1)', offset: 0.28 }, { transform: 'scale(1.2)', offset: 0.42 }, { transform: 'scale(1)', offset: 0.7 }], 1100),\n A('bounce', 'Hop up and settle with a squash.', [{ transform: 'translateY(0) scale(1,1)' }, { transform: 'translateY(-22px) scale(0.95,1.05)', offset: 0.35 }, { transform: 'translateY(0) scale(1.08,0.92)', offset: 0.6 }, { transform: 'translateY(-6px) scale(1,1)', offset: 0.8 }, { transform: 'translateY(0) scale(1,1)' }], 800),\n A('flash', 'Two soft flashes (well under 3 per second).', [{ opacity: 1 }, { opacity: 0.25, offset: 0.25 }, { opacity: 1, offset: 0.5 }, { opacity: 0.25, offset: 0.75 }, { opacity: 1 }], 1400),\n A('tada', 'Scale + shake celebration.', [{ transform: 'scale(1) rotate(0)' }, { transform: 'scale(0.9) rotate(-3deg)', offset: 0.1 }, { transform: 'scale(1.1) rotate(3deg)', offset: 0.3 }, { transform: 'scale(1.1) rotate(-3deg)', offset: 0.5 }, { transform: 'scale(1.1) rotate(3deg)', offset: 0.7 }, { transform: 'scale(1) rotate(0)' }], 1000),\n];\n\nconst click: EffectDefinition[] = [\n {\n name: 'burst',\n kind: 'click',\n description: 'Particle burst from the click point (or `x` / `y`, or the element center).',\n defaults: { count: 12 },\n run: (el, o: any, ctx) => {\n if (ctx.reduced) return;\n const r = el.getBoundingClientRect();\n const e = ctx.event as PointerEvent | undefined;\n burst(o.x ?? e?.clientX ?? r.left + r.width / 2, o.y ?? e?.clientY ?? r.top + r.height / 2, o);\n },\n },\n {\n name: 'confetti',\n kind: 'click',\n description: 'Confetti cannon from the element.',\n defaults: { count: 80 },\n run: (el, o: any, ctx) => {\n if (ctx.reduced) return;\n const r = el.getBoundingClientRect();\n confetti({ x: r.left + r.width / 2, y: r.top + r.height / 2, ...o });\n },\n },\n {\n name: 'shake',\n kind: 'attention',\n description: 'Horizontal \"no\" shake (errors, wrong password).',\n defaults: { intensity: 8, duration: 480 },\n run: (el, o: any, ctx) => (ctx.reduced ? ctx.animate(el, [{ opacity: 1 }, { opacity: 0.5 }, { opacity: 1 }], { duration: 300 }) : shake(el, o.intensity, o.duration)),\n },\n {\n name: 'ripple',\n kind: 'click',\n description: 'Material-style ink ripple from the pointer.',\n defaults: { color: 'currentColor', duration: 600 },\n run: (el, o: any, ctx) => {\n if (ctx.reduced) return;\n const r = el.getBoundingClientRect();\n const e = ctx.event as PointerEvent | undefined;\n const d = Math.hypot(r.width, r.height) * 2;\n const dot = document.createElement('span');\n dot.setAttribute('aria-hidden', 'true');\n Object.assign(dot.style, { position: 'absolute', left: `${(e?.clientX ?? r.left + r.width / 2) - r.left - d / 2}px`, top: `${(e?.clientY ?? r.top + r.height / 2) - r.top - d / 2}px`, width: `${d}px`, height: `${d}px`, borderRadius: '50%', background: o.color, opacity: '0.25', pointerEvents: 'none' });\n if (getComputedStyle(el).position === 'static') el.style.position = 'relative';\n el.style.overflow ||= 'hidden';\n el.appendChild(dot);\n const a = ctx.animate(dot, [{ transform: 'scale(0)', opacity: 0.3 }, { transform: 'scale(1)', opacity: 0 }], { duration: o.duration, easing: 'ease-out' });\n const done = () => dot.remove();\n if (a) a.finished.then(done, done);\n else done();\n return a;\n },\n },\n];\n\n/** Every built-in 5.0 effect definition. */\nexport const BUILTIN_EFFECTS: EffectDefinition[] = [...enter, ...attention, ...click];\n","/**\n * motionary/components/fx — unified plugin-style effects (5.0).\n * `registerEffect({ name, kind, run })`, `playEffect(el, name)`,\n * `bindEffect(el, name, { trigger })`, `<usa-fx effect trigger>`. Built-ins:\n * every timeline preset (`enter`), `pulse` · `pop` · `jelly` · `wiggle` ·\n * `heartbeat` · `bounce` · `flash` · `tada` · `shake` (attention),\n * `burst` · `confetti` · `ripple` (click). More packs: `motionary/components/effects`.\n */\nimport { defineFx, type UsaFxElement } from './fx-el';\nimport { registerEffects } from './registry';\nimport { BUILTIN_EFFECTS } from './builtins';\n\nexport { defineFx };\nexport { registerEffect, registerEffects, playEffect, bindEffect, getEffect, hasEffect, listEffects, EFFECT_KINDS, EFFECT_TRIGGERS } from './registry';\nexport type { EffectDefinition, EffectContext, EffectKind, EffectTrigger } from './registry';\nexport { BUILTIN_EFFECTS };\nexport type { UsaFxElement };\n\n/** Register the built-in effects (idempotent; `defineFxComponents()` calls it). */\nexport function registerBuiltinEffects(): void {\n registerEffects(BUILTIN_EFFECTS);\n}\n\n/** Register every component of this category under its default tag (+ the built-in effects). */\nexport function defineFxComponents(): void {\n registerBuiltinEffects();\n defineFx();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-fx': UsaFxElement;\n }\n}\n"],"names":["defineElement","playEffect","bindEffect","EFFECT_TRIGGERS","TIMELINE_PRESETS","burst","confetti","shake","registerEffects"],"mappings":";;;;;;;;AAcM,SAAU,QAAQ,CAAC,GAAG,GAAG,QAAQ,EAAA;AACrC,IAAA,OAAOA,kBAAa,CAAC,GAAG,EAAE,CAAC,IAAI,KAC7B,MAAM,KAAM,SAAQ,IAAI,CAAA;AACtB,QAAA,WAAW,kBAAkB,GAAA;AAC3B,YAAA,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;QACzC;AACA,QAAA,IAAI,MAAM,GAAA;YACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,IAAK,IAAI,CAAC,iBAAiC,IAAI,IAAI,CAAC;QACrF;QACQ,IAAI,GAAA;AACV,YAAA,IAAI;AACF,gBAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE;YACpD;AAAE,YAAA,MAAM;AACN,gBAAA,OAAO,EAAE;YACX;QACF;QACA,IAAI,GAAA;AACF,YAAA,OAAOC,mBAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC;QAC/F;QACA,KAAK,GAAA;AACH,YAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;AAAE,gBAAA,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,cAAc;YAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;YACtC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG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