chenglou / react-tween-state

React animation.
Other
1.74k stars 70 forks source link

tweening multiple values? #18

Closed adbl closed 9 years ago

adbl commented 9 years ago

Say I want to animate some div from:

transform: translate3d(-100%,0px,0px);
opacity: 0.0

to

transform: translate3d(0%,0px,0px);
opacity: 1.0

and I want them in perfect sync.

Will two consecutive calls to this.tweenState() with the same duration accomplish this? Or is there some other way which I overlooked?

If not, I'll be happy to try a PR with this kind of "batch" support.

chenglou commented 9 years ago

Try it. It should be in perfect sync. If not then it's a bug.

adbl commented 9 years ago

Yes, I'm not sure what I was thinking really...

I guess I felt that there would be some optimization possible by adding several state variables in the same call wrt delay,duration etc. and was looking for such an function. Anyway, thanks for this very useful plugin!

boopathi commented 9 years ago

How do we use % values ? Is it supported ?

boopathi commented 9 years ago

Oops. Figured. You just tween the value and convert it to % while rendering.