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

Add simple easing functions #149

Merged
merged 5 commits into from Dec 27, 2018

Conversation

Bretley
Copy link
Contributor

@Bretley Bretley commented Dec 23, 2018

@bryphe
Progress update:

  1. Test in AnimationTest.re does not actually change any of the other tests, only adds the quadratic one. I went back and checked this twice myself.

  2. oneDimBezier alone is not enough to fully recreate the variety of css easing functions, but I'm 98% certain that a true bezier cubic could be made using [x,y] as a pair of oneDimBezier, then some math, then we can copy every CSS easing function offered.

  3. New PR to get this all off of master and on to a feature branch :)

u0, u3 = 0,1; t in [0,1]
equivalent to a normal bezier curve where p1x = 1/3 and p2x = 2/3
*/
let genOneDimBezierFunc = (u1:float, u2:float) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for setting this up, @Bretley 👍

);

TestTicker.simulateTick(Time.Seconds(0.5));
expect(myAnimation.value.current).toBe(0.25);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks for the test!

examples/Bin.re Outdated
@@ -100,43 +103,6 @@ module AnimatedText = (
)
);

module SimpleButton = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to delete this here, or was it a merge issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryphe this is a merge issue for sure. At the time I was writing this, there was no button in the Bin.re test file. I tried to fetch upstream/master and then merge it with this branch, but git told me this branch was already up-to-date even though this code was missing. Not sure what commands I need to run to fix it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. What I usually do for this is just get the latest, ie git checkout master examples/Bin.re - and then reapply the changes (adding the easing functions). Think that's the easiest way here, but there may be other ways.

Copy link
Member

@bryphe bryphe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had one question around the <SimpleButton /> being deleted - otherwise looks good.

@bryphe
Copy link
Member

bryphe commented Dec 27, 2018

Looks great @Bretley , thank you! Will bring it once the build completes 👍

@bryphe bryphe merged commit 53ecd97 into revery-ui:master Dec 27, 2018
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.

None yet

2 participants