motionary 10.6.0 → 10.8.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/AGENTS.md +2 -0
- package/CHANGELOG.md +36 -0
- package/README.md +77 -4
- package/bin/motionary-mcp.mjs +160 -11
- package/dist/chunks/{anim-image-DECLkPH4.cjs → anim-image-BzTQa2k3.cjs} +2 -2
- package/dist/chunks/{anim-image-DECLkPH4.cjs.map → anim-image-BzTQa2k3.cjs.map} +1 -1
- package/dist/chunks/{anim-image-DNghy017.js → anim-image-iD646Q7i.js} +2 -2
- package/dist/chunks/{anim-image-DNghy017.js.map → anim-image-iD646Q7i.js.map} +1 -1
- package/dist/chunks/{keyframes-F6vp6tZZ.js → keyframes-B4zefz0k.js} +2 -2
- package/dist/chunks/{keyframes-F6vp6tZZ.js.map → keyframes-B4zefz0k.js.map} +1 -1
- package/dist/chunks/{keyframes-CbUZjD_5.cjs → keyframes-BlOyB1PP.cjs} +2 -2
- package/dist/chunks/{keyframes-CbUZjD_5.cjs.map → keyframes-BlOyB1PP.cjs.map} +1 -1
- package/dist/chunks/{registry-dr1CPTk1.cjs → registry-BZxDVL3h.cjs} +2 -2
- package/dist/chunks/{registry-dr1CPTk1.cjs.map → registry-BZxDVL3h.cjs.map} +1 -1
- package/dist/chunks/{registry-D8LAoXI-.js → registry-Bkt3-3ET.js} +3 -3
- package/dist/chunks/{registry-D8LAoXI-.js.map → registry-Bkt3-3ET.js.map} +1 -1
- package/dist/chunks/runtime-link-CUiZ8lbE.cjs +38 -0
- package/dist/chunks/runtime-link-CUiZ8lbE.cjs.map +1 -0
- package/dist/chunks/runtime-link-c13gskBZ.js +36 -0
- package/dist/chunks/runtime-link-c13gskBZ.js.map +1 -0
- package/dist/chunks/{ticker-DaAlEyOd.cjs → ticker-BfxAECfO.cjs} +2 -2
- package/dist/chunks/{ticker-DaAlEyOd.cjs.map → ticker-BfxAECfO.cjs.map} +1 -1
- package/dist/chunks/{ticker-Do9bGsaV.js → ticker-ZtweD3U4.js} +2 -2
- package/dist/chunks/{ticker-Do9bGsaV.js.map → ticker-ZtweD3U4.js.map} +1 -1
- package/dist/chunks/{tween-CmkdSyaC.cjs → tween--MD-39y0.cjs} +2 -2
- package/dist/chunks/{tween-CmkdSyaC.cjs.map → tween--MD-39y0.cjs.map} +1 -1
- package/dist/chunks/{tween-BzCGq_Ba.js → tween-DACdkLyO.js} +2 -2
- package/dist/chunks/{tween-BzCGq_Ba.js.map → tween-DACdkLyO.js.map} +1 -1
- package/dist/components/ai.cjs +314 -0
- package/dist/components/ai.cjs.map +1 -0
- package/dist/components/ai.d.cts +58 -0
- package/dist/components/ai.d.ts +58 -0
- package/dist/components/ai.js +311 -0
- package/dist/components/ai.js.map +1 -0
- package/dist/components/snap-carousel.cjs +216 -0
- package/dist/components/snap-carousel.cjs.map +1 -0
- package/dist/components/snap-carousel.d.cts +80 -0
- package/dist/components/snap-carousel.d.ts +80 -0
- package/dist/components/snap-carousel.js +214 -0
- package/dist/components/snap-carousel.js.map +1 -0
- package/dist/components/widgets.cjs +626 -268
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +515 -39
- package/dist/components/widgets.d.ts +515 -39
- package/dist/components/widgets.js +617 -262
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +191 -6
- package/dist/llms.txt +10 -3
- package/dist/manifest.json +497 -19
- package/dist/runtime/drag-snap.cjs +269 -0
- package/dist/runtime/drag-snap.cjs.map +1 -0
- package/dist/runtime/drag-snap.d.cts +109 -0
- package/dist/runtime/drag-snap.d.ts +109 -0
- package/dist/runtime/drag-snap.iife.js +2 -0
- package/dist/runtime/drag-snap.iife.js.map +1 -0
- package/dist/runtime/drag-snap.js +261 -0
- package/dist/runtime/drag-snap.js.map +1 -0
- package/dist/runtime/format-apng.cjs +4 -4
- package/dist/runtime/format-apng.js +4 -4
- package/dist/runtime/format-css.cjs +4 -4
- package/dist/runtime/format-css.js +4 -4
- package/dist/runtime/format-gif.cjs +4 -4
- package/dist/runtime/format-gif.js +4 -4
- package/dist/runtime/format-gltf.cjs +37 -18
- package/dist/runtime/format-gltf.cjs.map +1 -1
- package/dist/runtime/format-gltf.d.cts +18 -2
- package/dist/runtime/format-gltf.d.ts +18 -2
- package/dist/runtime/format-gltf.iife.js +1 -1
- package/dist/runtime/format-gltf.iife.js.map +1 -1
- package/dist/runtime/format-gltf.js +37 -18
- package/dist/runtime/format-gltf.js.map +1 -1
- package/dist/runtime/format-motion.cjs +4 -4
- package/dist/runtime/format-motion.js +4 -4
- package/dist/runtime/format-obj.cjs +1 -1
- package/dist/runtime/format-obj.d.cts +2 -0
- package/dist/runtime/format-obj.d.ts +2 -0
- package/dist/runtime/format-obj.iife.js.map +1 -1
- package/dist/runtime/format-obj.js +1 -1
- package/dist/runtime/format-scene.cjs +241 -0
- package/dist/runtime/format-scene.cjs.map +1 -0
- package/dist/runtime/format-scene.d.cts +349 -0
- package/dist/runtime/format-scene.d.ts +349 -0
- package/dist/runtime/format-scene.iife.js +2 -0
- package/dist/runtime/format-scene.iife.js.map +1 -0
- package/dist/runtime/format-scene.js +233 -0
- package/dist/runtime/format-scene.js.map +1 -0
- package/dist/runtime/format-sprite.cjs +3 -3
- package/dist/runtime/format-sprite.js +3 -3
- package/dist/runtime/format-svg.cjs +3 -3
- package/dist/runtime/format-svg.js +3 -3
- package/dist/runtime/format-webp.cjs +4 -4
- package/dist/runtime/format-webp.js +4 -4
- package/dist/runtime/gl.cjs +17 -4
- package/dist/runtime/gl.cjs.map +1 -1
- package/dist/runtime/gl.d.cts +2 -0
- package/dist/runtime/gl.d.ts +2 -0
- package/dist/runtime/gl.iife.js +1 -1
- package/dist/runtime/gl.iife.js.map +1 -1
- package/dist/runtime/gl.js +17 -4
- package/dist/runtime/gl.js.map +1 -1
- package/dist/runtime/gltf-anim.cjs +251 -0
- package/dist/runtime/gltf-anim.cjs.map +1 -0
- package/dist/runtime/gltf-anim.d.cts +216 -0
- package/dist/runtime/gltf-anim.d.ts +216 -0
- package/dist/runtime/gltf-anim.iife.js +2 -0
- package/dist/runtime/gltf-anim.iife.js.map +1 -0
- package/dist/runtime/gltf-anim.js +243 -0
- package/dist/runtime/gltf-anim.js.map +1 -0
- package/dist/runtime/physics.cjs +739 -0
- package/dist/runtime/physics.cjs.map +1 -0
- package/dist/runtime/physics.d.cts +250 -0
- package/dist/runtime/physics.d.ts +250 -0
- package/dist/runtime/physics.iife.js +2 -0
- package/dist/runtime/physics.iife.js.map +1 -0
- package/dist/runtime/physics.js +731 -0
- package/dist/runtime/physics.js.map +1 -0
- package/dist/runtime/scroll.cjs +2 -2
- package/dist/runtime/scroll.js +2 -2
- package/dist/runtime/smooth.cjs +1 -1
- package/dist/runtime/smooth.js +1 -1
- package/dist/runtime/text.cjs +1 -1
- package/dist/runtime/text.js +1 -1
- package/dist/runtime/vector.cjs +421 -11
- package/dist/runtime/vector.cjs.map +1 -1
- package/dist/runtime/vector.d.cts +20 -4
- package/dist/runtime/vector.d.ts +20 -4
- package/dist/runtime/vector.iife.js +1 -1
- package/dist/runtime/vector.iife.js.map +1 -1
- package/dist/runtime/vector.js +421 -12
- package/dist/runtime/vector.js.map +1 -1
- package/dist/runtime.cjs +3 -3
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.iife.js +1 -1
- package/dist/runtime.iife.js.map +1 -1
- package/dist/runtime.js +5 -5
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/components/README.md +5 -2
- package/docs/components/usa-gl-scene.md +27 -6
- package/docs/components/usa-lottie-player.md +18 -0
- package/docs/components/usa-motion-prompt.md +32 -0
- package/docs/components/usa-physics-playground.md +63 -0
- package/docs/components/usa-snap-carousel.md +68 -0
- package/docs/components.md +95 -3
- package/docs/runtime/drag-snap.md +60 -0
- package/docs/runtime/format-gltf.md +3 -2
- package/docs/runtime/format-scene.md +59 -0
- package/docs/runtime/gltf-anim.md +62 -0
- package/docs/runtime/physics.md +61 -0
- package/docs/runtime/vector.md +3 -2
- package/package.json +61 -1
package/dist/llms-full.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Motionary 10.
|
|
1
|
+
# Motionary 10.8.0 — full component reference
|
|
2
2
|
|
|
3
3
|
Generated from the source. Machine-readable version: https://harrisoncn.github.io/Motionary/components.json (schema https://harrisoncn.github.io/Motionary/components.schema.json).
|
|
4
4
|
|
|
@@ -362,6 +362,101 @@ defineRive();
|
|
|
362
362
|
// <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay></usa-rive>
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
+
### motionary/runtime/physics — 2D rigid-body physics
|
|
366
|
+
|
|
367
|
+
A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
|
|
368
|
+
|
|
369
|
+
- Install: `npm i motionary`
|
|
370
|
+
- Import: `motionary/runtime/physics`
|
|
371
|
+
- Register: `use(physics);` — Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself).
|
|
372
|
+
- CDN:
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
376
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
```js
|
|
380
|
+
import { use } from 'motionary/runtime';
|
|
381
|
+
import { physics, createWorld } from 'motionary/runtime/physics';
|
|
382
|
+
use(physics);
|
|
383
|
+
const world = createWorld({ gravity: [0, 980] });
|
|
384
|
+
world.bounds(600, 400);
|
|
385
|
+
const ball = world.body({ shape: 'circle', x: 300, y: 40, radius: 20, restitution: 0.7 });
|
|
386
|
+
world.run(); // steps on the shared ticker
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### motionary/runtime/format-scene — Scene JSON (motionary-scene@1)
|
|
390
|
+
|
|
391
|
+
The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
|
|
392
|
+
|
|
393
|
+
- Install: `npm i motionary`
|
|
394
|
+
- Import: `motionary/runtime/format-scene`
|
|
395
|
+
- Register: `use(formatScene);` — Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
|
|
396
|
+
- CDN:
|
|
397
|
+
|
|
398
|
+
```html
|
|
399
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
400
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
```js
|
|
404
|
+
import { use } from 'motionary/runtime';
|
|
405
|
+
import { physics } from 'motionary/runtime/physics';
|
|
406
|
+
import { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';
|
|
407
|
+
use(physics, formatScene);
|
|
408
|
+
const { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());
|
|
409
|
+
world.run();
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### motionary/runtime/drag-snap — Drag, inertia and snap points
|
|
413
|
+
|
|
414
|
+
Pointer drag along one axis with velocity tracking, inertial throws, rubber-band edges and spring-animated snap points on the shared ticker — the engine of <usa-snap-carousel>, usable for sheets, sliders and pickers (own implementation).
|
|
415
|
+
|
|
416
|
+
- Install: `npm i motionary`
|
|
417
|
+
- Import: `motionary/runtime/drag-snap`
|
|
418
|
+
- Register: `use(dragSnap);` — Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
|
|
419
|
+
- CDN:
|
|
420
|
+
|
|
421
|
+
```html
|
|
422
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
423
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.iife.js"></script>
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
```js
|
|
427
|
+
import { use } from 'motionary/runtime';
|
|
428
|
+
import { dragSnap, createDragSnap } from 'motionary/runtime/drag-snap';
|
|
429
|
+
use(dragSnap);
|
|
430
|
+
const track = document.querySelector('.track');
|
|
431
|
+
const ds = createDragSnap(track, { axis: 'x', snap: [0, -320, -640], onUpdate: (x) => (track.style.transform = `translateX(${x}px)`) });
|
|
432
|
+
ds.snapTo(1);
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### motionary/runtime/gltf-anim — glTF animation, skinning and morph targets
|
|
436
|
+
|
|
437
|
+
Plays glTF 2.0 animations on models loaded by motionary/runtime/format-gltf: translation / rotation / scale / weights channels with LINEAR, STEP and CUBICSPLINE samplers, skins (4 joints per vertex) and morph targets, deformed on the CPU and re-uploaded to motionary/runtime/gl (own implementation).
|
|
438
|
+
|
|
439
|
+
- Install: `npm i motionary`
|
|
440
|
+
- Import: `motionary/runtime/gltf-anim`
|
|
441
|
+
- Register: `use(gltfAnim);` — Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
|
|
442
|
+
- CDN:
|
|
443
|
+
|
|
444
|
+
```html
|
|
445
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
446
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.iife.js"></script>
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
```js
|
|
450
|
+
import { use } from 'motionary/runtime';
|
|
451
|
+
import { gl } from 'motionary/runtime/gl';
|
|
452
|
+
import { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';
|
|
453
|
+
import { gltfAnim, gltfAnimator } from 'motionary/runtime/gltf-anim';
|
|
454
|
+
use(gl, formatGltf, gltfAnim);
|
|
455
|
+
const model = await loadGltf('/models/robot.glb');
|
|
456
|
+
const anim = gltfAnimator(model, { clip: 'walk' });
|
|
457
|
+
anim.play(); // or anim.update(dt) in your own loop
|
|
458
|
+
```
|
|
459
|
+
|
|
365
460
|
## Components
|
|
366
461
|
|
|
367
462
|
### <usa-accordion> — Accordion
|
|
@@ -1292,25 +1387,26 @@ Full-screen sections that snap one at a time, with keyboard paging, dot navigati
|
|
|
1292
1387
|
|
|
1293
1388
|
### <usa-gl-scene> — 3D scene (glTF / OBJ)
|
|
1294
1389
|
|
|
1295
|
-
10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel, pinch, arrow keys), auto-rotate and video textures. Requires motionary/runtime/gl (+ format-gltf for .gltf / .glb, format-obj for .obj) — npm i motionary, then use(gl, formatGltf, formatObj) before it mounts. Alias: <usa-three-scene>.
|
|
1390
|
+
10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel, pinch, arrow keys), auto-rotate and video textures. Requires motionary/runtime/gl (+ format-gltf for .gltf / .glb, format-obj for .obj, gltf-anim for glTF animation — 10.8) — npm i motionary, then use(gl, formatGltf, formatObj, gltfAnim) before it mounts. Alias: <usa-three-scene>.
|
|
1296
1391
|
|
|
1297
1392
|
- Import: `import { defineGlScene } from 'motionary/components/widgets'; defineGlScene();`
|
|
1298
1393
|
- CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
|
|
1299
|
-
- Attributes: `src`, `shape`, `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label`
|
|
1394
|
+
- Attributes: `src`, `shape`, `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label`, `animation`, `animation-speed`
|
|
1300
1395
|
- Events: `usa:error`, `usa:load`, `usa:runtime-missing`
|
|
1301
1396
|
- Methods: `reload()`
|
|
1302
|
-
- Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
|
|
1397
|
+
- Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim
|
|
1303
1398
|
- Install: `npm i motionary`
|
|
1304
|
-
- Order: Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself).
|
|
1399
|
+
- Order: Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself). Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
|
|
1305
1400
|
|
|
1306
1401
|
```js
|
|
1307
1402
|
import { use } from 'motionary/runtime';
|
|
1308
1403
|
import { gl } from 'motionary/runtime/gl';
|
|
1309
1404
|
import { formatGltf } from 'motionary/runtime/format-gltf';
|
|
1310
1405
|
import { formatObj } from 'motionary/runtime/format-obj';
|
|
1406
|
+
import { gltfAnim } from 'motionary/runtime/gltf-anim';
|
|
1311
1407
|
import { defineGlScene } from 'motionary/components/widgets';
|
|
1312
1408
|
|
|
1313
|
-
use(gl, formatGltf, formatObj);
|
|
1409
|
+
use(gl, formatGltf, formatObj, gltfAnim);
|
|
1314
1410
|
defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
|
|
1315
1411
|
```
|
|
1316
1412
|
|
|
@@ -1319,6 +1415,7 @@ defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
|
|
|
1319
1415
|
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js"></script>
|
|
1320
1416
|
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
|
|
1321
1417
|
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js"></script>
|
|
1418
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.iife.js"></script>
|
|
1322
1419
|
<!-- then the component bundles -->
|
|
1323
1420
|
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1324
1421
|
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
@@ -1978,6 +2075,20 @@ Morph an SVG path through a list of shapes (paths="A | B | C") on click, hover,
|
|
|
1978
2075
|
<usa-motion-prefs></usa-motion-prefs>
|
|
1979
2076
|
```
|
|
1980
2077
|
|
|
2078
|
+
### <usa-motion-prompt> — Motion prompt (text → motion)
|
|
2079
|
+
|
|
2080
|
+
10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or a Motionary component. A small deterministic parser (motionary/components/ai), no model and no network; the same parser powers suggest_motion in motionary-mcp 2.0.
|
|
2081
|
+
|
|
2082
|
+
- Import: `import { defineMotionPrompt } from 'motionary/components/widgets'; defineMotionPrompt();`
|
|
2083
|
+
- CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
|
|
2084
|
+
- Attributes: `value`, `format`, `placeholder`, `label`
|
|
2085
|
+
- Events: `usa:suggest`, `usa:copy`
|
|
2086
|
+
- Methods: `suggest()`
|
|
2087
|
+
|
|
2088
|
+
```html
|
|
2089
|
+
<usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
|
|
2090
|
+
```
|
|
2091
|
+
|
|
1981
2092
|
### <usa-motion-spec> — Motion spec sheet
|
|
1982
2093
|
|
|
1983
2094
|
9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play playhead and Copy CSS; pairs with the Figma plugin and Framer export of motionary/design.
|
|
@@ -2261,6 +2372,42 @@ A canvas constellation that drifts away from the pointer. Runs only while visibl
|
|
|
2261
2372
|
<usa-perf-monitor corner="bottom-right"></usa-perf-monitor>
|
|
2262
2373
|
```
|
|
2263
2374
|
|
|
2375
|
+
### <usa-physics-playground> — Physics playground
|
|
2376
|
+
|
|
2377
|
+
10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a versioned motionary-scene@1 JSON (or a preset: balls, pyramid, pendulum, dominoes). Drag bodies, tap to spawn, arrow keys nudge. Requires motionary/runtime/physics + motionary/runtime/format-scene — npm i motionary, then use(physics, formatScene) before it mounts.
|
|
2378
|
+
|
|
2379
|
+
- Import: `import { definePhysicsPlayground } from 'motionary/components/widgets'; definePhysicsPlayground();`
|
|
2380
|
+
- CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
|
|
2381
|
+
- Attributes: `preset`, `src`, `gravity`, `spawn`, `label`
|
|
2382
|
+
- Events: `usa:collision`, `usa:load`, `usa:error`, `usa:runtime-missing`
|
|
2383
|
+
- Methods: `reset()`, `play()`, `pause()`, `toScene()`
|
|
2384
|
+
- Requires: motionary/runtime/physics + motionary/runtime/format-scene
|
|
2385
|
+
- Install: `npm i motionary`
|
|
2386
|
+
- Order: Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself). Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
|
|
2387
|
+
|
|
2388
|
+
```js
|
|
2389
|
+
import { use } from 'motionary/runtime';
|
|
2390
|
+
import { physics } from 'motionary/runtime/physics';
|
|
2391
|
+
import { formatScene } from 'motionary/runtime/format-scene';
|
|
2392
|
+
import { definePhysicsPlayground } from 'motionary/components/widgets';
|
|
2393
|
+
|
|
2394
|
+
use(physics, formatScene);
|
|
2395
|
+
definePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites
|
|
2396
|
+
```
|
|
2397
|
+
|
|
2398
|
+
```html
|
|
2399
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
2400
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/physics.iife.js"></script>
|
|
2401
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-scene.iife.js"></script>
|
|
2402
|
+
<!-- then the component bundles -->
|
|
2403
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
2404
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
2405
|
+
```
|
|
2406
|
+
|
|
2407
|
+
```html
|
|
2408
|
+
<usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
|
|
2409
|
+
```
|
|
2410
|
+
|
|
2264
2411
|
### <usa-pinch-zoom> — Pinch zoom
|
|
2265
2412
|
|
|
2266
2413
|
Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
|
|
@@ -2950,6 +3097,44 @@ defineSmoothScroll(); // registers <usa-smooth-scroll> — after the prerequisit
|
|
|
2950
3097
|
<usa-smooth-scroll lerp="0.1" offset="64"></usa-smooth-scroll>
|
|
2951
3098
|
```
|
|
2952
3099
|
|
|
3100
|
+
### <usa-snap-carousel> — Snap carousel (drag · inertia · snap)
|
|
3101
|
+
|
|
3102
|
+
10.8: drag or swipe with real inertia — a throw keeps gliding, then springs to the nearest slide (a quick flick always moves one); rubber-band edges, arrows, dots, ←/→ / Home / End, optional autoplay that pauses on hover, focus and off screen. Slides keep their own width so the next one peeks in. Requires motionary/runtime/drag-snap — npm i motionary, then use(dragSnap) before it mounts. Its own entry point: motionary/components/snap-carousel (not in the widgets / lite bundles).
|
|
3103
|
+
|
|
3104
|
+
- Import: `import { defineSnapCarousel } from 'motionary/components/snap-carousel'; defineSnapCarousel();`
|
|
3105
|
+
- CDN: https://unpkg.com/motionary@10/dist/components.umd.js
|
|
3106
|
+
- Attributes: `align`, `gap`, `autoplay`, `no-controls`, `no-dots`, `label`
|
|
3107
|
+
- Events: `usa:change`, `usa:runtime-missing`
|
|
3108
|
+
- Methods: `next()`, `prev()`, `goTo()`
|
|
3109
|
+
- Requires: motionary/runtime/drag-snap
|
|
3110
|
+
- Install: `npm i motionary`
|
|
3111
|
+
- Order: Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
|
|
3112
|
+
|
|
3113
|
+
```js
|
|
3114
|
+
import { use } from 'motionary/runtime';
|
|
3115
|
+
import { dragSnap } from 'motionary/runtime/drag-snap';
|
|
3116
|
+
import { defineSnapCarousel } from 'motionary/components/snap-carousel';
|
|
3117
|
+
|
|
3118
|
+
use(dragSnap);
|
|
3119
|
+
defineSnapCarousel(); // registers <usa-snap-carousel> — after the prerequisites
|
|
3120
|
+
```
|
|
3121
|
+
|
|
3122
|
+
```html
|
|
3123
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
3124
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.iife.js"></script>
|
|
3125
|
+
<!-- then the component bundles -->
|
|
3126
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
3127
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
3128
|
+
```
|
|
3129
|
+
|
|
3130
|
+
```html
|
|
3131
|
+
<usa-snap-carousel align="center" gap="16" label="Featured">
|
|
3132
|
+
<article>…</article>
|
|
3133
|
+
<article>…</article>
|
|
3134
|
+
<article>…</article>
|
|
3135
|
+
</usa-snap-carousel>
|
|
3136
|
+
```
|
|
3137
|
+
|
|
2953
3138
|
### <usa-sparkline> — Sparkline
|
|
2954
3139
|
|
|
2955
3140
|
7.2: a tiny inline trend — draws itself on first view, a soft area fades in, the last point pulses and new data morphs the line point by point. line | area | bars; hover shows the value.
|
package/dist/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Motionary 10.
|
|
1
|
+
# Motionary 10.8.0
|
|
2
2
|
|
|
3
|
-
> Motionary is a zero-dependency motion library: scroll animations, 200+ presets and
|
|
3
|
+
> Motionary is a zero-dependency motion library: scroll animations, 200+ presets and 208 animated Web Components (<usa-*>) that work in plain HTML and every framework, plus motionary/runtime — its own tween/timeline engine and format loaders.
|
|
4
4
|
|
|
5
5
|
Install: `npm i motionary` · CDN: https://unpkg.com/motionary@10/dist/components.umd.js (+ https://unpkg.com/motionary@10/dist/widgets.umd.js for 6.x+ widgets) · Manifest: https://harrisoncn.github.io/Motionary/components.json · Full text: https://harrisoncn.github.io/Motionary/llms-full.txt
|
|
6
6
|
|
|
@@ -24,6 +24,10 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
24
24
|
- [motionary/runtime/format-obj](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-obj.md): Load Wavefront OBJ (+ MTL materials and diffuse textures) into motionary/runtime/gl nodes: polygons triangulated, groups, per-material meshes.
|
|
25
25
|
- [motionary/runtime/vector](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/vector.md): Plays Lottie (bodymovin JSON) and dotLottie (.lottie) files on Canvas 2D with Motionary’s own renderer (no lottie-web code): shapes, gradients, trim paths, masks, track mattes, precomps, images; a runtime timeline you can seek, reverse and scrub.
|
|
26
26
|
- [@rive-app/canvas](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/rive.md): The official MIT-licensed Rive runtime, used by <usa-rive> to play .riv files (artboards, animations, state machines with inputs). Optional peer dependency: lazy-loaded on first use, never bundled into Motionary.
|
|
27
|
+
- [motionary/runtime/physics](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/physics.md): A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
|
|
28
|
+
- [motionary/runtime/format-scene](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-scene.md): The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
|
|
29
|
+
- [motionary/runtime/drag-snap](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/drag-snap.md): Pointer drag along one axis with velocity tracking, inertial throws, rubber-band edges and spring-animated snap points on the shared ticker — the engine of <usa-snap-carousel>, usable for sheets, sliders and pickers (own implementation).
|
|
30
|
+
- [motionary/runtime/gltf-anim](https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/gltf-anim.md): Plays glTF 2.0 animations on models loaded by motionary/runtime/format-gltf: translation / rotation / scale / weights channels with LINEAR, STEP and CUBICSPLINE samplers, skins (4 joints per vertex) and morph targets, deformed on the CPU and re-uploaded to motionary/runtime/gl (own implementation).
|
|
27
31
|
|
|
28
32
|
## Components
|
|
29
33
|
|
|
@@ -87,7 +91,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
87
91
|
- `<usa-gen-art>` (motionary/components/widgets): 9.3: seeded generative art on a canvas — flow fields, circle packing, Truchet tiles or layered waves in curated palettes; it draws itself in on screen and a tap
|
|
88
92
|
- `<usa-gesture-fx>` (motionary/components/effects): 5.7: <usa-gesture-fx> plays any registered effect on a fling (fast release), a two-finger twist or a long press that charges --usa-charge 0 → 1. JS: bindGesture
|
|
89
93
|
- `<usa-gesture-sticker>` (motionary/components/widgets): 8.7: a multi-touch sticker — drag with one finger, pinch with two to scale and twist to rotate, all at once, with a lifted shadow while held (wheel / Shift + wh
|
|
90
|
-
- `<usa-gl-scene>` (motionary/components/widgets; requires motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj): 10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel,
|
|
94
|
+
- `<usa-gl-scene>` (motionary/components/widgets; requires motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim): 10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel,
|
|
91
95
|
- `<usa-glitch>` (motionary/components/text): An RGB-split, sliced glitch — always on or on hover.
|
|
92
96
|
- `<usa-globe>` (motionary/components/widgets): 7.6: an SVG globe in orthographic projection — graticule, pulsing markers, spins while on screen, drag to turn it, flyTo(name) brings a city round to the front.
|
|
93
97
|
- `<usa-gpu-particles>` (motionary/components/widgets): 10.5 (WebGPU effects 2.0): tens of thousands of particles simulated by a WebGPU compute shader and drawn as instanced quads — swirl, galaxy or fountain, pointer
|
|
@@ -129,6 +133,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
129
133
|
- `<usa-motion>` (motionary/components/widgets): 9.0: the declarative motion DSL — describe motion as one readable string (“enter: fade-up 600ms stagger 80ms; hover: pop”) on <usa-motion> or any element’s data
|
|
130
134
|
- `<usa-motion-inspector>` (motionary/components/widgets): 10.2: a live panel listing the running animations in a scope (CSS animations, transitions, element.animate(), components) with state and progress, plus the moti
|
|
131
135
|
- `<usa-motion-prefs>` (motionary/components/widgets): 9.5: a motion settings panel for your users — motion level (full, gentle, minimal, none), animation speed, pause autoplaying video, no parallax — applied instan
|
|
136
|
+
- `<usa-motion-prompt>` (motionary/components/widgets): 10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or
|
|
132
137
|
- `<usa-motion-spec>` (motionary/components/widgets): 9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play p
|
|
133
138
|
- `<usa-motion-switch>` (motionary/components/page): Let users pick Off · Low · Normal · High for the whole app; scales every component, persists, and Off equals reduced motion.
|
|
134
139
|
- `<usa-motion-theme>` (motionary/components/effects): 5.8: <usa-motion-theme name> applies a theme pack — design tokens (--usa-theme-*), motion tokens and effect presets per role (enter / hover / click / attention
|
|
@@ -148,6 +153,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
148
153
|
- `<usa-particles>` (motionary/components/background): A canvas constellation that drifts away from the pointer. Runs only while visible, DPR ≤ 2, a still frame under reduced motion.
|
|
149
154
|
- `<usa-pause-all>` (motionary/components/widgets): 9.5: one button that pauses all motion on the page (WCAG 2.2.2) — Motionary’s shared clock, every CSS / Web animation and autoplaying media — and resumes it aga
|
|
150
155
|
- `<usa-perf-monitor>` (motionary/components/widgets): 9.6: a live performance overlay for motion work — FPS with a sparkline, active Motionary animations, frame-loop callbacks, long tasks and the shared clock — fla
|
|
156
|
+
- `<usa-physics-playground>` (motionary/components/widgets; requires motionary/runtime/physics + motionary/runtime/format-scene): 10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a vers
|
|
151
157
|
- `<usa-pinch-zoom>` (motionary/components/gesture): Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
|
|
152
158
|
- `<usa-player>` (motionary/components/effects): 5.9: <usa-player> plays a JSON animation — timeline presets, your own keyframes and any registered effect on a shared clock; play / pause / seek / rate / loop,
|
|
153
159
|
- `<usa-plugin-card>` (motionary/components/widgets; requires motionary/runtime): 10.1: a plugin’s name, version and author with a Motionary compatibility badge (semver `engine` range), a signature badge (SHA-256 integrity checked with Web Cr
|
|
@@ -189,6 +195,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
189
195
|
- `<usa-sketch-chart>` (motionary/components/widgets): 8.5: a hand-drawn chart — wobbly pencil axes with hatched bars or a sketchy line, sketched in stroke by stroke when it scrolls into view.
|
|
190
196
|
- `<usa-slider>` (motionary/components/ui): A form-associated range slider: spring-following thumb, value bubble, full keyboard support (arrows, Page Up/Down, Home/End).
|
|
191
197
|
- `<usa-smooth-scroll>` (motionary/components/widgets; requires motionary/runtime/smooth): 10.4: smooth, inertial wheel scrolling for the page or a container (wrapper), anchor links glide (with offset for sticky headers); keyboard / scrollbar / touch
|
|
198
|
+
- `<usa-snap-carousel>` (motionary/components/snap-carousel; requires motionary/runtime/drag-snap): 10.8: drag or swipe with real inertia — a throw keeps gliding, then springs to the nearest slide (a quick flick always moves one); rubber-band edges, arrows, do
|
|
192
199
|
- `<usa-sparkline>` (motionary/components/widgets): 7.2: a tiny inline trend — draws itself on first view, a soft area fades in, the last point pulses and new data morphs the line point by point. line | area | ba
|
|
193
200
|
- `<usa-spatial-card>` (motionary/components/widgets): 8.8: a spatial-computing window — frosted glass floating in depth, a soft gaze highlight that follows the pointer, layered content and an ornament bar; it eases
|
|
194
201
|
- `<usa-spinner>` (motionary/components/feedback): Six indeterminate indicators: the WinUI progress ring, the Windows 10 orbiting dots, ring, typing dots, pulse and bars.
|