motionary 10.1.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +61 -0
- package/CHANGELOG.md +36 -0
- package/README.md +69 -0
- package/dist/chunks/{keyframes-CyH_abhI.js → keyframes-DVAC5sQI.js} +2 -2
- package/dist/chunks/{keyframes-CyH_abhI.js.map → keyframes-DVAC5sQI.js.map} +1 -1
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs → keyframes-Dw9zwVQa.cjs} +2 -2
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs.map → keyframes-Dw9zwVQa.cjs.map} +1 -1
- package/dist/chunks/{registry-jF8VIA_9.js → registry-46AAzyeC.js} +2 -2
- package/dist/chunks/{registry-jF8VIA_9.js.map → registry-46AAzyeC.js.map} +1 -1
- package/dist/chunks/{registry-C0xLNq3-.cjs → registry-CSVil2qJ.cjs} +2 -2
- package/dist/chunks/{registry-C0xLNq3-.cjs.map → registry-CSVil2qJ.cjs.map} +1 -1
- package/dist/chunks/ticker-COOYAyQy.js +70 -0
- package/dist/chunks/ticker-COOYAyQy.js.map +1 -0
- package/dist/chunks/ticker-gHv6pNfx.cjs +72 -0
- package/dist/chunks/ticker-gHv6pNfx.cjs.map +1 -0
- package/dist/chunks/{tween-JEthWrjo.cjs → tween-CFN0WcOb.cjs} +16 -73
- package/dist/chunks/tween-CFN0WcOb.cjs.map +1 -0
- package/dist/chunks/{tween-DDObu9iA.js → tween-CGyolmzB.js} +16 -72
- package/dist/chunks/tween-CGyolmzB.js.map +1 -0
- package/dist/components/core.cjs +106 -0
- package/dist/components/core.cjs.map +1 -1
- package/dist/components/core.d.cts +44 -2
- package/dist/components/core.d.ts +44 -2
- package/dist/components/core.js +105 -1
- package/dist/components/core.js.map +1 -1
- package/dist/components/widgets.cjs +602 -198
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +186 -2
- package/dist/components/widgets.d.ts +186 -2
- package/dist/components/widgets.js +598 -199
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +194 -1
- package/dist/llms.txt +10 -2
- package/dist/manifest.json +492 -1
- package/dist/runtime/format-css.cjs +4 -3
- package/dist/runtime/format-css.cjs.map +1 -1
- package/dist/runtime/format-css.js +4 -3
- package/dist/runtime/format-css.js.map +1 -1
- package/dist/runtime/format-motion.cjs +4 -3
- package/dist/runtime/format-motion.cjs.map +1 -1
- package/dist/runtime/format-motion.js +4 -3
- package/dist/runtime/format-motion.js.map +1 -1
- package/dist/runtime/format-sprite.cjs +225 -0
- package/dist/runtime/format-sprite.cjs.map +1 -0
- package/dist/runtime/format-sprite.d.cts +224 -0
- package/dist/runtime/format-sprite.d.ts +224 -0
- package/dist/runtime/format-sprite.iife.js +2 -0
- package/dist/runtime/format-sprite.iife.js.map +1 -0
- package/dist/runtime/format-sprite.js +215 -0
- package/dist/runtime/format-sprite.js.map +1 -0
- package/dist/runtime/format-svg.cjs +457 -0
- package/dist/runtime/format-svg.cjs.map +1 -0
- package/dist/runtime/format-svg.d.cts +214 -0
- package/dist/runtime/format-svg.d.ts +214 -0
- package/dist/runtime/format-svg.iife.js +2 -0
- package/dist/runtime/format-svg.iife.js.map +1 -0
- package/dist/runtime/format-svg.js +446 -0
- package/dist/runtime/format-svg.js.map +1 -0
- package/dist/runtime/scroll.cjs +301 -0
- package/dist/runtime/scroll.cjs.map +1 -0
- package/dist/runtime/scroll.d.cts +236 -0
- package/dist/runtime/scroll.d.ts +236 -0
- package/dist/runtime/scroll.iife.js +2 -0
- package/dist/runtime/scroll.iife.js.map +1 -0
- package/dist/runtime/scroll.js +292 -0
- package/dist/runtime/scroll.js.map +1 -0
- package/dist/runtime/text.cjs +147 -0
- package/dist/runtime/text.cjs.map +1 -0
- package/dist/runtime/text.d.cts +65 -0
- package/dist/runtime/text.d.ts +65 -0
- package/dist/runtime/text.iife.js +2 -0
- package/dist/runtime/text.iife.js.map +1 -0
- package/dist/runtime/text.js +143 -0
- package/dist/runtime/text.js.map +1 -0
- package/dist/runtime.cjs +5 -4
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +9 -2
- package/dist/runtime.d.ts +9 -2
- package/dist/runtime.iife.js +1 -1
- package/dist/runtime.iife.js.map +1 -1
- package/dist/runtime.js +5 -4
- package/dist/runtime.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/ai-prompt-guide.md +54 -0
- package/docs/components/README.md +255 -0
- package/docs/components/usa-accordion.md +38 -0
- package/docs/components/usa-acrylic.md +38 -0
- package/docs/components/usa-add-to-cart.md +40 -0
- package/docs/components/usa-ambient.md +32 -0
- package/docs/components/usa-anim-icon.md +34 -0
- package/docs/components/usa-audio.md +38 -0
- package/docs/components/usa-aurora.md +36 -0
- package/docs/components/usa-auto-animate.md +44 -0
- package/docs/components/usa-auto-skeleton.md +38 -0
- package/docs/components/usa-avatar-stack.md +38 -0
- package/docs/components/usa-back-to-top.md +32 -0
- package/docs/components/usa-badge-wall.md +39 -0
- package/docs/components/usa-badge.md +36 -0
- package/docs/components/usa-bar-chart.md +33 -0
- package/docs/components/usa-bg-generator.md +32 -0
- package/docs/components/usa-blobs.md +32 -0
- package/docs/components/usa-bottom-sheet.md +32 -0
- package/docs/components/usa-button.md +78 -0
- package/docs/components/usa-card-stack.md +40 -0
- package/docs/components/usa-card.md +94 -0
- package/docs/components/usa-carousel-3d.md +40 -0
- package/docs/components/usa-carousel.md +40 -0
- package/docs/components/usa-cart-drawer.md +33 -0
- package/docs/components/usa-chapter-nav.md +40 -0
- package/docs/components/usa-chat-composer.md +33 -0
- package/docs/components/usa-check.md +32 -0
- package/docs/components/usa-checkbox.md +32 -0
- package/docs/components/usa-click.md +36 -0
- package/docs/components/usa-clock-control.md +37 -0
- package/docs/components/usa-code-export.md +36 -0
- package/docs/components/usa-color-picker.md +32 -0
- package/docs/components/usa-command-palette.md +39 -0
- package/docs/components/usa-compare.md +38 -0
- package/docs/components/usa-countdown.md +32 -0
- package/docs/components/usa-counter.md +32 -0
- package/docs/components/usa-cube-gallery.md +40 -0
- package/docs/components/usa-cube.md +36 -0
- package/docs/components/usa-cursor.md +32 -0
- package/docs/components/usa-date-picker.md +32 -0
- package/docs/components/usa-depth.md +44 -0
- package/docs/components/usa-dialog.md +40 -0
- package/docs/components/usa-disclosure.md +38 -0
- package/docs/components/usa-distort.md +36 -0
- package/docs/components/usa-dock.md +40 -0
- package/docs/components/usa-dot-network.md +32 -0
- package/docs/components/usa-double-tap.md +36 -0
- package/docs/components/usa-draggable.md +38 -0
- package/docs/components/usa-draw.md +36 -0
- package/docs/components/usa-drawer.md +34 -0
- package/docs/components/usa-equalizer.md +33 -0
- package/docs/components/usa-fab.md +40 -0
- package/docs/components/usa-festival-banner.md +32 -0
- package/docs/components/usa-field.md +34 -0
- package/docs/components/usa-file-drop.md +35 -0
- package/docs/components/usa-fullpage.md +38 -0
- package/docs/components/usa-fx.md +851 -0
- package/docs/components/usa-gauge.md +32 -0
- package/docs/components/usa-gen-art.md +32 -0
- package/docs/components/usa-gesture-fx.md +36 -0
- package/docs/components/usa-gesture-sticker.md +36 -0
- package/docs/components/usa-glitch.md +32 -0
- package/docs/components/usa-globe.md +33 -0
- package/docs/components/usa-gradient-text.md +32 -0
- package/docs/components/usa-grain.md +36 -0
- package/docs/components/usa-grid-glow.md +36 -0
- package/docs/components/usa-gyro-card.md +38 -0
- package/docs/components/usa-handwriting.md +32 -0
- package/docs/components/usa-hero-video.md +38 -0
- package/docs/components/usa-hold.md +32 -0
- package/docs/components/usa-hud-panel.md +38 -0
- package/docs/components/usa-hydrate.md +42 -0
- package/docs/components/usa-icon-morph.md +34 -0
- package/docs/components/usa-install-button.md +32 -0
- package/docs/components/usa-kanban.md +46 -0
- package/docs/components/usa-keyframe-editor.md +37 -0
- package/docs/components/usa-kpi.md +32 -0
- package/docs/components/usa-leaderboard.md +41 -0
- package/docs/components/usa-like.md +32 -0
- package/docs/components/usa-liquid-nav.md +36 -0
- package/docs/components/usa-liquid.md +36 -0
- package/docs/components/usa-loading-bar.md +35 -0
- package/docs/components/usa-location-card.md +34 -0
- package/docs/components/usa-lottie-icon.md +34 -0
- package/docs/components/usa-lottie.md +32 -0
- package/docs/components/usa-lyrics.md +38 -0
- package/docs/components/usa-magnetic.md +32 -0
- package/docs/components/usa-marquee.md +38 -0
- package/docs/components/usa-mask-reveal.md +36 -0
- package/docs/components/usa-masonry-flow.md +42 -0
- package/docs/components/usa-masonry.md +38 -0
- package/docs/components/usa-menu-toggle.md +34 -0
- package/docs/components/usa-menu.md +44 -0
- package/docs/components/usa-message-list.md +39 -0
- package/docs/components/usa-milestones.md +40 -0
- package/docs/components/usa-modal.md +42 -0
- package/docs/components/usa-morph.md +34 -0
- package/docs/components/usa-motion-inspector.md +32 -0
- package/docs/components/usa-motion-prefs.md +32 -0
- package/docs/components/usa-motion-spec.md +32 -0
- package/docs/components/usa-motion-switch.md +34 -0
- package/docs/components/usa-motion-theme.md +40 -0
- package/docs/components/usa-motion.md +42 -0
- package/docs/components/usa-music-player.md +36 -0
- package/docs/components/usa-native-preview.md +36 -0
- package/docs/components/usa-nav-morph.md +40 -0
- package/docs/components/usa-navbar.md +36 -0
- package/docs/components/usa-notification-bell.md +37 -0
- package/docs/components/usa-odometer.md +34 -0
- package/docs/components/usa-organic-card.md +36 -0
- package/docs/components/usa-otp.md +33 -0
- package/docs/components/usa-overscroll.md +36 -0
- package/docs/components/usa-pack.md +111 -0
- package/docs/components/usa-pagination.md +32 -0
- package/docs/components/usa-panorama.md +32 -0
- package/docs/components/usa-particles.md +32 -0
- package/docs/components/usa-pause-all.md +32 -0
- package/docs/components/usa-perf-monitor.md +32 -0
- package/docs/components/usa-pinch-zoom.md +36 -0
- package/docs/components/usa-player.md +38 -0
- package/docs/components/usa-plugin-card.md +61 -0
- package/docs/components/usa-plugin-store.md +36 -0
- package/docs/components/usa-popover.md +38 -0
- package/docs/components/usa-post-fx.md +36 -0
- package/docs/components/usa-presence.md +36 -0
- package/docs/components/usa-press.md +32 -0
- package/docs/components/usa-prize-wheel.md +32 -0
- package/docs/components/usa-product-gallery.md +40 -0
- package/docs/components/usa-progress-ring.md +38 -0
- package/docs/components/usa-progress.md +34 -0
- package/docs/components/usa-prop-panel.md +34 -0
- package/docs/components/usa-pull-cord.md +32 -0
- package/docs/components/usa-pull-refresh.md +37 -0
- package/docs/components/usa-radar.md +32 -0
- package/docs/components/usa-reactions.md +32 -0
- package/docs/components/usa-red-envelope.md +32 -0
- package/docs/components/usa-retro-button.md +34 -0
- package/docs/components/usa-reveal.md +36 -0
- package/docs/components/usa-ripple.md +32 -0
- package/docs/components/usa-route-transition.md +38 -0
- package/docs/components/usa-scene.md +38 -0
- package/docs/components/usa-scramble.md +32 -0
- package/docs/components/usa-scroll-highlight.md +34 -0
- package/docs/components/usa-scroll-progress.md +36 -0
- package/docs/components/usa-scroll-scene.md +66 -0
- package/docs/components/usa-scrolly.md +40 -0
- package/docs/components/usa-segmented.md +40 -0
- package/docs/components/usa-shader.md +74 -0
- package/docs/components/usa-sheet.md +42 -0
- package/docs/components/usa-shimmer-text.md +32 -0
- package/docs/components/usa-shortcut.md +34 -0
- package/docs/components/usa-skeleton-reveal.md +42 -0
- package/docs/components/usa-skeleton.md +36 -0
- package/docs/components/usa-sketch-chart.md +32 -0
- package/docs/components/usa-slider.md +32 -0
- package/docs/components/usa-sparkline.md +32 -0
- package/docs/components/usa-spatial-card.md +40 -0
- package/docs/components/usa-spinner.md +34 -0
- package/docs/components/usa-splash.md +36 -0
- package/docs/components/usa-split-text.md +32 -0
- package/docs/components/usa-spotlight.md +40 -0
- package/docs/components/usa-spring.md +42 -0
- package/docs/components/usa-stagger.md +40 -0
- package/docs/components/usa-star-rating.md +34 -0
- package/docs/components/usa-stepper.md +42 -0
- package/docs/components/usa-sticky-stack.md +40 -0
- package/docs/components/usa-sticky-wall.md +40 -0
- package/docs/components/usa-stories.md +38 -0
- package/docs/components/usa-story.md +80 -0
- package/docs/components/usa-suggestion-chips.md +32 -0
- package/docs/components/usa-swipe-deck.md +40 -0
- package/docs/components/usa-swipeable.md +36 -0
- package/docs/components/usa-switch.md +32 -0
- package/docs/components/usa-tab-bar.md +46 -0
- package/docs/components/usa-tabs.md +40 -0
- package/docs/components/usa-terminal.md +38 -0
- package/docs/components/usa-text-rotate.md +32 -0
- package/docs/components/usa-text-splitter.md +60 -0
- package/docs/components/usa-theme-surface.md +36 -0
- package/docs/components/usa-theme-switcher.md +32 -0
- package/docs/components/usa-tilt.md +36 -0
- package/docs/components/usa-timeline.md +40 -0
- package/docs/components/usa-tip.md +44 -0
- package/docs/components/usa-toast-stack.md +36 -0
- package/docs/components/usa-toaster.md +36 -0
- package/docs/components/usa-typewriter.md +32 -0
- package/docs/components/usa-upload-progress.md +33 -0
- package/docs/components/usa-video-card.md +40 -0
- package/docs/components/usa-view-switch.md +38 -0
- package/docs/components/usa-voice-button.md +33 -0
- package/docs/components/usa-volume-knob.md +32 -0
- package/docs/components/usa-water-ripple.md +36 -0
- package/docs/components/usa-wave-text.md +32 -0
- package/docs/components/usa-weather-card.md +32 -0
- package/docs/components/usa-worker-canvas.md +32 -0
- package/docs/components/usa-xp-bar.md +33 -0
- package/docs/components.md +95 -0
- package/docs/runtime/format-sprite.md +60 -0
- package/docs/runtime/format-svg.md +62 -0
- package/docs/runtime/scroll.md +61 -0
- package/docs/runtime/text.md +59 -0
- package/package.json +45 -3
- package/dist/chunks/tween-DDObu9iA.js.map +0 -1
- package/dist/chunks/tween-JEthWrjo.cjs.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-water-ripple>` — Water ripple
|
|
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
|
+
Interactive water ripples on a canvas over the content: move or tap to disturb the surface.
|
|
6
|
+
|
|
7
|
+
- **Category:** background
|
|
8
|
+
- **Import:** `import { defineWaterRipple } from 'motionary/components/background'` then `defineWaterRipple();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `mount()`
|
|
14
|
+
- **Source:** [src/components/background/bg-fx.ts](../../src/components/background/bg-fx.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-water-ripple>
|
|
20
|
+
<img src="lake.jpg" alt="">
|
|
21
|
+
</usa-water-ripple>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineWaterRipple } from 'motionary/components/background';
|
|
28
|
+
|
|
29
|
+
defineWaterRipple(); // registers <usa-water-ripple>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-water-ripple>
|
|
33
|
+
<img src="lake.jpg" alt="">
|
|
34
|
+
</usa-water-ripple>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-wave-text>` — Wave text
|
|
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
|
+
Letters bob in a travelling wave — playful headlines and loading labels.
|
|
6
|
+
|
|
7
|
+
- **Category:** text
|
|
8
|
+
- **Import:** `import { defineWaveText } from 'motionary/components/text'` then `defineWaveText();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `text`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `mount()`, `splitChars()`
|
|
14
|
+
- **Source:** [src/components/text/text-fx.ts](../../src/components/text/text-fx.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-wave-text>Loading…</usa-wave-text>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineWaveText } from 'motionary/components/text';
|
|
26
|
+
|
|
27
|
+
defineWaveText(); // registers <usa-wave-text>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-wave-text>Loading…</usa-wave-text>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-weather-card>` — Animated weather card
|
|
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
|
+
6.8: sun rays turn, clouds drift, rain and snow fall, a flash-safe bolt glows, fog bands and stars — pick a condition and the scene cross-fades; the temperature counts up.
|
|
6
|
+
|
|
7
|
+
- **Category:** feedback · **since** 6.8
|
|
8
|
+
- **Import:** `import { defineWeatherCard } from 'motionary/components/widgets'` then `defineWeatherCard();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `condition`, `temp`, `place`, `unit`, `label`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/weather-card.ts](../../src/components/widgets/weather-card.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-weather-card condition="rain" temp="12" place="Lisbon"></usa-weather-card>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineWeatherCard } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineWeatherCard(); // registers <usa-weather-card>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-weather-card condition="rain" temp="12" place="Lisbon"></usa-weather-card>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-worker-canvas>` — Worker 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
|
+
9.6: a canvas animation rendered in a Web Worker on an OffscreenCanvas — the main thread stays free for input — with a main-thread fallback; particles, orbits, starfield or your own draw program.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.6
|
|
8
|
+
- **Import:** `import { defineWorkerCanvas } from 'motionary/components/widgets'` then `defineWorkerCanvas();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `scene`, `label`
|
|
11
|
+
- **Events:** `usa:backend`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/worker-canvas.ts](../../src/components/widgets/worker-canvas.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-worker-canvas scene="starfield" style="height:240px"></usa-worker-canvas>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineWorkerCanvas } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineWorkerCanvas(); // registers <usa-worker-canvas>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-worker-canvas scene="starfield" style="height:240px"></usa-worker-canvas>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `<usa-xp-bar>` — XP bar
|
|
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
|
+
7.5: an experience bar — add(n) fills it smoothly; overflowing fills to the end, the level badge pops and the bar restarts with the remainder (several levels if needed).
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.5
|
|
8
|
+
- **Import:** `import { defineXpBar } from 'motionary/components/widgets'` then `defineXpBar();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `level`, `xp`, `per`
|
|
11
|
+
- **Events:** `usa:levelup`, `usa:xp`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `add()`
|
|
14
|
+
- **Source:** [src/components/widgets/xp-bar.ts](../../src/components/widgets/xp-bar.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-xp-bar level="3" xp="40" per="100"></usa-xp-bar>
|
|
20
|
+
<script>bar.add(75); // → level 4, 15 XP</script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineXpBar } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
defineXpBar(); // registers <usa-xp-bar>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-xp-bar level="3" xp="40" per="100"></usa-xp-bar>
|
|
32
|
+
*/
|
|
33
|
+
```
|
package/docs/components.md
CHANGED
|
@@ -1374,8 +1374,103 @@ definePluginCard(); // registers <usa-plugin-card> — after the prerequisites
|
|
|
1374
1374
|
</usa-plugin-card>
|
|
1375
1375
|
```
|
|
1376
1376
|
|
|
1377
|
+
### `<usa-scroll-scene>` — Requires: motionary/runtime/scroll
|
|
1378
|
+
|
|
1379
|
+
- **Install:** `npm i motionary`
|
|
1380
|
+
- **Import order & registration:** Register the core first, then the module: use(scroll) also registers the core. CDN: load runtime.iife.js, then runtime/scroll.iife.js (it registers itself).
|
|
1381
|
+
|
|
1382
|
+
```js
|
|
1383
|
+
import { use } from 'motionary/runtime';
|
|
1384
|
+
import { scroll } from 'motionary/runtime/scroll';
|
|
1385
|
+
import { defineScrollScene } from 'motionary/components/widgets';
|
|
1386
|
+
|
|
1387
|
+
use(scroll);
|
|
1388
|
+
defineScrollScene(); // registers <usa-scroll-scene> — after the prerequisites
|
|
1389
|
+
```
|
|
1390
|
+
|
|
1391
|
+
- **CDN:**
|
|
1392
|
+
|
|
1393
|
+
```html
|
|
1394
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
1395
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/scroll.iife.js"></script>
|
|
1396
|
+
<!-- then the component bundles -->
|
|
1397
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1398
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
1399
|
+
```
|
|
1400
|
+
|
|
1401
|
+
- **Minimal example:**
|
|
1402
|
+
|
|
1403
|
+
```html
|
|
1404
|
+
<usa-scroll-scene start="top 80%" end="bottom 20%" scrub="120" stagger="120">
|
|
1405
|
+
<h2 data-scrub="x: -80 -> 0; opacity: 0 -> 1">Scroll</h2>
|
|
1406
|
+
<p data-scrub="y: 40 -> 0; opacity: 0 -> 1">and it follows.</p>
|
|
1407
|
+
</usa-scroll-scene>
|
|
1408
|
+
```
|
|
1409
|
+
|
|
1410
|
+
### `<usa-text-splitter>` — Requires: motionary/runtime/text
|
|
1411
|
+
|
|
1412
|
+
- **Install:** `npm i motionary`
|
|
1413
|
+
- **Import order & registration:** Register the core first, then the module: use(text) also registers the core. CDN: load runtime.iife.js, then runtime/text.iife.js (it registers itself).
|
|
1414
|
+
|
|
1415
|
+
```js
|
|
1416
|
+
import { use } from 'motionary/runtime';
|
|
1417
|
+
import { text } from 'motionary/runtime/text';
|
|
1418
|
+
import { defineTextSplitter } from 'motionary/components/widgets';
|
|
1419
|
+
|
|
1420
|
+
use(text);
|
|
1421
|
+
defineTextSplitter(); // registers <usa-text-splitter> — after the prerequisites
|
|
1422
|
+
```
|
|
1423
|
+
|
|
1424
|
+
- **CDN:**
|
|
1425
|
+
|
|
1426
|
+
```html
|
|
1427
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime.iife.js"></script>
|
|
1428
|
+
<script src="https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/text.iife.js"></script>
|
|
1429
|
+
<!-- then the component bundles -->
|
|
1430
|
+
<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>
|
|
1431
|
+
<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
- **Minimal example:**
|
|
1435
|
+
|
|
1436
|
+
```html
|
|
1437
|
+
<usa-text-splitter split="chars" effect="rise" stagger="30">Motion, made simple.</usa-text-splitter>
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1377
1440
|
<!-- prereqs:end -->
|
|
1378
1441
|
|
|
1442
|
+
### v10.2 Scroll scenes (`motionary/runtime/scroll`) + SVG loader + `data-motion` in core: `<usa-scroll-scene>`, `<usa-motion-inspector>` (`components/widgets`)
|
|
1443
|
+
|
|
1444
|
+
```html
|
|
1445
|
+
<usa-scroll-scene start="top 80%" end="bottom 20%" scrub="120" stagger="120">
|
|
1446
|
+
<h2 data-scrub="x: -80 -> 0; opacity: 0 -> 1">Scroll</h2>
|
|
1447
|
+
<p data-scrub="y: 40 -> 0; opacity: 0 -> 1">and it follows.</p>
|
|
1448
|
+
</usa-scroll-scene>
|
|
1449
|
+
<usa-motion-inspector scope="#app"></usa-motion-inspector>
|
|
1450
|
+
```
|
|
1451
|
+
|
|
1452
|
+
| Element | Attributes | Methods / events |
|
|
1453
|
+
|---|---|---|
|
|
1454
|
+
| `<usa-scroll-scene>` (Requires: motionary/runtime/scroll) | `start`, `end`, `scrub` (`true` or ms), `pin`, `markers`, `stagger`, `toggle-class`, `preview`; children `data-scrub="prop: from -> to; …"` | `progress`, `refresh()`, `timeline()`; `usa:progress`, `usa:enter`, `usa:leave`, `usa:runtime-missing` |
|
|
1455
|
+
| `<usa-motion-inspector>` | `scope`, `interval` | `refresh()`, `pauseAll()`, `playAll()`, `setRate(rate)`, `animations()`; `usa:change` |
|
|
1456
|
+
|
|
1457
|
+
Declarative motion with just the core: `applyMotionAttributes(createMotion())` + `data-motion="enter: fade-up 600ms"`.
|
|
1458
|
+
|
|
1459
|
+
### v10.3 View Transitions 2.0 + text splitting (`motionary/runtime/text`) + sprite sheets: `<usa-route-transition>`, `<usa-text-splitter>` (`components/widgets`)
|
|
1460
|
+
|
|
1461
|
+
```html
|
|
1462
|
+
<usa-route-transition id="app" effect="slide" cross-document>
|
|
1463
|
+
<nav><a href="/">Home</a> <a href="/about">About</a></nav>
|
|
1464
|
+
<h1 data-shared="title">Home</h1>
|
|
1465
|
+
</usa-route-transition>
|
|
1466
|
+
<usa-text-splitter split="chars" effect="rise" stagger="30">Motion, made simple.</usa-text-splitter>
|
|
1467
|
+
```
|
|
1468
|
+
|
|
1469
|
+
| Element | Attributes | Methods / events |
|
|
1470
|
+
|---|---|---|
|
|
1471
|
+
| `<usa-route-transition>` | `effect` (fade, slide, zoom), `engine` (auto, view-transition, waapi), `selector`, `history` (push, replace, off), `links` (inside, document), `cross-document`; `[data-to]`, `<template data-route>`, `[data-shared]` | `navigate(url)`, `current`; `usa:navigate`, `usa:navigated` |
|
|
1472
|
+
| `<usa-text-splitter>` (Requires: motionary/runtime/text) | `split` (chars, words, lines), `effect` (rise, fade, blur, flip, wave), `stagger`, `duration`, `trigger` (view, load, hover), `loop` | `replay()`, `pieces()`; `usa:split`, `usa:done`, `usa:runtime-missing` |
|
|
1473
|
+
|
|
1379
1474
|
## Frameworks
|
|
1380
1475
|
|
|
1381
1476
|
Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# motionary/runtime/format-sprite — Sprite sheets & image sequences
|
|
2
|
+
|
|
3
|
+
> Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
|
|
4
|
+
|
|
5
|
+
Play TexturePacker / Aseprite sprite sheets and numbered image sequences on a canvas or an element background, as runtime timelines (scrubbable).
|
|
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-sprite`
|
|
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-sprite.iife.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-sprite.js`
|
|
21
|
+
|
|
22
|
+
4. **Import order & registration:** Register the core first, then the module: use(formatSprite) also registers the core. CDN: load runtime.iife.js, then runtime/format-sprite.iife.js (it registers itself).
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { use } from 'motionary/runtime';
|
|
26
|
+
import { formatSprite } from 'motionary/runtime/format-sprite';
|
|
27
|
+
use(formatSprite);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { use } from 'motionary/runtime';
|
|
34
|
+
import { formatSprite, parseSpriteSheet, spritePlayer } from 'motionary/runtime/format-sprite';
|
|
35
|
+
use(formatSprite);
|
|
36
|
+
const sheet = parseSpriteSheet(await (await fetch('/slime.json')).json());
|
|
37
|
+
const img = new Image(); img.src = '/slime.png'; await img.decode();
|
|
38
|
+
spritePlayer(document.querySelector('canvas'), sheet, img, { tag: 'bounce' });
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Exports
|
|
42
|
+
|
|
43
|
+
`formatSprite` · `parseSpriteSheet` · `gridSheet` · `frameOrder` · `drawFrame` · `spritePlayer` · `imageSequence` · `preloadImages` · `sequencePlayer`
|
|
44
|
+
|
|
45
|
+
## Compatibility
|
|
46
|
+
|
|
47
|
+
| Feature | Supported | Notes |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| TexturePacker JSON (hash + array) | ✅ yes | trimmed (spriteSourceSize / sourceSize) and rotated frames |
|
|
50
|
+
| Aseprite JSON (hash + array), per-frame duration | ✅ yes | |
|
|
51
|
+
| Aseprite frameTags: forward / reverse / pingpong / pingpong_reverse | ✅ yes | |
|
|
52
|
+
| plain grid sheets | ✅ yes | gridSheet(cols, rows, w, h) |
|
|
53
|
+
| image sequences (frame_{0001}.webp) | ✅ yes | preloading, cover-fit drawing, scrub via progress |
|
|
54
|
+
| multipack (several atlas images) | ✕ no | load each sheet separately |
|
|
55
|
+
| Aseprite slices / layers | ✕ no | frames only |
|
|
56
|
+
| SSR / workers | ◐ partial | parsing is pure; players need a canvas (OffscreenCanvas works) |
|
|
57
|
+
|
|
58
|
+
## Components that need it
|
|
59
|
+
|
|
60
|
+
_None yet._
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# motionary/runtime/format-svg — SVG loader: SMIL playback + path morphing
|
|
2
|
+
|
|
3
|
+
> Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
|
|
4
|
+
|
|
5
|
+
Replay SVG SMIL animations (animate, set, animateTransform, animateMotion) on the runtime timeline, morph between any two paths, and measure paths without the DOM.
|
|
6
|
+
|
|
7
|
+
Part of Motionary's own zero-dependency runtime. Size budget: **5.0 KB gzip** (enforced in CI).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Install:** `npm i motionary`
|
|
12
|
+
2. **Import path:** `motionary/runtime/format-svg`
|
|
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-svg.iife.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/format-svg.js`
|
|
21
|
+
|
|
22
|
+
4. **Import order & registration:** Register the core first, then the module: use(formatSvg) also registers the core. CDN: load runtime.iife.js, then runtime/format-svg.iife.js (it registers itself).
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { use } from 'motionary/runtime';
|
|
26
|
+
import { formatSvg } from 'motionary/runtime/format-svg';
|
|
27
|
+
use(formatSvg);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { use } from 'motionary/runtime';
|
|
34
|
+
import { formatSvg, playSmil, morphPath } from 'motionary/runtime/format-svg';
|
|
35
|
+
use(formatSvg);
|
|
36
|
+
const player = playSmil(document.querySelector('svg'));
|
|
37
|
+
player.timeline.timeScale = 0.5; // scrub / slow down / reverse like any runtime timeline
|
|
38
|
+
const f = morphPath('M0 0 L100 0 L50 80 Z', 'M50 0 A40 40 0 1 1 49.9 0 Z');
|
|
39
|
+
path.setAttribute('d', f(0.5));
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Exports
|
|
43
|
+
|
|
44
|
+
`formatSvg` · `playSmil` · `readSmil` · `morphPath` · `parsePath` · `flattenPath` · `pathLength` · `pointAtLength` · `samplePath` · `smilTime`
|
|
45
|
+
|
|
46
|
+
## Compatibility
|
|
47
|
+
|
|
48
|
+
| Feature | Supported | Notes |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| <animate> from / to / by / values, keyTimes, calcMode linear / discrete / spline + keySplines | ✅ yes | |
|
|
51
|
+
| <set> | ✅ yes | |
|
|
52
|
+
| <animateTransform> translate / scale / rotate / skewX / skewY | ✅ yes | |
|
|
53
|
+
| <animateMotion> path / <mpath>, rotate auto / auto-reverse / angle | ✅ yes | paced along the path |
|
|
54
|
+
| dur, numeric begin offsets, repeatCount (incl. indefinite), repeatDur, fill freeze | ✅ yes | |
|
|
55
|
+
| path morphing between any two paths (d attribute or morphPath()) | ✅ yes | resampled to N points, start points aligned |
|
|
56
|
+
| path parsing incl. relative commands, S/T reflections, arcs | ✅ yes | no DOM needed (SSR / workers) |
|
|
57
|
+
| event / syncbase begin (click, a.end), accumulate, additive="sum" | ✕ no | documented gap |
|
|
58
|
+
| CSS-animated SVG | ✅ yes | via motionary/runtime/format-css |
|
|
59
|
+
|
|
60
|
+
## Components that need it
|
|
61
|
+
|
|
62
|
+
_None yet._
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# motionary/runtime/scroll — Scroll scenes
|
|
2
|
+
|
|
3
|
+
> Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
|
|
4
|
+
|
|
5
|
+
Scroll-linked scenes: start / end rules, scrub (direct or smoothed), pin, markers, enter / leave callbacks and per-edge actions for a runtime tween or timeline.
|
|
6
|
+
|
|
7
|
+
Part of Motionary's own zero-dependency runtime. Size budget: **4.5 KB gzip** (enforced in CI).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Install:** `npm i motionary`
|
|
12
|
+
2. **Import path:** `motionary/runtime/scroll`
|
|
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/scroll.iife.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/scroll.js`
|
|
21
|
+
|
|
22
|
+
4. **Import order & registration:** Register the core first, then the module: use(scroll) also registers the core. CDN: load runtime.iife.js, then runtime/scroll.iife.js (it registers itself).
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { use } from 'motionary/runtime';
|
|
26
|
+
import { scroll } from 'motionary/runtime/scroll';
|
|
27
|
+
use(scroll);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { use, timeline } from 'motionary/runtime';
|
|
34
|
+
import { scroll, scrollScene } from 'motionary/runtime/scroll';
|
|
35
|
+
use(scroll);
|
|
36
|
+
const tl = timeline({ paused: true }).to('.card', { to: { x: 200, rotate: 8 } });
|
|
37
|
+
scrollScene({ trigger: '.section', start: 'top 80%', end: 'bottom 20%', scrub: 120, pin: true, markers: true, animation: tl });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Exports
|
|
41
|
+
|
|
42
|
+
`scroll` · `scrollScene` · `ScrollScene` · `refreshScenes` · `killScenes` · `allScenes` · `parseEdge` · `resolveRule`
|
|
43
|
+
|
|
44
|
+
## Compatibility
|
|
45
|
+
|
|
46
|
+
| Feature | Supported | Notes |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| start / end rules ("top 80%", "center center", "top top+=80", end "+=600") | ✅ yes | keywords, %, px, +=/-= offsets |
|
|
49
|
+
| scrub: direct (true) or smoothed (ms) | ✅ yes | drives any runtime tween / timeline |
|
|
50
|
+
| pin (fixed in the window, transform inside a scroll container) | ✅ yes | spacer keeps the layout |
|
|
51
|
+
| markers | ✅ yes | start / end + viewport lines |
|
|
52
|
+
| onEnter / onLeave / onEnterBack / onLeaveBack / onUpdate / onToggle | ✅ yes | |
|
|
53
|
+
| actions per edge (play pause resume reverse restart reset complete none) | ✅ yes | default "play none none reverse" |
|
|
54
|
+
| horizontal scenes, custom scroll containers | ✅ yes | |
|
|
55
|
+
| snap, nested pins, pinned scroll containers | ✕ no | planned with the smooth module (10.4) |
|
|
56
|
+
| SSR | ✅ yes | safe to import; scenes need a window |
|
|
57
|
+
| Web Workers | ✕ no | needs the DOM |
|
|
58
|
+
|
|
59
|
+
## Components that need it
|
|
60
|
+
|
|
61
|
+
- `<usa-scroll-scene>` — Scroll scene
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# motionary/runtime/text — Text splitting
|
|
2
|
+
|
|
3
|
+
> Generated from `showcase/catalog/prereqs.js` by `scripts/gen-runtime-docs.mjs` — edit the data, not this page.
|
|
4
|
+
|
|
5
|
+
Split text into characters (grapheme-aware), words and lines for animation while keeping it accessible (aria-label with the full text, pieces hidden from assistive tech).
|
|
6
|
+
|
|
7
|
+
Part of Motionary's own zero-dependency runtime. Size budget: **2.5 KB gzip** (enforced in CI).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Install:** `npm i motionary`
|
|
12
|
+
2. **Import path:** `motionary/runtime/text`
|
|
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/text.iife.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
ESM from a CDN: `https://cdn.jsdelivr.net/npm/motionary@10/dist/runtime/text.js`
|
|
21
|
+
|
|
22
|
+
4. **Import order & registration:** Register the core first, then the module: use(text) also registers the core. CDN: load runtime.iife.js, then runtime/text.iife.js (it registers itself).
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { use } from 'motionary/runtime';
|
|
26
|
+
import { text } from 'motionary/runtime/text';
|
|
27
|
+
use(text);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { use, tween } from 'motionary/runtime';
|
|
34
|
+
import { text, splitText } from 'motionary/runtime/text';
|
|
35
|
+
use(text);
|
|
36
|
+
const { chars } = splitText(document.querySelector('h1'), { type: 'chars,words' });
|
|
37
|
+
tween(chars, { from: { y: '1em', opacity: 0 }, to: { y: '0em', opacity: 1 }, stagger: 30 });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Exports
|
|
41
|
+
|
|
42
|
+
`text` · `splitText` · `segment`
|
|
43
|
+
|
|
44
|
+
## Compatibility
|
|
45
|
+
|
|
46
|
+
| Feature | Supported | Notes |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| chars (grapheme clusters: emoji, combining marks, CJK) | ✅ yes | Intl.Segmenter when available, code points otherwise |
|
|
49
|
+
| words, whitespace preserved | ✅ yes | |
|
|
50
|
+
| lines (grouped by rendered position) | ✅ yes | wrapped in line spans for flat text; data-line on words inside nested markup |
|
|
51
|
+
| nested inline markup (a, em, strong…) kept | ✅ yes | |
|
|
52
|
+
| accessibility: aria-label + aria-hidden pieces, revert() | ✅ yes | |
|
|
53
|
+
| --i index custom property for CSS staggers | ✅ yes | |
|
|
54
|
+
| SSR / workers | ◐ partial | segment() is pure; splitText() needs a DOM |
|
|
55
|
+
| right-to-left line detection | ◐ partial | lines by vertical position (works for RTL; bidi runs not reordered) |
|
|
56
|
+
|
|
57
|
+
## Components that need it
|
|
58
|
+
|
|
59
|
+
- `<usa-text-splitter>` — Text splitter
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motionary",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.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",
|
|
@@ -1238,6 +1238,46 @@
|
|
|
1238
1238
|
"default": "./dist/runtime/format-motion.cjs"
|
|
1239
1239
|
}
|
|
1240
1240
|
},
|
|
1241
|
+
"./runtime/scroll": {
|
|
1242
|
+
"import": {
|
|
1243
|
+
"types": "./dist/runtime/scroll.d.ts",
|
|
1244
|
+
"default": "./dist/runtime/scroll.js"
|
|
1245
|
+
},
|
|
1246
|
+
"require": {
|
|
1247
|
+
"types": "./dist/runtime/scroll.d.cts",
|
|
1248
|
+
"default": "./dist/runtime/scroll.cjs"
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
"./runtime/format-svg": {
|
|
1252
|
+
"import": {
|
|
1253
|
+
"types": "./dist/runtime/format-svg.d.ts",
|
|
1254
|
+
"default": "./dist/runtime/format-svg.js"
|
|
1255
|
+
},
|
|
1256
|
+
"require": {
|
|
1257
|
+
"types": "./dist/runtime/format-svg.d.cts",
|
|
1258
|
+
"default": "./dist/runtime/format-svg.cjs"
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
"./runtime/text": {
|
|
1262
|
+
"import": {
|
|
1263
|
+
"types": "./dist/runtime/text.d.ts",
|
|
1264
|
+
"default": "./dist/runtime/text.js"
|
|
1265
|
+
},
|
|
1266
|
+
"require": {
|
|
1267
|
+
"types": "./dist/runtime/text.d.cts",
|
|
1268
|
+
"default": "./dist/runtime/text.cjs"
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
"./runtime/format-sprite": {
|
|
1272
|
+
"import": {
|
|
1273
|
+
"types": "./dist/runtime/format-sprite.d.ts",
|
|
1274
|
+
"default": "./dist/runtime/format-sprite.js"
|
|
1275
|
+
},
|
|
1276
|
+
"require": {
|
|
1277
|
+
"types": "./dist/runtime/format-sprite.d.cts",
|
|
1278
|
+
"default": "./dist/runtime/format-sprite.cjs"
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1241
1281
|
"./manifest.json": "./dist/manifest.json",
|
|
1242
1282
|
"./manifest.schema.json": "./dist/manifest.schema.json",
|
|
1243
1283
|
"./components.css": "./dist/components.css",
|
|
@@ -1271,7 +1311,8 @@
|
|
|
1271
1311
|
"README_ja.md",
|
|
1272
1312
|
"LICENSE",
|
|
1273
1313
|
"CHANGELOG.md",
|
|
1274
|
-
"figma-plugin"
|
|
1314
|
+
"figma-plugin",
|
|
1315
|
+
"AGENTS.md"
|
|
1275
1316
|
],
|
|
1276
1317
|
"sideEffects": [
|
|
1277
1318
|
"*.css",
|
|
@@ -1294,7 +1335,8 @@
|
|
|
1294
1335
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
1295
1336
|
"manifest": "node scripts/gen-manifest.mjs",
|
|
1296
1337
|
"docs:runtime": "node scripts/gen-runtime-docs.mjs",
|
|
1297
|
-
"check:peer-docs": "node scripts/check-peer-docs.mjs"
|
|
1338
|
+
"check:peer-docs": "node scripts/check-peer-docs.mjs",
|
|
1339
|
+
"docs:components": "node scripts/gen-component-docs.mjs"
|
|
1298
1340
|
},
|
|
1299
1341
|
"keywords": [
|
|
1300
1342
|
"motionary",
|