@hilux/ngx-motion 1.0.13 → 1.0.15

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 CHANGED
@@ -1,105 +1,59 @@
1
- # NgxMotion
1
+ # ng motion poc
2
2
 
3
- WIP - Trigger and control angular animations with a Framer Motion like workflow in template HTML.
4
- Generated with [Angular CLI](https://github.com/angular/angular-cli) version 19.1.0.
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.5.
5
4
 
5
+ ## Development server
6
6
 
7
- ## Basic Example
7
+ To start a local development server, run:
8
8
 
9
+ ```bash
10
+ ng serve
9
11
  ```
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>
12
+
13
+ Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
14
+
15
+ ## Code scaffolding
16
+
17
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
18
+
19
+ ```bash
20
+ ng generate component component-name
21
+ ```
22
+
23
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24
+
25
+ ```bash
26
+ ng generate --help
27
+ ```
28
+
29
+ ## Building
30
+
31
+ To build the project run:
32
+
33
+ ```bash
34
+ ng build
27
35
  ```
28
36
 
37
+ This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
38
+
39
+ ## Running unit tests
29
40
 
30
- ## Variant Example
41
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
31
42
 
43
+ ```bash
44
+ ng test
32
45
  ```
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
46
 
47
+ ## Running end-to-end tests
48
+
49
+ For end-to-end (e2e) testing, run:
50
+
51
+ ```bash
52
+ ng e2e
56
53
  ```
57
54
 
58
- ## MotionDirective
59
-
60
- - @Input() initial: any = {};
61
- - @Input() animate: any = {};
62
- - @Input() exit: any = {};
63
- - @Input() inView: any = {};
64
- - @Input() duration = '0.3s';
65
- - @Input() delay = '0s';
66
- - @Input() repeat = false;
67
- - @Input() exitDelay = '0s';
68
- - @Input() easing = 'ease';
69
- - @Input() offset = '0px';
70
- - @Input() whileHover: any = {};
71
- - @Input() staggerChildren = '0s';
72
- - @Input() whileTap: any = {};
73
- - @Input() whileFocus: any = {};
74
- - @Input() whileInView: any = {};
75
- - @Input() variants: any = {};
76
- - @Output() animationComplete = new EventEmitter<void>();
77
-
78
- Current Limitations:
79
-
80
- - staggerChildren not complete.
81
- - Dynamic animate values must be generated in ts, you cant set directly in the animate value.
82
- - InView offset not complete.
83
- - Repeat & offset only apply to inView animations.
84
- - exitDelay not complete.
85
-
86
- ## MotionHostComponent
87
-
88
- WIP - Atempt at Angular version of AnimatePresence.
89
- So far unable to use @queue as expected using Animation Builder.
90
- Relying on router event and getLongestDuration to delay the [motion] entry delay.
91
-
92
- ## MotionService
93
-
94
- - scrollYProgress
95
- - registerMotionElement
96
- - unregisterMotionElement
97
- - getMotionElements
98
- - getAllElementsByRoute
99
- - cancelAllAnimations
100
- - runAllEnterAnimations
101
- - runAllExitAnimations
102
- - runAllEnterAnimationsForRoute
103
- - getLongestExitDuration
104
- - getLongestEnterDuration
105
- - getLongestDurationForRoute
55
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
56
+
57
+ ## Additional Resources
58
+
59
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.