motionary 10.4.0 → 10.5.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +37 -0
  3. package/dist/chunks/{anim-image-DDdb9q3X.js → anim-image-BlNPv4JG.js} +2 -2
  4. package/dist/chunks/{anim-image-DDdb9q3X.js.map → anim-image-BlNPv4JG.js.map} +1 -1
  5. package/dist/chunks/{anim-image-blQgPFFS.cjs → anim-image-DuxvYhq6.cjs} +2 -2
  6. package/dist/chunks/{anim-image-blQgPFFS.cjs.map → anim-image-DuxvYhq6.cjs.map} +1 -1
  7. package/dist/chunks/{keyframes-B5PWe5bU.js → keyframes-B8ITIAVa.js} +2 -2
  8. package/dist/chunks/{keyframes-B5PWe5bU.js.map → keyframes-B8ITIAVa.js.map} +1 -1
  9. package/dist/chunks/{keyframes-tC3I7anQ.cjs → keyframes-Ce1s05n3.cjs} +2 -2
  10. package/dist/chunks/{keyframes-tC3I7anQ.cjs.map → keyframes-Ce1s05n3.cjs.map} +1 -1
  11. package/dist/chunks/{registry-CT-TT_bx.js → registry-DXdFb2fJ.js} +2 -2
  12. package/dist/chunks/{registry-CT-TT_bx.js.map → registry-DXdFb2fJ.js.map} +1 -1
  13. package/dist/chunks/{registry-tzwKkldE.cjs → registry-VhfPSI0v.cjs} +2 -2
  14. package/dist/chunks/{registry-tzwKkldE.cjs.map → registry-VhfPSI0v.cjs.map} +1 -1
  15. package/dist/chunks/{ticker-C8lSGml9.js → ticker-C5RMHMW7.js} +2 -2
  16. package/dist/chunks/{ticker-C8lSGml9.js.map → ticker-C5RMHMW7.js.map} +1 -1
  17. package/dist/chunks/{ticker-Un0bvTWR.cjs → ticker-DvmC6WLS.cjs} +2 -2
  18. package/dist/chunks/{ticker-Un0bvTWR.cjs.map → ticker-DvmC6WLS.cjs.map} +1 -1
  19. package/dist/chunks/{tween-BcejKpsx.js → tween-CPtm-EdT.js} +2 -2
  20. package/dist/chunks/{tween-BcejKpsx.js.map → tween-CPtm-EdT.js.map} +1 -1
  21. package/dist/chunks/{tween-CwLLC3Ko.cjs → tween-_BGIl6hK.cjs} +2 -2
  22. package/dist/chunks/{tween-CwLLC3Ko.cjs.map → tween-_BGIl6hK.cjs.map} +1 -1
  23. package/dist/components/widgets.cjs +745 -212
  24. package/dist/components/widgets.cjs.map +1 -1
  25. package/dist/components/widgets.d.cts +202 -2
  26. package/dist/components/widgets.d.ts +202 -2
  27. package/dist/components/widgets.js +738 -213
  28. package/dist/components/widgets.js.map +1 -1
  29. package/dist/llms-full.txt +150 -1
  30. package/dist/llms.txt +9 -2
  31. package/dist/manifest.json +394 -1
  32. package/dist/runtime/format-apng.cjs +4 -4
  33. package/dist/runtime/format-apng.js +4 -4
  34. package/dist/runtime/format-css.cjs +4 -4
  35. package/dist/runtime/format-css.js +4 -4
  36. package/dist/runtime/format-gif.cjs +4 -4
  37. package/dist/runtime/format-gif.js +4 -4
  38. package/dist/runtime/format-gltf.cjs +207 -0
  39. package/dist/runtime/format-gltf.cjs.map +1 -0
  40. package/dist/runtime/format-gltf.d.cts +251 -0
  41. package/dist/runtime/format-gltf.d.ts +251 -0
  42. package/dist/runtime/format-gltf.iife.js +2 -0
  43. package/dist/runtime/format-gltf.iife.js.map +1 -0
  44. package/dist/runtime/format-gltf.js +200 -0
  45. package/dist/runtime/format-gltf.js.map +1 -0
  46. package/dist/runtime/format-motion.cjs +4 -4
  47. package/dist/runtime/format-motion.js +4 -4
  48. package/dist/runtime/format-obj.cjs +181 -0
  49. package/dist/runtime/format-obj.cjs.map +1 -0
  50. package/dist/runtime/format-obj.d.cts +176 -0
  51. package/dist/runtime/format-obj.d.ts +176 -0
  52. package/dist/runtime/format-obj.iife.js +2 -0
  53. package/dist/runtime/format-obj.iife.js.map +1 -0
  54. package/dist/runtime/format-obj.js +174 -0
  55. package/dist/runtime/format-obj.js.map +1 -0
  56. package/dist/runtime/format-sprite.cjs +3 -3
  57. package/dist/runtime/format-sprite.js +3 -3
  58. package/dist/runtime/format-svg.cjs +3 -3
  59. package/dist/runtime/format-svg.js +3 -3
  60. package/dist/runtime/format-webp.cjs +4 -4
  61. package/dist/runtime/format-webp.js +4 -4
  62. package/dist/runtime/gl.cjs +763 -0
  63. package/dist/runtime/gl.cjs.map +1 -0
  64. package/dist/runtime/gl.d.cts +260 -0
  65. package/dist/runtime/gl.d.ts +260 -0
  66. package/dist/runtime/gl.iife.js +2 -0
  67. package/dist/runtime/gl.iife.js.map +1 -0
  68. package/dist/runtime/gl.js +739 -0
  69. package/dist/runtime/gl.js.map +1 -0
  70. package/dist/runtime/scroll.cjs +2 -2
  71. package/dist/runtime/scroll.js +2 -2
  72. package/dist/runtime/smooth.cjs +1 -1
  73. package/dist/runtime/smooth.js +1 -1
  74. package/dist/runtime/text.cjs +1 -1
  75. package/dist/runtime/text.js +1 -1
  76. package/dist/runtime.cjs +3 -3
  77. package/dist/runtime.d.cts +1 -1
  78. package/dist/runtime.d.ts +1 -1
  79. package/dist/runtime.iife.js +1 -1
  80. package/dist/runtime.iife.js.map +1 -1
  81. package/dist/runtime.js +5 -5
  82. package/dist/widgets.umd.js +1 -1
  83. package/dist/widgets.umd.js.map +1 -1
  84. package/docs/ROADMAP.md +1 -1
  85. package/docs/components/README.md +8 -1
  86. package/docs/components/usa-gl-scene.md +66 -0
  87. package/docs/components/usa-gpu-particles.md +32 -0
  88. package/docs/components/usa-shader-backdrop.md +36 -0
  89. package/docs/components/usa-three-scene.md +20 -0
  90. package/docs/components.md +48 -0
  91. package/docs/runtime/format-gltf.md +63 -0
  92. package/docs/runtime/format-obj.md +59 -0
  93. package/docs/runtime/gl.md +62 -0
  94. package/package.json +32 -2
package/docs/ROADMAP.md CHANGED
@@ -61,7 +61,7 @@ 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>`)。
@@ -1,4 +1,4 @@
1
- # Motionary components (198)
1
+ # Motionary components (202)
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
@@ -94,6 +96,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
94
96
  - [`<usa-retro-button>`](usa-retro-button.md) — Retro buttons
95
97
  - [`<usa-scene>`](usa-scene.md) — Cinematic scene
96
98
  - [`<usa-segmented>`](usa-segmented.md) — Segmented control
99
+ - [`<usa-shader-backdrop>`](usa-shader-backdrop.md) — Shader backdrop + post chain
97
100
  - [`<usa-shortcut>`](usa-shortcut.md) — Shortcut hint
98
101
  - [`<usa-sketch-chart>`](usa-sketch-chart.md) — Sketch chart
99
102
  - [`<usa-slider>`](usa-slider.md) — Slider
@@ -256,3 +259,7 @@ One page per `<usa-*>` element, generated from the source. Machine-readable: `mo
256
259
  - [`<usa-pinch-zoom>`](usa-pinch-zoom.md) — Pinch zoom
257
260
  - [`<usa-swipe-deck>`](usa-swipe-deck.md) — Swipe cards deck
258
261
  - [`<usa-swipeable>`](usa-swipeable.md) — Swipeable
262
+
263
+ ## widgets
264
+
265
+ - [`<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,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
+ ```
@@ -1467,6 +1467,40 @@ 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
+
1470
1504
  <!-- prereqs:end -->
1471
1505
 
1472
1506
  ### v10.2 Scroll scenes (`motionary/runtime/scroll`) + SVG loader + `data-motion` in core: `<usa-scroll-scene>`, `<usa-motion-inspector>` (`components/widgets`)
@@ -1520,6 +1554,20 @@ Declarative motion with just the core: `applyMotionAttributes(createMotion())` +
1520
1554
 
1521
1555
  MCP: `npx -y -p motionary motionary-mcp` — see [docs/mcp.md](docs/mcp.md).
1522
1556
 
1557
+ ### 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`)
1558
+
1559
+ ```html
1560
+ <usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
1561
+ <usa-gpu-particles count="30000" mode="galaxy" pointer></usa-gpu-particles>
1562
+ <usa-shader-backdrop preset="aurora" post="bloom,vignette,grain"><h1>Hello</h1></usa-shader-backdrop>
1563
+ ```
1564
+
1565
+ | Element | Attributes | Methods / events |
1566
+ |---|---|---|
1567
+ | `<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` |
1568
+ | `<usa-gpu-particles>` | `count`, `mode` (swirl, galaxy, fountain), `colors`, `size`, `speed`, `trail`, `pointer`, `label` | `backend`; `usa:backend` |
1569
+ | `<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` |
1570
+
1523
1571
  ## Frameworks
1524
1572
 
1525
1573
  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)
@@ -0,0 +1,62 @@
1
+ # motionary/runtime/gl — WebGL2 scene renderer
2
+
3
+ > Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
4
+
5
+ A small WebGL2 renderer with its own API: scene graph, camera, lights, box / plane / sphere / torus, PBR-style materials, shader materials, image and video textures, orbit controls — not a Three.js clone.
6
+
7
+ Part of Motionary's own zero-dependency runtime. Size budget: **9.0 KB gzip** (enforced in CI).
8
+
9
+ ## Prerequisites
10
+
11
+ 1. **Install:** `npm i motionary`
12
+ 2. **Import path:** `motionary/runtime/gl`
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/gl.iife.js"></script>
18
+ ```
19
+
20
+ ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/gl.js`
21
+
22
+ 4. **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).
23
+
24
+ ```js
25
+ import { use } from 'motionary/runtime';
26
+ import { gl } from 'motionary/runtime/gl';
27
+ use(gl);
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```js
33
+ import { use } from 'motionary/runtime';
34
+ import { gl, createRenderer, Scene, Camera, GlNode, torus, standardMaterial } from 'motionary/runtime/gl';
35
+ use(gl);
36
+ const r = createRenderer(canvas);
37
+ const scene = new Scene();
38
+ scene.add(new GlNode('donut', { geometry: torus(), material: standardMaterial({ color: [0.5, 0.55, 1, 1] }) }));
39
+ r.resize(); r.render(scene, new Camera({ position: [0, 0.5, 3] }));
40
+ ```
41
+
42
+ ## Exports
43
+
44
+ `gl` · `createRenderer` · `Scene` · `Camera` · `GlNode` · `box` · `plane` · `sphere` · `torus` · `standardMaterial` · `unlitMaterial` · `shaderMaterial` · `texture` · `orbitControls` · `frameNode` · `bounds` · `scrubVideo` · `mat4` · `quatFromEuler` · `quatSlerp`
45
+
46
+ ## Compatibility
47
+
48
+ | Feature | Supported | Notes |
49
+ |---|---|---|
50
+ | scene graph: nodes, TRS / matrix, hierarchy, bounds, frameNode() | ✅ yes | |
51
+ | perspective camera, orbit controls (drag / wheel / pinch / arrow keys) | ✅ yes | auto-rotate off under reduced motion |
52
+ | ambient + up to 4 directional / point lights | ✅ yes | |
53
+ | standard material (metallic-roughness approximation), unlit, shader | ✅ yes | sRGB in/out, Reinhard tone mapping |
54
+ | image / canvas / ImageBitmap / raw RGBA textures, mipmaps (power of two) | ✅ yes | |
55
+ | video textures (MP4 / WebM), scroll-scrubbed video (scrubVideo) | ✅ yes | requestVideoFrameCallback; codecs depend on the browser |
56
+ | shadows, normal / occlusion / metallic-roughness maps, IBL | ✕ no | planned work beyond 11.0 |
57
+ | WebGL1 / no WebGL2 | ✕ no | createRenderer() throws a clear error |
58
+ | SSR / workers | ◐ partial | math / geometry / scene graph are pure; rendering needs WebGL2 (OffscreenCanvas works) |
59
+
60
+ ## Components that need it
61
+
62
+ - `<usa-gl-scene>` — 3D scene (glTF / OBJ)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motionary",
3
- "version": "10.4.0",
3
+ "version": "10.5.0",
4
4
  "description": "Motionary (formerly use-scroll-animate): dependency-free scroll animations + 94 animated Web Components — 214 scroll-reveal presets, card/click/button morphs, physics, page transitions, generative & sound-reactive backgrounds, cursor/gesture effects, themes, micro-interactions, <usa-player>, WebGL. React, Vue, Svelte, Solid, Angular or plain HTML.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1318,6 +1318,36 @@
1318
1318
  "default": "./dist/runtime/format-webp.cjs"
1319
1319
  }
1320
1320
  },
1321
+ "./runtime/gl": {
1322
+ "import": {
1323
+ "types": "./dist/runtime/gl.d.ts",
1324
+ "default": "./dist/runtime/gl.js"
1325
+ },
1326
+ "require": {
1327
+ "types": "./dist/runtime/gl.d.cts",
1328
+ "default": "./dist/runtime/gl.cjs"
1329
+ }
1330
+ },
1331
+ "./runtime/format-gltf": {
1332
+ "import": {
1333
+ "types": "./dist/runtime/format-gltf.d.ts",
1334
+ "default": "./dist/runtime/format-gltf.js"
1335
+ },
1336
+ "require": {
1337
+ "types": "./dist/runtime/format-gltf.d.cts",
1338
+ "default": "./dist/runtime/format-gltf.cjs"
1339
+ }
1340
+ },
1341
+ "./runtime/format-obj": {
1342
+ "import": {
1343
+ "types": "./dist/runtime/format-obj.d.ts",
1344
+ "default": "./dist/runtime/format-obj.js"
1345
+ },
1346
+ "require": {
1347
+ "types": "./dist/runtime/format-obj.d.cts",
1348
+ "default": "./dist/runtime/format-obj.cjs"
1349
+ }
1350
+ },
1321
1351
  "./manifest.json": "./dist/manifest.json",
1322
1352
  "./manifest.schema.json": "./dist/manifest.schema.json",
1323
1353
  "./components.css": "./dist/components.css",
@@ -1361,7 +1391,7 @@
1361
1391
  "./dist/presets-extended.umd.js"
1362
1392
  ],
1363
1393
  "scripts": {
1364
- "build": "npm run clean && node --max-old-space-size=6144 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs && node scripts/gen-manifest.mjs",
1394
+ "build": "npm run clean && PART=code node --max-old-space-size=5120 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs && PART=dts SLICE=0/3 node --max-old-space-size=4096 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs && PART=dts SLICE=1/3 node --max-old-space-size=4096 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs && PART=dts SLICE=2/3 node --max-old-space-size=4096 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs && node scripts/gen-manifest.mjs",
1365
1395
  "dev": "rollup -c rollup.config.mjs -w",
1366
1396
  "typecheck": "tsc --noEmit -p .",
1367
1397
  "test": "vitest run",