@hilux/ngx-motion 1.0.13 → 1.0.14
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 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,52 @@ WIP - Trigger and control angular animations with a Framer Motion like workflow
|
|
|
4
4
|
Generated with [Angular CLI](https://github.com/angular/angular-cli) version 19.1.0.
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
Make sure you have provideAnimations() in app config
|
|
10
|
+
|
|
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
|
+
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Import motin directive in your component
|
|
31
|
+
|
|
32
|
+
```
|
|
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
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
7
53
|
## Basic Example
|
|
8
54
|
|
|
9
55
|
```
|