motionary 9.9.0 → 10.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 +41 -0
- package/README.md +45 -0
- package/bin/create-motionary-plugin.mjs +124 -0
- package/dist/chunks/{audio-C1uFaOKQ.js → audio-D95jwlOh.js} +3 -3
- package/dist/chunks/{audio-C1uFaOKQ.js.map → audio-D95jwlOh.js.map} +1 -1
- package/dist/chunks/{base-DWYNLg6P.js → base-BnRyfuyM.js} +2 -2
- package/dist/chunks/{base-DWYNLg6P.js.map → base-BnRyfuyM.js.map} +1 -1
- package/dist/chunks/{builtins-DoCY96r9.js → builtins-CqIq1zBv.js} +3 -3
- package/dist/chunks/{builtins-DoCY96r9.js.map → builtins-CqIq1zBv.js.map} +1 -1
- package/dist/chunks/{core-DoR4w-E4.js → core-DsGoL9EY.js} +2 -2
- package/dist/chunks/{core-DoR4w-E4.js.map → core-DsGoL9EY.js.map} +1 -1
- package/dist/chunks/{core-BhuojMcL.js → core-XA2yhn1b.js} +2 -2
- package/dist/chunks/{core-BhuojMcL.js.map → core-XA2yhn1b.js.map} +1 -1
- package/dist/chunks/{fx-XBDr7-dH.js → fx-CtnrFEg9.js} +2 -2
- package/dist/chunks/{fx-XBDr7-dH.js.map → fx-CtnrFEg9.js.map} +1 -1
- package/dist/chunks/{gpu-DvLHwLxy.js → gpu-CDcXiNA8.js} +2 -2
- package/dist/chunks/{gpu-DvLHwLxy.js.map → gpu-CDcXiNA8.js.map} +1 -1
- package/dist/chunks/keyframes-CyH_abhI.js +183 -0
- package/dist/chunks/keyframes-CyH_abhI.js.map +1 -0
- package/dist/chunks/keyframes-cUdsXSXQ.cjs +187 -0
- package/dist/chunks/keyframes-cUdsXSXQ.cjs.map +1 -0
- package/dist/chunks/{manifest-BDpbuI-9.js → manifest-D58HXVY-.js} +2 -2
- package/dist/chunks/{manifest-BDpbuI-9.js.map → manifest-D58HXVY-.js.map} +1 -1
- package/dist/chunks/{player-CYGvna09.js → player-48Zy_NBG.js} +4 -4
- package/dist/chunks/{player-CYGvna09.js.map → player-48Zy_NBG.js.map} +1 -1
- package/dist/chunks/registry-C0xLNq3-.cjs +81 -0
- package/dist/chunks/registry-C0xLNq3-.cjs.map +1 -0
- package/dist/chunks/{registry-BRM2BRRY.js → registry-gFJRpPES.js} +2 -2
- package/dist/chunks/{registry-BRM2BRRY.js.map → registry-gFJRpPES.js.map} +1 -1
- package/dist/chunks/registry-jF8VIA_9.js +69 -0
- package/dist/chunks/registry-jF8VIA_9.js.map +1 -0
- package/dist/chunks/{spring-CAlkc1co.js → spring-CZDNyqWp.js} +2 -2
- package/dist/chunks/{spring-CAlkc1co.js.map → spring-CZDNyqWp.js.map} +1 -1
- package/dist/chunks/tween-DDObu9iA.js +542 -0
- package/dist/chunks/tween-DDObu9iA.js.map +1 -0
- package/dist/chunks/tween-JEthWrjo.cjs +554 -0
- package/dist/chunks/tween-JEthWrjo.cjs.map +1 -0
- package/dist/chunks/{variants-BBfyVPYm.js → variants-GU3yIL4F.js} +2 -2
- package/dist/chunks/{variants-BBfyVPYm.js.map → variants-GU3yIL4F.js.map} +1 -1
- package/dist/components/a11y.js +2 -2
- package/dist/components/angular.js +8 -8
- 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/core.cjs +219 -0
- package/dist/components/core.cjs.map +1 -0
- package/dist/components/core.d.cts +81 -0
- package/dist/components/core.d.ts +81 -0
- package/dist/components/core.js +214 -0
- package/dist/components/core.js.map +1 -0
- package/dist/components/depth.js +3 -3
- package/dist/components/design.js +3 -3
- package/dist/components/dsl.js +2 -2
- package/dist/components/effects.js +9 -9
- package/dist/components/engine.js +2 -2
- package/dist/components/feedback.js +1 -1
- package/dist/components/fx-3d.js +2 -2
- package/dist/components/fx-ai.js +2 -2
- package/dist/components/fx-chart.js +2 -2
- package/dist/components/fx-cinema.js +2 -2
- package/dist/components/fx-cyber.js +2 -2
- package/dist/components/fx-festival.js +2 -2
- package/dist/components/fx-focus.js +2 -2
- package/dist/components/fx-form.js +2 -2
- package/dist/components/fx-game.js +2 -2
- package/dist/components/fx-genart.js +2 -2
- package/dist/components/fx-geo.js +2 -2
- package/dist/components/fx-gesture.js +2 -2
- package/dist/components/fx-gpu.js +3 -3
- package/dist/components/fx-light.js +2 -2
- package/dist/components/fx-lottie.js +2 -2
- package/dist/components/fx-morph.js +2 -2
- package/dist/components/fx-music.js +3 -3
- package/dist/components/fx-organic.js +2 -2
- package/dist/components/fx-paper.js +2 -2
- package/dist/components/fx-perf.js +2 -2
- package/dist/components/fx-physics.js +2 -2
- package/dist/components/fx-retro.js +2 -2
- package/dist/components/fx-safe.js +2 -2
- package/dist/components/fx-shop.js +2 -2
- package/dist/components/fx-social.js +2 -2
- package/dist/components/fx-spatial.js +2 -2
- package/dist/components/fx-surface.js +2 -2
- package/dist/components/fx-text.js +2 -2
- package/dist/components/fx-transitions.js +3 -3
- package/dist/components/fx-video.js +2 -2
- package/dist/components/fx-weather.js +2 -2
- package/dist/components/fx.js +6 -6
- package/dist/components/fx2.cjs +1 -10
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +1 -6
- package/dist/components/fx2.d.ts +1 -6
- package/dist/components/fx2.js +7 -15
- 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.cjs +104 -0
- package/dist/components/marketplace.cjs.map +1 -1
- package/dist/components/marketplace.d.cts +33 -2
- package/dist/components/marketplace.d.ts +33 -2
- package/dist/components/marketplace.js +105 -5
- package/dist/components/marketplace.js.map +1 -1
- package/dist/components/native.js +3 -3
- 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/plugins.cjs +138 -0
- package/dist/components/plugins.cjs.map +1 -0
- package/dist/components/plugins.d.cts +120 -0
- package/dist/components/plugins.d.ts +120 -0
- package/dist/components/plugins.js +105 -0
- package/dist/components/plugins.js.map +1 -0
- package/dist/components/reveal.js +1 -1
- package/dist/components/solid.js +8 -8
- package/dist/components/svelte.js +8 -8
- 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 +8 -8
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +420 -199
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +42 -2
- package/dist/components/widgets.d.ts +42 -2
- package/dist/components/widgets.js +428 -209
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.js +10 -10
- package/dist/index.js +2 -2
- package/dist/llms-full.txt +3018 -0
- package/dist/llms.txt +207 -0
- package/dist/manifest.json +7562 -0
- package/dist/manifest.schema.json +85 -0
- package/dist/runtime/format-css.cjs +184 -0
- package/dist/runtime/format-css.cjs.map +1 -0
- package/dist/runtime/format-css.d.cts +174 -0
- package/dist/runtime/format-css.d.ts +174 -0
- package/dist/runtime/format-css.iife.js +2 -0
- package/dist/runtime/format-css.iife.js.map +1 -0
- package/dist/runtime/format-css.js +176 -0
- package/dist/runtime/format-css.js.map +1 -0
- package/dist/runtime/format-motion.cjs +138 -0
- package/dist/runtime/format-motion.cjs.map +1 -0
- package/dist/runtime/format-motion.d.cts +208 -0
- package/dist/runtime/format-motion.d.ts +208 -0
- package/dist/runtime/format-motion.iife.js +2 -0
- package/dist/runtime/format-motion.iife.js.map +1 -0
- package/dist/runtime/format-motion.js +132 -0
- package/dist/runtime/format-motion.js.map +1 -0
- package/dist/runtime.cjs +78 -0
- package/dist/runtime.cjs.map +1 -0
- package/dist/runtime.d.cts +236 -0
- package/dist/runtime.d.ts +236 -0
- package/dist/runtime.iife.js +2 -0
- package/dist/runtime.iife.js.map +1 -0
- package/dist/runtime.js +54 -0
- package/dist/runtime.js.map +1 -0
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +85 -14
- package/docs/components.md +66 -0
- package/docs/core.md +47 -0
- package/docs/deprecations.md +1 -1
- package/docs/runtime/core.md +55 -0
- package/docs/runtime/format-css.md +59 -0
- package/docs/runtime/format-motion.md +56 -0
- package/docs/upgrading-10.md +1 -1
- package/package.json +88 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as adoptStyles } from './base-BnRyfuyM.js';
|
|
2
2
|
|
|
3
3
|
var css = ":root{--usa-accent:#7c5cff;--usa-accent-text:#fff;--usa-surface:#1b1e27;--usa-text:inherit;--usa-radius:14px;--usa-border:1px solid rgb(127 127 127 / 0.25);--usa-shadow:0 10px 30px -12px rgb(0 0 0 / 0.45);--usa-blur:0px;--usa-font:inherit}:where([variant=\"minimal\"],[data-usa-variant=\"minimal\"]){--usa-accent:currentColor;--usa-accent-text:Canvas;--usa-surface:transparent;--usa-radius:6px;--usa-border:1px solid color-mix(in srgb,currentColor 22%,transparent);--usa-shadow:none;--usa-blur:0px}:where([variant=\"neon\"],[data-usa-variant=\"neon\"]){--usa-accent:#00f0ff;--usa-accent-text:#04121a;--usa-surface:#0a0b14;--usa-text:#e6fbff;--usa-radius:10px;--usa-border:1px solid #00f0ff;--usa-shadow:0 0 6px #00f0ff,0 0 22px rgb(0 240 255 / 0.45);--usa-blur:0px}:where([variant=\"glass\"],[data-usa-variant=\"glass\"]){--usa-accent:#a78bfa;--usa-accent-text:#fff;--usa-surface:rgb(255 255 255 / 0.12);--usa-radius:18px;--usa-border:1px solid rgb(255 255 255 / 0.28);--usa-shadow:0 12px 40px -12px rgb(0 0 0 / 0.35);--usa-blur:16px}:where([variant=\"brutalist\"],[data-usa-variant=\"brutalist\"]){--usa-accent:#ff3d00;--usa-accent-text:#000;--usa-surface:#fff;--usa-text:#000;--usa-radius:0px;--usa-border:3px solid #000;--usa-shadow:5px 5px 0 #000;--usa-blur:0px;--usa-font:ui-monospace,\"SFMono-Regular\",Menlo,monospace}:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#0067c0;--usa-accent-text:#fff;--usa-surface:rgb(249 249 249 / 0.82);--usa-text:#1a1a1a;--usa-radius:8px;--usa-border:1px solid rgb(0 0 0 / 0.08);--usa-shadow:0 2px 4px rgb(0 0 0 / 0.14),0 0 2px rgb(0 0 0 / 0.12);--usa-blur:30px;--usa-font:\"Segoe UI Variable\",\"Segoe UI\",system-ui,sans-serif}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#6750a4;--usa-accent-text:#fff;--usa-surface:#fffbfe;--usa-text:#1c1b1f;--usa-radius:20px;--usa-border:0 solid transparent;--usa-shadow:0 1px 3px rgb(0 0 0 / 0.3),0 4px 8px 3px rgb(0 0 0 / 0.15);--usa-blur:0px;--usa-font:Roboto,system-ui,sans-serif}@media (prefers-color-scheme:dark){:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#4cc2ff;--usa-accent-text:#000;--usa-surface:rgb(44 44 44 / 0.8);--usa-text:#fff;--usa-border:1px solid rgb(255 255 255 / 0.08)}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#d0bcff;--usa-accent-text:#381e72;--usa-surface:#1c1b1f;--usa-text:#e6e1e5}}.usa-surface{background:var(--usa-surface);color:var(--usa-text);border:var(--usa-border);border-radius:var(--usa-radius);box-shadow:var(--usa-shadow);font-family:var(--usa-font);-webkit-backdrop-filter:blur(var(--usa-blur));backdrop-filter:blur(var(--usa-blur))}@media (prefers-reduced-transparency:reduce){.usa-surface{-webkit-backdrop-filter:none;backdrop-filter:none}}";
|
|
4
4
|
|
|
@@ -32,4 +32,4 @@ function setVariant(variant, root = typeof document !== 'undefined' ? document.d
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export { VARIANTS as V, adoptVariants as a, setVariant as s };
|
|
35
|
-
//# sourceMappingURL=variants-
|
|
35
|
+
//# sourceMappingURL=variants-GU3yIL4F.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants-
|
|
1
|
+
{"version":3,"file":"variants-GU3yIL4F.js","sources":["../../src/components/ui/variants.ts"],"sourcesContent":["import { adoptStyles } from '../base';\nimport css from './variants.css?raw';\n\n/**\n * Style variants (v2.6): `variant=\"minimal | neon | glass | brutalist |\n * fluent | material\"` on any `<usa-*>` element — or on any ancestor as\n * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared\n * design tokens every component reads:\n *\n * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,\n * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.\n *\n * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`\n * for their kind; the token names never clash with those values except\n * `fluent`, which means the same thing there.)\n */\nexport const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'] as const;\nexport type Variant = (typeof VARIANTS)[number];\n\n/** Inject the variant token sheet (done automatically by every `ui` component). */\nexport function adoptVariants(): void {\n adoptStyles('variants', css);\n}\n\n/** Apply a variant to the whole page (or `root`); `null` removes it. */\nexport function setVariant(variant: Variant | null, root: Element | null = typeof document !== 'undefined' ? document.documentElement : null): void {\n if (!root) return;\n adoptVariants();\n if (variant) root.setAttribute('data-usa-variant', variant);\n else root.removeAttribute('data-usa-variant');\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU;AAGtF;SACgB,aAAa,GAAA;AAC3B,IAAA,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B;AAEA;SACgB,UAAU,CAAC,OAAuB,EAAE,IAAA,GAAuB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,EAAA;AAC1I,IAAA,IAAI,CAAC,IAAI;QAAE;AACX,IAAA,aAAa,EAAE;AACf,IAAA,IAAI,OAAO;AAAE,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;;AACtD,QAAA,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;AAC/C;;;;"}
|
package/dist/components/a11y.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { d as adaptKeyframes } from '../chunks/base-
|
|
1
|
+
import { C as deprecate, i as getMotionSensitivity, a as MOTION_SENSITIVITY_LEVELS, g as configureComponents, B as adoptStyles } from '../chunks/base-BnRyfuyM.js';
|
|
2
|
+
export { d as adaptKeyframes } from '../chunks/base-BnRyfuyM.js';
|
|
3
3
|
import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-B-JBecYg.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { defineComponents } from '../components.js';
|
|
2
2
|
export { b as bindUsa, u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
3
3
|
import './reveal.js';
|
|
4
|
-
import '../chunks/base-
|
|
4
|
+
import '../chunks/base-BnRyfuyM.js';
|
|
5
5
|
import './text.js';
|
|
6
|
-
import '../chunks/core-
|
|
6
|
+
import '../chunks/core-DsGoL9EY.js';
|
|
7
7
|
import './tokens.js';
|
|
8
8
|
import './interaction.js';
|
|
9
9
|
import './feedback.js';
|
|
10
10
|
import './background.js';
|
|
11
|
-
import '../chunks/variants-
|
|
11
|
+
import '../chunks/variants-GU3yIL4F.js';
|
|
12
12
|
import './transitions.js';
|
|
13
13
|
import './physics.js';
|
|
14
|
-
import '../chunks/spring-
|
|
14
|
+
import '../chunks/spring-CZDNyqWp.js';
|
|
15
15
|
import './cards.js';
|
|
16
16
|
import './click.js';
|
|
17
|
-
import '../chunks/fx-
|
|
17
|
+
import '../chunks/fx-CtnrFEg9.js';
|
|
18
18
|
import './ui.js';
|
|
19
19
|
import './page.js';
|
|
20
20
|
import './timeline.js';
|
|
21
21
|
import './gesture.js';
|
|
22
|
-
import '../chunks/core-
|
|
22
|
+
import '../chunks/core-XA2yhn1b.js';
|
|
23
23
|
import './svg.js';
|
|
24
24
|
import './webgl.js';
|
|
25
25
|
import './depth.js';
|
|
26
26
|
import './layout.js';
|
|
27
27
|
import './packs.js';
|
|
28
28
|
import './fx.js';
|
|
29
|
-
import '../chunks/registry-
|
|
30
|
-
import '../chunks/builtins-
|
|
29
|
+
import '../chunks/registry-gFJRpPES.js';
|
|
30
|
+
import '../chunks/builtins-CqIq1zBv.js';
|
|
31
31
|
import './a11y.js';
|
|
32
32
|
import '../chunks/index-tags-B-JBecYg.js';
|
|
33
33
|
import './perf.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as defineElement, l as caf, r as raf,
|
|
2
|
-
import { s as setVariant } from '../chunks/variants-
|
|
1
|
+
import { u as defineElement, l as caf, r as raf, B as adoptStyles, p as prefersReducedMotion } from '../chunks/base-BnRyfuyM.js';
|
|
2
|
+
import { s as setVariant } from '../chunks/variants-GU3yIL4F.js';
|
|
3
3
|
|
|
4
4
|
var css$6 = "usa-aurora{position:relative;display:block;isolation:isolate;overflow:hidden}usa-aurora .usa-aurora-layer{position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:var(--usa-aurora-opacity,0.7);overflow:hidden;contain:strict}usa-aurora .usa-aurora-layer i{position:absolute;display:block;width:70%;aspect-ratio:1;border-radius:50%;background:radial-gradient(closest-side,var(--c),transparent);will-change:transform;animation:usa-aurora-a var(--usa-aurora-speed,18s) ease-in-out infinite alternate}usa-aurora .usa-aurora-layer i:nth-child(1){left:-15%;top:-30%}usa-aurora .usa-aurora-layer i:nth-child(2){right:-20%;top:-10%;animation-name:usa-aurora-b;animation-duration:calc(var(--usa-aurora-speed,18s) * 1.3)}usa-aurora .usa-aurora-layer i:nth-child(3){left:10%;bottom:-45%;animation-name:usa-aurora-c;animation-duration:calc(var(--usa-aurora-speed,18s) * 0.9)}usa-aurora .usa-aurora-layer i:nth-child(4){right:0;bottom:-30%;width:50%;animation-name:usa-aurora-b;animation-direction:alternate-reverse}usa-aurora[paused] .usa-aurora-layer i,usa-aurora[data-offscreen] .usa-aurora-layer i{animation-play-state:paused}@keyframes usa-aurora-a{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(30%,20%,0) scale(1.25)}}@keyframes usa-aurora-b{from{transform:translate3d(0,0,0) scale(1.1)}to{transform:translate3d(-35%,25%,0) scale(0.85)}}@keyframes usa-aurora-c{from{transform:translate3d(0,0,0) rotate(0deg) scale(1)}to{transform:translate3d(25%,-30%,0) rotate(40deg) scale(1.2)}}@media (prefers-reduced-motion:reduce){usa-aurora .usa-aurora-layer i,usa-grain .usa-grain-layer,usa-acrylic::after{animation:none !important}}";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as configureComponents, a as MOTION_SENSITIVITY_LEVELS } from '../chunks/base-
|
|
1
|
+
import { g as configureComponents, a as MOTION_SENSITIVITY_LEVELS } from '../chunks/base-BnRyfuyM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* motionary/components/bridge — native shell bridges (4.7).
|
package/dist/components/cards.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as defineElement, r as raf, l as caf, D as EASE_OUT, k as clamp } from '../chunks/base-
|
|
2
|
-
import { d as springEasing, c as createSpring } from '../chunks/spring-
|
|
1
|
+
import { u as defineElement, r as raf, l as caf, D as EASE_OUT, k as clamp } from '../chunks/base-BnRyfuyM.js';
|
|
2
|
+
import { d as springEasing, c as createSpring } from '../chunks/spring-CZDNyqWp.js';
|
|
3
3
|
|
|
4
4
|
var css$3 = "usa-card{--usa-card-radius:18px;--usa-card-bg:var(--usa-surface,#1b1e27);--usa-card-glow:var(--usa-accent,#7c5cff);--usa-card-x:50%;--usa-card-y:50%;--usa-card-nx:0;--usa-card-ny:0;position:relative;display:block;border-radius:var(--usa-card-radius);isolation:isolate;-webkit-tap-highlight-color:transparent}usa-card:focus-visible{outline:2px solid var(--usa-card-glow);outline-offset:3px}usa-card[effect~=\"lift\"]{transition:transform 0.45s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.45s ease}usa-card[effect~=\"lift\"][data-hover],usa-card[effect~=\"lift\"]:focus-visible{transform:translateY(-6px) perspective(900px) rotateX(calc(var(--usa-card-ny) * -4deg)) rotateY(calc(var(--usa-card-nx) * 4deg));box-shadow:0 22px 44px -18px rgb(0 0 0 / 0.55)}usa-card[effect~=\"glass\"]{background:color-mix(in srgb,var(--usa-card-bg) 45%,transparent);border:1px solid rgb(255 255 255 / 0.16);-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5)}usa-card[effect~=\"spotlight\"]::before,usa-card[effect~=\"border-glow\"]::after{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity 0.3s ease}usa-card[effect~=\"spotlight\"]::before{z-index:-1;background:radial-gradient(260px circle at var(--usa-card-x) var(--usa-card-y),color-mix(in srgb,var(--usa-card-glow) 28%,transparent),transparent 70%)}usa-card[effect~=\"border-glow\"]::after{padding:1.5px;background:radial-gradient(180px circle at var(--usa-card-x) var(--usa-card-y),var(--usa-card-glow),transparent 70%);-webkit-mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}usa-card[data-hover]::before,usa-card[data-hover]::after{opacity:1}@property --usa-card-angle{syntax:\"<angle>\";inherits:false;initial-value:0deg}usa-card[effect~=\"conic-border\"]{border:2px solid transparent;background:linear-gradient(var(--usa-card-bg),var(--usa-card-bg)) padding-box,conic-gradient(from var(--usa-card-angle),var(--usa-card-glow),#22d3ee,#f472b6,var(--usa-card-glow)) border-box;animation:usa-card-spin 4s linear infinite}@keyframes usa-card-spin{to{--usa-card-angle:360deg}}usa-card .usa-card-sheen{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}usa-card .usa-card-sheen::before{content:\"\";position:absolute;top:0;bottom:0;width:45%;left:-60%;transform:skewX(-20deg);background:linear-gradient(90deg,transparent,rgb(255 255 255 / 0.35),transparent)}usa-card[effect~=\"sheen\"]:hover .usa-card-sheen::before,usa-card[effect~=\"sheen\"]:focus-visible .usa-card-sheen::before{left:130%;transition:left 0.8s cubic-bezier(0.22,1,0.36,1)}usa-card .usa-card-holo{position:absolute;inset:0;border-radius:inherit;pointer-events:none;mix-blend-mode:color-dodge;opacity:0.35;background:linear-gradient(115deg,transparent 20%,#ff7ad9 35%,#7af0ff 45%,#ffe27a 55%,transparent 70%) calc(var(--usa-card-x) * 1.4 - 20%) calc(var(--usa-card-y) * 1.4 - 20%) / 220% 220%;transition:opacity 0.3s ease}usa-card[data-hover] .usa-card-holo{opacity:0.7}usa-card[effect~=\"parallax-layers\"] [data-depth]{transition:transform 0.25s ease-out;will-change:transform}usa-card[effect~=\"flip\"]{perspective:1000px;display:grid}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{grid-area:1 / 1;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:inherit;transition:transform 0.7s cubic-bezier(0.34,1.3,0.64,1),opacity 0.3s ease}usa-card[effect~=\"flip\"]>[data-back]{transform:rotateY(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"]>[data-back]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateY(-180deg)}usa-card[effect~=\"flip\"][flipped]>[data-back],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateY(0deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-front],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-back],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateX(0deg)}usa-card[effect~=\"flip\"][trigger=\"click\"]{cursor:pointer}usa-card[effect~=\"expand\"]{cursor:zoom-in}usa-card[effect~=\"expand\"]:not([expanded]) [data-detail]{display:none}usa-card[expanded]{position:fixed;inset:6vh max(4vw,calc(50vw - 420px));z-index:1000;overflow:auto;cursor:default;background:var(--usa-card-bg);box-shadow:0 30px 80px -20px rgb(0 0 0 / 0.6)}.usa-card-backdrop{position:fixed;inset:0;z-index:999;background:rgb(0 0 0 / 0.45)}@media (prefers-reduced-motion:reduce){usa-card,usa-card *,usa-card .usa-card-sheen::before{transition-duration:0.01ms !important;animation:none !important}usa-card[effect~=\"lift\"][data-hover]{transform:none}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{transform:none !important}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([flipped])>[data-back]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{opacity:1;visibility:visible}}@media (prefers-reduced-transparency:reduce),(forced-colors:active){usa-card[effect~=\"glass\"]{background:var(--usa-card-bg);-webkit-backdrop-filter:none;backdrop-filter:none}}";
|
|
5
5
|
|
package/dist/components/click.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as defineElement, D as EASE_OUT, k as clamp, l as caf, q as now, r as raf } from '../chunks/base-
|
|
2
|
-
import { d as springEasing, c as createSpring } from '../chunks/spring-
|
|
3
|
-
import { b as burst, c as confetti, h as haptic, s as shake } from '../chunks/fx-
|
|
1
|
+
import { u as defineElement, D as EASE_OUT, k as clamp, l as caf, q as now, r as raf } from '../chunks/base-BnRyfuyM.js';
|
|
2
|
+
import { d as springEasing, c as createSpring } from '../chunks/spring-CZDNyqWp.js';
|
|
3
|
+
import { b as burst, c as confetti, h as haptic, s as shake } from '../chunks/fx-CtnrFEg9.js';
|
|
4
4
|
|
|
5
5
|
var css$6 = "usa-click{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}usa-click[block]{display:block}usa-click .usa-click-wave{position:absolute;border-radius:50%;pointer-events:none;z-index:-1;transform:scale(0);background:radial-gradient(circle,var(--usa-wave) 0 55%,color-mix(in srgb,var(--usa-wave) 40%,transparent) 70%,transparent 72%)}";
|
|
6
6
|
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.
|
|
5
|
+
*
|
|
6
|
+
* Everything else is a plugin: `createMotion().use(retro, cinema)` with the
|
|
7
|
+
* packs from `motionary/plugins` (or your own `{ name, effects }`).
|
|
8
|
+
*
|
|
9
|
+
* - `createMotion({ reducedMotion, rate })` → an instance with `use()`,
|
|
10
|
+
* `play(el, effect, options)`, `bind(el, effect, { trigger })`,
|
|
11
|
+
* `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,
|
|
12
|
+
* `pause()` / `resume()` / `setRate()` for everything it started,
|
|
13
|
+
* `effects()` and `destroy()`.
|
|
14
|
+
* - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,
|
|
15
|
+
* zoom-in/out, blur-in, flip-up), registered as `enter` effects.
|
|
16
|
+
* - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →
|
|
17
|
+
* `canvas`, the order GPU plugins use.
|
|
18
|
+
*
|
|
19
|
+
* Reduced motion is honoured everywhere (OS setting or `reducedMotion:
|
|
20
|
+
* 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.
|
|
21
|
+
*/
|
|
22
|
+
const VERSION = '10.0.0';
|
|
23
|
+
const T = (x, y, s = 1) => `translate(${x}px,${y}px) scale(${s})`;
|
|
24
|
+
/** Entrance keyframes (10.0). */
|
|
25
|
+
const PRESETS = {
|
|
26
|
+
fade: [{ opacity: 0 }, { opacity: 1 }],
|
|
27
|
+
'fade-up': [{ opacity: 0, transform: T(0, 24) }, { opacity: 1, transform: 'none' }],
|
|
28
|
+
'fade-down': [{ opacity: 0, transform: T(0, -24) }, { opacity: 1, transform: 'none' }],
|
|
29
|
+
'fade-left': [{ opacity: 0, transform: T(24, 0) }, { opacity: 1, transform: 'none' }],
|
|
30
|
+
'fade-right': [{ opacity: 0, transform: T(-24, 0) }, { opacity: 1, transform: 'none' }],
|
|
31
|
+
scale: [{ opacity: 0, transform: 'scale(.85)' }, { opacity: 1, transform: 'none' }],
|
|
32
|
+
'zoom-in': [{ opacity: 0, transform: 'scale(.6)' }, { opacity: 1, transform: 'none' }],
|
|
33
|
+
'zoom-out': [{ opacity: 0, transform: 'scale(1.2)' }, { opacity: 1, transform: 'none' }],
|
|
34
|
+
'blur-in': [{ opacity: 0, filter: 'blur(10px)' }, { opacity: 1, filter: 'none' }],
|
|
35
|
+
'flip-up': [{ opacity: 0, transform: 'perspective(600px) rotateX(-60deg)' }, { opacity: 1, transform: 'none' }],
|
|
36
|
+
};
|
|
37
|
+
const EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';
|
|
38
|
+
const SKIP = ['loop', 'background', 'cursor'];
|
|
39
|
+
/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */
|
|
40
|
+
function preferredBackend() {
|
|
41
|
+
if (typeof navigator !== 'undefined' && navigator.gpu)
|
|
42
|
+
return 'webgpu';
|
|
43
|
+
try {
|
|
44
|
+
if (typeof document !== 'undefined' && document.createElement('canvas').getContext?.('webgl2'))
|
|
45
|
+
return 'webgl2';
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
/* no GL */
|
|
49
|
+
}
|
|
50
|
+
return 'canvas';
|
|
51
|
+
}
|
|
52
|
+
const list = (t) => typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll(t))) : 'length' in t && !(t instanceof Element) ? Array.from(t) : [t];
|
|
53
|
+
/** Create a Motionary core instance (10.0). */
|
|
54
|
+
function createMotion(config = {}) {
|
|
55
|
+
const reg = new Map();
|
|
56
|
+
const plugins = new Set();
|
|
57
|
+
const live = new Set();
|
|
58
|
+
const offs = new Set();
|
|
59
|
+
let paused = false;
|
|
60
|
+
let rate = config.rate && config.rate > 0 ? config.rate : 1;
|
|
61
|
+
const reduced = () => config.reducedMotion === 'reduce' || (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
62
|
+
const animate = (el, kf, o) => {
|
|
63
|
+
if (typeof el.animate !== 'function')
|
|
64
|
+
return null;
|
|
65
|
+
const a = el.animate(kf, o);
|
|
66
|
+
if (!a)
|
|
67
|
+
return null;
|
|
68
|
+
live.add(a);
|
|
69
|
+
if (rate !== 1)
|
|
70
|
+
a.playbackRate = rate;
|
|
71
|
+
if (paused)
|
|
72
|
+
a.pause();
|
|
73
|
+
const done = () => live.delete(a);
|
|
74
|
+
a.finished?.then(done, done);
|
|
75
|
+
return a;
|
|
76
|
+
};
|
|
77
|
+
const ctx = (event, cleanups = []) => ({ reduced: reduced(), sensitivity: reduced() ? 'minimal' : 'full', event, animate, onCleanup: (f) => cleanups.push(f) });
|
|
78
|
+
const skip = (d) => reduced() && (d.reduced ?? (SKIP.includes(d.kind) ? 'skip' : 'run')) === 'skip';
|
|
79
|
+
const m = {
|
|
80
|
+
get paused() {
|
|
81
|
+
return paused;
|
|
82
|
+
},
|
|
83
|
+
get rate() {
|
|
84
|
+
return rate;
|
|
85
|
+
},
|
|
86
|
+
use(...ps) {
|
|
87
|
+
for (const p of ps) {
|
|
88
|
+
if (!p || plugins.has(p.name))
|
|
89
|
+
continue;
|
|
90
|
+
plugins.add(p.name);
|
|
91
|
+
for (const e of p.effects || [])
|
|
92
|
+
if (!reg.has(e.name))
|
|
93
|
+
reg.set(e.name, e);
|
|
94
|
+
p.install?.(m);
|
|
95
|
+
}
|
|
96
|
+
return m;
|
|
97
|
+
},
|
|
98
|
+
has: (n) => reg.has(n),
|
|
99
|
+
effects: () => Array.from(reg.keys()).sort(),
|
|
100
|
+
reduced,
|
|
101
|
+
animate,
|
|
102
|
+
async play(el, name, options = {}, event) {
|
|
103
|
+
const d = reg.get(name);
|
|
104
|
+
if (!d)
|
|
105
|
+
throw new Error(`[motionary] unknown effect "${name}" — add its plugin with use()`);
|
|
106
|
+
if (skip(d))
|
|
107
|
+
return;
|
|
108
|
+
const out = d.run(el, { ...(d.defaults || {}), ...options }, ctx(event));
|
|
109
|
+
if (out?.finished?.then)
|
|
110
|
+
await out.finished.catch(() => undefined);
|
|
111
|
+
else if (out?.then)
|
|
112
|
+
await out;
|
|
113
|
+
},
|
|
114
|
+
bind(el, name, options = {}) {
|
|
115
|
+
const { trigger = 'click', once, ...o } = options;
|
|
116
|
+
const d = reg.get(name);
|
|
117
|
+
if (!d)
|
|
118
|
+
throw new Error(`[motionary] unknown effect "${name}"`);
|
|
119
|
+
const stops = [];
|
|
120
|
+
let current = [];
|
|
121
|
+
const fire = (e) => {
|
|
122
|
+
if (skip(d))
|
|
123
|
+
return;
|
|
124
|
+
current.splice(0).forEach((f) => f());
|
|
125
|
+
const out = d.run(el, { ...(d.defaults || {}), ...o }, ctx(e, current));
|
|
126
|
+
if (typeof out === 'function')
|
|
127
|
+
current.push(out);
|
|
128
|
+
};
|
|
129
|
+
const on = (type) => {
|
|
130
|
+
const h = (e) => fire(e);
|
|
131
|
+
el.addEventListener(type, h, { once: !!once });
|
|
132
|
+
stops.push(() => el.removeEventListener(type, h));
|
|
133
|
+
};
|
|
134
|
+
if (trigger === 'click')
|
|
135
|
+
on('click');
|
|
136
|
+
else if (trigger === 'hover')
|
|
137
|
+
(on('pointerenter'), on('focusin'));
|
|
138
|
+
else if (trigger === 'load' || trigger === 'loop')
|
|
139
|
+
fire();
|
|
140
|
+
else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {
|
|
141
|
+
const io = new IntersectionObserver((es) => es.forEach((en) => {
|
|
142
|
+
if (!en.isIntersecting)
|
|
143
|
+
return;
|
|
144
|
+
fire();
|
|
145
|
+
if (once !== false)
|
|
146
|
+
io.disconnect();
|
|
147
|
+
}));
|
|
148
|
+
io.observe(el);
|
|
149
|
+
stops.push(() => io.disconnect());
|
|
150
|
+
}
|
|
151
|
+
const off = () => {
|
|
152
|
+
stops.splice(0).forEach((f) => f());
|
|
153
|
+
current.splice(0).forEach((f) => f());
|
|
154
|
+
offs.delete(off);
|
|
155
|
+
};
|
|
156
|
+
offs.add(off);
|
|
157
|
+
return off;
|
|
158
|
+
},
|
|
159
|
+
reveal(targets, preset = 'fade-up', o = {}) {
|
|
160
|
+
const els = list(targets);
|
|
161
|
+
const kf = PRESETS[preset] || PRESETS.fade;
|
|
162
|
+
const show = (el, i) => {
|
|
163
|
+
el.style.removeProperty('opacity');
|
|
164
|
+
animate(el, reduced() ? PRESETS.fade : kf, { duration: o.duration ?? 600, delay: (o.delay ?? 0) + (o.stagger ?? 0) * i, easing: o.easing || EASE, fill: 'backwards' });
|
|
165
|
+
};
|
|
166
|
+
if (typeof IntersectionObserver === 'undefined') {
|
|
167
|
+
els.forEach(show);
|
|
168
|
+
return () => undefined;
|
|
169
|
+
}
|
|
170
|
+
els.forEach((el) => (el.style.opacity = '0'));
|
|
171
|
+
let batch = 0;
|
|
172
|
+
const io = new IntersectionObserver((es) => {
|
|
173
|
+
batch = 0;
|
|
174
|
+
for (const en of es) {
|
|
175
|
+
if (!en.isIntersecting)
|
|
176
|
+
continue;
|
|
177
|
+
show(en.target, batch++);
|
|
178
|
+
if (o.once !== false)
|
|
179
|
+
io.unobserve(en.target);
|
|
180
|
+
}
|
|
181
|
+
}, { threshold: o.threshold ?? 0.15 });
|
|
182
|
+
els.forEach((el) => io.observe(el));
|
|
183
|
+
const off = () => {
|
|
184
|
+
io.disconnect();
|
|
185
|
+
els.forEach((el) => el.style.removeProperty('opacity'));
|
|
186
|
+
offs.delete(off);
|
|
187
|
+
};
|
|
188
|
+
offs.add(off);
|
|
189
|
+
return off;
|
|
190
|
+
},
|
|
191
|
+
pause() {
|
|
192
|
+
paused = true;
|
|
193
|
+
live.forEach((a) => a.pause());
|
|
194
|
+
},
|
|
195
|
+
resume() {
|
|
196
|
+
paused = false;
|
|
197
|
+
live.forEach((a) => a.play());
|
|
198
|
+
},
|
|
199
|
+
setRate(r) {
|
|
200
|
+
if (!(r > 0))
|
|
201
|
+
return;
|
|
202
|
+
rate = r;
|
|
203
|
+
live.forEach((a) => (a.playbackRate = r));
|
|
204
|
+
},
|
|
205
|
+
destroy() {
|
|
206
|
+
Array.from(offs).forEach((f) => f());
|
|
207
|
+
live.forEach((a) => a.cancel());
|
|
208
|
+
live.clear();
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
m.use({ name: 'core/presets', effects: Object.entries(PRESETS).map(([name, frames]) => ({ name, kind: 'enter', defaults: { duration: 600, delay: 0, easing: EASE }, run: (el, o, c) => c.animate(el, c.reduced ? PRESETS.fade : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }) })) });
|
|
212
|
+
return m;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
exports.PRESETS = PRESETS;
|
|
216
|
+
exports.VERSION = VERSION;
|
|
217
|
+
exports.createMotion = createMotion;
|
|
218
|
+
exports.preferredBackend = preferredBackend;
|
|
219
|
+
//# sourceMappingURL=core.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../../src/components/core/index.ts"],"sourcesContent":["/**\n * `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.\n *\n * Everything else is a plugin: `createMotion().use(retro, cinema)` with the\n * packs from `motionary/plugins` (or your own `{ name, effects }`).\n *\n * - `createMotion({ reducedMotion, rate })` → an instance with `use()`,\n * `play(el, effect, options)`, `bind(el, effect, { trigger })`,\n * `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,\n * `pause()` / `resume()` / `setRate()` for everything it started,\n * `effects()` and `destroy()`.\n * - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,\n * zoom-in/out, blur-in, flip-up), registered as `enter` effects.\n * - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →\n * `canvas`, the order GPU plugins use.\n *\n * Reduced motion is honoured everywhere (OS setting or `reducedMotion:\n * 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.\n */\nexport const VERSION = '10.0.0';\n\nexport type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});\nexport interface CoreEffectContext {\n reduced: boolean;\n sensitivity: 'full' | 'gentle' | 'minimal' | 'static';\n event?: Event;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n onCleanup(fn: () => void): void;\n}\nexport interface CoreEffect {\n name: string;\n kind: CoreEffectKind;\n description?: string;\n defaults?: Record<string, unknown>;\n reduced?: 'skip' | 'run';\n run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;\n}\nexport interface CorePlugin {\n name: string;\n effects?: CoreEffect[];\n install?(m: MotionInstance): void;\n}\nexport type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';\nexport interface RevealOptions {\n stagger?: number;\n delay?: number;\n duration?: number;\n easing?: string;\n once?: boolean;\n threshold?: number;\n}\nexport interface MotionInstance {\n readonly paused: boolean;\n readonly rate: number;\n use(...plugins: CorePlugin[]): MotionInstance;\n has(effect: string): boolean;\n effects(): string[];\n reduced(): boolean;\n animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;\n play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;\n bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & { trigger?: Trigger; once?: boolean }): () => void;\n reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;\n pause(): void;\n resume(): void;\n setRate(rate: number): void;\n destroy(): void;\n}\n\nconst T = (x: number, y: number, s = 1) => `translate(${x}px,${y}px) scale(${s})`;\n/** Entrance keyframes (10.0). */\nexport const PRESETS: Record<string, Keyframe[]> = {\n fade: [{ opacity: 0 }, { opacity: 1 }],\n 'fade-up': [{ opacity: 0, transform: T(0, 24) }, { opacity: 1, transform: 'none' }],\n 'fade-down': [{ opacity: 0, transform: T(0, -24) }, { opacity: 1, transform: 'none' }],\n 'fade-left': [{ opacity: 0, transform: T(24, 0) }, { opacity: 1, transform: 'none' }],\n 'fade-right': [{ opacity: 0, transform: T(-24, 0) }, { opacity: 1, transform: 'none' }],\n scale: [{ opacity: 0, transform: 'scale(.85)' }, { opacity: 1, transform: 'none' }],\n 'zoom-in': [{ opacity: 0, transform: 'scale(.6)' }, { opacity: 1, transform: 'none' }],\n 'zoom-out': [{ opacity: 0, transform: 'scale(1.2)' }, { opacity: 1, transform: 'none' }],\n 'blur-in': [{ opacity: 0, filter: 'blur(10px)' }, { opacity: 1, filter: 'none' }],\n 'flip-up': [{ opacity: 0, transform: 'perspective(600px) rotateX(-60deg)' }, { opacity: 1, transform: 'none' }],\n};\nconst EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';\nconst SKIP: string[] = ['loop', 'background', 'cursor'];\n\n/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */\nexport function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas' {\n if (typeof navigator !== 'undefined' && (navigator as any).gpu) return 'webgpu';\n try {\n if (typeof document !== 'undefined' && document.createElement('canvas').getContext?.('webgl2')) return 'webgl2';\n } catch {\n /* no GL */\n }\n return 'canvas';\n}\n\nconst list = (t: string | Element | ArrayLike<Element>): HTMLElement[] =>\n typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll<HTMLElement>(t))) : 'length' in (t as ArrayLike<Element>) && !(t instanceof Element) ? (Array.from(t as ArrayLike<Element>) as HTMLElement[]) : [t as HTMLElement];\n\n/** Create a Motionary core instance (10.0). */\nexport function createMotion(config: { reducedMotion?: 'user' | 'reduce'; rate?: number } = {}): MotionInstance {\n const reg = new Map<string, CoreEffect>();\n const plugins = new Set<string>();\n const live = new Set<Animation>();\n const offs = new Set<() => void>();\n let paused = false;\n let rate = config.rate && config.rate > 0 ? config.rate : 1;\n const reduced = () => config.reducedMotion === 'reduce' || (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches);\n const animate: MotionInstance['animate'] = (el, kf, o) => {\n if (typeof (el as any).animate !== 'function') return null;\n const a = el.animate(kf, o);\n if (!a) return null;\n live.add(a);\n if (rate !== 1) a.playbackRate = rate;\n if (paused) a.pause();\n const done = () => live.delete(a);\n a.finished?.then(done, done);\n return a;\n };\n const ctx = (event?: Event, cleanups: (() => void)[] = []): CoreEffectContext => ({ reduced: reduced(), sensitivity: reduced() ? 'minimal' : 'full', event, animate, onCleanup: (f) => cleanups.push(f) });\n const skip = (d: CoreEffect) => reduced() && (d.reduced ?? (SKIP.includes(d.kind) ? 'skip' : 'run')) === 'skip';\n const m: MotionInstance = {\n get paused() {\n return paused;\n },\n get rate() {\n return rate;\n },\n use(...ps) {\n for (const p of ps) {\n if (!p || plugins.has(p.name)) continue;\n plugins.add(p.name);\n for (const e of p.effects || []) if (!reg.has(e.name)) reg.set(e.name, e);\n p.install?.(m);\n }\n return m;\n },\n has: (n) => reg.has(n),\n effects: () => Array.from(reg.keys()).sort(),\n reduced,\n animate,\n async play(el, name, options = {}, event) {\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\" — add its plugin with use()`);\n if (skip(d)) return;\n const out = d.run(el, { ...(d.defaults || {}), ...options }, ctx(event)) as any;\n if (out?.finished?.then) await out.finished.catch(() => undefined);\n else if (out?.then) await out;\n },\n bind(el, name, options = {}) {\n const { trigger = 'click', once, ...o } = options;\n const d = reg.get(name);\n if (!d) throw new Error(`[motionary] unknown effect \"${name}\"`);\n const stops: (() => void)[] = [];\n let current: (() => void)[] = [];\n const fire = (e?: Event) => {\n if (skip(d)) return;\n current.splice(0).forEach((f) => f());\n const out = d.run(el, { ...(d.defaults || {}), ...o }, ctx(e, current));\n if (typeof out === 'function') current.push(out as () => void);\n };\n const on = (type: string) => {\n const h = (e: Event) => fire(e);\n el.addEventListener(type, h, { once: !!once });\n stops.push(() => el.removeEventListener(type, h));\n };\n if (trigger === 'click') on('click');\n else if (trigger === 'hover') (on('pointerenter'), on('focusin'));\n else if (trigger === 'load' || trigger === 'loop') fire();\n else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver((es) =>\n es.forEach((en) => {\n if (!en.isIntersecting) return;\n fire();\n if (once !== false) io.disconnect();\n })\n );\n io.observe(el);\n stops.push(() => io.disconnect());\n }\n const off = () => {\n stops.splice(0).forEach((f) => f());\n current.splice(0).forEach((f) => f());\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n reveal(targets, preset = 'fade-up', o = {}) {\n const els = list(targets);\n const kf = PRESETS[preset] || PRESETS.fade;\n const show = (el: HTMLElement, i: number) => {\n el.style.removeProperty('opacity');\n animate(el, reduced() ? PRESETS.fade : kf, { duration: o.duration ?? 600, delay: (o.delay ?? 0) + (o.stagger ?? 0) * i, easing: o.easing || EASE, fill: 'backwards' });\n };\n if (typeof IntersectionObserver === 'undefined') {\n els.forEach(show);\n return () => undefined;\n }\n els.forEach((el) => (el.style.opacity = '0'));\n let batch = 0;\n const io = new IntersectionObserver(\n (es) => {\n batch = 0;\n for (const en of es) {\n if (!en.isIntersecting) continue;\n show(en.target as HTMLElement, batch++);\n if (o.once !== false) io.unobserve(en.target);\n }\n },\n { threshold: o.threshold ?? 0.15 }\n );\n els.forEach((el) => io.observe(el));\n const off = () => {\n io.disconnect();\n els.forEach((el) => el.style.removeProperty('opacity'));\n offs.delete(off);\n };\n offs.add(off);\n return off;\n },\n pause() {\n paused = true;\n live.forEach((a) => a.pause());\n },\n resume() {\n paused = false;\n live.forEach((a) => a.play());\n },\n setRate(r) {\n if (!(r > 0)) return;\n rate = r;\n live.forEach((a) => (a.playbackRate = r));\n },\n destroy() {\n Array.from(offs).forEach((f) => f());\n live.forEach((a) => a.cancel());\n live.clear();\n },\n };\n m.use({ name: 'core/presets', effects: Object.entries(PRESETS).map(([name, frames]) => ({ name, kind: 'enter', defaults: { duration: 600, delay: 0, easing: EASE }, run: (el: HTMLElement, o: any, c: CoreEffectContext) => c.animate(el, c.reduced ? PRESETS.fade : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }) })) });\n return m;\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,OAAO,GAAG;AAiDvB,MAAM,CAAC,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAC,GAAG,CAAC,KAAK,aAAa,CAAC,CAAA,GAAA,EAAM,CAAC,CAAA,UAAA,EAAa,CAAC,GAAG;AACjF;AACO,MAAM,OAAO,GAA+B;AACjD,IAAA,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IACnF,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IACtF,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EA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MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAe,EAAE,CAAM,EAAE,CAAoB,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAClW,IAAA,OAAO,CAAC;AACV;;;;;;;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.
|
|
3
|
+
*
|
|
4
|
+
* Everything else is a plugin: `createMotion().use(retro, cinema)` with the
|
|
5
|
+
* packs from `motionary/plugins` (or your own `{ name, effects }`).
|
|
6
|
+
*
|
|
7
|
+
* - `createMotion({ reducedMotion, rate })` → an instance with `use()`,
|
|
8
|
+
* `play(el, effect, options)`, `bind(el, effect, { trigger })`,
|
|
9
|
+
* `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,
|
|
10
|
+
* `pause()` / `resume()` / `setRate()` for everything it started,
|
|
11
|
+
* `effects()` and `destroy()`.
|
|
12
|
+
* - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,
|
|
13
|
+
* zoom-in/out, blur-in, flip-up), registered as `enter` effects.
|
|
14
|
+
* - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →
|
|
15
|
+
* `canvas`, the order GPU plugins use.
|
|
16
|
+
*
|
|
17
|
+
* Reduced motion is honoured everywhere (OS setting or `reducedMotion:
|
|
18
|
+
* 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.
|
|
19
|
+
*/
|
|
20
|
+
declare const VERSION = "10.0.0";
|
|
21
|
+
type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});
|
|
22
|
+
interface CoreEffectContext {
|
|
23
|
+
reduced: boolean;
|
|
24
|
+
sensitivity: 'full' | 'gentle' | 'minimal' | 'static';
|
|
25
|
+
event?: Event;
|
|
26
|
+
animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;
|
|
27
|
+
onCleanup(fn: () => void): void;
|
|
28
|
+
}
|
|
29
|
+
interface CoreEffect {
|
|
30
|
+
name: string;
|
|
31
|
+
kind: CoreEffectKind;
|
|
32
|
+
description?: string;
|
|
33
|
+
defaults?: Record<string, unknown>;
|
|
34
|
+
reduced?: 'skip' | 'run';
|
|
35
|
+
run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;
|
|
36
|
+
}
|
|
37
|
+
interface CorePlugin {
|
|
38
|
+
name: string;
|
|
39
|
+
effects?: CoreEffect[];
|
|
40
|
+
install?(m: MotionInstance): void;
|
|
41
|
+
}
|
|
42
|
+
type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';
|
|
43
|
+
interface RevealOptions {
|
|
44
|
+
stagger?: number;
|
|
45
|
+
delay?: number;
|
|
46
|
+
duration?: number;
|
|
47
|
+
easing?: string;
|
|
48
|
+
once?: boolean;
|
|
49
|
+
threshold?: number;
|
|
50
|
+
}
|
|
51
|
+
interface MotionInstance {
|
|
52
|
+
readonly paused: boolean;
|
|
53
|
+
readonly rate: number;
|
|
54
|
+
use(...plugins: CorePlugin[]): MotionInstance;
|
|
55
|
+
has(effect: string): boolean;
|
|
56
|
+
effects(): string[];
|
|
57
|
+
reduced(): boolean;
|
|
58
|
+
animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;
|
|
59
|
+
play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;
|
|
60
|
+
bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & {
|
|
61
|
+
trigger?: Trigger;
|
|
62
|
+
once?: boolean;
|
|
63
|
+
}): () => void;
|
|
64
|
+
reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;
|
|
65
|
+
pause(): void;
|
|
66
|
+
resume(): void;
|
|
67
|
+
setRate(rate: number): void;
|
|
68
|
+
destroy(): void;
|
|
69
|
+
}
|
|
70
|
+
/** Entrance keyframes (10.0). */
|
|
71
|
+
declare const PRESETS: Record<string, Keyframe[]>;
|
|
72
|
+
/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */
|
|
73
|
+
declare function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas';
|
|
74
|
+
/** Create a Motionary core instance (10.0). */
|
|
75
|
+
declare function createMotion(config?: {
|
|
76
|
+
reducedMotion?: 'user' | 'reduce';
|
|
77
|
+
rate?: number;
|
|
78
|
+
}): MotionInstance;
|
|
79
|
+
|
|
80
|
+
export { PRESETS, VERSION, createMotion, preferredBackend };
|
|
81
|
+
export type { CoreEffect, CoreEffectContext, CoreEffectKind, CorePlugin, MotionInstance, RevealOptions, Trigger };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `motionary/core` (10.0) — the zero-dependency core, under 10 KB gzip.
|
|
3
|
+
*
|
|
4
|
+
* Everything else is a plugin: `createMotion().use(retro, cinema)` with the
|
|
5
|
+
* packs from `motionary/plugins` (or your own `{ name, effects }`).
|
|
6
|
+
*
|
|
7
|
+
* - `createMotion({ reducedMotion, rate })` → an instance with `use()`,
|
|
8
|
+
* `play(el, effect, options)`, `bind(el, effect, { trigger })`,
|
|
9
|
+
* `reveal(targets, preset, { stagger, once, threshold })`, `animate()`,
|
|
10
|
+
* `pause()` / `resume()` / `setRate()` for everything it started,
|
|
11
|
+
* `effects()` and `destroy()`.
|
|
12
|
+
* - `PRESETS` — entrance keyframes (fade, fade-up/down/left/right, scale,
|
|
13
|
+
* zoom-in/out, blur-in, flip-up), registered as `enter` effects.
|
|
14
|
+
* - `preferredBackend()` — `webgpu` (default when available) → `webgl2` →
|
|
15
|
+
* `canvas`, the order GPU plugins use.
|
|
16
|
+
*
|
|
17
|
+
* Reduced motion is honoured everywhere (OS setting or `reducedMotion:
|
|
18
|
+
* 'reduce'`): entrances fade, loops / backgrounds / cursors are skipped.
|
|
19
|
+
*/
|
|
20
|
+
declare const VERSION = "10.0.0";
|
|
21
|
+
type CoreEffectKind = 'enter' | 'exit' | 'attention' | 'hover' | 'click' | 'loop' | 'background' | 'cursor' | 'text' | 'scroll' | (string & {});
|
|
22
|
+
interface CoreEffectContext {
|
|
23
|
+
reduced: boolean;
|
|
24
|
+
sensitivity: 'full' | 'gentle' | 'minimal' | 'static';
|
|
25
|
+
event?: Event;
|
|
26
|
+
animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;
|
|
27
|
+
onCleanup(fn: () => void): void;
|
|
28
|
+
}
|
|
29
|
+
interface CoreEffect {
|
|
30
|
+
name: string;
|
|
31
|
+
kind: CoreEffectKind;
|
|
32
|
+
description?: string;
|
|
33
|
+
defaults?: Record<string, unknown>;
|
|
34
|
+
reduced?: 'skip' | 'run';
|
|
35
|
+
run(el: HTMLElement, options: any, ctx: CoreEffectContext): unknown;
|
|
36
|
+
}
|
|
37
|
+
interface CorePlugin {
|
|
38
|
+
name: string;
|
|
39
|
+
effects?: CoreEffect[];
|
|
40
|
+
install?(m: MotionInstance): void;
|
|
41
|
+
}
|
|
42
|
+
type Trigger = 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual';
|
|
43
|
+
interface RevealOptions {
|
|
44
|
+
stagger?: number;
|
|
45
|
+
delay?: number;
|
|
46
|
+
duration?: number;
|
|
47
|
+
easing?: string;
|
|
48
|
+
once?: boolean;
|
|
49
|
+
threshold?: number;
|
|
50
|
+
}
|
|
51
|
+
interface MotionInstance {
|
|
52
|
+
readonly paused: boolean;
|
|
53
|
+
readonly rate: number;
|
|
54
|
+
use(...plugins: CorePlugin[]): MotionInstance;
|
|
55
|
+
has(effect: string): boolean;
|
|
56
|
+
effects(): string[];
|
|
57
|
+
reduced(): boolean;
|
|
58
|
+
animate(el: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation | null;
|
|
59
|
+
play(el: HTMLElement, effect: string, options?: Record<string, unknown>, event?: Event): Promise<void>;
|
|
60
|
+
bind(el: HTMLElement, effect: string, options?: Record<string, unknown> & {
|
|
61
|
+
trigger?: Trigger;
|
|
62
|
+
once?: boolean;
|
|
63
|
+
}): () => void;
|
|
64
|
+
reveal(targets: string | Element | ArrayLike<Element>, preset?: string, options?: RevealOptions): () => void;
|
|
65
|
+
pause(): void;
|
|
66
|
+
resume(): void;
|
|
67
|
+
setRate(rate: number): void;
|
|
68
|
+
destroy(): void;
|
|
69
|
+
}
|
|
70
|
+
/** Entrance keyframes (10.0). */
|
|
71
|
+
declare const PRESETS: Record<string, Keyframe[]>;
|
|
72
|
+
/** GPU backend order used by GPU plugins: WebGPU by default (10.0). */
|
|
73
|
+
declare function preferredBackend(): 'webgpu' | 'webgl2' | 'canvas';
|
|
74
|
+
/** Create a Motionary core instance (10.0). */
|
|
75
|
+
declare function createMotion(config?: {
|
|
76
|
+
reducedMotion?: 'user' | 'reduce';
|
|
77
|
+
rate?: number;
|
|
78
|
+
}): MotionInstance;
|
|
79
|
+
|
|
80
|
+
export { PRESETS, VERSION, createMotion, preferredBackend };
|
|
81
|
+
export type { CoreEffect, CoreEffectContext, CoreEffectKind, CorePlugin, MotionInstance, RevealOptions, Trigger };
|