@pixodesk/svg-animator-web 1.0.30 โ 1.0.34
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/README.md +11 -9
- package/dist/index.cjs +247 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +247 -87
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.prerendered-waapi.umd.js +135 -17
- package/dist/index.prerendered-waapi.umd.js.map +1 -1
- package/dist/index.prerendered-waapi.umd.min.js +1 -1
- package/dist/index.prerendered.umd.js +136 -18
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/{index.umd.js โ pixodesk-svg-animator.umd.js} +240 -86
- package/dist/pixodesk-svg-animator.umd.js.map +1 -0
- package/dist/pixodesk-svg-animator.umd.min.js +1 -0
- package/package.json +5 -5
- package/dist/index.umd.js.map +0 -1
- package/dist/index.umd.min.js +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# animator-web
|
|
2
2
|
|
|
3
|
+
> ๐ Full user guide: [docs/library/web-player.md](../../docs/library/web-player.md) ยท [all docs](../../README.md#documentation)
|
|
4
|
+
|
|
3
5
|
[](https://github.com/pixodesk/pixodesk-svg-animator/actions/workflows/ci.yml)
|
|
4
6
|
[](https://opensource.org/licenses/MIT)
|
|
5
7
|
|
|
@@ -69,7 +71,7 @@ const animator = createAnimator({ data: animationDoc, container: '#container' })
|
|
|
69
71
|
|
|
70
72
|
animator.play();
|
|
71
73
|
animator.pause();
|
|
72
|
-
animator.setCurrentTime(500); //
|
|
74
|
+
animator.setCurrentTime(500); // jump to 0.5 s from the start
|
|
73
75
|
animator.setPlaybackRate(2); // 2x speed (-1 plays in reverse)
|
|
74
76
|
animator.finish(); // jump to end
|
|
75
77
|
animator.destroy(); // cleanup
|
|
@@ -97,7 +99,7 @@ It returns a `PxAnimatorAPI`:
|
|
|
97
99
|
| `finish()` | Jump to the end |
|
|
98
100
|
| `setPlaybackRate(rate)` | Change speed (1 = normal, 2 = double, -1 = reverse) |
|
|
99
101
|
| `getCurrentTime()` | Current time in ms |
|
|
100
|
-
| `setCurrentTime(ms)` |
|
|
102
|
+
| `setCurrentTime(ms)` | Jump to a point in the animation, in milliseconds from its start |
|
|
101
103
|
| `isPlaying()` | Whether the animation is currently playing |
|
|
102
104
|
| `isReady()` | Whether the document has loaded (relevant for URL-based creation) |
|
|
103
105
|
| `getRootElement()` | The rendered SVG DOM element |
|
|
@@ -132,17 +134,17 @@ createAnimator({
|
|
|
132
134
|
The `doc` passed to `createAnimator` is a `PxAnimatedSvgDocument` (`type: 'svg'`), the
|
|
133
135
|
same shape as the JSON export. It comes in two modes:
|
|
134
136
|
|
|
135
|
-
- **
|
|
136
|
-
- **
|
|
137
|
+
- **Self-contained document** โ has `children`: the player renders the SVG tree and animates it.
|
|
138
|
+
- **Bind-by-id document** โ no `children`: the player animates a pre-existing SVG DOM, mapping
|
|
137
139
|
element ids to animation specs via `animator.animateById`.
|
|
138
140
|
|
|
139
141
|
Elements may also carry a `node.effects` bucket (structural effects such as
|
|
140
142
|
`transformBy`, `repeater`, `maskedBy`, `strokeTrim`, `clone`, `fillGradient` /
|
|
141
|
-
`strokeGradient`, `
|
|
143
|
+
`strokeGradient`, `textPath`). This player materialises and removes them at
|
|
142
144
|
runtime before any other normalisation.
|
|
143
145
|
|
|
144
|
-
See the [
|
|
145
|
-
[Player effects](../../README.md#player-effects
|
|
146
|
-
|
|
147
|
-
[`PxAnimatorTypes.ts`](src/PxAnimatorTypes.ts).
|
|
146
|
+
See the [JSON format reference](../../docs/format/README.md#json-format-reference) and
|
|
147
|
+
[Player effects](../../docs/format/README.md#player-effects) for the full schema and
|
|
148
|
+
examples (compact printable schema: [SCHEMA.md](../../SCHEMA.md)). The wire
|
|
149
|
+
types live in [`PxAnimatorTypes.ts`](../svg-animator-core/src/PxAnimatorTypes.ts).
|
|
148
150
|
|