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

convert cubicBezier & steps easings #8

Open
2 of 4 tasks
cameralibre opened this issue Nov 26, 2020 · 2 comments
Open
2 of 4 tasks

convert cubicBezier & steps easings #8

cameralibre opened this issue Nov 26, 2020 · 2 comments
Labels

Comments

@cameralibre
Copy link
Collaborator

Anime.js provides multiple types of easings.

Some types of anime.js easings are now being converted to CSS ( #2 ):

  • linear ➡️ linear
  • Penner's equations (easeInQuad, easeOutCirc, easeInOutQuart etc) ➡️ cubic-bezier() equivalents

Some types of easing will not work in CSS, so I can't support them:

❎️ easeInElastic, easeOutBounce etc
❎️ spring equations
❎️ custom easing functions

Some types should be quite straightforward to convert, as they are based upon CSS themselves:

  • cubicBezier() ➡️ cubic-bezier()
  • steps() ➡️ steps()
@cameralibre
Copy link
Collaborator Author

Some types should be quite straightforward to convert, as they are based upon CSS themselves:

  • cubicBezier()➡️ cubic-bezier()

Actually this is not straightforward at all, or at least, I can't use the same lookup table approach - there is a small, finite number of Penner's easings, so each one will create a unique fingerprint when run on two values (0.2 & 0.7), and I can be sure that all are covered by hardcoding them in the script.

cubic-bezier() however, has a theoretically infinite number of variations, and I don't think that just two data points will describe the whole curve.

@cameralibre
Copy link
Collaborator Author

It might be worth exploring bezier.js to see if it can get control points from given points on a curve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant