Skip to content

[BUG] rotation [0,360] not working the second time #1015

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
Makio64 opened this issue May 24, 2025 · 1 comment
Open

[BUG] rotation [0,360] not working the second time #1015

Makio64 opened this issue May 24, 2025 · 1 comment
Labels

Comments

@Makio64
Copy link

Makio64 commented May 24, 2025

When i do the first animation it rotate well from 0 to 360 but on the second trigger on the same target it goes back and then stop and go to 360 ( so not a clean 0 to 360 rotation ).

Maybe im doing something wrong :

        animate(event.target, {
          rotate: [0,360],
          duration: 300,
          ease: 'inOutQuad',
        })
@Makio64 Makio64 added the bug label May 24, 2025
@juliangarnier
Copy link
Owner

rotate: [0,360], will always rotate from 0 to 360 deg, so if you re-trigger the animation on the same target mid-animation, it will immediately set the target back to 0 and start the animation again to 360.

The following pen showcase the expected behavior: https://codepen.io/juliangarnier/pen/RNPwada

so not a clean 0 to 360 rotation

What do you mean by no so clean ?

Can you provide a minimal reproduction demo of the bug?

You can fork this CodePen template

Thanks!

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

2 participants