@hilux/ngx-motion 1.0.11 → 1.0.13
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 +54 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,58 @@
|
|
|
3
3
|
WIP - Trigger and control angular animations with a Framer Motion like workflow in template HTML.
|
|
4
4
|
Generated with [Angular CLI](https://github.com/angular/angular-cli) version 19.1.0.
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
## Basic Example
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
<div
|
|
11
|
+
motion
|
|
12
|
+
[initial]="{
|
|
13
|
+
backgroundColor: 'red',
|
|
14
|
+
scale: 1,
|
|
15
|
+
transform: 'translateX(0px)'
|
|
16
|
+
}"
|
|
17
|
+
[animate]="{
|
|
18
|
+
backgroundColor: 'blue',
|
|
19
|
+
scale: 1,
|
|
20
|
+
transform: 'translateX(100px)'
|
|
21
|
+
}"
|
|
22
|
+
[duration]="'.5s'"
|
|
23
|
+
style="height: 100px; width: 100px; background-color: red"
|
|
24
|
+
>
|
|
25
|
+
Hello World
|
|
26
|
+
</div>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Variant Example
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
this.foodVariants = {
|
|
34
|
+
egg: { opacity: 1, transform: 'translateX(0px)', backgroundColor: 'blue' },
|
|
35
|
+
apple: { opacity: 1, transform: 'translateX(100px)', backgroundColor: 'green' },
|
|
36
|
+
pasta: { opacity: 0.5, transform: 'scale(0.8)', backgroundColor: 'yellow' }
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
motion
|
|
41
|
+
[variants]="foodVariants"
|
|
42
|
+
[animate]="currentFood"
|
|
43
|
+
style="
|
|
44
|
+
height: 100px;
|
|
45
|
+
width: 100px;
|
|
46
|
+
background-color: red;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
z-index: 100;
|
|
51
|
+
"
|
|
52
|
+
>
|
|
53
|
+
{{currentFood}}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
|
|
6
58
|
## MotionDirective
|
|
7
59
|
|
|
8
60
|
- @Input() initial: any = {};
|
|
@@ -25,8 +77,8 @@ Generated with [Angular CLI](https://github.com/angular/angular-cli) version 19.
|
|
|
25
77
|
|
|
26
78
|
Current Limitations:
|
|
27
79
|
|
|
28
|
-
- staggerChildren not
|
|
29
|
-
-
|
|
80
|
+
- staggerChildren not complete.
|
|
81
|
+
- Dynamic animate values must be generated in ts, you cant set directly in the animate value.
|
|
30
82
|
- InView offset not complete.
|
|
31
83
|
- Repeat & offset only apply to inView animations.
|
|
32
84
|
- exitDelay not complete.
|