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

Length Unit mixing fails #62

Open
Natim opened this issue Jul 25, 2018 · 1 comment
Open

Length Unit mixing fails #62

Natim opened this issue Jul 25, 2018 · 1 comment

Comments

@Natim
Copy link

Natim commented Jul 25, 2018

If you try to do the following:

Animation.style [ Animation.top (percent 100) ]
    |> Animation.interrupt  [ Animation.to [ Animation.top (px -200) ] ]

Note the (px -200)

It actually goes to (percent -200)

@Natim Natim changed the title Unit mixing fails Length Unit mixing fails Jul 25, 2018
@Natim Natim changed the title Length Unit mixing fails Lenght Unit mixing fails Jul 25, 2018
@Natim Natim changed the title Lenght Unit mixing fails Length Unit mixing fails Jul 25, 2018
@Natim
Copy link
Author

Natim commented Jul 25, 2018

In this case the solution I had in mind was to go to 0% and then switch to pixels.

But then you need a way to guess how many pixels might your 15% be.

            Animation.style [ Animation.top (percent 100) ]
                |> Animation.interrupt
                    [ Animation.loop
                        [ Animation.toWith (Animation.speed { perSecond = 15 })
                            [ Animation.top (percent 0) ]
                        , Animation.set [ Animation.top (px 0) ]
                        , Animation.toWith (Animation.speed { perSecond = 150 })
                            [ Animation.top (px -250) ]
                        , Animation.set [ Animation.top (percent 100) ]
                        ]
                    ]

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

No branches or pull requests

1 participant