Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.3, multi anim definitions, added options, global defaults... more #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea/
node_modules/
dist/
!example/
!example/
updaters
92 changes: 2 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,3 @@
# Description
DEPRECATED ! Use [ack-angular-fx](https://www.npmjs.com/package/ack-angular-fx)

Angular2 animations, inspired by [Animate.css](https://daneden.github.io/animate.css).

# Install

```bash
npm install ng2-animate --save
```

# Usage

## Entering and Leaving

```javascript
import { animateFactory } from 'ng2-animate';

@Component({
selector: 'app',
template: require('./app.html'),
animations: [animateFactory(1000, 200, 'ease-in')]
})
export class AppComponent{
show: boolean = true;
list: string[] = ['xxx', 'yyy'];
onAdd() {
this.list.push('zzz');
}
onRemove(i) {
this.list.splice(i, 1);
}
}
```

```html
<p [@animate]="'fadeIn'" *ngIf="show">fadeIn</p>
<button (click)="show = !show">toggle</button>


<button (click)="onAdd()">add</button>
<ul>
<li *ngFor="let item of list;let i = index;" [@animate]="'fadeInLeft'">
{{item}}
<button (click)="onRemove(i)">X</button>
</li>
</ul>
```

## Replace With [hidden]

```html
<p [@animate]="state">Hello World</p>
<button (click)="state = 'fadeOutDown'">hide</button>
```

# Params

```javascript
animateFactory(1000, 200, 'ease-in')
```

### duration

the duration of the animation

- type: string | number
- optional, default value is `500ms`

### delay

the delay of the animation

- type: string | number
- optional, default value is `0`

### easing

the easing function of the animation

- type: string
- optional, default value is `linear`

# Support Animations

see online demo https://yuyang041060120.github.io/ng2-animate

> click the top title and every element.

# License

MIT
This pull request was never reviewed by the owner of ng2-animate so I was forced to release my code.
2 changes: 2 additions & 0 deletions dist/animations/bounce.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { AnimationMetadata } from '@angular/core';
export declare const bounce: (timing: string, options: any) => AnimationMetadata[];
107 changes: 107 additions & 0 deletions dist/animations/bounce.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/animations/bounce.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/animations/fade.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { AnimationMetadata } from '@angular/core';
export declare const fade: (timing: string, options: any) => AnimationMetadata[];
Loading