Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
craigib

Rotating a DIV to make a triangle background

Recommended Posts

Hi, I'm trying to achieve a rotating background effect with GSAP, like in this site. http://toyfight.co/ 

 

I'm nearly there or at least I think so. Do I need to use the positioning attribute x & y to get the same effect? I've tried different combinations but just can't get it.

As you can see mine seems to rotate from the top down rather than bottom up. Like in the example website.

See the Pen mjzQxq by craig_codes (@craig_codes) on CodePen

Link to post
Share on other sites

You'll need to set the transformOrigin point. Please give this a try:

 

See the Pen WKYwMj by PointC (@PointC) on CodePen

Hopefully that helps. Happy tweening.

:)

 

  • Like 5
Link to post
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.

×