motionary 6.9.0 → 7.1.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 +30 -0
- package/README.md +2 -2
- package/README_ja.md +2 -2
- package/README_zh.md +2 -2
- package/dist/chunks/audio-DcPvT2Kh.js +333 -0
- package/dist/chunks/audio-DcPvT2Kh.js.map +1 -0
- package/dist/chunks/audio-EXUoijsG.cjs +342 -0
- package/dist/chunks/audio-EXUoijsG.cjs.map +1 -0
- package/dist/chunks/{base-D5MHqeDd.js → base-2-yYc93C.js} +2 -2
- package/dist/chunks/{base-D5MHqeDd.js.map → base-2-yYc93C.js.map} +1 -1
- package/dist/chunks/{core-DyJu5r5a.js → core-D5rU0CV6.js} +2 -2
- package/dist/chunks/{core-DyJu5r5a.js.map → core-D5rU0CV6.js.map} +1 -1
- package/dist/chunks/{core-ZGo4hOEk.js → core-DuO-AVXL.js} +2 -2
- package/dist/chunks/{core-ZGo4hOEk.js.map → core-DuO-AVXL.js.map} +1 -1
- package/dist/chunks/{fx-DlGRMJ-Z.js → fx-CMxWNwH8.js} +2 -2
- package/dist/chunks/{fx-DlGRMJ-Z.js.map → fx-CMxWNwH8.js.map} +1 -1
- package/dist/chunks/{gpu-DPhMkJq6.js → gpu-DLPghVWr.js} +183 -11
- package/dist/chunks/gpu-DLPghVWr.js.map +1 -0
- package/dist/chunks/{gpu-C2D4T9Q-.cjs → gpu-Dx0H875w.cjs} +185 -9
- package/dist/chunks/gpu-Dx0H875w.cjs.map +1 -0
- package/dist/chunks/{index-tags-wv0R_vkO.cjs → index-tags-BTMwrfgV.cjs} +3 -3
- package/dist/chunks/index-tags-BTMwrfgV.cjs.map +1 -0
- package/dist/chunks/{index-tags-DucKMQr_.js → index-tags-C04JP8g4.js} +3 -3
- package/dist/chunks/index-tags-C04JP8g4.js.map +1 -0
- package/dist/chunks/{player-DH3TIz-t.js → player-DxvCYo7Q.js} +4 -4
- package/dist/chunks/{player-DH3TIz-t.js.map → player-DxvCYo7Q.js.map} +1 -1
- package/dist/chunks/{registry-CTLWeg-J.js → registry-CyKExAmE.js} +2 -2
- package/dist/chunks/{registry-CTLWeg-J.js.map → registry-CyKExAmE.js.map} +1 -1
- package/dist/chunks/{spring-B-9MZOrW.js → spring-BK8DiezC.js} +2 -2
- package/dist/chunks/{spring-B-9MZOrW.js.map → spring-BK8DiezC.js.map} +1 -1
- package/dist/chunks/{variants-CoZn3k_5.js → variants-BQ6bhzn4.js} +2 -2
- package/dist/chunks/{variants-CoZn3k_5.js.map → variants-BQ6bhzn4.js.map} +1 -1
- package/dist/components/a11y.cjs +1 -1
- package/dist/components/a11y.d.cts +2 -2
- package/dist/components/a11y.d.ts +2 -2
- package/dist/components/a11y.js +3 -3
- package/dist/components/angular.cjs +2 -2
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.d.cts +5 -36
- package/dist/components/angular.d.ts +5 -36
- package/dist/components/angular.js +9 -9
- 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 +11 -336
- package/dist/components/effects.cjs.map +1 -1
- package/dist/components/effects.js +9 -333
- package/dist/components/effects.js.map +1 -1
- package/dist/components/feedback.js +1 -1
- package/dist/components/fx-3d.cjs +1 -7
- package/dist/components/fx-3d.cjs.map +1 -1
- package/dist/components/fx-3d.d.cts +1 -3
- package/dist/components/fx-3d.d.ts +1 -3
- package/dist/components/fx-3d.js +3 -8
- package/dist/components/fx-3d.js.map +1 -1
- package/dist/components/fx-focus.js +2 -2
- package/dist/components/fx-gpu.cjs +2 -3
- package/dist/components/fx-gpu.cjs.map +1 -1
- package/dist/components/fx-gpu.d.cts +1 -3
- package/dist/components/fx-gpu.d.ts +1 -3
- package/dist/components/fx-gpu.js +3 -3
- package/dist/components/fx-light.cjs +1 -7
- package/dist/components/fx-light.cjs.map +1 -1
- package/dist/components/fx-light.d.cts +1 -3
- package/dist/components/fx-light.d.ts +1 -3
- package/dist/components/fx-light.js +3 -8
- package/dist/components/fx-light.js.map +1 -1
- package/dist/components/fx-morph.cjs +1 -7
- package/dist/components/fx-morph.cjs.map +1 -1
- package/dist/components/fx-morph.d.cts +1 -3
- package/dist/components/fx-morph.d.ts +1 -3
- package/dist/components/fx-morph.js +3 -8
- package/dist/components/fx-morph.js.map +1 -1
- package/dist/components/fx-music.cjs +179 -0
- package/dist/components/fx-music.cjs.map +1 -0
- package/dist/components/fx-music.d.cts +102 -0
- package/dist/components/fx-music.d.ts +102 -0
- package/dist/components/fx-music.js +174 -0
- package/dist/components/fx-music.js.map +1 -0
- package/dist/components/fx-physics.cjs +1 -7
- package/dist/components/fx-physics.cjs.map +1 -1
- package/dist/components/fx-physics.d.cts +1 -3
- package/dist/components/fx-physics.d.ts +1 -3
- package/dist/components/fx-physics.js +3 -8
- package/dist/components/fx-physics.js.map +1 -1
- package/dist/components/fx-text.cjs +1 -7
- package/dist/components/fx-text.cjs.map +1 -1
- package/dist/components/fx-text.d.cts +1 -3
- package/dist/components/fx-text.d.ts +1 -3
- package/dist/components/fx-text.js +3 -8
- package/dist/components/fx-text.js.map +1 -1
- package/dist/components/fx-transitions.cjs +1 -7
- package/dist/components/fx-transitions.cjs.map +1 -1
- package/dist/components/fx-transitions.d.cts +1 -3
- package/dist/components/fx-transitions.d.ts +1 -3
- package/dist/components/fx-transitions.js +4 -9
- package/dist/components/fx-transitions.js.map +1 -1
- package/dist/components/fx-weather.cjs +1 -7
- package/dist/components/fx-weather.cjs.map +1 -1
- package/dist/components/fx-weather.d.cts +1 -3
- package/dist/components/fx-weather.d.ts +1 -3
- package/dist/components/fx-weather.js +3 -8
- package/dist/components/fx-weather.js.map +1 -1
- package/dist/components/fx.js +5 -5
- package/dist/components/fx2.cjs +15 -19
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +97 -22
- package/dist/components/fx2.d.ts +97 -22
- package/dist/components/fx2.js +16 -19
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/gesture.js +4 -4
- package/dist/components/interaction.cjs +11 -95
- package/dist/components/interaction.cjs.map +1 -1
- package/dist/components/interaction.css +0 -1
- package/dist/components/interaction.d.cts +3 -21
- package/dist/components/interaction.d.ts +3 -21
- package/dist/components/interaction.js +13 -96
- package/dist/components/interaction.js.map +1 -1
- package/dist/components/jsx.d.cts +2 -2
- package/dist/components/jsx.d.ts +2 -2
- package/dist/components/layout.js +1 -1
- package/dist/components/lazy.cjs +1 -1
- package/dist/components/lazy.d.cts +2 -2
- package/dist/components/lazy.d.ts +2 -2
- package/dist/components/lazy.js +1 -1
- package/dist/components/lite.cjs +115 -258
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +116 -257
- package/dist/components/lite.js.map +1 -1
- package/dist/components/marketplace.js +2 -2
- package/dist/components/packs.js +1 -1
- package/dist/components/page.js +3 -3
- package/dist/components/perf.cjs +1 -1
- package/dist/components/perf.d.cts +2 -2
- package/dist/components/perf.d.ts +2 -2
- package/dist/components/perf.js +3 -3
- package/dist/components/physics.js +3 -3
- package/dist/components/react.cjs +2 -2
- package/dist/components/react.cjs.map +1 -1
- package/dist/components/react.js +2 -2
- package/dist/components/react.js.map +1 -1
- package/dist/components/reveal.js +1 -1
- package/dist/components/solid.cjs +2 -2
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.d.cts +4 -35
- package/dist/components/solid.d.ts +4 -35
- package/dist/components/solid.js +9 -9
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +2 -2
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.d.cts +5 -36
- package/dist/components/svelte.d.ts +5 -36
- package/dist/components/svelte.js +9 -9
- 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.cjs +16 -75
- package/dist/components/ui.cjs.map +1 -1
- package/dist/components/ui.css +0 -1
- package/dist/components/ui.d.cts +3 -18
- package/dist/components/ui.d.ts +3 -18
- package/dist/components/ui.js +21 -79
- package/dist/components/ui.js.map +1 -1
- package/dist/components/vue.cjs +2 -2
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +5 -36
- package/dist/components/vue.d.ts +5 -36
- package/dist/components/vue.js +9 -9
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +542 -61
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +79 -2
- package/dist/components/widgets.d.ts +79 -2
- package/dist/components/widgets.js +542 -67
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.cjs +1 -3
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +0 -2
- package/dist/components.d.cts +6 -39
- package/dist/components.d.ts +6 -39
- package/dist/components.js +12 -12
- 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 +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +12 -12
- package/docs/accessibility.md +2 -2
- package/docs/components.md +38 -2
- package/docs/frameworks-ssr.md +4 -4
- package/docs/hybrid-apps.md +2 -2
- package/docs/upgrading-7.md +11 -1
- package/docs/windows-apps.md +1 -1
- package/package.json +131 -1
- package/dist/chunks/gpu-C2D4T9Q-.cjs.map +0 -1
- package/dist/chunks/gpu-DPhMkJq6.js.map +0 -1
- package/dist/chunks/index-tags-DucKMQr_.js.map +0 -1
- package/dist/chunks/index-tags-wv0R_vkO.cjs.map +0 -1
|
@@ -122,8 +122,6 @@ declare function loadEffectPack(src: string | {
|
|
|
122
122
|
declare const GPU_FX: EffectDefinition[];
|
|
123
123
|
/** Register the 6.2 GPU pack (idempotent). */
|
|
124
124
|
declare function registerGpuPack(): void;
|
|
125
|
-
/** @deprecated since 6.9 — use `registerGpuPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
126
|
-
declare function registerGpuEffects(): void;
|
|
127
125
|
|
|
128
126
|
/**
|
|
129
127
|
* 6.3 — Text effects 3.0 (`motionary/components/fx-text`), registered through
|
|
@@ -150,8 +148,6 @@ declare function splitChars(el: HTMLElement): HTMLElement[];
|
|
|
150
148
|
declare const TEXT3_FX: EffectDefinition[];
|
|
151
149
|
/** Register the 6.3 text pack (idempotent). */
|
|
152
150
|
declare function registerTextPack(): void;
|
|
153
|
-
/** @deprecated since 6.9 — use `registerTextPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
154
|
-
declare function registerTextEffects3(): void;
|
|
155
151
|
|
|
156
152
|
/**
|
|
157
153
|
* 6.4 — Light & materials (`motionary/components/fx-light`), registered
|
|
@@ -180,8 +176,6 @@ declare function trackPointer(el: HTMLElement, ctx: EffectContext, fn: (x: numbe
|
|
|
180
176
|
declare const LIGHT_FX: EffectDefinition[];
|
|
181
177
|
/** Register the 6.4 light & materials pack (idempotent). */
|
|
182
178
|
declare function registerLightPack(): void;
|
|
183
|
-
/** @deprecated since 6.9 — use `registerLightPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
184
|
-
declare function registerLightEffects(): void;
|
|
185
179
|
|
|
186
180
|
/**
|
|
187
181
|
* 6.5 — 3D scene cards (`motionary/components/fx-3d`), registered through
|
|
@@ -205,8 +199,6 @@ declare function registerLightEffects(): void;
|
|
|
205
199
|
declare const DEPTH3_FX: EffectDefinition[];
|
|
206
200
|
/** Register the 6.5 3D pack (idempotent). */
|
|
207
201
|
declare function register3dPack(): void;
|
|
208
|
-
/** @deprecated since 6.9 — use `register3dPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
209
|
-
declare function register3dEffects(): void;
|
|
210
202
|
|
|
211
203
|
/**
|
|
212
204
|
* 6.6 — Morph & SVG 2.0 (`motionary/components/fx-morph`), registered
|
|
@@ -234,8 +226,6 @@ declare const pointsToPath: (pts: [number, number][]) => string;
|
|
|
234
226
|
declare const MORPH2_FX: EffectDefinition[];
|
|
235
227
|
/** Register the 6.6 morph & SVG pack (idempotent). */
|
|
236
228
|
declare function registerMorphPack(): void;
|
|
237
|
-
/** @deprecated since 6.9 — use `registerMorphPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
238
|
-
declare function registerMorphEffects2(): void;
|
|
239
229
|
|
|
240
230
|
/**
|
|
241
231
|
* 6.7 — Transitions 2.0 (`motionary/components/fx-transitions`), registered
|
|
@@ -269,8 +259,6 @@ declare function pageTransition(update: () => void | Promise<void>, effect?: str
|
|
|
269
259
|
declare function crossDocumentTransitions(effect?: string, duration?: number): () => void;
|
|
270
260
|
/** Register the 6.7 transitions pack (idempotent). */
|
|
271
261
|
declare function registerTransitionsPack(): void;
|
|
272
|
-
/** @deprecated since 6.9 — use `registerTransitionsPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
273
|
-
declare function registerTransitionEffects2(): void;
|
|
274
262
|
|
|
275
263
|
/**
|
|
276
264
|
* 6.8 — Weather & ambience (`motionary/components/fx-weather`), registered
|
|
@@ -297,8 +285,6 @@ declare function skyAt(hour: number): [string, string];
|
|
|
297
285
|
declare const WEATHER_FX: EffectDefinition[];
|
|
298
286
|
/** Register the 6.8 weather & ambience pack (idempotent). */
|
|
299
287
|
declare function registerWeatherPack(): void;
|
|
300
|
-
/** @deprecated since 6.9 — use `registerWeatherPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
301
|
-
declare function registerWeatherEffects(): void;
|
|
302
288
|
|
|
303
289
|
/**
|
|
304
290
|
* 6.8 — Interactive physics 2.0 (`motionary/components/fx-physics`) on a tiny
|
|
@@ -346,8 +332,6 @@ declare class VerletWorld {
|
|
|
346
332
|
declare const PHYSICS2_FX: EffectDefinition[];
|
|
347
333
|
/** Register the 6.8 physics 2.0 pack (idempotent). */
|
|
348
334
|
declare function registerPhysicsPack(): void;
|
|
349
|
-
/** @deprecated since 6.9 — use `registerPhysicsPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
350
|
-
declare function registerPhysicsEffects2(): void;
|
|
351
335
|
|
|
352
336
|
/**
|
|
353
337
|
* 6.9 — Focus & feedback (`motionary/components/fx-focus`), registered
|
|
@@ -370,6 +354,64 @@ declare const FOCUS_FX: EffectDefinition[];
|
|
|
370
354
|
/** Register the 6.9 focus & feedback pack (idempotent). */
|
|
371
355
|
declare function registerFocusPack(): void;
|
|
372
356
|
|
|
357
|
+
/**
|
|
358
|
+
* 5.6 — sound-reactive effects (Web Audio).
|
|
359
|
+
*
|
|
360
|
+
* - `enableAudio(input)` — start analysing the microphone (`'mic'`), an
|
|
361
|
+
* `<audio>` / `<video>` element (or a selector for one) or a `MediaStream`.
|
|
362
|
+
* Browsers only allow an `AudioContext` to start inside a user gesture, so
|
|
363
|
+
* call it from a click handler (or use `<usa-audio>`, which renders the
|
|
364
|
+
* toggle button for you).
|
|
365
|
+
* - Background effects (kind `background`, Canvas 2D through
|
|
366
|
+
* `canvasBackground()`): `spectrum-bars`, `pulse-ring`, `wave-ring`. Before
|
|
367
|
+
* audio is enabled they idle gently.
|
|
368
|
+
* - Beat detection: `createBeatDetector()` (pure: energy → beat?), `onBeat(cb)`
|
|
369
|
+
* and `bindBeat(el, effect, options)`, which plays any registered effect on
|
|
370
|
+
* every beat. `<usa-audio>` does the same for `[data-usa-beat="effect"]`
|
|
371
|
+
* children and emits `usa-beat`.
|
|
372
|
+
* - While audio runs, `--usa-audio-level` and `--usa-audio-bass` (0–1) are set
|
|
373
|
+
* on `<html>` for CSS-driven reactions.
|
|
374
|
+
*
|
|
375
|
+
* Reduced motion: the visual effects are skipped, beats play no effects and
|
|
376
|
+
* the CSS variables stay at 0 — audio itself keeps playing.
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
interface AudioSample {
|
|
380
|
+
/** Overall loudness (RMS of the waveform), 0–1. */
|
|
381
|
+
level: number;
|
|
382
|
+
/** Low-frequency energy (first ~8 % of the spectrum), 0–1. */
|
|
383
|
+
bass: number;
|
|
384
|
+
/** Frequency bins, 0–255 each. */
|
|
385
|
+
freq: Uint8Array;
|
|
386
|
+
/** Time-domain waveform, 0–255 (128 = silence). */
|
|
387
|
+
wave: Uint8Array;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* 7.1 — Music visualization (`motionary/fx/music`, also
|
|
392
|
+
* `motionary/components/fx-music`), registered through `registerEffect()`.
|
|
393
|
+
* Every effect reads the running analyser (`enableAudio()` / `<usa-audio>`);
|
|
394
|
+
* without one it plays a gentle synthetic signal (`syntheticSample()`), so
|
|
395
|
+
* the visuals work as decoration too.
|
|
396
|
+
*
|
|
397
|
+
* - `waveform-scope` (background) — an oscilloscope line of the waveform.
|
|
398
|
+
* - `radial-spectrum` (background) — spectrum bars around a circle.
|
|
399
|
+
* - `spectrum-mirror` (background) — mirrored bars with a reflection.
|
|
400
|
+
* - `sound-particles` (background) — particles launched by the bass.
|
|
401
|
+
* - `beat-bounce` (loop) — the element pumps with the bass.
|
|
402
|
+
* - `vinyl-spin` (loop) — the element turns like a record; level speeds it.
|
|
403
|
+
*
|
|
404
|
+
* Reduced motion: backgrounds draw one static frame, loops do nothing.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
/** A smooth, deterministic fake analyser frame at time `t` (s). */
|
|
408
|
+
declare function syntheticSample(t: number, bins?: number): AudioSample;
|
|
409
|
+
/** The live analyser frame, or the synthetic one. */
|
|
410
|
+
declare const musicSample: (t: number) => AudioSample;
|
|
411
|
+
declare const MUSIC_FX: EffectDefinition[];
|
|
412
|
+
/** Register the 7.1 music visualization pack (idempotent). */
|
|
413
|
+
declare function registerMusicPack(): void;
|
|
414
|
+
|
|
373
415
|
/**
|
|
374
416
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
375
417
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -414,6 +456,8 @@ interface GenerativeSpec {
|
|
|
414
456
|
/** GLSL shared by every shader: uniforms, hash, value noise, fbm. */
|
|
415
457
|
declare const GLSL_HEAD = "#version 300 es\nprecision highp float;\nuniform vec2 u_res;uniform float u_t;uniform vec3 u_c0,u_c1,u_c2;uniform vec2 u_ptr;uniform float u_speed,u_scale;\nout vec4 o;\nfloat h(vec2 p){return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453);}\nfloat n(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.-2.*f);return mix(mix(h(i),h(i+vec2(1,0)),f.x),mix(h(i+vec2(0,1)),h(i+1.),f.x),f.y);}\nfloat fbm(vec2 p){float v=0.,a=.5;for(int k=0;k<5;k++){v+=a*n(p);p=p*2.03+vec2(1.7,9.2);a*=.5;}return v;}\n";
|
|
416
458
|
interface ShaderSpec {
|
|
459
|
+
/** 7.0: hand-written WGSL statements for the WebGPU backend (default: `glslToWgsl(body)`). */
|
|
460
|
+
wgsl?: string;
|
|
417
461
|
/** GLSL body of `main()`: `uv` (0–1), `p` (aspect-corrected, scaled), `t` (s × speed) are in scope; write `o`. */
|
|
418
462
|
body: string;
|
|
419
463
|
/** Canvas 2D fallback. */
|
|
@@ -422,7 +466,9 @@ interface ShaderSpec {
|
|
|
422
466
|
declare function supportsWebGL2(): boolean;
|
|
423
467
|
/**
|
|
424
468
|
* Mount a shader background behind `el` (options: `colors` [3 hex], `speed`,
|
|
425
|
-
* `scale`, `quality`, `backend` = `'auto' | 'webgl2' | 'canvas'`).
|
|
469
|
+
* `scale`, `quality`, `backend` = `'auto' | 'webgpu' | 'webgl2' | 'canvas'`).
|
|
470
|
+
* 7.0: `auto` tries WebGPU first, then WebGL2, then Canvas 2D
|
|
471
|
+
* (`el.dataset.usaBackend` names the one running). Returns the cleanup.
|
|
426
472
|
*/
|
|
427
473
|
declare function shaderBackground(el: HTMLElement, fx: EffectContext, spec: ShaderSpec, o: any): () => void;
|
|
428
474
|
/**
|
|
@@ -431,6 +477,39 @@ declare function shaderBackground(el: HTMLElement, fx: EffectContext, spec: Shad
|
|
|
431
477
|
*/
|
|
432
478
|
declare function fieldFallback(color: (x: number, y: number, t: number, o: any) => [number, number, number], cell?: number): GenerativeSpec;
|
|
433
479
|
|
|
480
|
+
/**
|
|
481
|
+
* 7.0 — WebGPU backend for the shader backgrounds (`shaderBackground()`).
|
|
482
|
+
*
|
|
483
|
+
* Every 6.x shader is written once as a small GLSL `main()` body. 7.0 runs it
|
|
484
|
+
* on **WebGPU** where the browser has it: `glslToWgsl()` translates the body
|
|
485
|
+
* (types, constructors, literals, loops, uniforms) into a WGSL fragment
|
|
486
|
+
* shader with the same noise helpers; a spec can also ship hand-written
|
|
487
|
+
* `wgsl`. If WebGPU is missing, the adapter / device is refused, or the
|
|
488
|
+
* shader does not compile, the effect falls back to **WebGL2**, then to the
|
|
489
|
+
* Canvas 2D fallback — `el.dataset.usaBackend` says which one runs.
|
|
490
|
+
*/
|
|
491
|
+
|
|
492
|
+
/** WGSL shared by every shader: uniforms, hash, value noise, fbm (mirrors `GLSL_HEAD`). */
|
|
493
|
+
declare const WGSL_HEAD = "struct U{res:vec2f,ptr:vec2f,t:f32,speed:f32,scale:f32,pad:f32,c0:vec4f,c1:vec4f,c2:vec4f};\n@group(0) @binding(0) var<uniform> u:U;\nfn h(p:vec2f)->f32{return fract(sin(dot(p,vec2f(127.1,311.7)))*43758.5453);}\nfn n(p:vec2f)->f32{let i=floor(p);var f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(h(i),h(i+vec2f(1.0,0.0)),f.x),mix(h(i+vec2f(0.0,1.0)),h(i+vec2f(1.0,1.0)),f.x),f.y);}\nfn fbm(p0:vec2f)->f32{var v=0.0;var a=0.5;var p=p0;for(var k=0;k<5;k++){v+=a*n(p);p=p*2.03+vec2f(1.7,9.2);a*=0.5;}return v;}\n@vertex fn vs(@builtin(vertex_index) i:u32)->@builtin(position) vec4f{var q=array<vec2f,3>(vec2f(-1.0,-1.0),vec2f(3.0,-1.0),vec2f(-1.0,3.0));return vec4f(q[i],0.0,1.0);}\n";
|
|
494
|
+
/**
|
|
495
|
+
* Translate a GLSL `main()` body (the 6.x `ShaderSpec.body` dialect) to WGSL
|
|
496
|
+
* statements. Throws on constructs it does not support (ternaries, `mod`,
|
|
497
|
+
* `discard`, user functions) so the caller can fall back to WebGL2.
|
|
498
|
+
*/
|
|
499
|
+
declare function glslToWgsl(body: string): string;
|
|
500
|
+
/** The full WGSL module for a body. */
|
|
501
|
+
declare const wgslModule: (body: string) => string;
|
|
502
|
+
/** `true` when `navigator.gpu` exists (the adapter may still be refused). */
|
|
503
|
+
declare const supportsWebGPU: () => boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Start a WebGPU shader background behind `el`. Resolves to its cleanup, or
|
|
506
|
+
* `null` when WebGPU cannot run this shader (the caller falls back).
|
|
507
|
+
*/
|
|
508
|
+
declare function webgpuBackground(el: HTMLElement, fx: EffectContext, spec: {
|
|
509
|
+
body: string;
|
|
510
|
+
wgsl?: string;
|
|
511
|
+
}, o: any): Promise<(() => void) | null>;
|
|
512
|
+
|
|
434
513
|
/**
|
|
435
514
|
* The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so
|
|
436
515
|
* their size budgets stay separate. This module (`registerFx2()`) registers
|
|
@@ -441,10 +520,6 @@ declare function fieldFallback(color: (x: number, y: number, t: number, o: any)
|
|
|
441
520
|
declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
442
521
|
/** Register every 6.x effect pack (idempotent). */
|
|
443
522
|
declare function registerEffectPacks(): void;
|
|
444
|
-
/** @deprecated since 6.9 — `EFFECT_PACKS` (removed in 7.0). */
|
|
445
|
-
declare const FX2_PACKS: Record<string, EffectDefinition<Record<string, any>>[]>;
|
|
446
|
-
/** @deprecated since 6.9 — use `registerEffectPacks()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
447
|
-
declare function registerFx2(): void;
|
|
448
523
|
|
|
449
|
-
export { DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FOCUS_FX,
|
|
524
|
+
export { DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FOCUS_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, crossDocumentTransitions, fieldFallback, glslToWgsl, loadEffectPack, musicSample, packManifest, pageTransition, pointsToPath, register3dPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack, samplePath, shaderBackground, skyAt, splitChars, supportsWebGL2, supportsWebGPU, syntheticSample, trackPointer, validateManifest, webgpuBackground, wgslModule };
|
|
450
525
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.d.ts
CHANGED
|
@@ -122,8 +122,6 @@ declare function loadEffectPack(src: string | {
|
|
|
122
122
|
declare const GPU_FX: EffectDefinition[];
|
|
123
123
|
/** Register the 6.2 GPU pack (idempotent). */
|
|
124
124
|
declare function registerGpuPack(): void;
|
|
125
|
-
/** @deprecated since 6.9 — use `registerGpuPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
126
|
-
declare function registerGpuEffects(): void;
|
|
127
125
|
|
|
128
126
|
/**
|
|
129
127
|
* 6.3 — Text effects 3.0 (`motionary/components/fx-text`), registered through
|
|
@@ -150,8 +148,6 @@ declare function splitChars(el: HTMLElement): HTMLElement[];
|
|
|
150
148
|
declare const TEXT3_FX: EffectDefinition[];
|
|
151
149
|
/** Register the 6.3 text pack (idempotent). */
|
|
152
150
|
declare function registerTextPack(): void;
|
|
153
|
-
/** @deprecated since 6.9 — use `registerTextPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
154
|
-
declare function registerTextEffects3(): void;
|
|
155
151
|
|
|
156
152
|
/**
|
|
157
153
|
* 6.4 — Light & materials (`motionary/components/fx-light`), registered
|
|
@@ -180,8 +176,6 @@ declare function trackPointer(el: HTMLElement, ctx: EffectContext, fn: (x: numbe
|
|
|
180
176
|
declare const LIGHT_FX: EffectDefinition[];
|
|
181
177
|
/** Register the 6.4 light & materials pack (idempotent). */
|
|
182
178
|
declare function registerLightPack(): void;
|
|
183
|
-
/** @deprecated since 6.9 — use `registerLightPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
184
|
-
declare function registerLightEffects(): void;
|
|
185
179
|
|
|
186
180
|
/**
|
|
187
181
|
* 6.5 — 3D scene cards (`motionary/components/fx-3d`), registered through
|
|
@@ -205,8 +199,6 @@ declare function registerLightEffects(): void;
|
|
|
205
199
|
declare const DEPTH3_FX: EffectDefinition[];
|
|
206
200
|
/** Register the 6.5 3D pack (idempotent). */
|
|
207
201
|
declare function register3dPack(): void;
|
|
208
|
-
/** @deprecated since 6.9 — use `register3dPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
209
|
-
declare function register3dEffects(): void;
|
|
210
202
|
|
|
211
203
|
/**
|
|
212
204
|
* 6.6 — Morph & SVG 2.0 (`motionary/components/fx-morph`), registered
|
|
@@ -234,8 +226,6 @@ declare const pointsToPath: (pts: [number, number][]) => string;
|
|
|
234
226
|
declare const MORPH2_FX: EffectDefinition[];
|
|
235
227
|
/** Register the 6.6 morph & SVG pack (idempotent). */
|
|
236
228
|
declare function registerMorphPack(): void;
|
|
237
|
-
/** @deprecated since 6.9 — use `registerMorphPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
238
|
-
declare function registerMorphEffects2(): void;
|
|
239
229
|
|
|
240
230
|
/**
|
|
241
231
|
* 6.7 — Transitions 2.0 (`motionary/components/fx-transitions`), registered
|
|
@@ -269,8 +259,6 @@ declare function pageTransition(update: () => void | Promise<void>, effect?: str
|
|
|
269
259
|
declare function crossDocumentTransitions(effect?: string, duration?: number): () => void;
|
|
270
260
|
/** Register the 6.7 transitions pack (idempotent). */
|
|
271
261
|
declare function registerTransitionsPack(): void;
|
|
272
|
-
/** @deprecated since 6.9 — use `registerTransitionsPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
273
|
-
declare function registerTransitionEffects2(): void;
|
|
274
262
|
|
|
275
263
|
/**
|
|
276
264
|
* 6.8 — Weather & ambience (`motionary/components/fx-weather`), registered
|
|
@@ -297,8 +285,6 @@ declare function skyAt(hour: number): [string, string];
|
|
|
297
285
|
declare const WEATHER_FX: EffectDefinition[];
|
|
298
286
|
/** Register the 6.8 weather & ambience pack (idempotent). */
|
|
299
287
|
declare function registerWeatherPack(): void;
|
|
300
|
-
/** @deprecated since 6.9 — use `registerWeatherPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
301
|
-
declare function registerWeatherEffects(): void;
|
|
302
288
|
|
|
303
289
|
/**
|
|
304
290
|
* 6.8 — Interactive physics 2.0 (`motionary/components/fx-physics`) on a tiny
|
|
@@ -346,8 +332,6 @@ declare class VerletWorld {
|
|
|
346
332
|
declare const PHYSICS2_FX: EffectDefinition[];
|
|
347
333
|
/** Register the 6.8 physics 2.0 pack (idempotent). */
|
|
348
334
|
declare function registerPhysicsPack(): void;
|
|
349
|
-
/** @deprecated since 6.9 — use `registerPhysicsPack()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
350
|
-
declare function registerPhysicsEffects2(): void;
|
|
351
335
|
|
|
352
336
|
/**
|
|
353
337
|
* 6.9 — Focus & feedback (`motionary/components/fx-focus`), registered
|
|
@@ -370,6 +354,64 @@ declare const FOCUS_FX: EffectDefinition[];
|
|
|
370
354
|
/** Register the 6.9 focus & feedback pack (idempotent). */
|
|
371
355
|
declare function registerFocusPack(): void;
|
|
372
356
|
|
|
357
|
+
/**
|
|
358
|
+
* 5.6 — sound-reactive effects (Web Audio).
|
|
359
|
+
*
|
|
360
|
+
* - `enableAudio(input)` — start analysing the microphone (`'mic'`), an
|
|
361
|
+
* `<audio>` / `<video>` element (or a selector for one) or a `MediaStream`.
|
|
362
|
+
* Browsers only allow an `AudioContext` to start inside a user gesture, so
|
|
363
|
+
* call it from a click handler (or use `<usa-audio>`, which renders the
|
|
364
|
+
* toggle button for you).
|
|
365
|
+
* - Background effects (kind `background`, Canvas 2D through
|
|
366
|
+
* `canvasBackground()`): `spectrum-bars`, `pulse-ring`, `wave-ring`. Before
|
|
367
|
+
* audio is enabled they idle gently.
|
|
368
|
+
* - Beat detection: `createBeatDetector()` (pure: energy → beat?), `onBeat(cb)`
|
|
369
|
+
* and `bindBeat(el, effect, options)`, which plays any registered effect on
|
|
370
|
+
* every beat. `<usa-audio>` does the same for `[data-usa-beat="effect"]`
|
|
371
|
+
* children and emits `usa-beat`.
|
|
372
|
+
* - While audio runs, `--usa-audio-level` and `--usa-audio-bass` (0–1) are set
|
|
373
|
+
* on `<html>` for CSS-driven reactions.
|
|
374
|
+
*
|
|
375
|
+
* Reduced motion: the visual effects are skipped, beats play no effects and
|
|
376
|
+
* the CSS variables stay at 0 — audio itself keeps playing.
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
interface AudioSample {
|
|
380
|
+
/** Overall loudness (RMS of the waveform), 0–1. */
|
|
381
|
+
level: number;
|
|
382
|
+
/** Low-frequency energy (first ~8 % of the spectrum), 0–1. */
|
|
383
|
+
bass: number;
|
|
384
|
+
/** Frequency bins, 0–255 each. */
|
|
385
|
+
freq: Uint8Array;
|
|
386
|
+
/** Time-domain waveform, 0–255 (128 = silence). */
|
|
387
|
+
wave: Uint8Array;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* 7.1 — Music visualization (`motionary/fx/music`, also
|
|
392
|
+
* `motionary/components/fx-music`), registered through `registerEffect()`.
|
|
393
|
+
* Every effect reads the running analyser (`enableAudio()` / `<usa-audio>`);
|
|
394
|
+
* without one it plays a gentle synthetic signal (`syntheticSample()`), so
|
|
395
|
+
* the visuals work as decoration too.
|
|
396
|
+
*
|
|
397
|
+
* - `waveform-scope` (background) — an oscilloscope line of the waveform.
|
|
398
|
+
* - `radial-spectrum` (background) — spectrum bars around a circle.
|
|
399
|
+
* - `spectrum-mirror` (background) — mirrored bars with a reflection.
|
|
400
|
+
* - `sound-particles` (background) — particles launched by the bass.
|
|
401
|
+
* - `beat-bounce` (loop) — the element pumps with the bass.
|
|
402
|
+
* - `vinyl-spin` (loop) — the element turns like a record; level speeds it.
|
|
403
|
+
*
|
|
404
|
+
* Reduced motion: backgrounds draw one static frame, loops do nothing.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
/** A smooth, deterministic fake analyser frame at time `t` (s). */
|
|
408
|
+
declare function syntheticSample(t: number, bins?: number): AudioSample;
|
|
409
|
+
/** The live analyser frame, or the synthetic one. */
|
|
410
|
+
declare const musicSample: (t: number) => AudioSample;
|
|
411
|
+
declare const MUSIC_FX: EffectDefinition[];
|
|
412
|
+
/** Register the 7.1 music visualization pack (idempotent). */
|
|
413
|
+
declare function registerMusicPack(): void;
|
|
414
|
+
|
|
373
415
|
/**
|
|
374
416
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
375
417
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -414,6 +456,8 @@ interface GenerativeSpec {
|
|
|
414
456
|
/** GLSL shared by every shader: uniforms, hash, value noise, fbm. */
|
|
415
457
|
declare const GLSL_HEAD = "#version 300 es\nprecision highp float;\nuniform vec2 u_res;uniform float u_t;uniform vec3 u_c0,u_c1,u_c2;uniform vec2 u_ptr;uniform float u_speed,u_scale;\nout vec4 o;\nfloat h(vec2 p){return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453);}\nfloat n(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.-2.*f);return mix(mix(h(i),h(i+vec2(1,0)),f.x),mix(h(i+vec2(0,1)),h(i+1.),f.x),f.y);}\nfloat fbm(vec2 p){float v=0.,a=.5;for(int k=0;k<5;k++){v+=a*n(p);p=p*2.03+vec2(1.7,9.2);a*=.5;}return v;}\n";
|
|
416
458
|
interface ShaderSpec {
|
|
459
|
+
/** 7.0: hand-written WGSL statements for the WebGPU backend (default: `glslToWgsl(body)`). */
|
|
460
|
+
wgsl?: string;
|
|
417
461
|
/** GLSL body of `main()`: `uv` (0–1), `p` (aspect-corrected, scaled), `t` (s × speed) are in scope; write `o`. */
|
|
418
462
|
body: string;
|
|
419
463
|
/** Canvas 2D fallback. */
|
|
@@ -422,7 +466,9 @@ interface ShaderSpec {
|
|
|
422
466
|
declare function supportsWebGL2(): boolean;
|
|
423
467
|
/**
|
|
424
468
|
* Mount a shader background behind `el` (options: `colors` [3 hex], `speed`,
|
|
425
|
-
* `scale`, `quality`, `backend` = `'auto' | 'webgl2' | 'canvas'`).
|
|
469
|
+
* `scale`, `quality`, `backend` = `'auto' | 'webgpu' | 'webgl2' | 'canvas'`).
|
|
470
|
+
* 7.0: `auto` tries WebGPU first, then WebGL2, then Canvas 2D
|
|
471
|
+
* (`el.dataset.usaBackend` names the one running). Returns the cleanup.
|
|
426
472
|
*/
|
|
427
473
|
declare function shaderBackground(el: HTMLElement, fx: EffectContext, spec: ShaderSpec, o: any): () => void;
|
|
428
474
|
/**
|
|
@@ -431,6 +477,39 @@ declare function shaderBackground(el: HTMLElement, fx: EffectContext, spec: Shad
|
|
|
431
477
|
*/
|
|
432
478
|
declare function fieldFallback(color: (x: number, y: number, t: number, o: any) => [number, number, number], cell?: number): GenerativeSpec;
|
|
433
479
|
|
|
480
|
+
/**
|
|
481
|
+
* 7.0 — WebGPU backend for the shader backgrounds (`shaderBackground()`).
|
|
482
|
+
*
|
|
483
|
+
* Every 6.x shader is written once as a small GLSL `main()` body. 7.0 runs it
|
|
484
|
+
* on **WebGPU** where the browser has it: `glslToWgsl()` translates the body
|
|
485
|
+
* (types, constructors, literals, loops, uniforms) into a WGSL fragment
|
|
486
|
+
* shader with the same noise helpers; a spec can also ship hand-written
|
|
487
|
+
* `wgsl`. If WebGPU is missing, the adapter / device is refused, or the
|
|
488
|
+
* shader does not compile, the effect falls back to **WebGL2**, then to the
|
|
489
|
+
* Canvas 2D fallback — `el.dataset.usaBackend` says which one runs.
|
|
490
|
+
*/
|
|
491
|
+
|
|
492
|
+
/** WGSL shared by every shader: uniforms, hash, value noise, fbm (mirrors `GLSL_HEAD`). */
|
|
493
|
+
declare const WGSL_HEAD = "struct U{res:vec2f,ptr:vec2f,t:f32,speed:f32,scale:f32,pad:f32,c0:vec4f,c1:vec4f,c2:vec4f};\n@group(0) @binding(0) var<uniform> u:U;\nfn h(p:vec2f)->f32{return fract(sin(dot(p,vec2f(127.1,311.7)))*43758.5453);}\nfn n(p:vec2f)->f32{let i=floor(p);var f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(h(i),h(i+vec2f(1.0,0.0)),f.x),mix(h(i+vec2f(0.0,1.0)),h(i+vec2f(1.0,1.0)),f.x),f.y);}\nfn fbm(p0:vec2f)->f32{var v=0.0;var a=0.5;var p=p0;for(var k=0;k<5;k++){v+=a*n(p);p=p*2.03+vec2f(1.7,9.2);a*=0.5;}return v;}\n@vertex fn vs(@builtin(vertex_index) i:u32)->@builtin(position) vec4f{var q=array<vec2f,3>(vec2f(-1.0,-1.0),vec2f(3.0,-1.0),vec2f(-1.0,3.0));return vec4f(q[i],0.0,1.0);}\n";
|
|
494
|
+
/**
|
|
495
|
+
* Translate a GLSL `main()` body (the 6.x `ShaderSpec.body` dialect) to WGSL
|
|
496
|
+
* statements. Throws on constructs it does not support (ternaries, `mod`,
|
|
497
|
+
* `discard`, user functions) so the caller can fall back to WebGL2.
|
|
498
|
+
*/
|
|
499
|
+
declare function glslToWgsl(body: string): string;
|
|
500
|
+
/** The full WGSL module for a body. */
|
|
501
|
+
declare const wgslModule: (body: string) => string;
|
|
502
|
+
/** `true` when `navigator.gpu` exists (the adapter may still be refused). */
|
|
503
|
+
declare const supportsWebGPU: () => boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Start a WebGPU shader background behind `el`. Resolves to its cleanup, or
|
|
506
|
+
* `null` when WebGPU cannot run this shader (the caller falls back).
|
|
507
|
+
*/
|
|
508
|
+
declare function webgpuBackground(el: HTMLElement, fx: EffectContext, spec: {
|
|
509
|
+
body: string;
|
|
510
|
+
wgsl?: string;
|
|
511
|
+
}, o: any): Promise<(() => void) | null>;
|
|
512
|
+
|
|
434
513
|
/**
|
|
435
514
|
* The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so
|
|
436
515
|
* their size budgets stay separate. This module (`registerFx2()`) registers
|
|
@@ -441,10 +520,6 @@ declare function fieldFallback(color: (x: number, y: number, t: number, o: any)
|
|
|
441
520
|
declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
442
521
|
/** Register every 6.x effect pack (idempotent). */
|
|
443
522
|
declare function registerEffectPacks(): void;
|
|
444
|
-
/** @deprecated since 6.9 — `EFFECT_PACKS` (removed in 7.0). */
|
|
445
|
-
declare const FX2_PACKS: Record<string, EffectDefinition<Record<string, any>>[]>;
|
|
446
|
-
/** @deprecated since 6.9 — use `registerEffectPacks()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
447
|
-
declare function registerFx2(): void;
|
|
448
523
|
|
|
449
|
-
export { DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FOCUS_FX,
|
|
524
|
+
export { DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FOCUS_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, crossDocumentTransitions, fieldFallback, glslToWgsl, loadEffectPack, musicSample, packManifest, pageTransition, pointsToPath, register3dPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack, samplePath, shaderBackground, skyAt, splitChars, supportsWebGL2, supportsWebGPU, syntheticSample, trackPointer, validateManifest, webgpuBackground, wgslModule };
|
|
450
525
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { u as deprecate } from '../chunks/base-D5MHqeDd.js';
|
|
2
1
|
export { EFFECT_PACK_FORMAT, loadEffectPack, packManifest, validateManifest } from './marketplace.js';
|
|
3
|
-
import { G as GPU_FX, r as registerGpuPack } from '../chunks/gpu-
|
|
4
|
-
export { a as GLSL_HEAD, f as fieldFallback,
|
|
2
|
+
import { G as GPU_FX, r as registerGpuPack } from '../chunks/gpu-DLPghVWr.js';
|
|
3
|
+
export { a as GLSL_HEAD, W as WGSL_HEAD, f as fieldFallback, g as glslToWgsl, s as shaderBackground, b as supportsWebGL2, c as supportsWebGPU, w as webgpuBackground, d as wgslModule } from '../chunks/gpu-DLPghVWr.js';
|
|
5
4
|
import { TEXT3_FX, registerTextPack } from './fx-text.js';
|
|
6
|
-
export {
|
|
5
|
+
export { splitChars } from './fx-text.js';
|
|
7
6
|
import { LIGHT_FX, registerLightPack } from './fx-light.js';
|
|
8
|
-
export {
|
|
7
|
+
export { trackPointer } from './fx-light.js';
|
|
9
8
|
import { DEPTH3_FX, register3dPack } from './fx-3d.js';
|
|
10
|
-
export { register3dEffects } from './fx-3d.js';
|
|
11
9
|
import { MORPH2_FX, registerMorphPack } from './fx-morph.js';
|
|
12
|
-
export { pointsToPath,
|
|
10
|
+
export { pointsToPath, samplePath } from './fx-morph.js';
|
|
13
11
|
import { TRANSITIONS2_FX, registerTransitionsPack } from './fx-transitions.js';
|
|
14
|
-
export { crossDocumentTransitions, pageTransition
|
|
12
|
+
export { crossDocumentTransitions, pageTransition } from './fx-transitions.js';
|
|
15
13
|
import { WEATHER_FX, registerWeatherPack } from './fx-weather.js';
|
|
16
|
-
export {
|
|
14
|
+
export { skyAt } from './fx-weather.js';
|
|
17
15
|
import { PHYSICS2_FX, registerPhysicsPack } from './fx-physics.js';
|
|
18
|
-
export { VerletWorld
|
|
16
|
+
export { VerletWorld } from './fx-physics.js';
|
|
19
17
|
import { FOCUS_FX, registerFocusPack } from './fx-focus.js';
|
|
20
|
-
import '
|
|
18
|
+
import { MUSIC_FX, registerMusicPack } from './fx-music.js';
|
|
19
|
+
export { musicSample, syntheticSample } from './fx-music.js';
|
|
20
|
+
import '../chunks/registry-CyKExAmE.js';
|
|
21
|
+
import '../chunks/base-2-yYc93C.js';
|
|
21
22
|
import '../chunks/generative-2LhxG5BJ.js';
|
|
22
23
|
import '../chunks/shared-CkKHWrtJ.js';
|
|
24
|
+
import '../chunks/audio-DcPvT2Kh.js';
|
|
23
25
|
|
|
24
26
|
/** The 6.x effect packs by name. */
|
|
25
27
|
const EFFECT_PACKS = {
|
|
@@ -32,6 +34,7 @@ const EFFECT_PACKS = {
|
|
|
32
34
|
weather: WEATHER_FX,
|
|
33
35
|
physics: PHYSICS2_FX,
|
|
34
36
|
focus: FOCUS_FX,
|
|
37
|
+
music: MUSIC_FX,
|
|
35
38
|
};
|
|
36
39
|
/** Register every 6.x effect pack (idempotent). */
|
|
37
40
|
function registerEffectPacks() {
|
|
@@ -44,14 +47,8 @@ function registerEffectPacks() {
|
|
|
44
47
|
registerWeatherPack();
|
|
45
48
|
registerPhysicsPack();
|
|
46
49
|
registerFocusPack();
|
|
47
|
-
|
|
48
|
-
/** @deprecated since 6.9 — `EFFECT_PACKS` (removed in 7.0). */
|
|
49
|
-
const FX2_PACKS = EFFECT_PACKS;
|
|
50
|
-
/** @deprecated since 6.9 — use `registerEffectPacks()` (removed in 7.0; `npx usa-codemod-7`). */
|
|
51
|
-
function registerFx2() {
|
|
52
|
-
deprecate('registerFx2', 'registerFx2() is deprecated since 6.9 and removed in 7.0 — use registerEffectPacks() (npx usa-codemod-7).');
|
|
53
|
-
registerEffectPacks();
|
|
50
|
+
registerMusicPack();
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
export { DEPTH3_FX, EFFECT_PACKS, FOCUS_FX,
|
|
53
|
+
export { DEPTH3_FX, EFFECT_PACKS, FOCUS_FX, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, WEATHER_FX, register3dPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack };
|
|
57
54
|
//# sourceMappingURL=fx2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx2.js","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\
|
|
1
|
+
{"version":3,"file":"fx2.js","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from './manifest';\nexport type { EffectPackManifest } from './manifest';\nimport { GPU_FX, registerGpuPack } from './gpu';\nimport { TEXT3_FX, registerTextPack, splitChars } from './text3';\nimport { LIGHT_FX, registerLightPack, trackPointer } from './light';\nimport { DEPTH3_FX, register3dPack } from './depth3';\nimport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath } from './morph2';\nimport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions } from './transitions2';\nimport { WEATHER_FX, registerWeatherPack, skyAt } from './weather';\nimport { PHYSICS2_FX, registerPhysicsPack, VerletWorld } from './physics2';\nimport { FOCUS_FX, registerFocusPack } from './focus';\nimport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample } from './music';\n\nexport { GPU_FX, registerGpuPack, TEXT3_FX, registerTextPack, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport { supportsWebGPU, glslToWgsl, wgslModule, webgpuBackground, WGSL_HEAD } from './webgpu';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightPack, trackPointer };\n\nexport { DEPTH3_FX, register3dPack };\n\nexport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath };\n\nexport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions };\n\nexport { WEATHER_FX, registerWeatherPack, skyAt };\n\nexport { PHYSICS2_FX, registerPhysicsPack, VerletWorld };\n\nexport { FOCUS_FX, registerFocusPack };\n\nexport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample };\n\n/** The 6.x effect packs by name. */\nexport const EFFECT_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n transitions: TRANSITIONS2_FX,\n weather: WEATHER_FX,\n physics: PHYSICS2_FX,\n focus: FOCUS_FX,\n music: MUSIC_FX,\n};\n\n/** Register every 6.x effect pack (idempotent). */\nexport function registerEffectPacks(): void {\n registerGpuPack();\n registerTextPack();\n registerLightPack();\n register3dPack();\n registerMorphPack();\n registerTransitionsPack();\n registerWeatherPack();\n registerPhysicsPack();\n registerFocusPack();\n registerMusicPack();\n}\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwCA;AACO,MAAM,YAAY,GAAuC;AAC9D,IAAA,GAAG,EAAE,MAAM;AACX,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,WAAW,EAAE,eAAe;AAC5B,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,QAAQ;;AAGjB;SACgB,mBAAmB,GAAA;AACjC,IAAA,eAAe,EAAE;AACjB,IAAA,gBAAgB,EAAE;AAClB,IAAA,iBAAiB,EAAE;AACnB,IAAA,cAAc,EAAE;AAChB,IAAA,iBAAiB,EAAE;AACnB,IAAA,uBAAuB,EAAE;AACzB,IAAA,mBAAmB,EAAE;AACrB,IAAA,mBAAmB,EAAE;AACrB,IAAA,iBAAiB,EAAE;AACnB,IAAA,iBAAiB,EAAE;AACrB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as createSpring } from '../chunks/spring-
|
|
3
|
-
import { g as gesture } from '../chunks/core-
|
|
4
|
-
export { p as pinchScale, s as swipeDirection } from '../chunks/core-
|
|
1
|
+
import { u as defineElement, k as clamp } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
import { c as createSpring } from '../chunks/spring-BK8DiezC.js';
|
|
3
|
+
import { g as gesture } from '../chunks/core-DuO-AVXL.js';
|
|
4
|
+
export { p as pinchScale, s as swipeDirection } from '../chunks/core-DuO-AVXL.js';
|
|
5
5
|
|
|
6
6
|
var css = "usa-swipeable{display:block;touch-action:pan-y;user-select:none;-webkit-user-select:none}usa-swipeable[axis=\"y\"]{touch-action:pan-x}usa-swipeable>*{transform:translate3d(var(--usa-swipe,0px),0,0);opacity:calc(1 - var(--usa-swipe-p,0) * 0.5)}usa-swipeable[axis=\"y\"]>*{transform:translate3d(0,var(--usa-swipe,0px),0)}usa-swipeable:focus-visible{outline:2px solid currentColor;outline-offset:2px}usa-pinch-zoom{display:block;overflow:hidden;touch-action:none;position:relative}usa-pinch-zoom>*{transform:translate3d(var(--usa-zoom-x,0px),var(--usa-zoom-y,0px),0) scale(var(--usa-zoom,1));transform-origin:50% 50%}usa-pinch-zoom[data-zoomed]{cursor:grab}usa-pinch-zoom:focus-visible{outline:2px solid currentColor;outline-offset:2px}";
|
|
7
7
|
|