@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 +46 -92
- package/main.38a76835f287cd47.js +1 -0
- package/package.json +60 -12
- package/polyfills.d01a0142b6650731.js +1 -0
- package/runtime.aacc6cb1e6befba3.js +1 -0
- package/tailwind.config.js +260 -0
- package/ng-package.json +0 -7
- package/src/lib/motion-host/motion-host.component.html +0 -3
- package/src/lib/motion-host/motion-host.component.scss +0 -0
- package/src/lib/motion-host/motion-host.component.spec.ts +0 -23
- package/src/lib/motion-host/motion-host.component.ts +0 -50
- package/src/lib/motion-host/motion-page-transition.ts +0 -19
- package/src/lib/ngx-motion-host.directive.ts +0 -126
- package/src/lib/ngx-motion.directive.ts +0 -311
- package/src/lib/ngx-motion.module.ts +0 -16
- package/src/lib/services/ngx-motion.service.ts +0 -128
- package/src/public-api.ts +0 -6
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
package/README.md
CHANGED
|
@@ -1,105 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ng motion poc
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
7
|
+
To start a local development server, run:
|
|
8
8
|
|
|
9
|
+
```bash
|
|
10
|
+
ng serve
|
|
9
11
|
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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.
|