motionary 7.0.0 → 7.2.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 +28 -0
- 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-DchG4q_S.js → base-2-yYc93C.js} +2 -2
- package/dist/chunks/{base-DchG4q_S.js.map → base-2-yYc93C.js.map} +1 -1
- package/dist/chunks/{core-DVyTlo9Q.js → core-D5rU0CV6.js} +2 -2
- package/dist/chunks/{core-DVyTlo9Q.js.map → core-D5rU0CV6.js.map} +1 -1
- package/dist/chunks/{core-D2vF8kZb.js → core-DuO-AVXL.js} +2 -2
- package/dist/chunks/{core-D2vF8kZb.js.map → core-DuO-AVXL.js.map} +1 -1
- package/dist/chunks/{fx-DUMVKSvg.js → fx-CMxWNwH8.js} +2 -2
- package/dist/chunks/{fx-DUMVKSvg.js.map → fx-CMxWNwH8.js.map} +1 -1
- package/dist/chunks/{gpu-Bkw605Ds.js → gpu-DLPghVWr.js} +2 -2
- package/dist/chunks/{gpu-Bkw605Ds.js.map → gpu-DLPghVWr.js.map} +1 -1
- package/dist/chunks/{player-C-TwEEy6.js → player-DxvCYo7Q.js} +4 -4
- package/dist/chunks/{player-C-TwEEy6.js.map → player-DxvCYo7Q.js.map} +1 -1
- package/dist/chunks/{registry-D23neB4M.js → registry-CyKExAmE.js} +2 -2
- package/dist/chunks/{registry-D23neB4M.js.map → registry-CyKExAmE.js.map} +1 -1
- package/dist/chunks/{spring-BhoT09Qb.js → spring-BK8DiezC.js} +2 -2
- package/dist/chunks/{spring-BhoT09Qb.js.map → spring-BK8DiezC.js.map} +1 -1
- package/dist/chunks/{variants-C_hv_s23.js → variants-BQ6bhzn4.js} +2 -2
- package/dist/chunks/{variants-C_hv_s23.js.map → variants-BQ6bhzn4.js.map} +1 -1
- package/dist/components/a11y.js +2 -2
- package/dist/components/angular.js +7 -7
- 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.js +2 -2
- package/dist/components/fx-chart.cjs +158 -0
- package/dist/components/fx-chart.cjs.map +1 -0
- package/dist/components/fx-chart.d.cts +73 -0
- package/dist/components/fx-chart.d.ts +73 -0
- package/dist/components/fx-chart.js +154 -0
- package/dist/components/fx-chart.js.map +1 -0
- package/dist/components/fx-focus.js +2 -2
- package/dist/components/fx-gpu.js +3 -3
- package/dist/components/fx-light.js +2 -2
- package/dist/components/fx-morph.js +2 -2
- 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.js +2 -2
- package/dist/components/fx-text.js +2 -2
- package/dist/components/fx-transitions.js +3 -3
- package/dist/components/fx-weather.js +2 -2
- package/dist/components/fx.js +5 -5
- package/dist/components/fx2.cjs +14 -0
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +88 -1
- package/dist/components/fx2.d.ts +88 -1
- package/dist/components/fx2.js +14 -5
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/gesture.js +4 -4
- package/dist/components/interaction.js +1 -1
- package/dist/components/layout.js +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.js +2 -2
- package/dist/components/physics.js +3 -3
- package/dist/components/reveal.js +1 -1
- package/dist/components/solid.js +7 -7
- package/dist/components/svelte.js +7 -7
- 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.js +7 -7
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +953 -61
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +143 -2
- package/dist/components/widgets.d.ts +143 -2
- package/dist/components/widgets.js +947 -67
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.js +9 -9
- 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 +2 -2
- package/docs/components.md +49 -0
- package/package.json +41 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerEffects } from '../chunks/registry-
|
|
2
|
-
import {
|
|
1
|
+
import { registerEffects } from '../chunks/registry-CyKExAmE.js';
|
|
2
|
+
import { v as srText } from '../chunks/base-2-yYc93C.js';
|
|
3
3
|
import { a as all, r as rand, f as fxLayer, s as spawn } from '../chunks/shared-CkKHWrtJ.js';
|
|
4
4
|
|
|
5
5
|
/** Split `el`'s text into `aria-hidden` inline-block characters (idempotent). Returns them. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getEffect, registerEffects } from '../chunks/registry-
|
|
2
|
-
import { p as prefersReducedMotion } from '../chunks/base-
|
|
1
|
+
import { getEffect, registerEffects } from '../chunks/registry-CyKExAmE.js';
|
|
2
|
+
import { p as prefersReducedMotion } from '../chunks/base-2-yYc93C.js';
|
|
3
3
|
import { b as origin, a as all } from '../chunks/shared-CkKHWrtJ.js';
|
|
4
4
|
|
|
5
5
|
const fade = (el, ctx, out) => ctx.animate(el, out ? [{ opacity: 1 }, { opacity: 0 }] : [{ opacity: 0 }, { opacity: 1 }], { duration: 200, fill: out ? 'forwards' : 'none' });
|
|
@@ -222,7 +222,7 @@ async function pageTransition(update, effect = 'ripple-dissolve', options = {},
|
|
|
222
222
|
await update();
|
|
223
223
|
const el = target || document.body.firstElementChild;
|
|
224
224
|
if (el && def) {
|
|
225
|
-
const { playEffect } = await import('../chunks/registry-
|
|
225
|
+
const { playEffect } = await import('../chunks/registry-CyKExAmE.js');
|
|
226
226
|
await playEffect(el, effect, { ...options, mode: 'in' });
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerEffects } from '../chunks/registry-
|
|
1
|
+
import { registerEffects } from '../chunks/registry-CyKExAmE.js';
|
|
2
2
|
import { c as canvasBackground } from '../chunks/generative-2LhxG5BJ.js';
|
|
3
3
|
import { r as rand } from '../chunks/shared-CkKHWrtJ.js';
|
|
4
|
-
import '../chunks/base-
|
|
4
|
+
import '../chunks/base-2-yYc93C.js';
|
|
5
5
|
|
|
6
6
|
const bg = (name, description, defaults, spec) => ({
|
|
7
7
|
name,
|
package/dist/components/fx.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { playEffect, bindEffect, EFFECT_TRIGGERS, registerEffects } from '../chunks/registry-
|
|
3
|
-
export { EFFECT_KINDS, getEffect, hasEffect, listEffects, registerEffect } from '../chunks/registry-
|
|
4
|
-
import { T as TIMELINE_PRESETS } from '../chunks/core-
|
|
5
|
-
import { b as burst, c as confetti, s as shake } from '../chunks/fx-
|
|
1
|
+
import { u as defineElement } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
import { playEffect, bindEffect, EFFECT_TRIGGERS, registerEffects } from '../chunks/registry-CyKExAmE.js';
|
|
3
|
+
export { EFFECT_KINDS, getEffect, hasEffect, listEffects, registerEffect } from '../chunks/registry-CyKExAmE.js';
|
|
4
|
+
import { T as TIMELINE_PRESETS } from '../chunks/core-D5rU0CV6.js';
|
|
5
|
+
import { b as burst, c as confetti, s as shake } from '../chunks/fx-CMxWNwH8.js';
|
|
6
6
|
import './tokens.js';
|
|
7
7
|
|
|
8
8
|
function defineFx(tag = 'usa-fx') {
|
package/dist/components/fx2.cjs
CHANGED
|
@@ -10,10 +10,13 @@ var components_fxTransitions = require('./fx-transitions.cjs');
|
|
|
10
10
|
var components_fxWeather = require('./fx-weather.cjs');
|
|
11
11
|
var components_fxPhysics = require('./fx-physics.cjs');
|
|
12
12
|
var components_fxFocus = require('./fx-focus.cjs');
|
|
13
|
+
var components_fxMusic = require('./fx-music.cjs');
|
|
14
|
+
var components_fxChart = require('./fx-chart.cjs');
|
|
13
15
|
require('../chunks/registry-DehBVRDV.cjs');
|
|
14
16
|
require('../chunks/base-BaQV-2ha.cjs');
|
|
15
17
|
require('../chunks/generative-BHIj-NU0.cjs');
|
|
16
18
|
require('../chunks/shared-jkgRH-Hx.cjs');
|
|
19
|
+
require('../chunks/audio-EXUoijsG.cjs');
|
|
17
20
|
|
|
18
21
|
/** The 6.x effect packs by name. */
|
|
19
22
|
const EFFECT_PACKS = {
|
|
@@ -26,6 +29,8 @@ const EFFECT_PACKS = {
|
|
|
26
29
|
weather: components_fxWeather.WEATHER_FX,
|
|
27
30
|
physics: components_fxPhysics.PHYSICS2_FX,
|
|
28
31
|
focus: components_fxFocus.FOCUS_FX,
|
|
32
|
+
music: components_fxMusic.MUSIC_FX,
|
|
33
|
+
chart: components_fxChart.CHART_FX,
|
|
29
34
|
};
|
|
30
35
|
/** Register every 6.x effect pack (idempotent). */
|
|
31
36
|
function registerEffectPacks() {
|
|
@@ -38,6 +43,8 @@ function registerEffectPacks() {
|
|
|
38
43
|
components_fxWeather.registerWeatherPack();
|
|
39
44
|
components_fxPhysics.registerPhysicsPack();
|
|
40
45
|
components_fxFocus.registerFocusPack();
|
|
46
|
+
components_fxMusic.registerMusicPack();
|
|
47
|
+
components_fxChart.registerChartPack();
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
exports.EFFECT_PACK_FORMAT = components_marketplace.EFFECT_PACK_FORMAT;
|
|
@@ -79,6 +86,13 @@ exports.VerletWorld = components_fxPhysics.VerletWorld;
|
|
|
79
86
|
exports.registerPhysicsPack = components_fxPhysics.registerPhysicsPack;
|
|
80
87
|
exports.FOCUS_FX = components_fxFocus.FOCUS_FX;
|
|
81
88
|
exports.registerFocusPack = components_fxFocus.registerFocusPack;
|
|
89
|
+
exports.MUSIC_FX = components_fxMusic.MUSIC_FX;
|
|
90
|
+
exports.musicSample = components_fxMusic.musicSample;
|
|
91
|
+
exports.registerMusicPack = components_fxMusic.registerMusicPack;
|
|
92
|
+
exports.syntheticSample = components_fxMusic.syntheticSample;
|
|
93
|
+
exports.CHART_FX = components_fxChart.CHART_FX;
|
|
94
|
+
exports.parseFigure = components_fxChart.parseFigure;
|
|
95
|
+
exports.registerChartPack = components_fxChart.registerChartPack;
|
|
82
96
|
exports.EFFECT_PACKS = EFFECT_PACKS;
|
|
83
97
|
exports.registerEffectPacks = registerEffectPacks;
|
|
84
98
|
//# sourceMappingURL=fx2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx2.cjs","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\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';\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\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};\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}\n\n\n"],"names":["GPU_FX","TEXT3_FX","LIGHT_FX","DEPTH3_FX","MORPH2_FX","TRANSITIONS2_FX","WEATHER_FX","PHYSICS2_FX","FOCUS_FX","registerGpuPack","registerTextPack","registerLightPack","register3dPack","registerMorphPack","registerTransitionsPack","registerWeatherPack","registerPhysicsPack","registerFocusPack"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fx2.cjs","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\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';\nimport { CHART_FX, registerChartPack, parseFigure } from './chart';\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\nexport { CHART_FX, registerChartPack, parseFigure };\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 chart: CHART_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 registerChartPack();\n}\n\n\n"],"names":["GPU_FX","TEXT3_FX","LIGHT_FX","DEPTH3_FX","MORPH2_FX","TRANSITIONS2_FX","WEATHER_FX","PHYSICS2_FX","FOCUS_FX","MUSIC_FX","CHART_FX","registerGpuPack","registerTextPack","registerLightPack","register3dPack","registerMorphPack","registerTransitionsPack","registerWeatherPack","registerPhysicsPack","registerFocusPack","registerMusicPack","registerChartPack"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA;AACO,MAAM,YAAY,GAAuC;AAC9D,IAAA,GAAG,EAAEA,uBAAM;AACX,IAAA,IAAI,EAAEC,0BAAQ;AACd,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,yBAAS;AAChB,IAAA,KAAK,EAAEC,4BAAS;AAChB,IAAA,WAAW,EAAEC,wCAAe;AAC5B,IAAA,OAAO,EAAEC,+BAAU;AACnB,IAAA,OAAO,EAAEC,gCAAW;AACpB,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,2BAAQ;AACf,IAAA,KAAK,EAAEC,2BAAQ;;AAGjB;SACgB,mBAAmB,GAAA;AACjC,IAAAC,gCAAe,EAAE;AACjB,IAAAC,kCAAgB,EAAE;AAClB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,8BAAc,EAAE;AAChB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,gDAAuB,EAAE;AACzB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,wCAAmB,EAAE;AACrB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,oCAAiB,EAAE;AACnB,IAAAC,oCAAiB,EAAE;AACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -354,6 +354,93 @@ declare const FOCUS_FX: EffectDefinition[];
|
|
|
354
354
|
/** Register the 6.9 focus & feedback pack (idempotent). */
|
|
355
355
|
declare function registerFocusPack(): void;
|
|
356
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
|
+
|
|
415
|
+
/**
|
|
416
|
+
* 7.2 — Data-viz motion (`motionary/fx/chart`, also
|
|
417
|
+
* `motionary/components/fx-chart`): entrances for the charts you already
|
|
418
|
+
* have (any SVG or HTML chart library), registered through `registerEffect()`:
|
|
419
|
+
*
|
|
420
|
+
* - `bars-grow` (enter) — bars (`[data-bar]`, `rect`, or the children) grow
|
|
421
|
+
* from the baseline in a stagger.
|
|
422
|
+
* - `line-draw` (enter) — every SVG `path` / `polyline` / `line` draws itself.
|
|
423
|
+
* - `ring-sweep` (enter) — SVG `circle` arcs sweep around from 12 o'clock.
|
|
424
|
+
* - `sankey-flow` (loop) — dashes flow along the SVG links (`[data-flow]` or
|
|
425
|
+
* every stroked `path`) to show direction and volume.
|
|
426
|
+
* - `number-roll` (enter) — numbers (`[data-value]` or the text) count up
|
|
427
|
+
* with locale formatting.
|
|
428
|
+
* - `dots-pop` (enter) — scatter / line points (`circle`, `[data-dot]`) pop in.
|
|
429
|
+
*
|
|
430
|
+
* Reduced motion: final state with a short fade (sankey-flow is static).
|
|
431
|
+
*/
|
|
432
|
+
|
|
433
|
+
/** Parse a number out of text like "$1,234.5k" → { n, pre, post, dec }. */
|
|
434
|
+
declare function parseFigure(s: string): {
|
|
435
|
+
n: number;
|
|
436
|
+
pre: string;
|
|
437
|
+
post: string;
|
|
438
|
+
dec: number;
|
|
439
|
+
} | null;
|
|
440
|
+
declare const CHART_FX: EffectDefinition[];
|
|
441
|
+
/** Register the 7.2 data-viz motion pack (idempotent). */
|
|
442
|
+
declare function registerChartPack(): void;
|
|
443
|
+
|
|
357
444
|
/**
|
|
358
445
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
359
446
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -463,5 +550,5 @@ declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
|
463
550
|
/** Register every 6.x effect pack (idempotent). */
|
|
464
551
|
declare function registerEffectPacks(): void;
|
|
465
552
|
|
|
466
|
-
export { DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FOCUS_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, crossDocumentTransitions, fieldFallback, glslToWgsl, loadEffectPack, packManifest, pageTransition, pointsToPath, register3dPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack, samplePath, shaderBackground, skyAt, splitChars, supportsWebGL2, supportsWebGPU, trackPointer, validateManifest, webgpuBackground, wgslModule };
|
|
553
|
+
export { CHART_FX, 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, parseFigure, pointsToPath, register3dPack, registerChartPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack, samplePath, shaderBackground, skyAt, splitChars, supportsWebGL2, supportsWebGPU, syntheticSample, trackPointer, validateManifest, webgpuBackground, wgslModule };
|
|
467
554
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.d.ts
CHANGED
|
@@ -354,6 +354,93 @@ declare const FOCUS_FX: EffectDefinition[];
|
|
|
354
354
|
/** Register the 6.9 focus & feedback pack (idempotent). */
|
|
355
355
|
declare function registerFocusPack(): void;
|
|
356
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
|
+
|
|
415
|
+
/**
|
|
416
|
+
* 7.2 — Data-viz motion (`motionary/fx/chart`, also
|
|
417
|
+
* `motionary/components/fx-chart`): entrances for the charts you already
|
|
418
|
+
* have (any SVG or HTML chart library), registered through `registerEffect()`:
|
|
419
|
+
*
|
|
420
|
+
* - `bars-grow` (enter) — bars (`[data-bar]`, `rect`, or the children) grow
|
|
421
|
+
* from the baseline in a stagger.
|
|
422
|
+
* - `line-draw` (enter) — every SVG `path` / `polyline` / `line` draws itself.
|
|
423
|
+
* - `ring-sweep` (enter) — SVG `circle` arcs sweep around from 12 o'clock.
|
|
424
|
+
* - `sankey-flow` (loop) — dashes flow along the SVG links (`[data-flow]` or
|
|
425
|
+
* every stroked `path`) to show direction and volume.
|
|
426
|
+
* - `number-roll` (enter) — numbers (`[data-value]` or the text) count up
|
|
427
|
+
* with locale formatting.
|
|
428
|
+
* - `dots-pop` (enter) — scatter / line points (`circle`, `[data-dot]`) pop in.
|
|
429
|
+
*
|
|
430
|
+
* Reduced motion: final state with a short fade (sankey-flow is static).
|
|
431
|
+
*/
|
|
432
|
+
|
|
433
|
+
/** Parse a number out of text like "$1,234.5k" → { n, pre, post, dec }. */
|
|
434
|
+
declare function parseFigure(s: string): {
|
|
435
|
+
n: number;
|
|
436
|
+
pre: string;
|
|
437
|
+
post: string;
|
|
438
|
+
dec: number;
|
|
439
|
+
} | null;
|
|
440
|
+
declare const CHART_FX: EffectDefinition[];
|
|
441
|
+
/** Register the 7.2 data-viz motion pack (idempotent). */
|
|
442
|
+
declare function registerChartPack(): void;
|
|
443
|
+
|
|
357
444
|
/**
|
|
358
445
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
359
446
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -463,5 +550,5 @@ declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
|
463
550
|
/** Register every 6.x effect pack (idempotent). */
|
|
464
551
|
declare function registerEffectPacks(): void;
|
|
465
552
|
|
|
466
|
-
export { DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FOCUS_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, MORPH2_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, crossDocumentTransitions, fieldFallback, glslToWgsl, loadEffectPack, packManifest, pageTransition, pointsToPath, register3dPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack, samplePath, shaderBackground, skyAt, splitChars, supportsWebGL2, supportsWebGPU, trackPointer, validateManifest, webgpuBackground, wgslModule };
|
|
553
|
+
export { CHART_FX, 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, parseFigure, pointsToPath, register3dPack, registerChartPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack, samplePath, shaderBackground, skyAt, splitChars, supportsWebGL2, supportsWebGPU, syntheticSample, trackPointer, validateManifest, webgpuBackground, wgslModule };
|
|
467
554
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EFFECT_PACK_FORMAT, loadEffectPack, packManifest, validateManifest } from './marketplace.js';
|
|
2
|
-
import { G as GPU_FX, r as registerGpuPack } from '../chunks/gpu-
|
|
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-
|
|
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';
|
|
4
4
|
import { TEXT3_FX, registerTextPack } from './fx-text.js';
|
|
5
5
|
export { splitChars } from './fx-text.js';
|
|
6
6
|
import { LIGHT_FX, registerLightPack } from './fx-light.js';
|
|
@@ -15,10 +15,15 @@ export { skyAt } from './fx-weather.js';
|
|
|
15
15
|
import { PHYSICS2_FX, registerPhysicsPack } from './fx-physics.js';
|
|
16
16
|
export { VerletWorld } from './fx-physics.js';
|
|
17
17
|
import { FOCUS_FX, registerFocusPack } from './fx-focus.js';
|
|
18
|
-
import '
|
|
19
|
-
|
|
18
|
+
import { MUSIC_FX, registerMusicPack } from './fx-music.js';
|
|
19
|
+
export { musicSample, syntheticSample } from './fx-music.js';
|
|
20
|
+
import { CHART_FX, registerChartPack } from './fx-chart.js';
|
|
21
|
+
export { parseFigure } from './fx-chart.js';
|
|
22
|
+
import '../chunks/registry-CyKExAmE.js';
|
|
23
|
+
import '../chunks/base-2-yYc93C.js';
|
|
20
24
|
import '../chunks/generative-2LhxG5BJ.js';
|
|
21
25
|
import '../chunks/shared-CkKHWrtJ.js';
|
|
26
|
+
import '../chunks/audio-DcPvT2Kh.js';
|
|
22
27
|
|
|
23
28
|
/** The 6.x effect packs by name. */
|
|
24
29
|
const EFFECT_PACKS = {
|
|
@@ -31,6 +36,8 @@ const EFFECT_PACKS = {
|
|
|
31
36
|
weather: WEATHER_FX,
|
|
32
37
|
physics: PHYSICS2_FX,
|
|
33
38
|
focus: FOCUS_FX,
|
|
39
|
+
music: MUSIC_FX,
|
|
40
|
+
chart: CHART_FX,
|
|
34
41
|
};
|
|
35
42
|
/** Register every 6.x effect pack (idempotent). */
|
|
36
43
|
function registerEffectPacks() {
|
|
@@ -43,7 +50,9 @@ function registerEffectPacks() {
|
|
|
43
50
|
registerWeatherPack();
|
|
44
51
|
registerPhysicsPack();
|
|
45
52
|
registerFocusPack();
|
|
53
|
+
registerMusicPack();
|
|
54
|
+
registerChartPack();
|
|
46
55
|
}
|
|
47
56
|
|
|
48
|
-
export { DEPTH3_FX, EFFECT_PACKS, FOCUS_FX, GPU_FX, LIGHT_FX, MORPH2_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, WEATHER_FX, register3dPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack };
|
|
57
|
+
export { CHART_FX, DEPTH3_FX, EFFECT_PACKS, FOCUS_FX, GPU_FX, LIGHT_FX, MORPH2_FX, MUSIC_FX, PHYSICS2_FX, TEXT3_FX, TRANSITIONS2_FX, WEATHER_FX, register3dPack, registerChartPack, registerEffectPacks, registerFocusPack, registerGpuPack, registerLightPack, registerMorphPack, registerMusicPack, registerPhysicsPack, registerTextPack, registerTransitionsPack, registerWeatherPack };
|
|
49
58
|
//# 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';\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';\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\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};\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}\n\n\n"],"names":[],"mappings":"
|
|
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';\nimport { CHART_FX, registerChartPack, parseFigure } from './chart';\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\nexport { CHART_FX, registerChartPack, parseFigure };\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 chart: CHART_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 registerChartPack();\n}\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA;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;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;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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as defineElement, z as EASE_OUT, r as raf, l as caf, k as clamp, E as EASE_SPRING } from '../chunks/base-2-yYc93C.js';
|
|
2
2
|
|
|
3
3
|
var css$4 = "usa-ripple{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent}usa-ripple[block]{display:block}usa-ripple .usa-ripple-wave{position:absolute;border-radius:50%;pointer-events:none;transform:scale(0);z-index:-1;will-change:transform,opacity}";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as prefersReducedMotion, z as EASE_OUT, m as motionScale,
|
|
1
|
+
import { p as prefersReducedMotion, z as EASE_OUT, m as motionScale, u as defineElement } from '../chunks/base-2-yYc93C.js';
|
|
2
2
|
|
|
3
3
|
/** FLIP keyframes from a previous box to the current one (pure). */
|
|
4
4
|
function flipFrames(from, to, scale = true) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hasEffect, registerEffect, EFFECT_KINDS } from '../chunks/registry-
|
|
2
|
-
import '../chunks/base-
|
|
1
|
+
import { hasEffect, registerEffect, EFFECT_KINDS } from '../chunks/registry-CyKExAmE.js';
|
|
2
|
+
import '../chunks/base-2-yYc93C.js';
|
|
3
3
|
|
|
4
4
|
const EFFECT_PACK_FORMAT = 'motionary/effect-pack';
|
|
5
5
|
const SEMVER = /^\d+\.\d+\.\d+(?:-[\w.]+)?$/;
|
package/dist/components/packs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as prefersReducedMotion, q as now, m as motionScale, r as raf, z as EASE_OUT, k as clamp, E as EASE_SPRING,
|
|
1
|
+
import { p as prefersReducedMotion, q as now, m as motionScale, r as raf, z as EASE_OUT, k as clamp, E as EASE_SPRING, u as defineElement } from '../chunks/base-2-yYc93C.js';
|
|
2
2
|
|
|
3
3
|
const anim = (el, frames, o) => {
|
|
4
4
|
if (typeof el.animate !== 'function')
|
package/dist/components/page.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { M as MOTION_SCALE } from '../chunks/base-
|
|
3
|
-
import { e as springSamples } from '../chunks/spring-
|
|
1
|
+
import { u as defineElement, l as caf, r as raf, p as prefersReducedMotion, q as now, i as getMotionSensitivity, h as getMotionIntensity, g as configureComponents, x as adoptStyles } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
export { M as MOTION_SCALE } from '../chunks/base-2-yYc93C.js';
|
|
3
|
+
import { e as springSamples } from '../chunks/spring-BK8DiezC.js';
|
|
4
4
|
|
|
5
5
|
var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
|
|
6
6
|
|
package/dist/components/perf.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as onFrame, t as setStyleLoader, f as animationBudget, h as getMotionIntensity, g as configureComponents, j as setAnimationBudget, b as activeAnimations } from '../chunks/base-
|
|
2
|
-
export { s as schedulerStats } from '../chunks/base-
|
|
1
|
+
import { o as onFrame, t as setStyleLoader, f as animationBudget, h as getMotionIntensity, g as configureComponents, j as setAnimationBudget, b as activeAnimations } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
export { s as schedulerStats } from '../chunks/base-2-yYc93C.js';
|
|
3
3
|
import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-C04JP8g4.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-
|
|
3
|
-
export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-
|
|
1
|
+
import { u as defineElement, k as clamp } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-BK8DiezC.js';
|
|
3
|
+
export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-BK8DiezC.js';
|
|
4
4
|
|
|
5
5
|
var css$2 = "usa-spring{display:inline-block;transform-origin:50% 70%}usa-spring[block]{display:block}usa-spring[effect=\"drop\"]{transform-origin:50% 100%}usa-spring[data-state=\"hidden\"]{opacity:0}usa-spring[trigger=\"click\"],usa-spring[trigger=\"hover\"]{cursor:pointer;-webkit-tap-highlight-color:transparent}";
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as defineElement, z as EASE_OUT, l as caf, r as raf, k as clamp } from '../chunks/base-2-yYc93C.js';
|
|
2
2
|
|
|
3
3
|
/** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
|
|
4
4
|
const REVEAL_EFFECTS = [
|
package/dist/components/solid.js
CHANGED
|
@@ -3,32 +3,32 @@ import { defineComponents } from '../components.js';
|
|
|
3
3
|
import { b as bindUsa } from '../chunks/bind-B_CTL6Qn.js';
|
|
4
4
|
export { u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
5
5
|
import './reveal.js';
|
|
6
|
-
import '../chunks/base-
|
|
6
|
+
import '../chunks/base-2-yYc93C.js';
|
|
7
7
|
import './text.js';
|
|
8
|
-
import '../chunks/core-
|
|
8
|
+
import '../chunks/core-D5rU0CV6.js';
|
|
9
9
|
import './tokens.js';
|
|
10
10
|
import './interaction.js';
|
|
11
11
|
import './feedback.js';
|
|
12
12
|
import './background.js';
|
|
13
|
-
import '../chunks/variants-
|
|
13
|
+
import '../chunks/variants-BQ6bhzn4.js';
|
|
14
14
|
import './transitions.js';
|
|
15
15
|
import './physics.js';
|
|
16
|
-
import '../chunks/spring-
|
|
16
|
+
import '../chunks/spring-BK8DiezC.js';
|
|
17
17
|
import './cards.js';
|
|
18
18
|
import './click.js';
|
|
19
|
-
import '../chunks/fx-
|
|
19
|
+
import '../chunks/fx-CMxWNwH8.js';
|
|
20
20
|
import './ui.js';
|
|
21
21
|
import './page.js';
|
|
22
22
|
import './timeline.js';
|
|
23
23
|
import './gesture.js';
|
|
24
|
-
import '../chunks/core-
|
|
24
|
+
import '../chunks/core-DuO-AVXL.js';
|
|
25
25
|
import './svg.js';
|
|
26
26
|
import './webgl.js';
|
|
27
27
|
import './depth.js';
|
|
28
28
|
import './layout.js';
|
|
29
29
|
import './packs.js';
|
|
30
30
|
import './fx.js';
|
|
31
|
-
import '../chunks/registry-
|
|
31
|
+
import '../chunks/registry-CyKExAmE.js';
|
|
32
32
|
import './a11y.js';
|
|
33
33
|
import '../chunks/index-tags-C04JP8g4.js';
|
|
34
34
|
import './perf.js';
|
|
@@ -2,32 +2,32 @@ import { defineComponents } from '../components.js';
|
|
|
2
2
|
import { b as bindUsa } from '../chunks/bind-B_CTL6Qn.js';
|
|
3
3
|
export { u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
4
4
|
import './reveal.js';
|
|
5
|
-
import '../chunks/base-
|
|
5
|
+
import '../chunks/base-2-yYc93C.js';
|
|
6
6
|
import './text.js';
|
|
7
|
-
import '../chunks/core-
|
|
7
|
+
import '../chunks/core-D5rU0CV6.js';
|
|
8
8
|
import './tokens.js';
|
|
9
9
|
import './interaction.js';
|
|
10
10
|
import './feedback.js';
|
|
11
11
|
import './background.js';
|
|
12
|
-
import '../chunks/variants-
|
|
12
|
+
import '../chunks/variants-BQ6bhzn4.js';
|
|
13
13
|
import './transitions.js';
|
|
14
14
|
import './physics.js';
|
|
15
|
-
import '../chunks/spring-
|
|
15
|
+
import '../chunks/spring-BK8DiezC.js';
|
|
16
16
|
import './cards.js';
|
|
17
17
|
import './click.js';
|
|
18
|
-
import '../chunks/fx-
|
|
18
|
+
import '../chunks/fx-CMxWNwH8.js';
|
|
19
19
|
import './ui.js';
|
|
20
20
|
import './page.js';
|
|
21
21
|
import './timeline.js';
|
|
22
22
|
import './gesture.js';
|
|
23
|
-
import '../chunks/core-
|
|
23
|
+
import '../chunks/core-DuO-AVXL.js';
|
|
24
24
|
import './svg.js';
|
|
25
25
|
import './webgl.js';
|
|
26
26
|
import './depth.js';
|
|
27
27
|
import './layout.js';
|
|
28
28
|
import './packs.js';
|
|
29
29
|
import './fx.js';
|
|
30
|
-
import '../chunks/registry-
|
|
30
|
+
import '../chunks/registry-CyKExAmE.js';
|
|
31
31
|
import './a11y.js';
|
|
32
32
|
import '../chunks/index-tags-C04JP8g4.js';
|
|
33
33
|
import './perf.js';
|
package/dist/components/svg.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as clamp, m as motionScale, l as caf, p as prefersReducedMotion, q as now, r as raf,
|
|
1
|
+
import { k as clamp, m as motionScale, l as caf, p as prefersReducedMotion, q as now, r as raf, u as defineElement, z as EASE_OUT } from '../chunks/base-2-yYc93C.js';
|
|
2
2
|
|
|
3
3
|
const NUM = /-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi;
|
|
4
4
|
/** `true` when two path strings share the same commands (so their numbers can be interpolated). */
|
package/dist/components/text.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as timeline } from '../chunks/core-
|
|
1
|
+
import { u as defineElement, v as srText, l as caf, q as now, r as raf, z as EASE_OUT, E as EASE_SPRING, k as clamp } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
import { t as timeline } from '../chunks/core-D5rU0CV6.js';
|
|
3
3
|
import './tokens.js';
|
|
4
4
|
|
|
5
5
|
var css$5 = "usa-typewriter{white-space:pre-wrap}usa-typewriter .usa-tw-caret{display:inline-block;width:var(--usa-caret-width,0.08em);height:1.05em;margin-left:0.06em;vertical-align:-0.12em;background:var(--usa-caret-color,currentColor);animation:usa-caret 1.06s steps(1) infinite}usa-typewriter[data-typing] .usa-tw-caret{animation:none}usa-typewriter[data-no-cursor] .usa-tw-caret{display:none}@keyframes usa-caret{50%{opacity:0}}@media (prefers-reduced-motion:reduce){usa-typewriter .usa-tw-caret,usa-shimmer-text{animation:none}}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as timeline, T as TIMELINE_PRESETS } from '../chunks/core-
|
|
3
|
-
export { r as resolvePosition, s as supportsNativeScrub } from '../chunks/core-
|
|
1
|
+
import { u as defineElement } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
import { t as timeline, T as TIMELINE_PRESETS } from '../chunks/core-D5rU0CV6.js';
|
|
3
|
+
export { r as resolvePosition, s as supportsNativeScrub } from '../chunks/core-D5rU0CV6.js';
|
|
4
4
|
import './tokens.js';
|
|
5
5
|
|
|
6
6
|
var css = "usa-timeline{display:block}usa-timeline[scrub]{position:relative}@media (prefers-reduced-motion:reduce){usa-timeline [data-tl]{opacity:1 !important;transform:none !important;filter:none !important;clip-path:none !important}}";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as defineElement, A as kindOf, B as shadowStyles, z as EASE_OUT, F as FLUENT_DECELERATE, p as prefersReducedMotion } from '../chunks/base-2-yYc93C.js';
|
|
2
2
|
|
|
3
3
|
var shadowCss = ":host{display:contents}dialog{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;overflow:hidden}dialog:not([open]){display:none}dialog::backdrop{background:transparent}[part=\"backdrop\"]{position:absolute;inset:0;background:var(--usa-dialog-backdrop,rgb(0 0 0 / 0.42))}[part=\"panel\"]{position:absolute;left:50%;top:50%;translate:-50% -50%;box-sizing:border-box;width:min(var(--usa-dialog-width,480px),calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;padding:var(--usa-dialog-padding,24px);border-radius:var(--usa-dialog-radius,12px);background:var(--usa-dialog-bg,Canvas);color:var(--usa-dialog-fg,CanvasText);box-shadow:0 32px 64px -12px rgb(0 0 0 / 0.45),0 0 0 1px rgb(127 127 127 / 0.18)}dialog[data-kind^=\"drawer\"] [part=\"panel\"]{top:0;bottom:0;translate:none;max-height:none;height:100%;border-radius:0;width:min(var(--usa-dialog-width,380px),88vw)}dialog[data-kind=\"drawer-start\"] [part=\"panel\"]{left:0}dialog[data-kind=\"drawer-end\"] [part=\"panel\"]{left:auto;right:0}dialog[data-kind=\"drawer-bottom\"] [part=\"panel\"],dialog[data-kind=\"sheet\"] [part=\"panel\"]{top:auto;bottom:0;left:0;right:0;translate:none;width:100%;height:auto;max-height:85vh;border-radius:var(--usa-dialog-radius,16px) var(--usa-dialog-radius,16px) 0 0}dialog[data-kind=\"sheet\"] [part=\"panel\"]{left:50%;translate:-50% 0;width:min(var(--usa-dialog-width,560px),100vw)}";
|
|
4
4
|
|
package/dist/components/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as springEasing, c as createSpring, p as projectInertia, s as snapTo, a as rubberBand } from '../chunks/spring-
|
|
3
|
-
import { a as adoptVariants } from '../chunks/variants-
|
|
4
|
-
export { V as VARIANTS, s as setVariant } from '../chunks/variants-
|
|
1
|
+
import { u as defineElement, k as clamp, l as caf, r as raf } from '../chunks/base-2-yYc93C.js';
|
|
2
|
+
import { d as springEasing, c as createSpring, p as projectInertia, s as snapTo, a as rubberBand } from '../chunks/spring-BK8DiezC.js';
|
|
3
|
+
import { a as adoptVariants } from '../chunks/variants-BQ6bhzn4.js';
|
|
4
|
+
export { V as VARIANTS, s as setVariant } from '../chunks/variants-BQ6bhzn4.js';
|
|
5
5
|
|
|
6
6
|
/** Position a fixed `floating` element next to `anchor`, flipping when it would leave the viewport. */
|
|
7
7
|
function place(floating, anchor, placement = 'top', gap = 8) {
|