Jump to content
Search Community

Is it Possible to Rotate a Gradient Object in the Timeline?

kaiijuu test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

I am working on a project where I have the gradient object displayed horizontally, but I need to rotate it in the final frame to vertically (so 90 degrees, I believe?)
 

I tried using this kind of syntax(?) and it didn't work:

 

TweenMax.to(g1.el, (css:x:90});

TweenMax.to(g1.el, {attr:{gradientTransform:'rotate(90)'}});

m.tmln.to(g1, {attr:{gradientTransform:'rotate(90)'}});

 

This is the gradient object for reference:
 

g1 = m.construct('grdnt', {
    stops:[
      {offset:0, color:'#e60e64'},
      {offset:1, color:'#572c60'},
    ]
  });

 

Any help would be greatly appreciated! I hope it makes sense!

😇

See the Pen XWpaOqq by kaiijuuu (@kaiijuuu) on CodePen

Link to comment
Share on other sites

Hi Kaijuu!

Is this gradient an SVG gradient? If so the gradientTransform syntax looks correct if you're targeting the gradient element.

 

Maybe you could you rotate the element the gradient is applied to instead?
 

gsap.to(element, {transform:'rotate(90)'});


If it isn't SVG or this isn't helpful, would you be able to attach a minimal demo so we can help you more effectively?

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