npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-animation-box

v0.0.8

Published

A scriptable animation box for Ember.js

Downloads

23

Readme

npm version Build Status

ember-animation-box

For most your Ember animation needs, you should turn to liquid-fire. ember-animation-box provides a much more limited feature set, but also a more dynamic API. You can pass transitions into it at runtime, rather than having to hard-code them into a transitions.js file. For most web applications, liquid-fire is the safer choice, but we needed something a little more flexible for the Affinity Engine game engine.

Installation

ember install ember-animation-box

Usage

The ember-animation-box should wrap the content you want to animate:

{{#ember-animation-box transitions=transitions animationAdapter="velocity"}}
  <h1>My Html</h1>
  {{my-component}}
{{/ember-animation-box}}

animationAdapter

The animationAdapter let's you specify which animation library this box should use. It defaults to using jquery, which won't actually animate the transitions. (It simply changes the css values.) The only other adapter build-in to ember-animation-box is 'velocity', which uses Velocity.js. You'll still need to include Velocity in your repo to use it, perhaps through the ember-cli-velocity addon.

transitions

The transitions param should be an Ember.A of transition objects. Currently, ember-animation-box supports three types of transitions:

Standard Transitions

{
  duration: 100, // in millliseconds
  otherOptions: 'foobar',
  effect: {
    opacity: 0.7
    width: '50px'
  }
}

The standard transition contains an effect object, which has an array of css attributes/values. Outside of the effect object you can pass in additional options supported by your animation library, such as duration.

Cross Fade

{
  crossFade: {
    cb() {
      . . . .
    },
    in: {
      duration: 500,
      effect: {
        opacity: 1
      }
    },
    out {
      duration: 250,
      effect: {
        opacity: 0
      }
    }
  }
}

If the transition contains a crossFade object, then it'll clone the current content of your animation box and perform the out transition on it. It'll also executes cb before performing the in animation, which is the ideal time to change the content of your animation box so that the new content appears to transition in.

Delay

{
  duration: 100
}

To get a simple delay before the next transition, provide a transition without an effect or crossFade object.

AnimatableMixin

Alternatively, you can apply the AnimatableMixin directly to a component, which will make it expose the same API as the ember-animation-box. The one limitation of this approach is that it cannot crossfade:

import Ember from 'ember';
import { AnimatableMixin } from 'ember-animation-box';

export default Ember.Component.extend(AnimatableMixin, {
  . . . .
});