@hilux/ngx-motion 1.0.14 → 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,151 +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
- ## Setup
8
-
9
- Make sure you have provideAnimations() in app config
7
+ To start a local development server, run:
10
8
 
9
+ ```bash
10
+ ng serve
11
11
  ```
12
- import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
13
- import { provideRouter, Router, withViewTransitions } from '@angular/router';
14
- import { provideAnimations } from '@angular/platform-browser/animations';
15
- import { routes } from './app.routes';
16
- import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
17
-
18
- export const appConfig: ApplicationConfig = {
19
- providers: [
20
- provideZoneChangeDetection({ eventCoalescing: true }),
21
- provideRouter(routes , withViewTransitions()),
22
- provideClientHydration(withEventReplay()),
23
- provideAnimations(),
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.
27
14
 
28
- ```
15
+ ## Code scaffolding
29
16
 
30
- Import motin directive in your component
17
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
31
18
 
19
+ ```bash
20
+ ng generate component component-name
32
21
  ```
33
- import { Component } from '@angular/core';
34
- import { RouterOutlet, RouterLink, RouterLinkActive, ActivatedRoute, Router, NavigationEnd , NavigationStart} from '@angular/router';
35
- import { MotionDirective } from '../../../../dist/ngx-motion/';
36
- @Component({
37
- selector: 'app-root',
38
- imports: [
39
- RouterOutlet,
40
- MotionDirective
41
- ],
42
- templateUrl: './app.component.html',
43
- styleUrl: './app.component.scss',
44
- standalone: true
45
- })
46
- export class AppComponent {
47
- title = 'ngx-motion-demo';
48
- }
49
22
 
23
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24
+
25
+ ```bash
26
+ ng generate --help
50
27
  ```
51
28
 
29
+ ## Building
52
30
 
53
- ## Basic Example
31
+ To build the project run:
54
32
 
33
+ ```bash
34
+ ng build
55
35
  ```
56
- <div
57
- motion
58
- [initial]="{
59
- backgroundColor: 'red',
60
- scale: 1,
61
- transform: 'translateX(0px)'
62
- }"
63
- [animate]="{
64
- backgroundColor: 'blue',
65
- scale: 1,
66
- transform: 'translateX(100px)'
67
- }"
68
- [duration]="'.5s'"
69
- style="height: 100px; width: 100px; background-color: red"
70
- >
71
- Hello World
72
- </div>
73
- ```
74
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
75
40
 
76
- ## Variant Example
41
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
77
42
 
43
+ ```bash
44
+ ng test
78
45
  ```
79
- this.foodVariants = {
80
- egg: { opacity: 1, transform: 'translateX(0px)', backgroundColor: 'blue' },
81
- apple: { opacity: 1, transform: 'translateX(100px)', backgroundColor: 'green' },
82
- pasta: { opacity: 0.5, transform: 'scale(0.8)', backgroundColor: 'yellow' }
83
- };
84
-
85
- <div
86
- motion
87
- [variants]="foodVariants"
88
- [animate]="currentFood"
89
- style="
90
- height: 100px;
91
- width: 100px;
92
- background-color: red;
93
- position: absolute;
94
- top: 0;
95
- left: 0;
96
- z-index: 100;
97
- "
98
- >
99
- {{currentFood}}
100
- </div>
101
46
 
47
+ ## Running end-to-end tests
48
+
49
+ For end-to-end (e2e) testing, run:
50
+
51
+ ```bash
52
+ ng e2e
102
53
  ```
103
54
 
104
- ## MotionDirective
105
-
106
- - @Input() initial: any = {};
107
- - @Input() animate: any = {};
108
- - @Input() exit: any = {};
109
- - @Input() inView: any = {};
110
- - @Input() duration = '0.3s';
111
- - @Input() delay = '0s';
112
- - @Input() repeat = false;
113
- - @Input() exitDelay = '0s';
114
- - @Input() easing = 'ease';
115
- - @Input() offset = '0px';
116
- - @Input() whileHover: any = {};
117
- - @Input() staggerChildren = '0s';
118
- - @Input() whileTap: any = {};
119
- - @Input() whileFocus: any = {};
120
- - @Input() whileInView: any = {};
121
- - @Input() variants: any = {};
122
- - @Output() animationComplete = new EventEmitter<void>();
123
-
124
- Current Limitations:
125
-
126
- - staggerChildren not complete.
127
- - Dynamic animate values must be generated in ts, you cant set directly in the animate value.
128
- - InView offset not complete.
129
- - Repeat & offset only apply to inView animations.
130
- - exitDelay not complete.
131
-
132
- ## MotionHostComponent
133
-
134
- WIP - Atempt at Angular version of AnimatePresence.
135
- So far unable to use @queue as expected using Animation Builder.
136
- Relying on router event and getLongestDuration to delay the [motion] entry delay.
137
-
138
- ## MotionService
139
-
140
- - scrollYProgress
141
- - registerMotionElement
142
- - unregisterMotionElement
143
- - getMotionElements
144
- - getAllElementsByRoute
145
- - cancelAllAnimations
146
- - runAllEnterAnimations
147
- - runAllExitAnimations
148
- - runAllEnterAnimationsForRoute
149
- - getLongestExitDuration
150
- - getLongestEnterDuration
151
- - 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.