motionary 10.7.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/CHANGELOG.md +20 -0
- package/README.md +42 -3
- package/dist/chunks/{anim-image-CFGpUX7t.cjs → anim-image-BzTQa2k3.cjs} +2 -2
- package/dist/chunks/{anim-image-CFGpUX7t.cjs.map → anim-image-BzTQa2k3.cjs.map} +1 -1
- package/dist/chunks/{anim-image-CXDD19FH.js → anim-image-iD646Q7i.js} +2 -2
- package/dist/chunks/{anim-image-CXDD19FH.js.map → anim-image-iD646Q7i.js.map} +1 -1
- package/dist/chunks/{keyframes-DwR6GPej.js → keyframes-B4zefz0k.js} +2 -2
- package/dist/chunks/{keyframes-DwR6GPej.js.map → keyframes-B4zefz0k.js.map} +1 -1
- package/dist/chunks/{keyframes-DdwGY1gr.cjs → keyframes-BlOyB1PP.cjs} +2 -2
- package/dist/chunks/{keyframes-DdwGY1gr.cjs.map → keyframes-BlOyB1PP.cjs.map} +1 -1
- package/dist/chunks/{registry-DhKZCitb.cjs → registry-BZxDVL3h.cjs} +2 -2
- package/dist/chunks/{registry-DhKZCitb.cjs.map → registry-BZxDVL3h.cjs.map} +1 -1
- package/dist/chunks/{registry-D87dP_aR.js → registry-Bkt3-3ET.js} +3 -3
- package/dist/chunks/{registry-D87dP_aR.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-jD9_A9Rh.cjs → ticker-BfxAECfO.cjs} +2 -2
- package/dist/chunks/{ticker-jD9_A9Rh.cjs.map → ticker-BfxAECfO.cjs.map} +1 -1
- package/dist/chunks/{ticker-CJYI5Pxc.js → ticker-ZtweD3U4.js} +2 -2
- package/dist/chunks/{ticker-CJYI5Pxc.js.map → ticker-ZtweD3U4.js.map} +1 -1
- package/dist/chunks/{tween-Dk0QmNe9.cjs → tween--MD-39y0.cjs} +2 -2
- package/dist/chunks/{tween-Dk0QmNe9.cjs.map → tween--MD-39y0.cjs.map} +1 -1
- package/dist/chunks/{tween-_Lld1MsF.js → tween-DACdkLyO.js} +2 -2
- package/dist/chunks/{tween-_Lld1MsF.js.map → tween-DACdkLyO.js.map} +1 -1
- 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 +32 -46
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +77 -4
- package/dist/components/widgets.d.ts +77 -4
- package/dist/components/widgets.js +22 -36
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +94 -6
- package/dist/llms.txt +6 -3
- package/dist/manifest.json +260 -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 +1 -1
- package/dist/runtime/format-scene.js +1 -1
- 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 +1 -1
- package/dist/runtime/physics.js +1 -1
- 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 +1 -1
- package/docs/components/README.md +3 -2
- package/docs/components/usa-gl-scene.md +27 -6
- package/docs/components/usa-lottie-player.md +18 -0
- package/docs/components/usa-snap-carousel.md +68 -0
- package/docs/components.md +51 -3
- package/docs/runtime/drag-snap.md +60 -0
- package/docs/runtime/format-gltf.md +3 -2
- package/docs/runtime/gltf-anim.md +62 -0
- package/docs/runtime/vector.md +3 -2
- package/package.json +31 -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
|
|
|
@@ -409,6 +409,54 @@ const { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json'))
|
|
|
409
409
|
world.run();
|
|
410
410
|
```
|
|
411
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
|
+
|
|
412
460
|
## Components
|
|
413
461
|
|
|
414
462
|
### <usa-accordion> — Accordion
|
|
@@ -1339,25 +1387,26 @@ Full-screen sections that snap one at a time, with keyboard paging, dot navigati
|
|
|
1339
1387
|
|
|
1340
1388
|
### <usa-gl-scene> — 3D scene (glTF / OBJ)
|
|
1341
1389
|
|
|
1342
|
-
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>.
|
|
1343
1391
|
|
|
1344
1392
|
- Import: `import { defineGlScene } from 'motionary/components/widgets'; defineGlScene();`
|
|
1345
1393
|
- CDN: https://unpkg.com/motionary@10/dist/widgets.umd.js
|
|
1346
|
-
- 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`
|
|
1347
1395
|
- Events: `usa:error`, `usa:load`, `usa:runtime-missing`
|
|
1348
1396
|
- Methods: `reload()`
|
|
1349
|
-
- 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
|
|
1350
1398
|
- Install: `npm i motionary`
|
|
1351
|
-
- 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).
|
|
1352
1400
|
|
|
1353
1401
|
```js
|
|
1354
1402
|
import { use } from 'motionary/runtime';
|
|
1355
1403
|
import { gl } from 'motionary/runtime/gl';
|
|
1356
1404
|
import { formatGltf } from 'motionary/runtime/format-gltf';
|
|
1357
1405
|
import { formatObj } from 'motionary/runtime/format-obj';
|
|
1406
|
+
import { gltfAnim } from 'motionary/runtime/gltf-anim';
|
|
1358
1407
|
import { defineGlScene } from 'motionary/components/widgets';
|
|
1359
1408
|
|
|
1360
|
-
use(gl, formatGltf, formatObj);
|
|
1409
|
+
use(gl, formatGltf, formatObj, gltfAnim);
|
|
1361
1410
|
defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
|
|
1362
1411
|
```
|
|
1363
1412
|
|
|
@@ -1366,6 +1415,7 @@ defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
|
|
|
1366
1415
|
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js"></script>
|
|
1367
1416
|
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
|
|
1368
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>
|
|
1369
1419
|
<!-- then the component bundles -->
|
|
1370
1420
|
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1371
1421
|
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
@@ -3047,6 +3097,44 @@ defineSmoothScroll(); // registers <usa-smooth-scroll> — after the prerequisit
|
|
|
3047
3097
|
<usa-smooth-scroll lerp="0.1" offset="64"></usa-smooth-scroll>
|
|
3048
3098
|
```
|
|
3049
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
|
+
|
|
3050
3138
|
### <usa-sparkline> — Sparkline
|
|
3051
3139
|
|
|
3052
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
|
|
|
@@ -26,6 +26,8 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
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
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
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).
|
|
29
31
|
|
|
30
32
|
## Components
|
|
31
33
|
|
|
@@ -89,7 +91,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
89
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
|
|
90
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
|
|
91
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
|
|
92
|
-
- `<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,
|
|
93
95
|
- `<usa-glitch>` (motionary/components/text): An RGB-split, sliced glitch — always on or on hover.
|
|
94
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.
|
|
95
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
|
|
@@ -193,6 +195,7 @@ Rules for using a component: (1) import its define function from `import.path` a
|
|
|
193
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.
|
|
194
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).
|
|
195
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
|
|
196
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
|
|
197
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
|
|
198
201
|
- `<usa-spinner>` (motionary/components/feedback): Six indeterminate indicators: the WinUI progress ring, the Windows 10 orbiting dots, ring, typing dots, pulse and bars.
|
package/dist/manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"format": "motionary/components",
|
|
4
4
|
"schemaVersion": 1,
|
|
5
5
|
"package": "motionary",
|
|
6
|
-
"version": "10.
|
|
6
|
+
"version": "10.8.0",
|
|
7
7
|
"homepage": "https://harrisoncn.github.io/Motionary/",
|
|
8
8
|
"llms": "https://harrisoncn.github.io/Motionary/llms.txt",
|
|
9
9
|
"cdn": {
|
|
@@ -895,8 +895,13 @@
|
|
|
895
895
|
],
|
|
896
896
|
[
|
|
897
897
|
"skins, morph targets, animations",
|
|
898
|
-
"
|
|
899
|
-
"
|
|
898
|
+
"yes",
|
|
899
|
+
"data kept on the nodes / geometry; played by motionary/runtime/gltf-anim (10.8)"
|
|
900
|
+
],
|
|
901
|
+
[
|
|
902
|
+
"sparse accessors",
|
|
903
|
+
"yes",
|
|
904
|
+
"10.8"
|
|
900
905
|
],
|
|
901
906
|
[
|
|
902
907
|
"Draco / meshopt / KTX2 (Basis) compression",
|
|
@@ -904,7 +909,7 @@
|
|
|
904
909
|
"files that require them fail with a clear error; decoder hooks planned for 10.9"
|
|
905
910
|
],
|
|
906
911
|
[
|
|
907
|
-
"
|
|
912
|
+
"cameras, KHR_lights_punctual, texture transforms",
|
|
908
913
|
"no",
|
|
909
914
|
"ignored"
|
|
910
915
|
],
|
|
@@ -995,6 +1000,7 @@
|
|
|
995
1000
|
"budget": 12288,
|
|
996
1001
|
"exports": [
|
|
997
1002
|
"vector",
|
|
1003
|
+
"evalExpression",
|
|
998
1004
|
"loadLottie",
|
|
999
1005
|
"parseDotLottie",
|
|
1000
1006
|
"unzipEntries",
|
|
@@ -1063,9 +1069,14 @@
|
|
|
1063
1069
|
""
|
|
1064
1070
|
],
|
|
1065
1071
|
[
|
|
1066
|
-
"text layers,
|
|
1067
|
-
"
|
|
1068
|
-
"
|
|
1072
|
+
"text layers: fonts by family + style, justification, tracking, line height, fill / stroke, box text (wrapping), source-text keyframes",
|
|
1073
|
+
"yes",
|
|
1074
|
+
"10.8; system / page fonts (glyph outlines in chars are not used); text animators not supported"
|
|
1075
|
+
],
|
|
1076
|
+
[
|
|
1077
|
+
"expressions: time, value, wiggle, loopOut / loopIn (cycle, pingpong, offset, continue), linear / ease, valueAtTime, Math, arithmetic, var / $bm_rt",
|
|
1078
|
+
"yes",
|
|
1079
|
+
"10.8 subset, own interpreter (no eval; CSP-safe); other expressions keep the keyframed value and are listed by inspectLottie()"
|
|
1069
1080
|
],
|
|
1070
1081
|
[
|
|
1071
1082
|
"3D layers, layer effects, merge paths, repeaters",
|
|
@@ -1276,6 +1287,142 @@
|
|
|
1276
1287
|
]
|
|
1277
1288
|
],
|
|
1278
1289
|
"example": "import { use } from 'motionary/runtime';\nimport { physics } from 'motionary/runtime/physics';\nimport { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';\nuse(physics, formatScene);\nconst { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());\nworld.run();"
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
"kind": "runtime",
|
|
1293
|
+
"id": "drag-snap",
|
|
1294
|
+
"label": "motionary/runtime/drag-snap",
|
|
1295
|
+
"title": "Drag, inertia and snap points",
|
|
1296
|
+
"summary": "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).",
|
|
1297
|
+
"install": "npm i motionary",
|
|
1298
|
+
"importPath": "motionary/runtime/drag-snap",
|
|
1299
|
+
"import": "import { use } from 'motionary/runtime';\nimport { dragSnap } from 'motionary/runtime/drag-snap';",
|
|
1300
|
+
"register": "use(dragSnap);",
|
|
1301
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.iife.js\"></script>",
|
|
1302
|
+
"cdnEsm": "https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.js",
|
|
1303
|
+
"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).",
|
|
1304
|
+
"docs": "docs/runtime/drag-snap.md",
|
|
1305
|
+
"budget": 4096,
|
|
1306
|
+
"exports": [
|
|
1307
|
+
"dragSnap",
|
|
1308
|
+
"createDragSnap",
|
|
1309
|
+
"projectThrow",
|
|
1310
|
+
"nearestSnap",
|
|
1311
|
+
"rubberband",
|
|
1312
|
+
"springStep",
|
|
1313
|
+
"velocityTracker"
|
|
1314
|
+
],
|
|
1315
|
+
"compat": [
|
|
1316
|
+
[
|
|
1317
|
+
"pointer, touch and pen (Pointer Events), drag threshold, pointer capture, touch-action for the other axis",
|
|
1318
|
+
"yes",
|
|
1319
|
+
"one axis per controller (x or y)"
|
|
1320
|
+
],
|
|
1321
|
+
[
|
|
1322
|
+
"velocity from the last 100 ms, inertial throw with constant deceleration",
|
|
1323
|
+
"yes",
|
|
1324
|
+
"off under reduced motion"
|
|
1325
|
+
],
|
|
1326
|
+
[
|
|
1327
|
+
"snap points: nearest to the projected throw, a fast flick moves at least one point",
|
|
1328
|
+
"yes",
|
|
1329
|
+
""
|
|
1330
|
+
],
|
|
1331
|
+
[
|
|
1332
|
+
"critically damped spring to the snap point (shared ticker)",
|
|
1333
|
+
"yes",
|
|
1334
|
+
"instant under reduced motion"
|
|
1335
|
+
],
|
|
1336
|
+
[
|
|
1337
|
+
"bounds with rubber-band resistance",
|
|
1338
|
+
"yes",
|
|
1339
|
+
""
|
|
1340
|
+
],
|
|
1341
|
+
[
|
|
1342
|
+
"clicks inside are kept; the click that ends a drag is swallowed",
|
|
1343
|
+
"yes",
|
|
1344
|
+
""
|
|
1345
|
+
],
|
|
1346
|
+
[
|
|
1347
|
+
"free 2D dragging, scroll-linked snapping (CSS scroll-snap)",
|
|
1348
|
+
"no",
|
|
1349
|
+
"use two controllers / native scroll-snap"
|
|
1350
|
+
],
|
|
1351
|
+
[
|
|
1352
|
+
"SSR / workers",
|
|
1353
|
+
"partial",
|
|
1354
|
+
"the maths (projectThrow, nearestSnap, rubberband, springStep, velocityTracker) is pure"
|
|
1355
|
+
]
|
|
1356
|
+
],
|
|
1357
|
+
"example": "import { use } from 'motionary/runtime';\nimport { dragSnap, createDragSnap } from 'motionary/runtime/drag-snap';\nuse(dragSnap);\nconst track = document.querySelector('.track');\nconst ds = createDragSnap(track, { axis: 'x', snap: [0, -320, -640], onUpdate: (x) => (track.style.transform = `translateX(${x}px)`) });\nds.snapTo(1);"
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
"kind": "runtime",
|
|
1361
|
+
"id": "gltf-anim",
|
|
1362
|
+
"label": "motionary/runtime/gltf-anim",
|
|
1363
|
+
"title": "glTF animation, skinning and morph targets",
|
|
1364
|
+
"summary": "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).",
|
|
1365
|
+
"install": "npm i motionary",
|
|
1366
|
+
"importPath": "motionary/runtime/gltf-anim",
|
|
1367
|
+
"import": "import { use } from 'motionary/runtime';\nimport { gltfAnim } from 'motionary/runtime/gltf-anim';",
|
|
1368
|
+
"register": "use(gltfAnim);",
|
|
1369
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.iife.js\"></script>",
|
|
1370
|
+
"cdnEsm": "https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.js",
|
|
1371
|
+
"order": "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).",
|
|
1372
|
+
"docs": "docs/runtime/gltf-anim.md",
|
|
1373
|
+
"budget": 4608,
|
|
1374
|
+
"exports": [
|
|
1375
|
+
"gltfAnim",
|
|
1376
|
+
"gltfAnimator",
|
|
1377
|
+
"gltfClips",
|
|
1378
|
+
"sampleChannel",
|
|
1379
|
+
"applyClip",
|
|
1380
|
+
"deformModel",
|
|
1381
|
+
"deformGeometry"
|
|
1382
|
+
],
|
|
1383
|
+
"compat": [
|
|
1384
|
+
[
|
|
1385
|
+
"animation channels: translation, rotation, scale, weights",
|
|
1386
|
+
"yes",
|
|
1387
|
+
"KHR_animation_pointer is ignored"
|
|
1388
|
+
],
|
|
1389
|
+
[
|
|
1390
|
+
"samplers: LINEAR (quaternions slerped), STEP, CUBICSPLINE (Hermite, in / out tangents)",
|
|
1391
|
+
"yes",
|
|
1392
|
+
""
|
|
1393
|
+
],
|
|
1394
|
+
[
|
|
1395
|
+
"skins: joint hierarchy, inverse bind matrices, JOINTS_0 / WEIGHTS_0 (4 influences)",
|
|
1396
|
+
"yes",
|
|
1397
|
+
"CPU skinning; JOINTS_1 / WEIGHTS_1 (8 influences) not used"
|
|
1398
|
+
],
|
|
1399
|
+
[
|
|
1400
|
+
"morph targets: POSITION + NORMAL deltas, mesh / node default weights, animated weights",
|
|
1401
|
+
"yes",
|
|
1402
|
+
"TANGENT / TEXCOORD / COLOR targets ignored"
|
|
1403
|
+
],
|
|
1404
|
+
[
|
|
1405
|
+
"sparse accessors (common for morph targets)",
|
|
1406
|
+
"yes",
|
|
1407
|
+
"read by format-gltf"
|
|
1408
|
+
],
|
|
1409
|
+
[
|
|
1410
|
+
"clip player: by name or index, loop, speed, seek, update(dt) or the shared ticker",
|
|
1411
|
+
"yes",
|
|
1412
|
+
"one clip at a time (no blending)"
|
|
1413
|
+
],
|
|
1414
|
+
[
|
|
1415
|
+
"GPU skinning, animation blending / cross-fades, a mesh shared by several skinned nodes",
|
|
1416
|
+
"no",
|
|
1417
|
+
"planned work beyond 11.0"
|
|
1418
|
+
],
|
|
1419
|
+
[
|
|
1420
|
+
"SSR / workers",
|
|
1421
|
+
"yes",
|
|
1422
|
+
"sampling and deformation are pure; play() needs the runtime ticker"
|
|
1423
|
+
]
|
|
1424
|
+
],
|
|
1425
|
+
"example": "import { use } from 'motionary/runtime';\nimport { gl } from 'motionary/runtime/gl';\nimport { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';\nimport { gltfAnim, gltfAnimator } from 'motionary/runtime/gltf-anim';\nuse(gl, formatGltf, gltfAnim);\nconst model = await loadGltf('/models/robot.glb');\nconst anim = gltfAnimator(model, { clip: 'walk' });\nanim.play(); // or anim.update(dt) in your own loop"
|
|
1279
1426
|
}
|
|
1280
1427
|
],
|
|
1281
1428
|
"components": [
|
|
@@ -3945,7 +4092,7 @@
|
|
|
3945
4092
|
"id": "gl-scene",
|
|
3946
4093
|
"tag": "usa-gl-scene",
|
|
3947
4094
|
"title": "3D scene (glTF / OBJ)",
|
|
3948
|
-
"description": "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>.",
|
|
4095
|
+
"description": "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>.",
|
|
3949
4096
|
"category": "ui",
|
|
3950
4097
|
"since": "10.5",
|
|
3951
4098
|
"keywords": [
|
|
@@ -3975,7 +4122,9 @@
|
|
|
3975
4122
|
"auto-rotate",
|
|
3976
4123
|
"video",
|
|
3977
4124
|
"video-scrub",
|
|
3978
|
-
"label"
|
|
4125
|
+
"label",
|
|
4126
|
+
"animation",
|
|
4127
|
+
"animation-speed"
|
|
3979
4128
|
],
|
|
3980
4129
|
"events": [
|
|
3981
4130
|
"usa:error",
|
|
@@ -3987,31 +4136,48 @@
|
|
|
3987
4136
|
"reload"
|
|
3988
4137
|
],
|
|
3989
4138
|
"example": "<usa-gl-scene src=\"/models/chair.glb\" controls auto-rotate=\"20\" label=\"Chair\"></usa-gl-scene>",
|
|
3990
|
-
"esm": "import { use } from 'motionary/runtime';\nimport { gl } from 'motionary/runtime/gl';\nimport { formatGltf } from 'motionary/runtime/format-gltf';\nimport { formatObj } from 'motionary/runtime/format-obj';\n\nuse(gl, formatGltf, formatObj);\nimport { defineGlScene } from 'motionary/components/widgets';\n\ndefineGlScene(); // registers <usa-gl-scene>\n\n/* then use it in your HTML:\n<usa-gl-scene src=\"/models/chair.glb\" controls auto-rotate=\"20\" label=\"Chair\"></usa-gl-scene>\n*/",
|
|
4139
|
+
"esm": "import { use } from 'motionary/runtime';\nimport { gl } from 'motionary/runtime/gl';\nimport { formatGltf } from 'motionary/runtime/format-gltf';\nimport { formatObj } from 'motionary/runtime/format-obj';\nimport { gltfAnim } from 'motionary/runtime/gltf-anim';\n\nuse(gl, formatGltf, formatObj, gltfAnim);\nimport { defineGlScene } from 'motionary/components/widgets';\n\ndefineGlScene(); // registers <usa-gl-scene>\n\n/* then use it in your HTML:\n<usa-gl-scene src=\"/models/chair.glb\" controls auto-rotate=\"20\" label=\"Chair\"></usa-gl-scene>\n*/",
|
|
3991
4140
|
"requires": [
|
|
3992
4141
|
"gl",
|
|
3993
4142
|
"format-gltf",
|
|
3994
|
-
"format-obj"
|
|
4143
|
+
"format-obj",
|
|
4144
|
+
"gltf-anim"
|
|
3995
4145
|
],
|
|
3996
4146
|
"prerequisites": {
|
|
3997
|
-
"badge": "Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj",
|
|
4147
|
+
"badge": "Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim",
|
|
3998
4148
|
"modules": [
|
|
3999
4149
|
"motionary/runtime/gl",
|
|
4000
4150
|
"motionary/runtime/format-gltf",
|
|
4001
|
-
"motionary/runtime/format-obj"
|
|
4151
|
+
"motionary/runtime/format-obj",
|
|
4152
|
+
"motionary/runtime/gltf-anim"
|
|
4002
4153
|
],
|
|
4003
4154
|
"install": "npm i motionary",
|
|
4004
|
-
"importAndRegister": "import { use } from 'motionary/runtime';\nimport { gl } from 'motionary/runtime/gl';\nimport { formatGltf } from 'motionary/runtime/format-gltf';\nimport { formatObj } from 'motionary/runtime/format-obj';\nimport { defineGlScene } from 'motionary/components/widgets';\n\nuse(gl, formatGltf, formatObj);\ndefineGlScene(); // registers <usa-gl-scene> — after the prerequisites",
|
|
4005
|
-
"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).",
|
|
4006
|
-
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js\"></script>\n<!-- then the component bundles -->\n<script src=\"https://unpkg.com/motionary@10/dist/components.umd.js\"></script>\n<script src=\"https://unpkg.com/motionary@10/dist/widgets.umd.js\"></script>",
|
|
4155
|
+
"importAndRegister": "import { use } from 'motionary/runtime';\nimport { gl } from 'motionary/runtime/gl';\nimport { formatGltf } from 'motionary/runtime/format-gltf';\nimport { formatObj } from 'motionary/runtime/format-obj';\nimport { gltfAnim } from 'motionary/runtime/gltf-anim';\nimport { defineGlScene } from 'motionary/components/widgets';\n\nuse(gl, formatGltf, formatObj, gltfAnim);\ndefineGlScene(); // registers <usa-gl-scene> — after the prerequisites",
|
|
4156
|
+
"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).",
|
|
4157
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gltf-anim.iife.js\"></script>\n<!-- then the component bundles -->\n<script src=\"https://unpkg.com/motionary@10/dist/components.umd.js\"></script>\n<script src=\"https://unpkg.com/motionary@10/dist/widgets.umd.js\"></script>",
|
|
4007
4158
|
"example": "<usa-gl-scene src=\"/models/chair.glb\" controls auto-rotate=\"20\" label=\"Chair\"></usa-gl-scene>",
|
|
4008
4159
|
"docs": [
|
|
4009
4160
|
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/gl.md",
|
|
4010
4161
|
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-gltf.md",
|
|
4011
|
-
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-obj.md"
|
|
4162
|
+
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/format-obj.md",
|
|
4163
|
+
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/gltf-anim.md"
|
|
4012
4164
|
]
|
|
4013
4165
|
},
|
|
4014
|
-
"source": "src/components/widgets/gl-scene.ts"
|
|
4166
|
+
"source": "src/components/widgets/gl-scene.ts",
|
|
4167
|
+
"variants": [
|
|
4168
|
+
{
|
|
4169
|
+
"id": "gl-scene",
|
|
4170
|
+
"title": "3D scene (glTF / OBJ)",
|
|
4171
|
+
"description": "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>.",
|
|
4172
|
+
"example": "<usa-gl-scene src=\"/models/chair.glb\" controls auto-rotate=\"20\" label=\"Chair\"></usa-gl-scene>"
|
|
4173
|
+
},
|
|
4174
|
+
{
|
|
4175
|
+
"id": "gl-skinned",
|
|
4176
|
+
"title": "3D animation (glTF skin + morph)",
|
|
4177
|
+
"description": "10.8: <usa-gl-scene animation> plays glTF animations — skeletal skinning (4 joints per vertex), morph targets and LINEAR / STEP / CUBICSPLINE channels — on Motionary’s own WebGL2 renderer. Pick a clip by name or index, set animation-speed; reduced motion shows the first pose. Requires motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/gltf-anim (+ format-obj for .obj models) — npm i motionary, then use(gl, formatGltf, formatObj, gltfAnim).",
|
|
4178
|
+
"example": "<usa-gl-scene src=\"/models/robot.glb\" animation=\"walk\" controls label=\"Walking robot\"></usa-gl-scene>"
|
|
4179
|
+
}
|
|
4180
|
+
]
|
|
4015
4181
|
},
|
|
4016
4182
|
{
|
|
4017
4183
|
"id": "glitch",
|
|
@@ -4978,7 +5144,21 @@
|
|
|
4978
5144
|
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/vector.md"
|
|
4979
5145
|
]
|
|
4980
5146
|
},
|
|
4981
|
-
"source": "src/components/widgets/lottie-player.ts"
|
|
5147
|
+
"source": "src/components/widgets/lottie-player.ts",
|
|
5148
|
+
"variants": [
|
|
5149
|
+
{
|
|
5150
|
+
"id": "lottie-player",
|
|
5151
|
+
"title": "Lottie player (JSON + dotLottie)",
|
|
5152
|
+
"description": "10.6: plays Lottie JSON and dotLottie (.lottie) files with Motionary’s own Canvas 2D renderer — shapes, gradients, trim paths, masks, track mattes, precomps and images; autoplay, loop, bounce, segments / markers, play on hover or scrub with scroll. Requires motionary/runtime/vector — npm i motionary, then use(vector) before it mounts.",
|
|
5153
|
+
"example": "<usa-lottie-player src=\"/anim/hero.lottie\" autoplay loop label=\"Hero animation\"></usa-lottie-player>"
|
|
5154
|
+
},
|
|
5155
|
+
{
|
|
5156
|
+
"id": "lottie-text",
|
|
5157
|
+
"title": "Lottie text + expressions",
|
|
5158
|
+
"description": "10.8: the Lottie player now draws text layers (fonts by family and style, justification, tracking, line height, fill and stroke, wrapping box text, source-text keyframes) and runs an expression subset — time, value, wiggle, loopOut / loopIn, linear / ease, Math — with its own interpreter (no eval, CSP-safe). Requires motionary/runtime/vector — npm i motionary, then use(vector).",
|
|
5159
|
+
"example": "<usa-lottie-player src=\"/anim/title.json\" autoplay loop label=\"Animated title\"></usa-lottie-player>"
|
|
5160
|
+
}
|
|
5161
|
+
]
|
|
4982
5162
|
},
|
|
4983
5163
|
{
|
|
4984
5164
|
"id": "lyrics",
|
|
@@ -7877,6 +8057,67 @@
|
|
|
7877
8057
|
},
|
|
7878
8058
|
"source": "src/components/widgets/smooth-scroll.ts"
|
|
7879
8059
|
},
|
|
8060
|
+
{
|
|
8061
|
+
"id": "snap-carousel",
|
|
8062
|
+
"tag": "usa-snap-carousel",
|
|
8063
|
+
"title": "Snap carousel (drag · inertia · snap)",
|
|
8064
|
+
"description": "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).",
|
|
8065
|
+
"category": "ui",
|
|
8066
|
+
"since": "10.8",
|
|
8067
|
+
"keywords": [
|
|
8068
|
+
"carousel",
|
|
8069
|
+
"slider",
|
|
8070
|
+
"drag",
|
|
8071
|
+
"inertia",
|
|
8072
|
+
"snap",
|
|
8073
|
+
"swipe",
|
|
8074
|
+
"runtime"
|
|
8075
|
+
],
|
|
8076
|
+
"import": {
|
|
8077
|
+
"path": "motionary/components/snap-carousel",
|
|
8078
|
+
"define": "defineSnapCarousel",
|
|
8079
|
+
"register": "defineSnapCarousel();"
|
|
8080
|
+
},
|
|
8081
|
+
"cdn": "https://unpkg.com/motionary@10/dist/components.umd.js",
|
|
8082
|
+
"attributes": [
|
|
8083
|
+
"align",
|
|
8084
|
+
"gap",
|
|
8085
|
+
"autoplay",
|
|
8086
|
+
"no-controls",
|
|
8087
|
+
"no-dots",
|
|
8088
|
+
"label"
|
|
8089
|
+
],
|
|
8090
|
+
"events": [
|
|
8091
|
+
"usa:change",
|
|
8092
|
+
"usa:runtime-missing"
|
|
8093
|
+
],
|
|
8094
|
+
"slots": [],
|
|
8095
|
+
"methods": [
|
|
8096
|
+
"next",
|
|
8097
|
+
"prev",
|
|
8098
|
+
"goTo"
|
|
8099
|
+
],
|
|
8100
|
+
"example": "<usa-snap-carousel align=\"center\" gap=\"16\" label=\"Featured\">\n <article>…</article>\n <article>…</article>\n <article>…</article>\n</usa-snap-carousel>",
|
|
8101
|
+
"esm": "import { use } from 'motionary/runtime';\nimport { dragSnap } from 'motionary/runtime/drag-snap';\n\nuse(dragSnap);\nimport { defineSnapCarousel } from 'motionary/components/snap-carousel';\n\ndefineSnapCarousel(); // registers <usa-snap-carousel>\n\n/* then use it in your HTML:\n<usa-snap-carousel align=\"center\" gap=\"16\" label=\"Featured\">\n <article>…</article>\n <article>…</article>\n <article>…</article>\n</usa-snap-carousel>\n*/",
|
|
8102
|
+
"requires": [
|
|
8103
|
+
"drag-snap"
|
|
8104
|
+
],
|
|
8105
|
+
"prerequisites": {
|
|
8106
|
+
"badge": "Requires: motionary/runtime/drag-snap",
|
|
8107
|
+
"modules": [
|
|
8108
|
+
"motionary/runtime/drag-snap"
|
|
8109
|
+
],
|
|
8110
|
+
"install": "npm i motionary",
|
|
8111
|
+
"importAndRegister": "import { use } from 'motionary/runtime';\nimport { dragSnap } from 'motionary/runtime/drag-snap';\nimport { defineSnapCarousel } from 'motionary/components/snap-carousel';\n\nuse(dragSnap);\ndefineSnapCarousel(); // registers <usa-snap-carousel> — after the prerequisites",
|
|
8112
|
+
"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).",
|
|
8113
|
+
"cdn": "<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/drag-snap.iife.js\"></script>\n<!-- then the component bundles -->\n<script src=\"https://unpkg.com/motionary@10/dist/components.umd.js\"></script>\n<script src=\"https://unpkg.com/motionary@10/dist/widgets.umd.js\"></script>",
|
|
8114
|
+
"example": "<usa-snap-carousel align=\"center\" gap=\"16\" label=\"Featured\">\n <article>…</article>\n <article>…</article>\n <article>…</article>\n</usa-snap-carousel>",
|
|
8115
|
+
"docs": [
|
|
8116
|
+
"https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/drag-snap.md"
|
|
8117
|
+
]
|
|
8118
|
+
},
|
|
8119
|
+
"source": "src/components/widgets/snap-carousel.ts"
|
|
8120
|
+
},
|
|
7880
8121
|
{
|
|
7881
8122
|
"id": "sparkline",
|
|
7882
8123
|
"tag": "usa-sparkline",
|