motionary 6.7.0 → 6.9.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/bin/usa-codemod-7.mjs +91 -0
  3. package/dist/chunks/{base-DchG4q_S.js → base-D5MHqeDd.js} +2 -2
  4. package/dist/chunks/{base-DchG4q_S.js.map → base-D5MHqeDd.js.map} +1 -1
  5. package/dist/chunks/{core-DVyTlo9Q.js → core-DyJu5r5a.js} +2 -2
  6. package/dist/chunks/{core-DVyTlo9Q.js.map → core-DyJu5r5a.js.map} +1 -1
  7. package/dist/chunks/{core-D2vF8kZb.js → core-ZGo4hOEk.js} +2 -2
  8. package/dist/chunks/{core-D2vF8kZb.js.map → core-ZGo4hOEk.js.map} +1 -1
  9. package/dist/chunks/{fx-DUMVKSvg.js → fx-DlGRMJ-Z.js} +2 -2
  10. package/dist/chunks/{fx-DUMVKSvg.js.map → fx-DlGRMJ-Z.js.map} +1 -1
  11. package/dist/chunks/{gpu-BBRLgEzM.cjs → gpu-C2D4T9Q-.cjs} +9 -2
  12. package/dist/chunks/gpu-C2D4T9Q-.cjs.map +1 -0
  13. package/dist/chunks/{gpu-CsP2ZB3x.js → gpu-DPhMkJq6.js} +10 -4
  14. package/dist/chunks/gpu-DPhMkJq6.js.map +1 -0
  15. package/dist/chunks/player-DH3TIz-t.js +516 -0
  16. package/dist/chunks/player-DH3TIz-t.js.map +1 -0
  17. package/dist/chunks/player-PS6_FzNw.cjs +525 -0
  18. package/dist/chunks/player-PS6_FzNw.cjs.map +1 -0
  19. package/dist/chunks/{registry-D23neB4M.js → registry-CTLWeg-J.js} +2 -2
  20. package/dist/chunks/{registry-D23neB4M.js.map → registry-CTLWeg-J.js.map} +1 -1
  21. package/dist/chunks/{spring-BhoT09Qb.js → spring-B-9MZOrW.js} +2 -2
  22. package/dist/chunks/{spring-BhoT09Qb.js.map → spring-B-9MZOrW.js.map} +1 -1
  23. package/dist/chunks/{variants-C_hv_s23.js → variants-CoZn3k_5.js} +2 -2
  24. package/dist/chunks/{variants-C_hv_s23.js.map → variants-CoZn3k_5.js.map} +1 -1
  25. package/dist/components/a11y.js +2 -2
  26. package/dist/components/angular.js +7 -7
  27. package/dist/components/background.js +2 -2
  28. package/dist/components/bridge.js +1 -1
  29. package/dist/components/cards.js +2 -2
  30. package/dist/components/click.js +3 -3
  31. package/dist/components/depth.js +3 -3
  32. package/dist/components/effects.cjs +13 -522
  33. package/dist/components/effects.cjs.map +1 -1
  34. package/dist/components/effects.js +7 -515
  35. package/dist/components/effects.js.map +1 -1
  36. package/dist/components/feedback.js +1 -1
  37. package/dist/components/fx-3d.cjs +8 -2
  38. package/dist/components/fx-3d.cjs.map +1 -1
  39. package/dist/components/fx-3d.d.cts +3 -1
  40. package/dist/components/fx-3d.d.ts +3 -1
  41. package/dist/components/fx-3d.js +9 -4
  42. package/dist/components/fx-3d.js.map +1 -1
  43. package/dist/components/fx-focus.cjs +125 -0
  44. package/dist/components/fx-focus.cjs.map +1 -0
  45. package/dist/components/fx-focus.d.cts +65 -0
  46. package/dist/components/fx-focus.d.ts +65 -0
  47. package/dist/components/fx-focus.js +122 -0
  48. package/dist/components/fx-focus.js.map +1 -0
  49. package/dist/components/fx-gpu.cjs +3 -2
  50. package/dist/components/fx-gpu.cjs.map +1 -1
  51. package/dist/components/fx-gpu.d.cts +3 -1
  52. package/dist/components/fx-gpu.d.ts +3 -1
  53. package/dist/components/fx-gpu.js +3 -3
  54. package/dist/components/fx-light.cjs +8 -2
  55. package/dist/components/fx-light.cjs.map +1 -1
  56. package/dist/components/fx-light.d.cts +3 -1
  57. package/dist/components/fx-light.d.ts +3 -1
  58. package/dist/components/fx-light.js +9 -4
  59. package/dist/components/fx-light.js.map +1 -1
  60. package/dist/components/fx-morph.cjs +8 -2
  61. package/dist/components/fx-morph.cjs.map +1 -1
  62. package/dist/components/fx-morph.d.cts +3 -1
  63. package/dist/components/fx-morph.d.ts +3 -1
  64. package/dist/components/fx-morph.js +9 -4
  65. package/dist/components/fx-morph.js.map +1 -1
  66. package/dist/components/fx-physics.cjs +350 -0
  67. package/dist/components/fx-physics.cjs.map +1 -0
  68. package/dist/components/fx-physics.d.cts +94 -0
  69. package/dist/components/fx-physics.d.ts +94 -0
  70. package/dist/components/fx-physics.js +345 -0
  71. package/dist/components/fx-physics.js.map +1 -0
  72. package/dist/components/fx-text.cjs +8 -2
  73. package/dist/components/fx-text.cjs.map +1 -1
  74. package/dist/components/fx-text.d.cts +3 -1
  75. package/dist/components/fx-text.d.ts +3 -1
  76. package/dist/components/fx-text.js +9 -4
  77. package/dist/components/fx-text.js.map +1 -1
  78. package/dist/components/fx-transitions.cjs +8 -2
  79. package/dist/components/fx-transitions.cjs.map +1 -1
  80. package/dist/components/fx-transitions.d.cts +3 -1
  81. package/dist/components/fx-transitions.d.ts +3 -1
  82. package/dist/components/fx-transitions.js +10 -5
  83. package/dist/components/fx-transitions.js.map +1 -1
  84. package/dist/components/fx-weather.cjs +271 -0
  85. package/dist/components/fx-weather.cjs.map +1 -0
  86. package/dist/components/fx-weather.d.cts +72 -0
  87. package/dist/components/fx-weather.d.ts +72 -0
  88. package/dist/components/fx-weather.js +266 -0
  89. package/dist/components/fx-weather.js.map +1 -0
  90. package/dist/components/fx.js +5 -5
  91. package/dist/components/fx2.cjs +49 -10
  92. package/dist/components/fx2.cjs.map +1 -1
  93. package/dist/components/fx2.d.cts +181 -4
  94. package/dist/components/fx2.d.ts +181 -4
  95. package/dist/components/fx2.js +42 -22
  96. package/dist/components/fx2.js.map +1 -1
  97. package/dist/components/gesture.js +4 -4
  98. package/dist/components/interaction.cjs +1 -0
  99. package/dist/components/interaction.cjs.map +1 -1
  100. package/dist/components/interaction.js +2 -1
  101. package/dist/components/interaction.js.map +1 -1
  102. package/dist/components/layout.js +1 -1
  103. package/dist/components/lite.cjs +2 -0
  104. package/dist/components/lite.cjs.map +1 -1
  105. package/dist/components/lite.js +2 -0
  106. package/dist/components/lite.js.map +1 -1
  107. package/dist/components/marketplace.cjs +82 -0
  108. package/dist/components/marketplace.cjs.map +1 -0
  109. package/dist/components/marketplace.d.cts +108 -0
  110. package/dist/components/marketplace.d.ts +108 -0
  111. package/dist/components/marketplace.js +77 -0
  112. package/dist/components/marketplace.js.map +1 -0
  113. package/dist/components/packs.js +1 -1
  114. package/dist/components/page.js +3 -3
  115. package/dist/components/perf.js +2 -2
  116. package/dist/components/physics.js +3 -3
  117. package/dist/components/reveal.js +1 -1
  118. package/dist/components/solid.js +7 -7
  119. package/dist/components/svelte.js +7 -7
  120. package/dist/components/svg.js +1 -1
  121. package/dist/components/text.js +2 -2
  122. package/dist/components/timeline.js +3 -3
  123. package/dist/components/transitions.js +1 -1
  124. package/dist/components/ui.cjs +1 -0
  125. package/dist/components/ui.cjs.map +1 -1
  126. package/dist/components/ui.js +5 -4
  127. package/dist/components/ui.js.map +1 -1
  128. package/dist/components/vue.js +7 -7
  129. package/dist/components/webgl.js +1 -1
  130. package/dist/components/widgets.cjs +1189 -45
  131. package/dist/components/widgets.cjs.map +1 -1
  132. package/dist/components/widgets.d.cts +177 -2
  133. package/dist/components/widgets.d.ts +177 -2
  134. package/dist/components/widgets.js +1179 -48
  135. package/dist/components/widgets.js.map +1 -1
  136. package/dist/components.js +9 -9
  137. package/dist/components.umd.js +2 -2
  138. package/dist/components.umd.js.map +1 -1
  139. package/dist/index.js +2 -2
  140. package/dist/widgets.umd.js +1 -1
  141. package/dist/widgets.umd.js.map +1 -1
  142. package/docs/ROADMAP.md +2 -2
  143. package/docs/components.md +55 -0
  144. package/docs/deprecations.md +4 -0
  145. package/docs/upgrading-7.md +33 -0
  146. package/package.json +43 -2
  147. package/dist/chunks/gpu-BBRLgEzM.cjs.map +0 -1
  148. package/dist/chunks/gpu-CsP2ZB3x.js.map +0 -1
@@ -0,0 +1,350 @@
1
+ 'use strict';
2
+
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
+ var registry = require('../chunks/registry-DehBVRDV.cjs');
5
+ var generative = require('../chunks/generative-BHIj-NU0.cjs');
6
+ require('../chunks/shared-jkgRH-Hx.cjs');
7
+
8
+ /** A minimal Verlet world: points, distance sticks, gravity, damping. */
9
+ class VerletWorld {
10
+ constructor(gravity = 900, damping = 0.99, iterations = 4) {
11
+ this.gravity = gravity;
12
+ this.damping = damping;
13
+ this.iterations = iterations;
14
+ this.points = [];
15
+ this.sticks = [];
16
+ }
17
+ add(x, y, pinned = false) {
18
+ this.points.push({ x, y, px: x, py: y, pinned });
19
+ return this.points.length - 1;
20
+ }
21
+ link(a, b, len) {
22
+ const p = this.points[a];
23
+ const q = this.points[b];
24
+ this.sticks.push([a, b, len ?? Math.hypot(p.x - q.x, p.y - q.y)]);
25
+ }
26
+ step(dt, bounds) {
27
+ const g = this.gravity * dt * dt;
28
+ for (const p of this.points) {
29
+ if (p.pinned)
30
+ continue;
31
+ const vx = (p.x - p.px) * this.damping;
32
+ const vy = (p.y - p.py) * this.damping;
33
+ p.px = p.x;
34
+ p.py = p.y;
35
+ p.x += vx;
36
+ p.y += vy + g;
37
+ }
38
+ for (let k = 0; k < this.iterations; k++) {
39
+ for (const [a, b, len] of this.sticks) {
40
+ const p = this.points[a];
41
+ const q = this.points[b];
42
+ const dx = q.x - p.x;
43
+ const dy = q.y - p.y;
44
+ const d = Math.hypot(dx, dy) || 1e-6;
45
+ const diff = (d - len) / d / (p.pinned || q.pinned ? 1 : 2);
46
+ if (!p.pinned)
47
+ (p.x += dx * diff), (p.y += dy * diff);
48
+ if (!q.pinned)
49
+ (q.x -= dx * diff), (q.y -= dy * diff);
50
+ }
51
+ if (bounds)
52
+ for (const p of this.points)
53
+ (p.x = Math.min(bounds.w, Math.max(0, p.x))), (p.y = Math.min(bounds.h, Math.max(0, p.y)));
54
+ }
55
+ }
56
+ /** Push points within `r` px of (x, y) by (dx, dy). */
57
+ push(x, y, dx, dy, r = 40) {
58
+ for (const p of this.points)
59
+ if (!p.pinned && Math.hypot(p.x - x, p.y - y) < r)
60
+ (p.x += dx), (p.y += dy);
61
+ }
62
+ }
63
+ const bg = (name, description, defaults, spec) => ({
64
+ name,
65
+ kind: 'background',
66
+ description,
67
+ reduced: 'run',
68
+ defaults: { speed: 1, quality: 1, ...defaults },
69
+ run: (el, o, ctx) => {
70
+ const stop = generative.canvasBackground(el, ctx, spec(el), o);
71
+ ctx.onCleanup(stop);
72
+ return stop;
73
+ },
74
+ });
75
+ /** Pointer position relative to `el` plus the movement since the last read. */
76
+ function pointer(el) {
77
+ const s = { x: -999, y: -999, dx: 0, dy: 0, down: false, clicks: 0 };
78
+ const move = (e) => {
79
+ const r = el.getBoundingClientRect();
80
+ const x = e.clientX - r.left;
81
+ const y = e.clientY - r.top;
82
+ if (s.x > -999)
83
+ (s.dx += x - s.x), (s.dy += y - s.y);
84
+ s.x = x;
85
+ s.y = y;
86
+ };
87
+ const click = () => s.clicks++;
88
+ const leave = () => (s.x = s.y = -999);
89
+ el.addEventListener('pointermove', move);
90
+ el.addEventListener('pointerdown', click);
91
+ el.addEventListener('pointerleave', leave);
92
+ return { s, off: () => (el.removeEventListener('pointermove', move), el.removeEventListener('pointerdown', click), el.removeEventListener('pointerleave', leave)) };
93
+ }
94
+ const tick = (state, t) => {
95
+ const dt = state.last ? Math.min(1 / 30, t - state.last) : 1 / 60;
96
+ state.last = t;
97
+ return dt;
98
+ };
99
+ const PHYSICS2_FX = [
100
+ {
101
+ name: 'soft-body',
102
+ kind: 'hover',
103
+ description: 'The element wobbles like jelly: pointer motion pushes a damped spring that squashes and skews it (`stiffness`, `damping`, `amount`).',
104
+ defaults: { stiffness: 220, damping: 9, amount: 1 },
105
+ reduced: 'skip',
106
+ run: (el, o, ctx) => {
107
+ let vx = 0;
108
+ let x = 0;
109
+ let vy = 0;
110
+ let y = 0;
111
+ let raf = 0;
112
+ let lx = NaN;
113
+ let ly = NaN;
114
+ let last = 0;
115
+ const prev = el.style.transform;
116
+ const loop = (now) => {
117
+ const dt = last ? Math.min(0.033, (now - last) / 1000) : 1 / 60;
118
+ last = now;
119
+ vx += (-o.stiffness * x - o.damping * vx) * dt;
120
+ vy += (-o.stiffness * y - o.damping * vy) * dt;
121
+ x += vx * dt;
122
+ y += vy * dt;
123
+ const a = o.amount;
124
+ el.style.transform = `skew(${(x * 0.6 * a).toFixed(2)}deg,${(y * 0.25 * a).toFixed(2)}deg) scale(${(1 + y * 0.004 * a).toFixed(4)},${(1 - y * 0.004 * a).toFixed(4)})`;
125
+ if (Math.abs(x) + Math.abs(vx) + Math.abs(y) + Math.abs(vy) > 0.02)
126
+ raf = requestAnimationFrame(loop);
127
+ else
128
+ ((raf = 0), (last = 0), (el.style.transform = prev));
129
+ };
130
+ const move = (e) => {
131
+ if (!Number.isNaN(lx))
132
+ (vx += Math.max(-60, Math.min(60, (e.clientX - lx) * 4))), (vy += Math.max(-60, Math.min(60, (e.clientY - ly) * 4)));
133
+ lx = e.clientX;
134
+ ly = e.clientY;
135
+ if (!raf && typeof requestAnimationFrame === 'function')
136
+ raf = requestAnimationFrame(loop);
137
+ };
138
+ const leave = () => (lx = ly = NaN);
139
+ el.addEventListener('pointermove', move);
140
+ el.addEventListener('pointerleave', leave);
141
+ const stop = () => {
142
+ el.removeEventListener('pointermove', move);
143
+ el.removeEventListener('pointerleave', leave);
144
+ if (raf)
145
+ cancelAnimationFrame(raf);
146
+ el.style.transform = prev;
147
+ };
148
+ ctx.onCleanup(stop);
149
+ return stop;
150
+ },
151
+ },
152
+ {
153
+ name: 'magnet',
154
+ kind: 'hover',
155
+ description: "The element's children are pulled toward the pointer on springs and settle back when it leaves (`strength`, `radius`).",
156
+ defaults: { strength: 0.35, radius: 160 },
157
+ reduced: 'skip',
158
+ run: (el, o, ctx) => {
159
+ const kids = Array.from(el.children);
160
+ const prev = kids.map((k) => k.style.transform);
161
+ kids.forEach((k) => (k.style.transition = 'transform .45s cubic-bezier(.3,1.5,.5,1)'));
162
+ const move = (e) => {
163
+ for (const k of kids) {
164
+ const r = k.getBoundingClientRect();
165
+ const dx = e.clientX - (r.left + r.width / 2);
166
+ const dy = e.clientY - (r.top + r.height / 2);
167
+ const d = Math.hypot(dx, dy);
168
+ const f = d < o.radius ? o.strength * (1 - d / o.radius) : 0;
169
+ k.style.transform = `translate(${(dx * f).toFixed(1)}px,${(dy * f).toFixed(1)}px)`;
170
+ }
171
+ };
172
+ const leave = () => kids.forEach((k, i) => (k.style.transform = prev[i]));
173
+ el.addEventListener('pointermove', move);
174
+ el.addEventListener('pointerleave', leave);
175
+ const stop = () => {
176
+ el.removeEventListener('pointermove', move);
177
+ el.removeEventListener('pointerleave', leave);
178
+ kids.forEach((k, i) => ((k.style.transform = prev[i]), (k.style.transition = '')));
179
+ };
180
+ ctx.onCleanup(stop);
181
+ return stop;
182
+ },
183
+ },
184
+ bg('cloth', 'A cloth hangs from the top edge and ripples when the pointer moves through it (Verlet, Canvas 2D).', { cols: 16, rows: 10, color: '#7c5cff' }, (el) => {
185
+ const p = pointer(el);
186
+ return {
187
+ init: (w, h, o) => {
188
+ const world = new VerletWorld(600, 0.985, 3);
189
+ const sx = (w * 0.86) / (o.cols - 1);
190
+ const sy = (h * 0.75) / (o.rows - 1);
191
+ for (let r = 0; r < o.rows; r++)
192
+ for (let c = 0; c < o.cols; c++)
193
+ world.add(w * 0.07 + c * sx, 6 + r * sy, r === 0 && c % 3 === 0);
194
+ for (let r = 0; r < o.rows; r++)
195
+ for (let c = 0; c < o.cols; c++) {
196
+ const i = r * o.cols + c;
197
+ if (c)
198
+ world.link(i - 1, i);
199
+ if (r)
200
+ world.link(i - o.cols, i);
201
+ }
202
+ return { world, off: p.off };
203
+ },
204
+ draw: ({ ctx, w, h, t, state, o }) => {
205
+ const dt = tick(state, t);
206
+ const world = state.world;
207
+ if (t > 0) {
208
+ if (p.s.x > -999)
209
+ world.push(p.s.x, p.s.y, p.s.dx * 0.6, p.s.dy * 0.6, 50);
210
+ p.s.dx = p.s.dy = 0;
211
+ world.step(dt * o.speed, { w, h });
212
+ }
213
+ ctx.clearRect(0, 0, w, h);
214
+ for (let r = 0; r < o.rows - 1; r++)
215
+ for (let c = 0; c < o.cols - 1; c++) {
216
+ const i = r * o.cols + c;
217
+ const a = world.points[i];
218
+ const b = world.points[i + 1];
219
+ const d = world.points[i + o.cols + 1];
220
+ const e = world.points[i + o.cols];
221
+ const shade = 0.55 + 0.45 * Math.max(0, Math.min(1, (b.x - a.x) / ((w * 0.86) / (o.cols - 1))));
222
+ ctx.globalAlpha = shade;
223
+ ctx.fillStyle = (r + c) % 2 ? o.color : '#22d3ee';
224
+ ctx.beginPath();
225
+ ctx.moveTo(a.x, a.y);
226
+ ctx.lineTo(b.x, b.y);
227
+ ctx.lineTo(d.x, d.y);
228
+ ctx.lineTo(e.x, e.y);
229
+ ctx.fill();
230
+ }
231
+ ctx.globalAlpha = 1;
232
+ },
233
+ };
234
+ }),
235
+ bg('rope', 'A rope with a weight swings from the top; the pointer pushes it (Verlet, Canvas 2D).', { links: 14, color: '#f59e0b' }, (el) => {
236
+ const p = pointer(el);
237
+ return {
238
+ init: (w, h, o) => {
239
+ const world = new VerletWorld(900, 0.995, 6);
240
+ const len = (h * 0.7) / o.links;
241
+ for (let i = 0; i <= o.links; i++)
242
+ world.add(w / 2 + i * len * 0.6, 4 + i * len * 0.8, i === 0);
243
+ for (let i = 1; i <= o.links; i++)
244
+ world.link(i - 1, i, len);
245
+ return { world, off: p.off };
246
+ },
247
+ draw: ({ ctx, w, h, t, state, o }) => {
248
+ const dt = tick(state, t);
249
+ const world = state.world;
250
+ if (t > 0) {
251
+ if (p.s.x > -999)
252
+ world.push(p.s.x, p.s.y, p.s.dx, p.s.dy, 36);
253
+ p.s.dx = p.s.dy = 0;
254
+ world.step(dt * o.speed, { w, h });
255
+ }
256
+ ctx.clearRect(0, 0, w, h);
257
+ ctx.strokeStyle = o.color;
258
+ ctx.lineWidth = 3;
259
+ ctx.lineCap = 'round';
260
+ ctx.beginPath();
261
+ world.points.forEach((q, i) => (i ? ctx.lineTo(q.x, q.y) : ctx.moveTo(q.x, q.y)));
262
+ ctx.stroke();
263
+ const end = world.points[world.points.length - 1];
264
+ ctx.fillStyle = o.color;
265
+ ctx.beginPath();
266
+ ctx.arc(end.x, end.y, 11, 0, Math.PI * 2);
267
+ ctx.fill();
268
+ },
269
+ };
270
+ }),
271
+ bg('pinball', 'Balls fall through round bumpers that light up on a hit; click to drop another ball (Canvas 2D).', { balls: 5, bumpers: 7, colors: ['#f43f5e', '#f59e0b', '#22d3ee', '#a3e635'] }, (el) => {
272
+ const p = pointer(el);
273
+ return {
274
+ init: (w, h, o) => {
275
+ const ball = () => ({ x: w * (0.3 + Math.random() * 0.4), y: -10 - Math.random() * h * 0.5, vx: (Math.random() - 0.5) * 80, vy: 0 });
276
+ const bumpers = Array.from({ length: o.bumpers }, (_, i) => ({ x: w * (0.15 + ((i * 0.37) % 0.7)), y: h * (0.25 + ((i * 0.53) % 0.6)), r: Math.min(w, h) * 0.06, hit: 0 }));
277
+ return { balls: Array.from({ length: o.balls }, ball), bumpers, ball, clicks: 0, off: p.off };
278
+ },
279
+ draw: ({ ctx, w, h, t, state, o }) => {
280
+ const dt = tick(state, t) * o.speed;
281
+ if (p.s.clicks !== state.clicks) {
282
+ state.clicks = p.s.clicks;
283
+ const b = state.ball();
284
+ if (p.s.x > -999)
285
+ b.x = p.s.x;
286
+ b.y = 0;
287
+ state.balls.push(b);
288
+ if (state.balls.length > 24)
289
+ state.balls.shift();
290
+ }
291
+ ctx.clearRect(0, 0, w, h);
292
+ for (const bu of state.bumpers) {
293
+ bu.hit = Math.max(0, bu.hit - dt * 2.5);
294
+ ctx.fillStyle = `rgba(124,92,255,${0.35 + bu.hit * 0.65})`;
295
+ ctx.shadowColor = '#a78bfa';
296
+ ctx.shadowBlur = bu.hit * 20;
297
+ ctx.beginPath();
298
+ ctx.arc(bu.x, bu.y, bu.r * (1 + bu.hit * 0.15), 0, Math.PI * 2);
299
+ ctx.fill();
300
+ }
301
+ ctx.shadowBlur = 0;
302
+ state.balls.forEach((b, i) => {
303
+ if (t > 0) {
304
+ b.vy += 600 * dt;
305
+ b.x += b.vx * dt;
306
+ b.y += b.vy * dt;
307
+ for (const bu of state.bumpers) {
308
+ const dx = b.x - bu.x;
309
+ const dy = b.y - bu.y;
310
+ const d = Math.hypot(dx, dy);
311
+ if (d < bu.r + 6 && d > 0) {
312
+ const nx = dx / d;
313
+ const ny = dy / d;
314
+ const dot = b.vx * nx + b.vy * ny;
315
+ b.vx = (b.vx - 2 * dot * nx) * 0.92;
316
+ b.vy = (b.vy - 2 * dot * ny) * 0.92;
317
+ b.x = bu.x + nx * (bu.r + 6);
318
+ b.y = bu.y + ny * (bu.r + 6);
319
+ bu.hit = 1;
320
+ }
321
+ }
322
+ if (b.x < 6 || b.x > w - 6)
323
+ (b.vx *= -0.8), (b.x = Math.min(w - 6, Math.max(6, b.x)));
324
+ if (b.y > h + 12)
325
+ Object.assign(b, state.ball());
326
+ }
327
+ ctx.fillStyle = o.colors[i % o.colors.length];
328
+ ctx.beginPath();
329
+ ctx.arc(b.x, b.y, 6, 0, Math.PI * 2);
330
+ ctx.fill();
331
+ });
332
+ },
333
+ };
334
+ }),
335
+ ];
336
+ /** Register the 6.8 physics 2.0 pack (idempotent). */
337
+ function registerPhysicsPack() {
338
+ registry.registerEffects(PHYSICS2_FX);
339
+ }
340
+ /** @deprecated since 6.9 — use `registerPhysicsPack()` (removed in 7.0; `npx usa-codemod-7`). */
341
+ function registerPhysicsEffects2() {
342
+ base.deprecate('registerPhysicsEffects2', 'registerPhysicsEffects2() is deprecated since 6.9 and removed in 7.0 — use registerPhysicsPack() (npx usa-codemod-7).');
343
+ registerPhysicsPack();
344
+ }
345
+
346
+ exports.PHYSICS2_FX = PHYSICS2_FX;
347
+ exports.VerletWorld = VerletWorld;
348
+ exports.registerPhysicsEffects2 = registerPhysicsEffects2;
349
+ exports.registerPhysicsPack = registerPhysicsPack;
350
+ //# sourceMappingURL=fx-physics.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-physics.cjs","sources":["../../src/components/fx2/physics2.ts"],"sourcesContent":["/**\n * 6.8 — Interactive physics 2.0 (`motionary/components/fx-physics`) on a tiny\n * Verlet integrator (`VerletWorld`), registered through `registerEffect()`:\n *\n * - `soft-body` (kind `hover`) — the element wobbles like jelly: pointer\n * motion pushes a damped spring that squashes and skews it.\n * - `magnet` (kind `hover`) — the element's children are pulled toward the\n * pointer on springs and settle back when it leaves.\n * - `cloth` (kind `background`) — a cloth hangs from the top edge and ripples\n * when the pointer moves through it.\n * - `rope` (kind `background`) — a rope with a weight swings from the top;\n * the pointer pushes it.\n * - `pinball` (kind `background`) — balls fall through round bumpers that\n * light up on a hit; click to drop another ball.\n *\n * Canvas effects render only while visible; reduced motion draws one static\n * frame and the hover effects do nothing.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { deprecate } from '../base';\nimport { registerEffects } from '../fx/registry';\nimport { canvasBackground, type GenerativeSpec } from '../effects/generative';\n\nexport interface VerletPoint {\n x: number;\n y: number;\n px: number;\n py: number;\n pinned: boolean;\n}\n\n/** A minimal Verlet world: points, distance sticks, gravity, damping. */\nexport class VerletWorld {\n points: VerletPoint[] = [];\n sticks: [number, number, number][] = [];\n constructor(public gravity = 900, public damping = 0.99, public iterations = 4) {}\n add(x: number, y: number, pinned = false): number {\n this.points.push({ x, y, px: x, py: y, pinned });\n return this.points.length - 1;\n }\n link(a: number, b: number, len?: number): void {\n const p = this.points[a];\n const q = this.points[b];\n this.sticks.push([a, b, len ?? Math.hypot(p.x - q.x, p.y - q.y)]);\n }\n step(dt: number, bounds?: { w: number; h: number }): void {\n const g = this.gravity * dt * dt;\n for (const p of this.points) {\n if (p.pinned) continue;\n const vx = (p.x - p.px) * this.damping;\n const vy = (p.y - p.py) * this.damping;\n p.px = p.x;\n p.py = p.y;\n p.x += vx;\n p.y += vy + g;\n }\n for (let k = 0; k < this.iterations; k++) {\n for (const [a, b, len] of this.sticks) {\n const p = this.points[a];\n const q = this.points[b];\n const dx = q.x - p.x;\n const dy = q.y - p.y;\n const d = Math.hypot(dx, dy) || 1e-6;\n const diff = (d - len) / d / (p.pinned || q.pinned ? 1 : 2);\n if (!p.pinned) (p.x += dx * diff), (p.y += dy * diff);\n if (!q.pinned) (q.x -= dx * diff), (q.y -= dy * diff);\n }\n if (bounds) for (const p of this.points) (p.x = Math.min(bounds.w, Math.max(0, p.x))), (p.y = Math.min(bounds.h, Math.max(0, p.y)));\n }\n }\n /** Push points within `r` px of (x, y) by (dx, dy). */\n push(x: number, y: number, dx: number, dy: number, r = 40): void {\n for (const p of this.points) if (!p.pinned && Math.hypot(p.x - x, p.y - y) < r) (p.x += dx), (p.y += dy);\n }\n}\n\nconst bg = (name: string, description: string, defaults: Record<string, unknown>, spec: (el: HTMLElement) => GenerativeSpec): EffectDefinition => ({\n name,\n kind: 'background',\n description,\n reduced: 'run',\n defaults: { speed: 1, quality: 1, ...defaults },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const stop = canvasBackground(el, ctx, spec(el), o);\n ctx.onCleanup(stop);\n return stop;\n },\n});\n\n/** Pointer position relative to `el` plus the movement since the last read. */\nfunction pointer(el: HTMLElement) {\n const s = { x: -999, y: -999, dx: 0, dy: 0, down: false, clicks: 0 };\n const move = (e: PointerEvent) => {\n const r = el.getBoundingClientRect();\n const x = e.clientX - r.left;\n const y = e.clientY - r.top;\n if (s.x > -999) (s.dx += x - s.x), (s.dy += y - s.y);\n s.x = x;\n s.y = y;\n };\n const click = () => s.clicks++;\n const leave = () => (s.x = s.y = -999);\n el.addEventListener('pointermove', move);\n el.addEventListener('pointerdown', click);\n el.addEventListener('pointerleave', leave);\n return { s, off: () => (el.removeEventListener('pointermove', move), el.removeEventListener('pointerdown', click), el.removeEventListener('pointerleave', leave)) };\n}\n\nconst tick = (state: any, t: number) => {\n const dt = state.last ? Math.min(1 / 30, t - state.last) : 1 / 60;\n state.last = t;\n return dt;\n};\n\nexport const PHYSICS2_FX: EffectDefinition[] = [\n {\n name: 'soft-body',\n kind: 'hover',\n description: 'The element wobbles like jelly: pointer motion pushes a damped spring that squashes and skews it (`stiffness`, `damping`, `amount`).',\n defaults: { stiffness: 220, damping: 9, amount: 1 },\n reduced: 'skip',\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n let vx = 0;\n let x = 0;\n let vy = 0;\n let y = 0;\n let raf = 0;\n let lx = NaN;\n let ly = NaN;\n let last = 0;\n const prev = el.style.transform;\n const loop = (now: number) => {\n const dt = last ? Math.min(0.033, (now - last) / 1000) : 1 / 60;\n last = now;\n vx += (-o.stiffness * x - o.damping * vx) * dt;\n vy += (-o.stiffness * y - o.damping * vy) * dt;\n x += vx * dt;\n y += vy * dt;\n const a = o.amount;\n el.style.transform = `skew(${(x * 0.6 * a).toFixed(2)}deg,${(y * 0.25 * a).toFixed(2)}deg) scale(${(1 + y * 0.004 * a).toFixed(4)},${(1 - y * 0.004 * a).toFixed(4)})`;\n if (Math.abs(x) + Math.abs(vx) + Math.abs(y) + Math.abs(vy) > 0.02) raf = requestAnimationFrame(loop);\n else ((raf = 0), (last = 0), (el.style.transform = prev));\n };\n const move = (e: PointerEvent) => {\n if (!Number.isNaN(lx)) (vx += Math.max(-60, Math.min(60, (e.clientX - lx) * 4))), (vy += Math.max(-60, Math.min(60, (e.clientY - ly) * 4)));\n lx = e.clientX;\n ly = e.clientY;\n if (!raf && typeof requestAnimationFrame === 'function') raf = requestAnimationFrame(loop);\n };\n const leave = () => (lx = ly = NaN);\n el.addEventListener('pointermove', move);\n el.addEventListener('pointerleave', leave);\n const stop = () => {\n el.removeEventListener('pointermove', move);\n el.removeEventListener('pointerleave', leave);\n if (raf) cancelAnimationFrame(raf);\n el.style.transform = prev;\n };\n ctx.onCleanup(stop);\n return stop;\n },\n },\n {\n name: 'magnet',\n kind: 'hover',\n description: \"The element's children are pulled toward the pointer on springs and settle back when it leaves (`strength`, `radius`).\",\n defaults: { strength: 0.35, radius: 160 },\n reduced: 'skip',\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const kids = Array.from(el.children) as HTMLElement[];\n const prev = kids.map((k) => k.style.transform);\n kids.forEach((k) => (k.style.transition = 'transform .45s cubic-bezier(.3,1.5,.5,1)'));\n const move = (e: PointerEvent) => {\n for (const k of kids) {\n const r = k.getBoundingClientRect();\n const dx = e.clientX - (r.left + r.width / 2);\n const dy = e.clientY - (r.top + r.height / 2);\n const d = Math.hypot(dx, dy);\n const f = d < o.radius ? o.strength * (1 - d / o.radius) : 0;\n k.style.transform = `translate(${(dx * f).toFixed(1)}px,${(dy * f).toFixed(1)}px)`;\n }\n };\n const leave = () => kids.forEach((k, i) => (k.style.transform = prev[i]));\n el.addEventListener('pointermove', move);\n el.addEventListener('pointerleave', leave);\n const stop = () => {\n el.removeEventListener('pointermove', move);\n el.removeEventListener('pointerleave', leave);\n kids.forEach((k, i) => ((k.style.transform = prev[i]), (k.style.transition = '')));\n };\n ctx.onCleanup(stop);\n return stop;\n },\n },\n bg('cloth', 'A cloth hangs from the top edge and ripples when the pointer moves through it (Verlet, Canvas 2D).', { cols: 16, rows: 10, color: '#7c5cff' }, (el) => {\n const p = pointer(el);\n return {\n init: (w, h, o) => {\n const world = new VerletWorld(600, 0.985, 3);\n const sx = (w * 0.86) / (o.cols - 1);\n const sy = (h * 0.75) / (o.rows - 1);\n for (let r = 0; r < o.rows; r++) for (let c = 0; c < o.cols; c++) world.add(w * 0.07 + c * sx, 6 + r * sy, r === 0 && c % 3 === 0);\n for (let r = 0; r < o.rows; r++)\n for (let c = 0; c < o.cols; c++) {\n const i = r * o.cols + c;\n if (c) world.link(i - 1, i);\n if (r) world.link(i - o.cols, i);\n }\n return { world, off: p.off };\n },\n draw: ({ ctx, w, h, t, state, o }) => {\n const dt = tick(state, t);\n const world: VerletWorld = state.world;\n if (t > 0) {\n if (p.s.x > -999) world.push(p.s.x, p.s.y, p.s.dx * 0.6, p.s.dy * 0.6, 50);\n p.s.dx = p.s.dy = 0;\n world.step(dt * o.speed, { w, h });\n }\n ctx.clearRect(0, 0, w, h);\n for (let r = 0; r < o.rows - 1; r++)\n for (let c = 0; c < o.cols - 1; c++) {\n const i = r * o.cols + c;\n const a = world.points[i];\n const b = world.points[i + 1];\n const d = world.points[i + o.cols + 1];\n const e = world.points[i + o.cols];\n const shade = 0.55 + 0.45 * Math.max(0, Math.min(1, (b.x - a.x) / ((w * 0.86) / (o.cols - 1))));\n ctx.globalAlpha = shade;\n ctx.fillStyle = (r + c) % 2 ? o.color : '#22d3ee';\n ctx.beginPath();\n ctx.moveTo(a.x, a.y);\n ctx.lineTo(b.x, b.y);\n ctx.lineTo(d.x, d.y);\n ctx.lineTo(e.x, e.y);\n ctx.fill();\n }\n ctx.globalAlpha = 1;\n },\n };\n }),\n bg('rope', 'A rope with a weight swings from the top; the pointer pushes it (Verlet, Canvas 2D).', { links: 14, color: '#f59e0b' }, (el) => {\n const p = pointer(el);\n return {\n init: (w, h, o) => {\n const world = new VerletWorld(900, 0.995, 6);\n const len = (h * 0.7) / o.links;\n for (let i = 0; i <= o.links; i++) world.add(w / 2 + i * len * 0.6, 4 + i * len * 0.8, i === 0);\n for (let i = 1; i <= o.links; i++) world.link(i - 1, i, len);\n return { world, off: p.off };\n },\n draw: ({ ctx, w, h, t, state, o }) => {\n const dt = tick(state, t);\n const world: VerletWorld = state.world;\n if (t > 0) {\n if (p.s.x > -999) world.push(p.s.x, p.s.y, p.s.dx, p.s.dy, 36);\n p.s.dx = p.s.dy = 0;\n world.step(dt * o.speed, { w, h });\n }\n ctx.clearRect(0, 0, w, h);\n ctx.strokeStyle = o.color;\n ctx.lineWidth = 3;\n ctx.lineCap = 'round';\n ctx.beginPath();\n world.points.forEach((q, i) => (i ? ctx.lineTo(q.x, q.y) : ctx.moveTo(q.x, q.y)));\n ctx.stroke();\n const end = world.points[world.points.length - 1];\n ctx.fillStyle = o.color;\n ctx.beginPath();\n ctx.arc(end.x, end.y, 11, 0, Math.PI * 2);\n ctx.fill();\n },\n };\n }),\n bg('pinball', 'Balls fall through round bumpers that light up on a hit; click to drop another ball (Canvas 2D).', { balls: 5, bumpers: 7, colors: ['#f43f5e', '#f59e0b', '#22d3ee', '#a3e635'] }, (el) => {\n const p = pointer(el);\n return {\n init: (w, h, o) => {\n const ball = () => ({ x: w * (0.3 + Math.random() * 0.4), y: -10 - Math.random() * h * 0.5, vx: (Math.random() - 0.5) * 80, vy: 0 });\n const bumpers = Array.from({ length: o.bumpers }, (_, i) => ({ x: w * (0.15 + ((i * 0.37) % 0.7)), y: h * (0.25 + ((i * 0.53) % 0.6)), r: Math.min(w, h) * 0.06, hit: 0 }));\n return { balls: Array.from({ length: o.balls }, ball), bumpers, ball, clicks: 0, off: p.off };\n },\n draw: ({ ctx, w, h, t, state, o }) => {\n const dt = tick(state, t) * o.speed;\n if (p.s.clicks !== state.clicks) {\n state.clicks = p.s.clicks;\n const b = state.ball();\n if (p.s.x > -999) b.x = p.s.x;\n b.y = 0;\n state.balls.push(b);\n if (state.balls.length > 24) state.balls.shift();\n }\n ctx.clearRect(0, 0, w, h);\n for (const bu of state.bumpers) {\n bu.hit = Math.max(0, bu.hit - dt * 2.5);\n ctx.fillStyle = `rgba(124,92,255,${0.35 + bu.hit * 0.65})`;\n ctx.shadowColor = '#a78bfa';\n ctx.shadowBlur = bu.hit * 20;\n ctx.beginPath();\n ctx.arc(bu.x, bu.y, bu.r * (1 + bu.hit * 0.15), 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.shadowBlur = 0;\n state.balls.forEach((b: any, i: number) => {\n if (t > 0) {\n b.vy += 600 * dt;\n b.x += b.vx * dt;\n b.y += b.vy * dt;\n for (const bu of state.bumpers) {\n const dx = b.x - bu.x;\n const dy = b.y - bu.y;\n const d = Math.hypot(dx, dy);\n if (d < bu.r + 6 && d > 0) {\n const nx = dx / d;\n const ny = dy / d;\n const dot = b.vx * nx + b.vy * ny;\n b.vx = (b.vx - 2 * dot * nx) * 0.92;\n b.vy = (b.vy - 2 * dot * ny) * 0.92;\n b.x = bu.x + nx * (bu.r + 6);\n b.y = bu.y + ny * (bu.r + 6);\n bu.hit = 1;\n }\n }\n if (b.x < 6 || b.x > w - 6) (b.vx *= -0.8), (b.x = Math.min(w - 6, Math.max(6, b.x)));\n if (b.y > h + 12) Object.assign(b, state.ball());\n }\n ctx.fillStyle = o.colors[i % o.colors.length];\n ctx.beginPath();\n ctx.arc(b.x, b.y, 6, 0, Math.PI * 2);\n ctx.fill();\n });\n },\n };\n }),\n];\n\n/** Register the 6.8 physics 2.0 pack (idempotent). */\nexport function registerPhysicsPack(): void {\n registerEffects(PHYSICS2_FX);\n}\n\n/** @deprecated since 6.9 — use `registerPhysicsPack()` (removed in 7.0; `npx usa-codemod-7`). */\nexport function registerPhysicsEffects2(): void {\n deprecate('registerPhysicsEffects2', 'registerPhysicsEffects2() is deprecated since 6.9 and removed in 7.0 — use registerPhysicsPack() (npx usa-codemod-7).');\n registerPhysicsPack();\n}\n"],"names":["canvasBackground","registerEffects","deprecate"],"mappings":";;;;;;;AA+BA;MACa,WAAW,CAAA;AAGtB,IAAA,WAAA,CAAmB,UAAU,GAAG,EAAS,UAAU,IAAI,EAAS,aAAa,CAAC,EAAA;QAA3D,IAAA,CAAA,OAAO,GAAP,OAAO;QAAe,IAAA,CAAA,OAAO,GAAP,OAAO;QAAgB,IAAA,CAAA,UAAU,GAAV,UAAU;QAF1E,IAAA,CAAA,MAAM,GAAkB,EAAE;QAC1B,IAAA,CAAA,MAAM,GAA+B,EAAE;IAC0C;AACjF,IAAA,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,MAAM,GAAG,KAAK,EAAA;QACtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AAChD,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;IAC/B;AACA,IAAA,IAAI,CAAC,CAAS,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CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,4BAAA,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,wBAAA,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE;4BAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;oBAClD;AACA,oBAAA,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;oBAC7C,GAAG,CAAC,SAAS,EAAE;oBACf,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;oBACpC,GAAG,CAAC,IAAI,EAAE;AACZ,gBAAA,CAAC,CAAC;YACJ,CAAC;SACF;AACH,IAAA,CAAC,CAAC;;AAGJ;SACgB,mBAAmB,GAAA;IACjCC,wBAAe,CAAC,WAAW,CAAC;AAC9B;AAEA;SACgB,uBAAuB,GAAA;AACrC,IAAAC,cAAS,CAAC,yBAAyB,EAAE,uHAAuH,CAAC;AAC7J,IAAA,mBAAmB,EAAE;AACvB;;;;;;;"}
@@ -0,0 +1,94 @@
1
+ type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
2
+ type Cleanup = () => void;
3
+
4
+ /**
5
+ * 5.0 — unified plugin-style effect registration. Every effect (built-in or
6
+ * yours) is a plain object registered once and played the same way:
7
+ * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
8
+ * `<usa-fx effect="name" trigger="click">`. Effects get a context that
9
+ * already applies reduced motion, motion sensitivity, intensity and the
10
+ * animation budget.
11
+ */
12
+
13
+ declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
14
+ type EffectKind = (typeof EFFECT_KINDS)[number];
15
+ interface EffectContext {
16
+ /** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
17
+ readonly reduced: boolean;
18
+ readonly sensitivity: MotionSensitivity;
19
+ /** The triggering event (pointer position for click effects), if any. */
20
+ readonly event?: Event;
21
+ /** `el.animate()` with the library's motion rules (may return `null`). */
22
+ animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
23
+ /** Register teardown for long-running effects (loops, listeners). */
24
+ onCleanup(fn: Cleanup): void;
25
+ }
26
+ interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
27
+ /** Unique, kebab-case. */
28
+ name: string;
29
+ kind: EffectKind;
30
+ /** One line for docs and the gallery. */
31
+ description?: string;
32
+ /** Option defaults (merged under the caller's options). */
33
+ defaults?: Partial<O>;
34
+ /**
35
+ * Under reduced motion: `'skip'` (do nothing — default for loop, background
36
+ * and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
37
+ * effect degrades itself — default for everything else).
38
+ */
39
+ reduced?: 'skip' | 'run';
40
+ /** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
41
+ run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
42
+ }
43
+
44
+ /**
45
+ * 6.8 — Interactive physics 2.0 (`motionary/components/fx-physics`) on a tiny
46
+ * Verlet integrator (`VerletWorld`), registered through `registerEffect()`:
47
+ *
48
+ * - `soft-body` (kind `hover`) — the element wobbles like jelly: pointer
49
+ * motion pushes a damped spring that squashes and skews it.
50
+ * - `magnet` (kind `hover`) — the element's children are pulled toward the
51
+ * pointer on springs and settle back when it leaves.
52
+ * - `cloth` (kind `background`) — a cloth hangs from the top edge and ripples
53
+ * when the pointer moves through it.
54
+ * - `rope` (kind `background`) — a rope with a weight swings from the top;
55
+ * the pointer pushes it.
56
+ * - `pinball` (kind `background`) — balls fall through round bumpers that
57
+ * light up on a hit; click to drop another ball.
58
+ *
59
+ * Canvas effects render only while visible; reduced motion draws one static
60
+ * frame and the hover effects do nothing.
61
+ */
62
+
63
+ interface VerletPoint {
64
+ x: number;
65
+ y: number;
66
+ px: number;
67
+ py: number;
68
+ pinned: boolean;
69
+ }
70
+ /** A minimal Verlet world: points, distance sticks, gravity, damping. */
71
+ declare class VerletWorld {
72
+ gravity: number;
73
+ damping: number;
74
+ iterations: number;
75
+ points: VerletPoint[];
76
+ sticks: [number, number, number][];
77
+ constructor(gravity?: number, damping?: number, iterations?: number);
78
+ add(x: number, y: number, pinned?: boolean): number;
79
+ link(a: number, b: number, len?: number): void;
80
+ step(dt: number, bounds?: {
81
+ w: number;
82
+ h: number;
83
+ }): void;
84
+ /** Push points within `r` px of (x, y) by (dx, dy). */
85
+ push(x: number, y: number, dx: number, dy: number, r?: number): void;
86
+ }
87
+ declare const PHYSICS2_FX: EffectDefinition[];
88
+ /** Register the 6.8 physics 2.0 pack (idempotent). */
89
+ declare function registerPhysicsPack(): void;
90
+ /** @deprecated since 6.9 — use `registerPhysicsPack()` (removed in 7.0; `npx usa-codemod-7`). */
91
+ declare function registerPhysicsEffects2(): void;
92
+
93
+ export { PHYSICS2_FX, VerletWorld, registerPhysicsEffects2, registerPhysicsPack };
94
+ export type { VerletPoint };
@@ -0,0 +1,94 @@
1
+ type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
2
+ type Cleanup = () => void;
3
+
4
+ /**
5
+ * 5.0 — unified plugin-style effect registration. Every effect (built-in or
6
+ * yours) is a plain object registered once and played the same way:
7
+ * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
8
+ * `<usa-fx effect="name" trigger="click">`. Effects get a context that
9
+ * already applies reduced motion, motion sensitivity, intensity and the
10
+ * animation budget.
11
+ */
12
+
13
+ declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
14
+ type EffectKind = (typeof EFFECT_KINDS)[number];
15
+ interface EffectContext {
16
+ /** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
17
+ readonly reduced: boolean;
18
+ readonly sensitivity: MotionSensitivity;
19
+ /** The triggering event (pointer position for click effects), if any. */
20
+ readonly event?: Event;
21
+ /** `el.animate()` with the library's motion rules (may return `null`). */
22
+ animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
23
+ /** Register teardown for long-running effects (loops, listeners). */
24
+ onCleanup(fn: Cleanup): void;
25
+ }
26
+ interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
27
+ /** Unique, kebab-case. */
28
+ name: string;
29
+ kind: EffectKind;
30
+ /** One line for docs and the gallery. */
31
+ description?: string;
32
+ /** Option defaults (merged under the caller's options). */
33
+ defaults?: Partial<O>;
34
+ /**
35
+ * Under reduced motion: `'skip'` (do nothing — default for loop, background
36
+ * and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
37
+ * effect degrades itself — default for everything else).
38
+ */
39
+ reduced?: 'skip' | 'run';
40
+ /** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
41
+ run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
42
+ }
43
+
44
+ /**
45
+ * 6.8 — Interactive physics 2.0 (`motionary/components/fx-physics`) on a tiny
46
+ * Verlet integrator (`VerletWorld`), registered through `registerEffect()`:
47
+ *
48
+ * - `soft-body` (kind `hover`) — the element wobbles like jelly: pointer
49
+ * motion pushes a damped spring that squashes and skews it.
50
+ * - `magnet` (kind `hover`) — the element's children are pulled toward the
51
+ * pointer on springs and settle back when it leaves.
52
+ * - `cloth` (kind `background`) — a cloth hangs from the top edge and ripples
53
+ * when the pointer moves through it.
54
+ * - `rope` (kind `background`) — a rope with a weight swings from the top;
55
+ * the pointer pushes it.
56
+ * - `pinball` (kind `background`) — balls fall through round bumpers that
57
+ * light up on a hit; click to drop another ball.
58
+ *
59
+ * Canvas effects render only while visible; reduced motion draws one static
60
+ * frame and the hover effects do nothing.
61
+ */
62
+
63
+ interface VerletPoint {
64
+ x: number;
65
+ y: number;
66
+ px: number;
67
+ py: number;
68
+ pinned: boolean;
69
+ }
70
+ /** A minimal Verlet world: points, distance sticks, gravity, damping. */
71
+ declare class VerletWorld {
72
+ gravity: number;
73
+ damping: number;
74
+ iterations: number;
75
+ points: VerletPoint[];
76
+ sticks: [number, number, number][];
77
+ constructor(gravity?: number, damping?: number, iterations?: number);
78
+ add(x: number, y: number, pinned?: boolean): number;
79
+ link(a: number, b: number, len?: number): void;
80
+ step(dt: number, bounds?: {
81
+ w: number;
82
+ h: number;
83
+ }): void;
84
+ /** Push points within `r` px of (x, y) by (dx, dy). */
85
+ push(x: number, y: number, dx: number, dy: number, r?: number): void;
86
+ }
87
+ declare const PHYSICS2_FX: EffectDefinition[];
88
+ /** Register the 6.8 physics 2.0 pack (idempotent). */
89
+ declare function registerPhysicsPack(): void;
90
+ /** @deprecated since 6.9 — use `registerPhysicsPack()` (removed in 7.0; `npx usa-codemod-7`). */
91
+ declare function registerPhysicsEffects2(): void;
92
+
93
+ export { PHYSICS2_FX, VerletWorld, registerPhysicsEffects2, registerPhysicsPack };
94
+ export type { VerletPoint };