jamesplease / puppets

A modern Backbone extension.
MIT License
4 stars 0 forks source link

Animation extension #18

Open jamesplease opened 9 years ago

jamesplease commented 9 years ago

Animations will be based on css className.

<span class='my-list'></span>

At certain points in the Application, Puppets will add additional classNames to the element in an attempt to see if it begins to animate. For instance, p-enter will be added when a view is being shown, and p-exit for a view that is being exited.

Puppets will intelligently handle the situation that the animation has not been configured, so it should be a pretty seamless experience for developers.

Javascript animations would be registered via:

Puppets.registerAnimation('.my-list', {
  enter(element, done) {},
  exit(element, done) {}
});

Situations that trigger animations:

Puppets.Animate will be a separate library.

* this is based off Angular's implementation of animations, which I think is pretty baller