项目作者: KamilPuczka

项目描述 :
Angular wrapper for animate-css-grid
高级语言: TypeScript
项目地址: git://github.com/KamilPuczka/ngx-animate-css-grid.git
创建时间: 2019-12-18T18:57:38Z
项目社区:https://github.com/KamilPuczka/ngx-animate-css-grid

开源协议:MIT License

下载


NgxAnimateCssGrid

Angular wrapper for animate-css-grid

Installing and usage

  1. npm install --save animate-css-grid
  2. npm install --save ngx-animate-css-grid

Usage

Load the module for your app

  1. import { NgxAnimateCssGridModule } from 'ngx-animate-css-grid';
  2. @NgModule({
  3. ...
  4. imports: [
  5. ...
  6. NgxAnimateCssGridModule
  7. ]
  8. })

Use directive in you component template

  1. <!-- grid class -->
  2. <ul class="some-grid-class-that-changes" ngxAnimateCssGrid>
  3. <li class="grid-item">
  4. <!-- each grid item must have a single direct child -->
  5. <div>
  6. <h3>Item title</h3>
  7. <div>Item body</div>
  8. </div>
  9. </li>
  10. <div>

You can provide optional config and listen to events:

  1. <!-- grid class -->
  2. <ul class="some-grid-class-that-changes" [ngxAnimateCssGrid]="config" (onStart)="onStart($event)" (onEnd)="onEnd($event)">
  3. <li class="grid-item">
  4. <!-- each grid item must have a single direct child -->
  5. <div>
  6. <h3>Item title</h3>
  7. <div>Item body</div>
  8. </div>
  9. </li>
  10. <div>

Available configuration options:

  1. {
  2. // int: default is 0 ms
  3. stagger: 100,
  4. // int: default is 250 ms
  5. duration: 500
  6. // string: default is 'easeInOut'
  7. easing: 'backInOut',
  8. }

Events

  1. (onStart) // called with list of HTMLElements about to animate
  2. (onEnd) // called with list of HTMLElements that just finished animating

Helper functions available through the directive reference

  1. forceGridAnimation() // use it to force update after inline style changes
  2. unwrapGrid() // remove animations but not the grid itself

For more detailed documentation with all the supported options see: animate-css-grid