Jump to content
Search Community

Create box with unequal sides

sarahann test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I am trying to create a rectangle with 4 unequal sides (a quadrilateral) that looks like this:

image.png.c20406c3b0ce9156d6ebba71b6eb589c.png

 

Then eventually animate the corners slightly so the box has some movement. 

 

Any suggestions? I can't seem to find anything in the docs. All I can seem to find is how to expand the size of the box, or translate it.

See the Pen ajXBYq by sarahannnicholson (@sarahannnicholson) on CodePen

Link to comment
Share on other sites

You really can't make a quad like that with HTML, let alone animate it.

 

You should look into SVG. Here's a good place to start.

http://tutorials.jenkov.com/svg/index.html

 

Really simple example of animating a <polygon>

 

See the Pen oMmYPa by osublake (@osublake) on CodePen

 

 

 

This post shows another way to animate a <polygon>. It's more advanced, but allows you to animate each corner independently.

 

 

 

See the Pen gvBvjZ by osublake (@osublake) on CodePen

 

 

 

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