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

Animation API #6

Open
hemanth opened this issue Feb 25, 2015 · 6 comments
Open

Animation API #6

hemanth opened this issue Feb 25, 2015 · 6 comments

Comments

@hemanth
Copy link
Member

hemanth commented Feb 25, 2015

@stoeffel How about animate(animationFunction, element) to use Element#animate?

@stoeffel
Copy link

How would animationFunction look like?

@hemanth
Copy link
Member Author

hemanth commented Feb 25, 2015

Well, something like:

let animationFunction = () => {
  {  animate : [
      {cssProperty: value0},
      {cssProperty: value1},
      {cssProperty: value2},
     ], 
     duration: timeInMs,
     iterations: iterationCount,
     delay: delayValue
  };
};

@stoeffel
Copy link

How about
animate(animationFunction, configFunction, element)

let animationFunction = () => [
      {cssProperty: value0},
      {cssProperty: value1},
      {cssProperty: value2},
     ];
let configFunction = () => {
     duration: timeInMs,
     iterations: iterationCount,
     delay: delayValue
  }

@stoeffel
Copy link

So it would be possible to create a animation like this:

const fancyAnim = animate(fancyStuff);
const fancyAnim2s = fancyAnim(() => { duration: 2000 });
const fancyAnim3s = fancyAnim(() => { duration: 3000 });

fancyAnim2s(element1);
fancyAnim3s(element2);

@hemanth
Copy link
Member Author

hemanth commented Feb 25, 2015

Should be.

@stoeffel
Copy link

👍

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

No branches or pull requests

2 participants