Skip to content

Add css-ease-approx #7

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add css-ease-approx #7

wants to merge 4 commits into from

Conversation

axyz
Copy link

@axyz axyz commented Jul 8, 2017

Hi,
I've found this css ease (cubic-bezier(.25,.1,.25,1)) approximation.
source: https://github.com/mietek/ease-tween/blob/master/src/index.js#L26

I think it is a nice to have in order to be able to reproduce most of the css transition default easing in pure JS.
Of course for a 1:1 matching would be probably better to use https://github.com/gre/bezier-easing
but in most use cases the often more lightweight mathematically perfect alternative will probably be close enough.

This is the opposite case: an exponential approximation of the cubic-bezier result used by default on css, I didn't found a possible "original" curve that cubic-bezier(.25,.1,.25,1) may be trying to approximate, but if you have more knowledge on the topic or you have better ideas to get similar results being light on the CPU please let me know.

@axyz axyz changed the title Patch 1 Add css-ease-approx Jul 8, 2017
@sylvesteraswin
Copy link

+1

1 similar comment
@ytanruengsri
Copy link

+1

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

Successfully merging this pull request may close these issues.

3 participants