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

Enhancement: Allow the ability to define things like translate with a function. #35

Open
andremalkine opened this issue Aug 17, 2015 · 2 comments

Comments

@andremalkine
Copy link

This would allow the animator to do things such as take measurements at the point in time when an animation actually takes place. Example:

element1.animate({
  translate: function() {
    return [ 0, element2.state.translate[1], 0 ];
  },
  duration: 1000,
  delay: 3000
});
@lvivski
Copy link
Owner

lvivski commented Aug 17, 2015

Do you expect this function to be called on each frame calculation? I can see that to be useful when you want to calculate next state based on previous state. It would require some major refactoring, but can definitely be implemented.

There are some major changes coming soon, like animating arbitrary CSS properties (incl. color, background-color, etc) and more.

@andremalkine
Copy link
Author

I suppose I was not thinking that it would be called on every loop, which would cause element1 to "track" element2. I was thinking only about the moment in which a given animation starts, after it's delay is complete but before it's duration begins, so it could set a "target" based on the current state of the world at that time.

It's possible I'm thinking too abstractly about this, as timelines are pretty complex I'm guessing.

Glad to hear about the enhancements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants