@hanzogui/animations-motion 2.0.0-rc.41-hanzoai.5
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/LICENSE +21 -0
- package/README.md +72 -0
- package/dist/cjs/createAnimations.cjs +698 -0
- package/dist/cjs/createAnimations.native.js +822 -0
- package/dist/cjs/createAnimations.native.js.map +1 -0
- package/dist/cjs/index.cjs +21 -0
- package/dist/cjs/index.native.js +45 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/polyfill.cjs +3 -0
- package/dist/cjs/polyfill.native.js +6 -0
- package/dist/cjs/polyfill.native.js.map +1 -0
- package/dist/esm/createAnimations.mjs +661 -0
- package/dist/esm/createAnimations.mjs.map +1 -0
- package/dist/esm/createAnimations.native.js +782 -0
- package/dist/esm/createAnimations.native.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +17 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/polyfill.mjs +4 -0
- package/dist/esm/polyfill.mjs.map +1 -0
- package/dist/esm/polyfill.native.js +4 -0
- package/dist/esm/polyfill.native.js.map +1 -0
- package/package.json +53 -0
- package/src/createAnimations.tsx +991 -0
- package/src/index.native.ts +28 -0
- package/src/index.ts +3 -0
- package/src/polyfill.ts +4 -0
- package/types/createAnimations.d.ts +8 -0
- package/types/createAnimations.d.ts.map +11 -0
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +11 -0
- package/types/index.native.d.ts +4 -0
- package/types/index.native.d.ts.map +11 -0
- package/types/polyfill.d.ts +2 -0
- package/types/polyfill.d.ts.map +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Nate Wienert
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @hanzogui/animations-motion
|
|
2
|
+
|
|
3
|
+
Motion animation driver for Hanzogui, powered by the [Motion](https://motion.dev) library and the Web Animations API (WAAPI).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Hybrid Engine**: Combines JavaScript animations with native WAAPI for GPU-accelerated performance
|
|
8
|
+
- **Spring Physics**: Natural, physics-based animations with intuitive `damping`, `stiffness`, and `mass` parameters
|
|
9
|
+
- **Independent Transforms**: Animate `x`, `y`, `scale`, `rotate` properties separately with different configurations
|
|
10
|
+
- **Compositor Thread**: Runs animations smoothly even when the main thread is busy
|
|
11
|
+
- **Web-Only**: Optimized for modern web browsers with WAAPI support
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @hanzogui/animations-motion motion
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Add to your Hanzogui configuration:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { createAnimations } from '@hanzogui/animations-motion'
|
|
25
|
+
import { createHanzogui } from 'hanzogui'
|
|
26
|
+
|
|
27
|
+
export default createHanzogui({
|
|
28
|
+
animations: createAnimations({
|
|
29
|
+
bouncy: {
|
|
30
|
+
type: 'spring',
|
|
31
|
+
damping: 9,
|
|
32
|
+
mass: 0.9,
|
|
33
|
+
stiffness: 150,
|
|
34
|
+
},
|
|
35
|
+
quick: {
|
|
36
|
+
type: 'spring',
|
|
37
|
+
damping: 20,
|
|
38
|
+
mass: 1.2,
|
|
39
|
+
stiffness: 250,
|
|
40
|
+
},
|
|
41
|
+
'100ms': {
|
|
42
|
+
duration: 100,
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
// ...
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Animation Types
|
|
50
|
+
|
|
51
|
+
### Spring Animations
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
{
|
|
55
|
+
type: 'spring',
|
|
56
|
+
damping: 10, // Higher = less bouncy
|
|
57
|
+
stiffness: 100, // Higher = faster
|
|
58
|
+
mass: 1, // Higher = more inertia
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Tween Animations
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
{
|
|
66
|
+
duration: 200, // Duration in milliseconds
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
For complete documentation, see the [Hanzogui Animations docs](https://hanzogui.dev/docs/core/animations).
|