motionary 10.4.0 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +97 -0
- package/dist/chunks/{anim-image-blQgPFFS.cjs → anim-image-DECLkPH4.cjs} +2 -2
- package/dist/chunks/{anim-image-blQgPFFS.cjs.map → anim-image-DECLkPH4.cjs.map} +1 -1
- package/dist/chunks/{anim-image-DDdb9q3X.js → anim-image-DNghy017.js} +2 -2
- package/dist/chunks/{anim-image-DDdb9q3X.js.map → anim-image-DNghy017.js.map} +1 -1
- package/dist/chunks/{keyframes-tC3I7anQ.cjs → keyframes-CbUZjD_5.cjs} +2 -2
- package/dist/chunks/{keyframes-tC3I7anQ.cjs.map → keyframes-CbUZjD_5.cjs.map} +1 -1
- package/dist/chunks/{keyframes-B5PWe5bU.js → keyframes-F6vp6tZZ.js} +2 -2
- package/dist/chunks/{keyframes-B5PWe5bU.js.map → keyframes-F6vp6tZZ.js.map} +1 -1
- package/dist/chunks/{registry-CT-TT_bx.js → registry-D8LAoXI-.js} +2 -2
- package/dist/chunks/{registry-CT-TT_bx.js.map → registry-D8LAoXI-.js.map} +1 -1
- package/dist/chunks/{registry-tzwKkldE.cjs → registry-dr1CPTk1.cjs} +2 -2
- package/dist/chunks/{registry-tzwKkldE.cjs.map → registry-dr1CPTk1.cjs.map} +1 -1
- package/dist/chunks/{ticker-Un0bvTWR.cjs → ticker-DaAlEyOd.cjs} +2 -2
- package/dist/chunks/{ticker-Un0bvTWR.cjs.map → ticker-DaAlEyOd.cjs.map} +1 -1
- package/dist/chunks/{ticker-C8lSGml9.js → ticker-Do9bGsaV.js} +2 -2
- package/dist/chunks/{ticker-C8lSGml9.js.map → ticker-Do9bGsaV.js.map} +1 -1
- package/dist/chunks/{tween-BcejKpsx.js → tween-BzCGq_Ba.js} +2 -2
- package/dist/chunks/{tween-BcejKpsx.js.map → tween-BzCGq_Ba.js.map} +1 -1
- package/dist/chunks/{tween-CwLLC3Ko.cjs → tween-CmkdSyaC.cjs} +2 -2
- package/dist/chunks/{tween-CwLLC3Ko.cjs.map → tween-CmkdSyaC.cjs.map} +1 -1
- package/dist/components/lite.cjs +179 -0
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +176 -1
- package/dist/components/lite.js.map +1 -1
- package/dist/components/tokens.cjs +179 -0
- package/dist/components/tokens.cjs.map +1 -1
- package/dist/components/tokens.d.cts +36 -1
- package/dist/components/tokens.d.ts +36 -1
- package/dist/components/tokens.js +176 -1
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/widgets.cjs +1138 -213
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +401 -2
- package/dist/components/widgets.d.ts +401 -2
- package/dist/components/widgets.js +1124 -214
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.cjs +4 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +36 -1
- package/dist/components.d.ts +36 -1
- package/dist/components.js +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/llms-full.txt +273 -1
- package/dist/llms.txt +14 -2
- package/dist/manifest.json +736 -1
- 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 +207 -0
- package/dist/runtime/format-gltf.cjs.map +1 -0
- package/dist/runtime/format-gltf.d.cts +251 -0
- package/dist/runtime/format-gltf.d.ts +251 -0
- package/dist/runtime/format-gltf.iife.js +2 -0
- package/dist/runtime/format-gltf.iife.js.map +1 -0
- package/dist/runtime/format-gltf.js +200 -0
- package/dist/runtime/format-gltf.js.map +1 -0
- package/dist/runtime/format-motion.cjs +4 -4
- package/dist/runtime/format-motion.js +4 -4
- package/dist/runtime/format-obj.cjs +181 -0
- package/dist/runtime/format-obj.cjs.map +1 -0
- package/dist/runtime/format-obj.d.cts +176 -0
- package/dist/runtime/format-obj.d.ts +176 -0
- package/dist/runtime/format-obj.iife.js +2 -0
- package/dist/runtime/format-obj.iife.js.map +1 -0
- package/dist/runtime/format-obj.js +174 -0
- package/dist/runtime/format-obj.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 +763 -0
- package/dist/runtime/gl.cjs.map +1 -0
- package/dist/runtime/gl.d.cts +260 -0
- package/dist/runtime/gl.d.ts +260 -0
- package/dist/runtime/gl.iife.js +2 -0
- package/dist/runtime/gl.iife.js.map +1 -0
- package/dist/runtime/gl.js +739 -0
- package/dist/runtime/gl.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 +704 -0
- package/dist/runtime/vector.cjs.map +1 -0
- package/dist/runtime/vector.d.cts +306 -0
- package/dist/runtime/vector.d.ts +306 -0
- package/dist/runtime/vector.iife.js +2 -0
- package/dist/runtime/vector.iife.js.map +1 -0
- package/dist/runtime/vector.js +692 -0
- package/dist/runtime/vector.js.map +1 -0
- 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 +11 -1
- package/docs/components/usa-gl-scene.md +66 -0
- package/docs/components/usa-gpu-particles.md +32 -0
- package/docs/components/usa-lottie-player.md +60 -0
- package/docs/components/usa-rive.md +57 -0
- package/docs/components/usa-shader-backdrop.md +36 -0
- package/docs/components/usa-three-scene.md +20 -0
- package/docs/components/usa-token-editor.md +32 -0
- package/docs/components.md +120 -0
- package/docs/runtime/format-gltf.md +63 -0
- package/docs/runtime/format-obj.md +59 -0
- package/docs/runtime/gl.md +62 -0
- package/docs/runtime/rive.md +55 -0
- package/docs/runtime/vector.md +67 -0
- package/package.json +47 -3
package/docs/ROADMAP.md
CHANGED
|
@@ -61,11 +61,11 @@ Store 卡片显示 **「Requires: motionary/runtime/<module>」** 徽章(官
|
|
|
61
61
|
- 主线 B:**smooth 模块** —— 平滑滚动(减少动态效果时停用)。
|
|
62
62
|
- 格式:GIF(自研 LZW)、APNG、动画 WebP 拆帧到 canvas。
|
|
63
63
|
- 新组件:滚动进度环、视差分层容器、`<usa-smooth-scroll>`。
|
|
64
|
-
- **v10.5** — WebGPU 特效 2.0:计算着色器粒子、后处理链。
|
|
64
|
+
- ✅ **v10.5** — WebGPU 特效 2.0:计算着色器粒子、后处理链。
|
|
65
65
|
- 主线 B:**gl 模块** —— 迷你 WebGL2 场景(网格 / 基础几何体、相机、灯光、着色器材质;不是 Three.js 克隆)。
|
|
66
66
|
- 格式:OBJ / MTL、glTF 2.0 / GLB 基础、视频纹理。
|
|
67
67
|
- 新组件:粒子画布、着色器背景、`<usa-gl-scene>`(保留别名 `<usa-three-scene>`)。
|
|
68
|
-
- **v10.6** — 动效设计令牌 2.0:W3C Design Tokens 格式导入导出。
|
|
68
|
+
- ✅ **v10.6** — 动效设计令牌 2.0:W3C Design Tokens 格式导入导出。
|
|
69
69
|
- 主线 B:**vector 模块** —— 矢量动画播放器,支持文档列出的 Lottie JSON 子集(形状、变换、修剪路径、基础遮罩、预合成、渐变;文档列出不支持的特性)+ dotLottie。
|
|
70
70
|
- 官方运行时:`<usa-rive>`(Requires: @rive-app/canvas,可选 peer,懒加载)。
|
|
71
71
|
- 新组件:令牌编辑器、`<usa-lottie-player>`、`<usa-rive>`。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Motionary components (
|
|
1
|
+
# Motionary components (205)
|
|
2
2
|
|
|
3
3
|
One page per `<usa-*>` element, generated from the source. Machine-readable: `motionary/manifest.json` · Pages `/components.json` · `/llms.txt` · `/llms-full.txt`. How to use these with an AI assistant: [AGENTS.md](../../AGENTS.md) and [the prompt guide](../ai-prompt-guide.md).
|
|
4
4
|
|
|
@@ -51,7 +51,9 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
|
|
|
51
51
|
- [`<usa-gauge>`](usa-gauge.md) — Spring gauge
|
|
52
52
|
- [`<usa-gen-art>`](usa-gen-art.md) — Generative artwork
|
|
53
53
|
- [`<usa-gesture-sticker>`](usa-gesture-sticker.md) — Multi-touch sticker
|
|
54
|
+
- [`<usa-gl-scene>`](usa-gl-scene.md) — 3D scene (glTF / OBJ) · Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
|
|
54
55
|
- [`<usa-globe>`](usa-globe.md) — Spinning globe
|
|
56
|
+
- [`<usa-gpu-particles>`](usa-gpu-particles.md) — GPU particle canvas
|
|
55
57
|
- [`<usa-gyro-card>`](usa-gyro-card.md) — Gyro 3D card
|
|
56
58
|
- [`<usa-hero-video>`](usa-hero-video.md) — Hero video
|
|
57
59
|
- [`<usa-hud-panel>`](usa-hud-panel.md) — HUD panel
|
|
@@ -63,6 +65,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
|
|
|
63
65
|
- [`<usa-location-card>`](usa-location-card.md) — Location card
|
|
64
66
|
- [`<usa-lottie>`](usa-lottie.md) — Lottie player
|
|
65
67
|
- [`<usa-lottie-icon>`](usa-lottie-icon.md) — Animated icon set
|
|
68
|
+
- [`<usa-lottie-player>`](usa-lottie-player.md) — Lottie player (JSON + dotLottie) · Requires: motionary/runtime/vector
|
|
66
69
|
- [`<usa-menu>`](usa-menu.md) — Dropdown menu
|
|
67
70
|
- [`<usa-message-list>`](usa-message-list.md) — Chat thread
|
|
68
71
|
- [`<usa-motion>`](usa-motion.md) — Motion DSL
|
|
@@ -92,8 +95,10 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
|
|
|
92
95
|
- [`<usa-reactions>`](usa-reactions.md) — Emoji reactions
|
|
93
96
|
- [`<usa-red-envelope>`](usa-red-envelope.md) — Red envelope (红包)
|
|
94
97
|
- [`<usa-retro-button>`](usa-retro-button.md) — Retro buttons
|
|
98
|
+
- [`<usa-rive>`](usa-rive.md) — Rive player (official runtime) · Requires: @rive-app/canvas
|
|
95
99
|
- [`<usa-scene>`](usa-scene.md) — Cinematic scene
|
|
96
100
|
- [`<usa-segmented>`](usa-segmented.md) — Segmented control
|
|
101
|
+
- [`<usa-shader-backdrop>`](usa-shader-backdrop.md) — Shader backdrop + post chain
|
|
97
102
|
- [`<usa-shortcut>`](usa-shortcut.md) — Shortcut hint
|
|
98
103
|
- [`<usa-sketch-chart>`](usa-sketch-chart.md) — Sketch chart
|
|
99
104
|
- [`<usa-slider>`](usa-slider.md) — Slider
|
|
@@ -109,6 +114,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
|
|
|
109
114
|
- [`<usa-theme-surface>`](usa-theme-surface.md) — Theme surface
|
|
110
115
|
- [`<usa-theme-switcher>`](usa-theme-switcher.md) — Theme switcher
|
|
111
116
|
- [`<usa-tip>`](usa-tip.md) — Tooltip / popover 2.0
|
|
117
|
+
- [`<usa-token-editor>`](usa-token-editor.md) — Motion token editor (W3C DTCG)
|
|
112
118
|
- [`<usa-upload-progress>`](usa-upload-progress.md) — Upload progress
|
|
113
119
|
- [`<usa-video-card>`](usa-video-card.md) — Video card
|
|
114
120
|
- [`<usa-voice-button>`](usa-voice-button.md) — Voice button
|
|
@@ -256,3 +262,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
|
|
|
256
262
|
- [`<usa-pinch-zoom>`](usa-pinch-zoom.md) — Pinch zoom
|
|
257
263
|
- [`<usa-swipe-deck>`](usa-swipe-deck.md) — Swipe cards deck
|
|
258
264
|
- [`<usa-swipeable>`](usa-swipeable.md) — Swipeable
|
|
265
|
+
|
|
266
|
+
## widgets
|
|
267
|
+
|
|
268
|
+
- [`<usa-three-scene>`](usa-three-scene.md) — <usa-three-scene>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# `<usa-gl-scene>` — 3D scene (glTF / OBJ)
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
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>.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.5
|
|
8
|
+
- **Import:** `import { defineGlScene } from 'motionary/components/widgets'` then `defineGlScene();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `src`, `shape`, `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label`
|
|
11
|
+
- **Events:** `usa:error`, `usa:load`, `usa:runtime-missing`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `reload()`
|
|
14
|
+
- **Source:** [src/components/widgets/gl-scene.ts](../../src/components/widgets/gl-scene.ts)
|
|
15
|
+
|
|
16
|
+
## Prerequisites — Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
|
|
17
|
+
|
|
18
|
+
1. **Install:** `npm i motionary`
|
|
19
|
+
2. **Import order & registration:** 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).
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { use } from 'motionary/runtime';
|
|
23
|
+
import { gl } from 'motionary/runtime/gl';
|
|
24
|
+
import { formatGltf } from 'motionary/runtime/format-gltf';
|
|
25
|
+
import { formatObj } from 'motionary/runtime/format-obj';
|
|
26
|
+
import { defineGlScene } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
use(gl, formatGltf, formatObj);
|
|
29
|
+
defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. **CDN:**
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js"></script>
|
|
37
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
|
|
38
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js"></script>
|
|
39
|
+
<!-- then the component bundles -->
|
|
40
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
41
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Minimal example
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## ES module
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
import { use } from 'motionary/runtime';
|
|
54
|
+
import { gl } from 'motionary/runtime/gl';
|
|
55
|
+
import { formatGltf } from 'motionary/runtime/format-gltf';
|
|
56
|
+
import { formatObj } from 'motionary/runtime/format-obj';
|
|
57
|
+
|
|
58
|
+
use(gl, formatGltf, formatObj);
|
|
59
|
+
import { defineGlScene } from 'motionary/components/widgets';
|
|
60
|
+
|
|
61
|
+
defineGlScene(); // registers <usa-gl-scene>
|
|
62
|
+
|
|
63
|
+
/* then use it in your HTML:
|
|
64
|
+
<usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
|
|
65
|
+
*/
|
|
66
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-gpu-particles>` — GPU particle canvas
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
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 repulsion, trails; Canvas 2D fallback where WebGPU is missing.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.5
|
|
8
|
+
- **Import:** `import { defineGpuParticles } from 'motionary/components/widgets'` then `defineGpuParticles();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `count`, `mode`, `colors`, `size`, `speed`, `trail`, `pointer`, `label`
|
|
11
|
+
- **Events:** `usa:backend`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/gpu-particles.ts](../../src/components/widgets/gpu-particles.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-gpu-particles count="30000" mode="galaxy" colors="#818cf8,#f472b6" pointer></usa-gpu-particles>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineGpuParticles } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineGpuParticles(); // registers <usa-gpu-particles>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-gpu-particles count="30000" mode="galaxy" colors="#818cf8,#f472b6" pointer></usa-gpu-particles>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# `<usa-lottie-player>` — Lottie player (JSON + dotLottie)
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.6
|
|
8
|
+
- **Import:** `import { defineLottiePlayer } from 'motionary/components/widgets'` then `defineLottiePlayer();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `src`, `animation`, `autoplay`, `loop`, `speed`, `mode`, `segment`, `hover`, `scrub`, `fit`, `background`, `label`
|
|
11
|
+
- **Events:** `usa:complete`, `usa:load`, `usa:error`, `usa:runtime-missing`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `pause()`, `stop()`, `seek()`
|
|
14
|
+
- **Source:** [src/components/widgets/lottie-player.ts](../../src/components/widgets/lottie-player.ts)
|
|
15
|
+
|
|
16
|
+
## Prerequisites — Requires: motionary/runtime/vector
|
|
17
|
+
|
|
18
|
+
1. **Install:** `npm i motionary`
|
|
19
|
+
2. **Import order & registration:** Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself).
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { use } from 'motionary/runtime';
|
|
23
|
+
import { vector } from 'motionary/runtime/vector';
|
|
24
|
+
import { defineLottiePlayer } from 'motionary/components/widgets';
|
|
25
|
+
|
|
26
|
+
use(vector);
|
|
27
|
+
defineLottiePlayer(); // registers <usa-lottie-player> — after the prerequisites
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. **CDN:**
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
34
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/vector.iife.js"></script>
|
|
35
|
+
<!-- then the component bundles -->
|
|
36
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
37
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Minimal example
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## ES module
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { use } from 'motionary/runtime';
|
|
50
|
+
import { vector } from 'motionary/runtime/vector';
|
|
51
|
+
|
|
52
|
+
use(vector);
|
|
53
|
+
import { defineLottiePlayer } from 'motionary/components/widgets';
|
|
54
|
+
|
|
55
|
+
defineLottiePlayer(); // registers <usa-lottie-player>
|
|
56
|
+
|
|
57
|
+
/* then use it in your HTML:
|
|
58
|
+
<usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
|
|
59
|
+
*/
|
|
60
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# `<usa-rive>` — Rive player (official runtime)
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
10.6: plays Rive (.riv) files — artboards, animations and state machines with inputs — through the official Rive runtime @rive-app/canvas, an optional peer dependency that is lazy-loaded on first use (Motionary does not reimplement the proprietary .riv format). Requires @rive-app/canvas — npm i @rive-app/canvas, or load its CDN script first; missing → a clear message in place.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.6
|
|
8
|
+
- **Import:** `import { defineRive } from 'motionary/components/widgets'` then `defineRive();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `src`, `artboard`, `animation`, `state-machine`, `autoplay`, `fit`, `label`, `runtime-src`
|
|
11
|
+
- **Events:** `usa:load`, `usa:error`, `usa:runtime-missing`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `pause()`, `input()`
|
|
14
|
+
- **Source:** [src/components/widgets/rive.ts](../../src/components/widgets/rive.ts)
|
|
15
|
+
|
|
16
|
+
## Prerequisites — Requires: @rive-app/canvas
|
|
17
|
+
|
|
18
|
+
1. **Install:** `npm i @rive-app/canvas`
|
|
19
|
+
2. **Import order & registration:** Install the official runtime next to motionary, then hand <usa-rive> a lazy loader with provideRiveRuntime(() => import('@rive-app/canvas')) before the element mounts — your bundler splits the runtime into its own chunk, fetched only when the first <usa-rive> appears. Without a bundler: load the official rive.js from a CDN before the component bundles (window.rive), use an import map, or set runtime-src on the element. Missing → a clear message in place + usa:runtime-missing.
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { provideRiveRuntime } from 'motionary/components/widgets';
|
|
23
|
+
import { defineRive } from 'motionary/components/widgets';
|
|
24
|
+
|
|
25
|
+
provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
|
|
26
|
+
defineRive(); // registers <usa-rive> — after the prerequisites
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. **CDN:**
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
|
|
33
|
+
<!-- then the component bundles -->
|
|
34
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
35
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Minimal example
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## ES module
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import { provideRiveRuntime } from 'motionary/components/widgets';
|
|
48
|
+
|
|
49
|
+
provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
|
|
50
|
+
import { defineRive } from 'motionary/components/widgets';
|
|
51
|
+
|
|
52
|
+
defineRive(); // registers <usa-rive>
|
|
53
|
+
|
|
54
|
+
/* then use it in your HTML:
|
|
55
|
+
<usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
|
|
56
|
+
*/
|
|
57
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-shader-backdrop>` — Shader backdrop + post chain
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
10.5 (WebGPU effects 2.0): an animated shader background (aurora, plasma, waves, nebula or your own GLSL) run through a post-processing chain — bloom, vignette, grain, chromatic aberration, pixelate, scanlines — in any order; CSS gradient fallback.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.5
|
|
8
|
+
- **Import:** `import { defineShaderBackdrop } from 'motionary/components/widgets'` then `defineShaderBackdrop();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `preset`, `post`, `colors`, `speed`, `intensity`, `label`
|
|
11
|
+
- **Events:** `usa:backend`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/shader-backdrop.ts](../../src/components/widgets/shader-backdrop.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-shader-backdrop preset="aurora" post="bloom,vignette,grain">
|
|
20
|
+
<h1>Hello</h1>
|
|
21
|
+
</usa-shader-backdrop>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineShaderBackdrop } from 'motionary/components/widgets';
|
|
28
|
+
|
|
29
|
+
defineShaderBackdrop(); // registers <usa-shader-backdrop>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-shader-backdrop preset="aurora" post="bloom,vignette,grain">
|
|
33
|
+
<h1>Hello</h1>
|
|
34
|
+
</usa-shader-backdrop>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# `<usa-three-scene>` — <usa-three-scene>
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
`<usa-three-scene>` — alias of `<usa-gl-scene>` (same attributes, events and methods; no Three.js involved).
|
|
6
|
+
|
|
7
|
+
- **Category:** widgets
|
|
8
|
+
- **Import:** `import { defineThreeScene } from 'motionary/components/widgets'` then `defineThreeScene();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/gl-scene.ts](../../src/components/widgets/gl-scene.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-three-scene></usa-three-scene>
|
|
20
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-token-editor>` — Motion token editor (W3C DTCG)
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
10.6 (motion design tokens 2.0): edit duration and cubic-bézier easing tokens with a live preview per token, then export W3C Design Tokens (DTCG 2025.10 or the earlier draft) or import a DTCG file — aliases resolved, problems listed; apply writes the tokens to :root custom properties as you edit.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.6
|
|
8
|
+
- **Import:** `import { defineTokenEditor } from 'motionary/components/widgets'` then `defineTokenEditor();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `apply`, `format`, `groups`
|
|
11
|
+
- **Events:** `usa:export`, `usa:import`, `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `exportJSON()`, `importJSON()`
|
|
14
|
+
- **Source:** [src/components/widgets/token-editor.ts](../../src/components/widgets/token-editor.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-token-editor apply format="2025.10"></usa-token-editor>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineTokenEditor } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineTokenEditor(); // registers <usa-token-editor>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-token-editor apply format="2025.10"></usa-token-editor>
|
|
31
|
+
*/
|
|
32
|
+
```
|
package/docs/components.md
CHANGED
|
@@ -1467,6 +1467,98 @@ defineSmoothScroll(); // registers <usa-smooth-scroll> — after the prerequisit
|
|
|
1467
1467
|
<usa-smooth-scroll lerp="0.1" offset="64"></usa-smooth-scroll>
|
|
1468
1468
|
```
|
|
1469
1469
|
|
|
1470
|
+
### `<usa-gl-scene>` — Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj
|
|
1471
|
+
|
|
1472
|
+
- **Install:** `npm i motionary`
|
|
1473
|
+
- **Import order & registration:** 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).
|
|
1474
|
+
|
|
1475
|
+
```js
|
|
1476
|
+
import { use } from 'motionary/runtime';
|
|
1477
|
+
import { gl } from 'motionary/runtime/gl';
|
|
1478
|
+
import { formatGltf } from 'motionary/runtime/format-gltf';
|
|
1479
|
+
import { formatObj } from 'motionary/runtime/format-obj';
|
|
1480
|
+
import { defineGlScene } from 'motionary/components/widgets';
|
|
1481
|
+
|
|
1482
|
+
use(gl, formatGltf, formatObj);
|
|
1483
|
+
defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
|
|
1484
|
+
```
|
|
1485
|
+
|
|
1486
|
+
- **CDN:**
|
|
1487
|
+
|
|
1488
|
+
```html
|
|
1489
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
1490
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.iife.js"></script>
|
|
1491
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
|
|
1492
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js"></script>
|
|
1493
|
+
<!-- then the component bundles -->
|
|
1494
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1495
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
1496
|
+
```
|
|
1497
|
+
|
|
1498
|
+
- **Minimal example:**
|
|
1499
|
+
|
|
1500
|
+
```html
|
|
1501
|
+
<usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
|
|
1502
|
+
```
|
|
1503
|
+
|
|
1504
|
+
### `<usa-lottie-player>` — Requires: motionary/runtime/vector
|
|
1505
|
+
|
|
1506
|
+
- **Install:** `npm i motionary`
|
|
1507
|
+
- **Import order & registration:** Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself).
|
|
1508
|
+
|
|
1509
|
+
```js
|
|
1510
|
+
import { use } from 'motionary/runtime';
|
|
1511
|
+
import { vector } from 'motionary/runtime/vector';
|
|
1512
|
+
import { defineLottiePlayer } from 'motionary/components/widgets';
|
|
1513
|
+
|
|
1514
|
+
use(vector);
|
|
1515
|
+
defineLottiePlayer(); // registers <usa-lottie-player> — after the prerequisites
|
|
1516
|
+
```
|
|
1517
|
+
|
|
1518
|
+
- **CDN:**
|
|
1519
|
+
|
|
1520
|
+
```html
|
|
1521
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
1522
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/vector.iife.js"></script>
|
|
1523
|
+
<!-- then the component bundles -->
|
|
1524
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1525
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
1526
|
+
```
|
|
1527
|
+
|
|
1528
|
+
- **Minimal example:**
|
|
1529
|
+
|
|
1530
|
+
```html
|
|
1531
|
+
<usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
|
|
1532
|
+
```
|
|
1533
|
+
|
|
1534
|
+
### `<usa-rive>` — Requires: @rive-app/canvas
|
|
1535
|
+
|
|
1536
|
+
- **Install:** `npm i @rive-app/canvas`
|
|
1537
|
+
- **Import order & registration:** Install the official runtime next to motionary, then hand <usa-rive> a lazy loader with provideRiveRuntime(() => import('@rive-app/canvas')) before the element mounts — your bundler splits the runtime into its own chunk, fetched only when the first <usa-rive> appears. Without a bundler: load the official rive.js from a CDN before the component bundles (window.rive), use an import map, or set runtime-src on the element. Missing → a clear message in place + usa:runtime-missing.
|
|
1538
|
+
|
|
1539
|
+
```js
|
|
1540
|
+
import { provideRiveRuntime } from 'motionary/components/widgets';
|
|
1541
|
+
import { defineRive } from 'motionary/components/widgets';
|
|
1542
|
+
|
|
1543
|
+
provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
|
|
1544
|
+
defineRive(); // registers <usa-rive> — after the prerequisites
|
|
1545
|
+
```
|
|
1546
|
+
|
|
1547
|
+
- **CDN:**
|
|
1548
|
+
|
|
1549
|
+
```html
|
|
1550
|
+
<script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
|
|
1551
|
+
<!-- then the component bundles -->
|
|
1552
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1553
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
- **Minimal example:**
|
|
1557
|
+
|
|
1558
|
+
```html
|
|
1559
|
+
<usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
|
|
1560
|
+
```
|
|
1561
|
+
|
|
1470
1562
|
<!-- prereqs:end -->
|
|
1471
1563
|
|
|
1472
1564
|
### v10.2 Scroll scenes (`motionary/runtime/scroll`) + SVG loader + `data-motion` in core: `<usa-scroll-scene>`, `<usa-motion-inspector>` (`components/widgets`)
|
|
@@ -1520,6 +1612,34 @@ Declarative motion with just the core: `applyMotionAttributes(createMotion())` +
|
|
|
1520
1612
|
|
|
1521
1613
|
MCP: `npx -y -p motionary motionary-mcp` — see [docs/mcp.md](docs/mcp.md).
|
|
1522
1614
|
|
|
1615
|
+
### v10.5 3D (`motionary/runtime/gl` + glTF / OBJ loaders) + WebGPU effects 2.0: `<usa-gl-scene>` / `<usa-three-scene>`, `<usa-gpu-particles>`, `<usa-shader-backdrop>` (`components/widgets`)
|
|
1616
|
+
|
|
1617
|
+
```html
|
|
1618
|
+
<usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
|
|
1619
|
+
<usa-gpu-particles count="30000" mode="galaxy" pointer></usa-gpu-particles>
|
|
1620
|
+
<usa-shader-backdrop preset="aurora" post="bloom,vignette,grain"><h1>Hello</h1></usa-shader-backdrop>
|
|
1621
|
+
```
|
|
1622
|
+
|
|
1623
|
+
| Element | Attributes | Methods / events |
|
|
1624
|
+
|---|---|---|
|
|
1625
|
+
| `<usa-gl-scene>` / `<usa-three-scene>` (Requires: motionary/runtime/gl; + format-gltf / format-obj for models) | `src` (.gltf, .glb, .obj), `shape` (torus, box, sphere, plane), `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label` | `scene`, `camera`, `root`, `reload()`; `usa:load`, `usa:error`, `usa:runtime-missing` |
|
|
1626
|
+
| `<usa-gpu-particles>` | `count`, `mode` (swirl, galaxy, fountain), `colors`, `size`, `speed`, `trail`, `pointer`, `label` | `backend`; `usa:backend` |
|
|
1627
|
+
| `<usa-shader-backdrop>` | `preset` (aurora, plasma, waves, nebula), `post` (bloom, vignette, grain, chromatic, pixelate, scanlines), `colors`, `speed`, `intensity`, `label`; child `<script type="x-shader/x-fragment">` | `passes`; `usa:backend` |
|
|
1628
|
+
|
|
1629
|
+
### v10.6 Lottie / dotLottie (`motionary/runtime/vector`), Rive (official runtime, optional peer) and W3C motion tokens: `<usa-lottie-player>`, `<usa-rive>`, `<usa-token-editor>` (`components/widgets`)
|
|
1630
|
+
|
|
1631
|
+
```html
|
|
1632
|
+
<usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
|
|
1633
|
+
<usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
|
|
1634
|
+
<usa-token-editor apply format="2025.10"></usa-token-editor>
|
|
1635
|
+
```
|
|
1636
|
+
|
|
1637
|
+
| Element | Attributes | Methods / events |
|
|
1638
|
+
|---|---|---|
|
|
1639
|
+
| `<usa-lottie-player>` (Requires: motionary/runtime/vector) | `src` (.json, .lottie), `animation`, `autoplay`, `loop`, `speed`, `mode` (normal, bounce), `segment`, `hover`, `scrub`, `fit` (contain, cover, fill), `background`, `label` | `play()`, `pause()`, `stop()`, `seek(frame)`, `player`, `animationData`, `unsupported`; `usa:load`, `usa:complete`, `usa:error`, `usa:runtime-missing` |
|
|
1640
|
+
| `<usa-rive>` (Requires: @rive-app/canvas — official runtime, optional peer) | `src`, `artboard`, `animation`, `state-machine`, `autoplay`, `fit` (contain, cover, fill, fitWidth, fitHeight, none), `runtime-src`, `label` | `rive`, `play()`, `pause()`, `input(name)`; `usa:load`, `usa:error`, `usa:runtime-missing`; `provideRiveRuntime(loader)` |
|
|
1641
|
+
| `<usa-token-editor>` | `apply`, `format` (2025.10, draft), `groups` (duration, easing), `label` | `tokens`, `exportJSON()`, `importJSON(json)`; `usa:change`, `usa:export`, `usa:import` |
|
|
1642
|
+
|
|
1523
1643
|
## Frameworks
|
|
1524
1644
|
|
|
1525
1645
|
Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# motionary/runtime/format-gltf — glTF 2.0 / GLB loader
|
|
2
|
+
|
|
3
|
+
> Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
|
|
4
|
+
|
|
5
|
+
Load glTF 2.0 (.gltf with external or data: buffers, .glb) into motionary/runtime/gl nodes: node hierarchy, meshes, PBR metallic-roughness materials, embedded / external images.
|
|
6
|
+
|
|
7
|
+
Part of Motionary's own zero-dependency runtime. Size budget: **6.0 KB gzip** (enforced in CI).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Install:** `npm i motionary`
|
|
12
|
+
2. **Import path:** `motionary/runtime/format-gltf`
|
|
13
|
+
3. **CDN:**
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.iife.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-gltf.js`
|
|
21
|
+
|
|
22
|
+
4. **Import order & registration:** 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).
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { use } from 'motionary/runtime';
|
|
26
|
+
import { formatGltf } from 'motionary/runtime/format-gltf';
|
|
27
|
+
use(formatGltf);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { use } from 'motionary/runtime';
|
|
34
|
+
import { gl, createRenderer, Scene, Camera, frameNode } from 'motionary/runtime/gl';
|
|
35
|
+
import { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';
|
|
36
|
+
use(gl, formatGltf);
|
|
37
|
+
const model = await loadGltf('/models/chair.glb');
|
|
38
|
+
const scene = new Scene().add(model), cam = new Camera();
|
|
39
|
+
frameNode(cam, model);
|
|
40
|
+
const r = createRenderer(canvas); r.resize(); r.render(scene, cam);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Exports
|
|
44
|
+
|
|
45
|
+
`formatGltf` · `loadGltf` · `parseGlb` · `gltfToNode` · `readAccessor` · `SUPPORTED_EXTENSIONS`
|
|
46
|
+
|
|
47
|
+
## Compatibility
|
|
48
|
+
|
|
49
|
+
| Feature | Supported | Notes |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| .gltf (external + data: URI buffers / images) and .glb | ✅ yes | |
|
|
52
|
+
| scenes, node hierarchy, TRS and matrix transforms | ✅ yes | |
|
|
53
|
+
| POSITION / NORMAL / TEXCOORD_0, indices, all component types, normalised ints, byteStride | ✅ yes | missing normals computed (flat) |
|
|
54
|
+
| primitive modes points / lines / triangles / strips / fans | ✅ yes | strips and fans converted to triangles |
|
|
55
|
+
| PBR metallic-roughness factors, base colour texture, emissive, alpha blend, double-sided | ✅ yes | KHR_materials_emissive_strength, KHR_materials_unlit |
|
|
56
|
+
| skins, morph targets, animations | ✕ no | arrive in 10.8 |
|
|
57
|
+
| Draco / meshopt / KTX2 (Basis) compression | ✕ no | files that require them fail with a clear error; decoder hooks planned for 10.9 |
|
|
58
|
+
| sparse accessors, cameras, KHR_lights_punctual, texture transforms | ✕ no | ignored |
|
|
59
|
+
| SSR / workers | ◐ partial | parseGlb / gltfToNode are pure; loadGltf decodes images with createImageBitmap |
|
|
60
|
+
|
|
61
|
+
## Components that need it
|
|
62
|
+
|
|
63
|
+
- `<usa-gl-scene>` — 3D scene (glTF / OBJ)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# motionary/runtime/format-obj — OBJ / MTL loader
|
|
2
|
+
|
|
3
|
+
> Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
|
|
4
|
+
|
|
5
|
+
Load Wavefront OBJ (+ MTL materials and diffuse textures) into motionary/runtime/gl nodes: polygons triangulated, groups, per-material meshes.
|
|
6
|
+
|
|
7
|
+
Part of Motionary's own zero-dependency runtime. Size budget: **3.0 KB gzip** (enforced in CI).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Install:** `npm i motionary`
|
|
12
|
+
2. **Import path:** `motionary/runtime/format-obj`
|
|
13
|
+
3. **CDN:**
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.iife.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-obj.js`
|
|
21
|
+
|
|
22
|
+
4. **Import order & registration:** 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).
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { use } from 'motionary/runtime';
|
|
26
|
+
import { formatObj } from 'motionary/runtime/format-obj';
|
|
27
|
+
use(formatObj);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { use } from 'motionary/runtime';
|
|
34
|
+
import { gl, Scene } from 'motionary/runtime/gl';
|
|
35
|
+
import { formatObj, loadObj } from 'motionary/runtime/format-obj';
|
|
36
|
+
use(gl, formatObj);
|
|
37
|
+
const cube = await loadObj('/models/cube.obj'); // + cube.mtl + textures next to it
|
|
38
|
+
new Scene().add(cube);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Exports
|
|
42
|
+
|
|
43
|
+
`formatObj` · `loadObj` · `parseObj` · `parseMtl` · `objToNode` · `objMaterial`
|
|
44
|
+
|
|
45
|
+
## Compatibility
|
|
46
|
+
|
|
47
|
+
| Feature | Supported | Notes |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| v / vt / vn, faces with any vertex count (fan-triangulated), negative indices | ✅ yes | |
|
|
50
|
+
| o / g groups, usemtl (one mesh per material), mtllib | ✅ yes | |
|
|
51
|
+
| MTL Kd, Ks + Ns (→ roughness), Ke, d / Tr, map_Kd (options stripped) | ✅ yes | |
|
|
52
|
+
| missing normals | ✅ yes | computed (flat) |
|
|
53
|
+
| smoothing groups (s), lines (l), free-form curves / surfaces | ✕ no | ignored |
|
|
54
|
+
| bump / normal / specular maps, PBR MTL extensions | ✕ no | ignored |
|
|
55
|
+
| SSR / workers | ◐ partial | parsing is pure; loadObj fetches files and decodes textures with createImageBitmap |
|
|
56
|
+
|
|
57
|
+
## Components that need it
|
|
58
|
+
|
|
59
|
+
- `<usa-gl-scene>` — 3D scene (glTF / OBJ)
|