Jump to content
Search Community

Rotation doesnt work before translate

artstyle test
Moderator Tag

Go to solution Solved by mikel,

Recommended Posts

Hello!  i have a code like this 

tl_portfolio1.to(".portfolio1", {rotate:-5, x:-570, y:105, duration:0.1})
  .to(".portfolio2",{rotate:-5, x:570, y:105, duration:0.1},"<");


but when it renders it looks like this transform: translate(570px, 105px) rotate(-5deg) scale(1.00001);

so the rotation applies after translate. i want it work firstly. why it doesnt work?

Link to comment
Share on other sites

i dont need 2 different translations. i need to change the order of the translatons. when the page rendered in the dev tools i see 

<div class="portfolio1" style="transform: translate(-100px, 15px) rotate(-5deg) scale(1.00001, 1.00001);">
          </div>

the animations looks broken because of translating then rotating. i want to swap them. gsap.set is not working

Link to comment
Share on other sites

5 hours ago, artstyle said:

the animations looks broken because of translating then rotating. i want to swap them. gsap.set is not working

One of the strengths of GSAP is the fact that it delivers CONSISTENCY with transforms, always rendering them in the same order. That allows you to independently control each component (almost impossible with CSS). Trust me, this is a GOOD thing. It's not a bug. 

 

We also strongly recommend setting all your transforms via GSAP for maximum speed and accuracy which we explain here

 

In the vast majority of cases, there are much cleaner workarounds to getting the effect that people THINK they need the non-standard order-of-operation transforms to accomplish, like @mikel showed. If you really, really need transforms in a different order there are solutions for that, like using a proxy object and animating a complex string. I'll spare you the lengthy explanation unless you request it :)

 

Happy tweening!

  • Like 4
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...