chenglou / react-tween-state

React animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tweening multiple values?

adbl opened this issue · comments

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.

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

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!

How do we use % values ? Is it supported ?

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