angular-movement 0.0.1 → 0.1.0

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,64 +1,146 @@
1
- # Movement
1
+ # angular-movement
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0.
3
+ Lightweight Angular motion library with declarative directives, presets, spring physics, scroll-driven animation, and presence/stagger orchestration.
4
4
 
5
- ## Code scaffolding
5
+ ## Features
6
6
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
7
+ - Preset-based enter and leave animations
8
+ - Custom keyframes for full control
9
+ - Spring-driven transitions
10
+ - Hover, tap, focus, in-view, and scroll interactions
11
+ - Presence orchestration for exit animations before DOM removal
12
+ - Stagger support for list choreography
13
+ - Works with modern standalone Angular apps
14
+
15
+ ## Installation
8
16
 
9
17
  ```bash
10
- ng generate component component-name
18
+ npm install angular-movement
11
19
  ```
12
20
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
21
+ Peer dependencies:
14
22
 
15
- ```bash
16
- ng generate --help
23
+ - @angular/core ^21.2.0
24
+ - @angular/common ^21.2.0
25
+
26
+ ## Quick Start
27
+
28
+ Register global config and import directives in your app config.
29
+
30
+ ```ts
31
+ import { ApplicationConfig } from '@angular/core';
32
+ import { provideMovement } from 'angular-movement';
33
+
34
+ export const appConfig: ApplicationConfig = {
35
+ providers: [
36
+ provideMovement({
37
+ duration: 320,
38
+ easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
39
+ delay: 0,
40
+ disabled: false,
41
+ }),
42
+ ],
43
+ };
17
44
  ```
18
45
 
19
- ## Building
46
+ ```ts
47
+ import { Component } from '@angular/core';
48
+ import { MOVEMENT_DIRECTIVES } from 'angular-movement';
49
+
50
+ @Component({
51
+ selector: 'app-demo',
52
+ standalone: true,
53
+ imports: [...MOVEMENT_DIRECTIVES],
54
+ template: `
55
+ <h2 [move]="'fade-up'">Hello movement</h2>
56
+ <button [moveWhileHover]="{ scale: [1, 1.05] }">Hover me</button>
57
+ `,
58
+ })
59
+ export class DemoComponent {}
60
+ ```
20
61
 
21
- To build the library, run:
62
+ ## Common Usage
22
63
 
23
- ```bash
24
- ng build movement
64
+ ### Preset animation
65
+
66
+ ```html
67
+ <section [move]="'slide-up'">Content</section>
25
68
  ```
26
69
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
70
+ ### Custom keyframes
28
71
 
29
- ### Publishing the Library
72
+ ```html
73
+ <div [move]="{ opacity: [0, 1], y: [20, 0], scale: [0.96, 1] }">Card</div>
74
+ ```
30
75
 
31
- Once the project is built, you can publish your library by following these steps:
76
+ ### Framer-style API
77
+
78
+ ```html
79
+ <article
80
+ [moveAnimation]="{
81
+ initial: { opacity: 0, y: 24 },
82
+ animate: { opacity: 1, y: 0 },
83
+ exit: { opacity: 0, y: -16 },
84
+ duration: 300
85
+ }"
86
+ >
87
+ Item
88
+ </article>
89
+ ```
32
90
 
33
- 1. Navigate to the `dist` directory:
91
+ ### Presence for exit transitions
34
92
 
35
- ```bash
36
- cd dist/movement
37
- ```
93
+ ```html
94
+ <ng-container *movePresence="isOpen">
95
+ <aside [move]="'fade-right'" [moveAnimateLeave]="'fade-left'">Panel</aside>
96
+ </ng-container>
97
+ ```
38
98
 
39
- 2. Run the `npm publish` command to publish your library to the npm registry:
40
- ```bash
41
- npm publish
42
- ```
99
+ ### Staggered lists
43
100
 
44
- ## Running unit tests
101
+ ```html
102
+ <ul moveStagger [moveStaggerStep]="80">
103
+ <li [move]="'fade-up'">One</li>
104
+ <li [move]="'fade-up'">Two</li>
105
+ <li [move]="'fade-up'">Three</li>
106
+ </ul>
107
+ ```
108
+
109
+ ## Available Presets
110
+
111
+ fade-up, fade-down, fade-left, fade-right, slide-up, slide-down, slide-left, slide-right, zoom-in, zoom-out, flip-x, flip-y, bounce-in, blur-in, spin, pulse, none
112
+
113
+ ## Exports
114
+
115
+ Main entrypoint exports:
116
+
117
+ - MOVEMENT_DIRECTIVES
118
+ - All directives
119
+ - provideMovement
120
+ - Preset and keyframe types
121
+ - Animation engine/control types
122
+ - Tokens for advanced integration
45
123
 
46
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
124
+ ## Development
125
+
126
+ Build library:
47
127
 
48
128
  ```bash
49
- ng test
129
+ ng build movement
50
130
  ```
51
131
 
52
- ## Running end-to-end tests
53
-
54
- For end-to-end (e2e) testing, run:
132
+ Run library tests:
55
133
 
56
134
  ```bash
57
- ng e2e
135
+ ng test movement
58
136
  ```
59
137
 
60
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
138
+ Run coverage:
139
+
140
+ ```bash
141
+ ng test movement --coverage --watch=false
142
+ ```
61
143
 
62
- ## Additional Resources
144
+ ## License
63
145
 
64
- 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.
146
+ MIT