Giter Club home page Giter Club logo

ember-animatable's Introduction

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

ember-animatable's People

Contributors

bekzod avatar corck avatar ember-tomster avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.