motionary 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/chunks/audio-DcPvT2Kh.js +333 -0
  3. package/dist/chunks/audio-DcPvT2Kh.js.map +1 -0
  4. package/dist/chunks/audio-EXUoijsG.cjs +342 -0
  5. package/dist/chunks/audio-EXUoijsG.cjs.map +1 -0
  6. package/dist/chunks/{base-DchG4q_S.js → base-2-yYc93C.js} +2 -2
  7. package/dist/chunks/{base-DchG4q_S.js.map → base-2-yYc93C.js.map} +1 -1
  8. package/dist/chunks/{core-DVyTlo9Q.js → core-D5rU0CV6.js} +2 -2
  9. package/dist/chunks/{core-DVyTlo9Q.js.map → core-D5rU0CV6.js.map} +1 -1
  10. package/dist/chunks/{core-D2vF8kZb.js → core-DuO-AVXL.js} +2 -2
  11. package/dist/chunks/{core-D2vF8kZb.js.map → core-DuO-AVXL.js.map} +1 -1
  12. package/dist/chunks/{fx-DUMVKSvg.js → fx-CMxWNwH8.js} +2 -2
  13. package/dist/chunks/{fx-DUMVKSvg.js.map → fx-CMxWNwH8.js.map} +1 -1
  14. package/dist/chunks/{gpu-Bkw605Ds.js → gpu-DLPghVWr.js} +2 -2
  15. package/dist/chunks/{gpu-Bkw605Ds.js.map → gpu-DLPghVWr.js.map} +1 -1
  16. package/dist/chunks/{player-C-TwEEy6.js → player-DxvCYo7Q.js} +4 -4
  17. package/dist/chunks/{player-C-TwEEy6.js.map → player-DxvCYo7Q.js.map} +1 -1
  18. package/dist/chunks/{registry-D23neB4M.js → registry-CyKExAmE.js} +2 -2
  19. package/dist/chunks/{registry-D23neB4M.js.map → registry-CyKExAmE.js.map} +1 -1
  20. package/dist/chunks/{spring-BhoT09Qb.js → spring-BK8DiezC.js} +2 -2
  21. package/dist/chunks/{spring-BhoT09Qb.js.map → spring-BK8DiezC.js.map} +1 -1
  22. package/dist/chunks/{variants-C_hv_s23.js → variants-BQ6bhzn4.js} +2 -2
  23. package/dist/chunks/{variants-C_hv_s23.js.map → variants-BQ6bhzn4.js.map} +1 -1
  24. package/dist/components/a11y.js +2 -2
  25. package/dist/components/angular.js +7 -7
  26. package/dist/components/background.js +2 -2
  27. package/dist/components/bridge.js +1 -1
  28. package/dist/components/cards.js +2 -2
  29. package/dist/components/click.js +3 -3
  30. package/dist/components/depth.js +3 -3
  31. package/dist/components/effects.cjs +11 -336
  32. package/dist/components/effects.cjs.map +1 -1
  33. package/dist/components/effects.js +9 -333
  34. package/dist/components/effects.js.map +1 -1
  35. package/dist/components/feedback.js +1 -1
  36. package/dist/components/fx-3d.js +2 -2
  37. package/dist/components/fx-focus.js +2 -2
  38. package/dist/components/fx-gpu.js +3 -3
  39. package/dist/components/fx-light.js +2 -2
  40. package/dist/components/fx-morph.js +2 -2
  41. package/dist/components/fx-music.cjs +179 -0
  42. package/dist/components/fx-music.cjs.map +1 -0
  43. package/dist/components/fx-music.d.cts +102 -0
  44. package/dist/components/fx-music.d.ts +102 -0
  45. package/dist/components/fx-music.js +174 -0
  46. package/dist/components/fx-music.js.map +1 -0
  47. package/dist/components/fx-physics.js +2 -2
  48. package/dist/components/fx-text.js +2 -2
  49. package/dist/components/fx-transitions.js +3 -3
  50. package/dist/components/fx-weather.js +2 -2
  51. package/dist/components/fx.js +5 -5
  52. package/dist/components/fx2.cjs +8 -0
  53. package/dist/components/fx2.cjs.map +1 -1
  54. package/dist/components/fx2.d.cts +59 -1
  55. package/dist/components/fx2.d.ts +59 -1
  56. package/dist/components/fx2.js +10 -5
  57. package/dist/components/fx2.js.map +1 -1
  58. package/dist/components/gesture.js +4 -4
  59. package/dist/components/interaction.js +1 -1
  60. package/dist/components/layout.js +1 -1
  61. package/dist/components/marketplace.js +2 -2
  62. package/dist/components/packs.js +1 -1
  63. package/dist/components/page.js +3 -3
  64. package/dist/components/perf.js +2 -2
  65. package/dist/components/physics.js +3 -3
  66. package/dist/components/reveal.js +1 -1
  67. package/dist/components/solid.js +7 -7
  68. package/dist/components/svelte.js +7 -7
  69. package/dist/components/svg.js +1 -1
  70. package/dist/components/text.js +2 -2
  71. package/dist/components/timeline.js +3 -3
  72. package/dist/components/transitions.js +1 -1
  73. package/dist/components/ui.js +4 -4
  74. package/dist/components/vue.js +7 -7
  75. package/dist/components/webgl.js +1 -1
  76. package/dist/components/widgets.cjs +542 -61
  77. package/dist/components/widgets.cjs.map +1 -1
  78. package/dist/components/widgets.d.cts +79 -2
  79. package/dist/components/widgets.d.ts +79 -2
  80. package/dist/components/widgets.js +542 -67
  81. package/dist/components/widgets.js.map +1 -1
  82. package/dist/components.js +9 -9
  83. package/dist/index.js +2 -2
  84. package/dist/widgets.umd.js +1 -1
  85. package/dist/widgets.umd.js.map +1 -1
  86. package/docs/ROADMAP.md +1 -1
  87. package/docs/components.md +25 -0
  88. package/package.json +21 -1
package/docs/ROADMAP.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  7.0 已发布:移除 6.9 弃用项、按效果包拆分入口(`motionary/fx/*`)、着色器背景默认 WebGPU(自动回退 WebGL2 → Canvas 2D),`motionary` 与 `use-scroll-animate` 同时成为 npm `latest`。下面是 7.1 → 8.0 的计划,每个版本一个特效主题 + 一组新的动画组件。
4
4
 
5
- - **v7.1** — 音乐可视化:频谱柱、波形、节拍脉冲、唱片旋转;新组件 音乐播放器、音量旋钮、均衡器。
5
+ - ✅ **v7.1** — 音乐可视化:频谱柱、波形、节拍脉冲、唱片旋转;新组件 音乐播放器、音量旋钮、均衡器。
6
6
  - **v7.2** — 数据可视化动效:柱状 / 折线 / 环形 / 桑基图入场与数值过渡;新组件 仪表盘(Gauge)、迷你走势图(Sparkline)、KPI 指标卡。
7
7
  - **v7.3** — 电商动效:飞入购物车、价格翻牌、库存脉冲、优惠券撕开;新组件 购物车抽屉、商品图库、限时倒计时。
8
8
  - **v7.4** — 聊天 / 社交:输入中气泡、表情回应飘升、已读回执、消息撤回;新组件 消息列表、头像叠放、通知铃铛。
@@ -728,6 +728,31 @@ document.querySelector('.hero').dataset.usaBackend; // 'webgpu' | 'webg
728
728
  - `glslToWgsl(body)` translates the 6.x shader-body dialect (vec / float / int declarations, constructors, literals, `for` loops, `u_c0…u_ptr` uniforms) and throws on unsupported constructs (ternaries, `mod`, `discard`) so the effect falls back to WebGL2; `ShaderSpec.wgsl` overrides it.
729
729
  - Removed in 7.0: `registerFx2`, `FX2_PACKS`, the version-suffixed 6.x registrars, `<usa-tooltip>`, `<usa-toggle>` — see [upgrading-7.md](./upgrading-7.md).
730
730
 
731
+ ### v7.1 Widgets: music player, volume knob, equalizer, lyrics (`components/widgets`) + music visualization (`motionary/fx/music`)
732
+
733
+ ```html
734
+ <usa-music-player id="p" title="Night Drive" artist="Motionary" cover="cover.jpg"><audio src="track.mp3"></audio></usa-music-player>
735
+ <usa-lyrics for="p"><script type="text/plain">[00:01.00] First line
736
+ [00:04.50] Second line</script></usa-lyrics>
737
+ <usa-volume-knob value="60"></usa-volume-knob>
738
+ <usa-equalizer preset="rock"></usa-equalizer>
739
+
740
+ <usa-fx effect="radial-spectrum" trigger="load"><section>…</section></usa-fx>
741
+ <usa-fx effect="vinyl-spin" trigger="load"><img src="album.jpg" alt="…"></usa-fx>
742
+ ```
743
+ ```js
744
+ import { defineWidgets } from 'motionary/components/widgets';
745
+ import { registerMusicPack } from 'motionary/fx/music';
746
+ import { enableAudio } from 'motionary/components/effects';
747
+ defineWidgets(); registerMusicPack();
748
+ enableAudio(document.querySelector('audio')); // optional: without it the visuals use a synthetic signal
749
+ ```
750
+ - `<usa-music-player title artist cover src duration>`: `playing`, `currentTime`, `duration`, `play()`, `pause()`, `toggle()`, `seek(s)`; `usa:play | pause | seek | prev | next`.
751
+ - `<usa-volume-knob value min max label>`: `value`; `usa:input`, `usa:change`.
752
+ - `<usa-equalizer bands preset>`: `values`, `applyPreset(name)`; `usa:change` (`{ values }`); `EQ_PRESETS`.
753
+ - `<usa-lyrics for time>`: `time`, `lines`; `usa:seek` (`{ time }`); `parseLRC(text)`.
754
+ - Music: `waveform-scope` · `radial-spectrum` (`bars`) · `spectrum-mirror` (`bars`, `gap`) · `sound-particles` (`max`) · `beat-bounce` (`amount`) · `vinyl-spin` (`rpm`); `syntheticSample(t)`, `musicSample(t)`.
755
+
731
756
  ## Frameworks
732
757
 
733
758
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motionary",
3
- "version": "7.0.0",
3
+ "version": "7.1.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",
@@ -198,6 +198,16 @@
198
198
  "default": "./dist/components/marketplace.cjs"
199
199
  }
200
200
  },
201
+ "./fx/music": {
202
+ "import": {
203
+ "types": "./dist/components/fx-music.d.ts",
204
+ "default": "./dist/components/fx-music.js"
205
+ },
206
+ "require": {
207
+ "types": "./dist/components/fx-music.d.cts",
208
+ "default": "./dist/components/fx-music.cjs"
209
+ }
210
+ },
201
211
  "./components/reveal": {
202
212
  "import": {
203
213
  "types": "./dist/components/reveal.d.ts",
@@ -628,6 +638,16 @@
628
638
  "default": "./dist/components/marketplace.cjs"
629
639
  }
630
640
  },
641
+ "./components/fx-music": {
642
+ "import": {
643
+ "types": "./dist/components/fx-music.d.ts",
644
+ "default": "./dist/components/fx-music.js"
645
+ },
646
+ "require": {
647
+ "types": "./dist/components/fx-music.d.cts",
648
+ "default": "./dist/components/fx-music.cjs"
649
+ }
650
+ },
631
651
  "./components/lite": {
632
652
  "import": {
633
653
  "types": "./dist/components/lite.d.ts",