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

Use request animation Frame instead of gsap #3

Open
vin-ni opened this issue Dec 4, 2017 · 4 comments
Open

Use request animation Frame instead of gsap #3

vin-ni opened this issue Dec 4, 2017 · 4 comments

Comments

@vin-ni
Copy link
Owner

vin-ni commented Dec 4, 2017

No description provided.

@cristidrg
Copy link

Hi, I'm interested in contributing to this issue. Do you have any insights on this task before jumping on it?

@vin-ni
Copy link
Owner Author

vin-ni commented Dec 4, 2017

Cool!
I built it on gsap, as the project it's used in already uses gsap. But since there is no easing on the animation (just linear progression), it really isn't necessary.

I played around with different easings but decided to use linear for now.

I did some others tests now, and maybe it could still be interesting to use some of gsaps fancy easings. SlowMo for example gives a nice effect.

Maybe the best way would be to keep both. To use plain animationFrame as default, and switch to gsap Easing if an easing is passed via the options.

Basically we need to rewrite this:

this.animation = TweenLite.to(this.calculatedSettings, this.animationSettings.speedIn, {currentDistance:`+=${coloumnsString}`,
onUpdate:this.updateHandlerRunIn, onUpdateParams:[self, true],
onComplete:this.completeHandlerStart, onCompleteParams:[self, callbackMiddle, callbackEnd],
ease: Power0.easeNone});

What do you think?

@cristidrg
Copy link

As you suggested, I believe using rAF as default is right way; I'm not sure if keeping gsap would be that great since it would add additional chunks of code and increase the size of the snippet.

Regarding the easing, there must be a way of implementing them via rAF; however we can look on that after the rewrite.

I'll look into rewriting the animation with rAF and provide fps/perf comparisons between the old and the new.

@vin-ni
Copy link
Owner Author

vin-ni commented Dec 5, 2017

Cool!

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