mdgriffith / elm-animator

A timeline-based animation engine for Elm
https://package.elm-lang.org/packages/mdgriffith/elm-animator/latest/
BSD 3-Clause "New" or "Revised" License
133 stars 14 forks source link

Fix docs for `wrap` #15

Closed stoeffel closed 4 years ago

stoeffel commented 4 years ago

Using 360 instead of (2 * pi) will spin the loader 57 times.

You can try it here https://ellie-app.com/93T5cxxRPbfa1

Additionally, I wasn't expecting that the button would spin back in this example because wrap should end up at 0 right? Is this a bug or expected? How would you perform just one full rotation clockwise without spinning back when changing the state back to False? (let me know if you want me to open an issue)

Thanks for making this awesome library! ❤️

mdgriffith commented 4 years ago

Hey Stoeffel! Glad you're checking it out 😄

🤔 Ah, yeah it probably does make sense to change the docs.

Animator.wrap doesn't care about units, though Animator.Inline.rotate does assume radians. And of course it helps to have all examples using the same stuff.

I like your fix, and I'll also add a note in Animator.Inline.rotate about units.

And yeah, you're right, that reverse spin shouldn't happen, it should already be at 0.

stoeffel commented 4 years ago

Thanks for accepting this PR and for further clarifying the docs!

I really love elm-animator (and elm-ui) so far (building something for my kids). I actually think that these two libraries are a major reason I'd choose elm for any project.