Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding keyframe animation support #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bitgangsta
Copy link

Hi,

I have added support to your plugin for controlling "keyframe" animations. I'd like to get your feedback before continuing to go any further.

Right now this supports the following:

  1. Applying a "keyframe" animation by name to an element.

    $("#foo").playKeyframe({name: 'bounce-in', duration: 1000});
  2. Pause/play/reset

    $("#foo").pauseKeyframe().resumeKeyframe().resetKeyframe();
  3. Callbacks

    $("#foo").playKeyframe({name: 'bounce-in', duration: 1000}, function() { ... });

I supported your "alternate" style of passing callbacks in as well, as a coffee-script user it makes things much easier to have it in the hash like that. I also tried to follow your code conventions as much as possible. The one exception is that I did not implement a "splat" style method signature. This is because there are a large number of arguments to the keyframe animation call, and it seems unreasonable for the user to have to think about the order or set them in order if they just want to customize a few. I am open to implementing the "splat" style though, if you think it should be there.

I have yet to do two things:

  1. Adding keyframe support. I am not so sure this is 100% necessary off the bat. I think if you're going to build your own animations in JS, why not just chain together transitions and use your existing lib functionality. jQuery nicely handles this via the fx queue. The one downside I can see, however, is that when using keyframe animations, you can get some greater control over easing the entire set of states. With your library, I can control easing for each step, but not a group of steps.
  2. Tests. I will definitely add these if you're interested in this pull request. I assume you'd like them before you accept it.

Note this is sortof related to your issue #3, which mentioned keyframe support.

…-style animations with transit, and retain the ability to control them using jQuery. Presently, a user can add a keyframe animation to an element, remove/reset, and pause/play a currently running animation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant