Jump to content
Search Community

Issue with "rotate/rotation" property inside of motionPath?

green_machine test
Moderator Tag

Recommended Posts

I often use non-position properties in a motion path, but found a potential bug with the "rotate" property inside of an array of motionPath values. In my CodePen, you can see that using "rotation" works just fine, but when using "rotate", nothing happens. The only different between the two lines other than the selector is the "rotate/rotation" property swapped out.

 

Am I missing something obvious here? I switched to using "rotate" over "rotation" in 3.0 to stay consistent with how I'd write it in CSS, so was curious if I encountered a bug here or if I am messing something up.

See the Pen 8c674b01dc6276a7cc2a7662836e76d2 by dsenneff (@dsenneff) on CodePen

  • Thanks 1
Link to comment
Share on other sites

Yeah, that's because the official GSAP property is "rotation", but when you directly animate things via CSSPlugin it'll accept some aliases too like "rotate" (which internally we just map to "rotation"). MotionPathPlugin wasn't able to do that mapping. I'll update the next version of MotionPathPlugin to look for those aliases too - here's a preview: https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/MotionPathPlugin.min.js

 

Better? 

 

By the way, thanks so much for the reduced test case! Super helpful. 

  • Like 1
Link to comment
Share on other sites

Ah, I gotcha. I misread then; I thought in 3.0 that you meant that you could now use "rotate" across the board in GSAP, which I prefer since it matches CSS now and not AS (and it's also fewer characters). If it means you had to add logic now to convert "rotate" to "rotation" everywhere behind the scenes then no need, I can just go back to using "rotation" instead and keep the library leaner.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...