GitXplorerGitXplorer
b

ember-animatable

public
6 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
c2735e9ef1bb12ecd374c6f6c4ef84934efa40e4

readme update

bbekzod committed 9 years ago
Unverified
1d6994fc3f0ae10a82c684b05702591fb61b12c5

dependencies update

bbekzod committed 9 years ago
Unverified
fe6c689a9da77e53fbd8218f52dfed12750a2311

changed animate arguments position

bbekzod committed 9 years ago
Unverified
6ffeeff71047c486e1caaf5388acf9ac821e04db

exposing animate function

bbekzod committed 9 years ago
Unverified
5cb0f2c05827fcc4d55b166f925687c6eea0809d

exposing

bbekzod committed 9 years ago
Unverified
14baf9db130b1b93fb0c27676700300b6cc944c0

Merge branch 'master' of https://github.com/bekzod/ember-animatable

bbekzod committed 9 years ago

README

The README file for this repository.

ember-animatable Ember Observer Score npm version

Ember Mixin which provides convenient way using animate.css animations in components. Demo

Mixin Method

  • animate(animationType:string, animationTarget:string): promise
    animationType: animation type bounce, full list can be found here
    animationTarget: css selector .class-name (optional if not provided component is the target)
    returns: promise which is resolved when animation finishes

Standalone Function

  • animate(animationTarget:string/element, animationType:string): promise
    animationTarget: css selector .class-name animationType: animation type bounce, full list can be found here
    returns: promise which is resolved when animation finishes

Import as mixin

import Ember from 'ember';
import AnimatableMixin from 'ember-animatable';

export default Ember.Component.extend(AnimatableMixin, {
    click() {
      let anim = this.animate('pulse', '.animation-target');
      anim.then(function() {
        console.log('animation complete')
      });
    }
});

Import as function

import Ember from 'ember';
import { animate } from 'ember-animatable';

export default Ember.Component.extend({
    click() {
      let anim = animate('.animation-target', 'pulse');
      anim.then(function() {
        console.log('animation complete')
      });
    }
});

Use what you need

By default addon will import all css animations provided by animate.css, but usually you don't need all css animations, so you can specify which once to import in app config.

 let app = new EmberApp(defaults, {
  'ember-animatable': {
    include: ['pulse', 'bounceIn'] // pulse and bounceIn animation will be imported
  }
});

Installation

  ember install ember-animatable