Jump to content
Search Community

Problem filling beer glass

gmw test
Moderator Tag

Go to solution Solved by PointC,

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 simply want to create the effect of beer rising in a Belgian-style shaped glass (as opposed to a rectangular shaped mug). My hope was that all I needed to do was animate the <rect id="beer"> upwards. Bit it looks like since the beer has already been clipped by AI, it isn't going to be quite that simple. Any suggestions? Thanks.

See the Pen aZOOmq by gmw (@gmw) on CodePen

Link to comment
Share on other sites

  • Solution

Hi gmw  :)


Welcome to the GreenSock forums.


I saw your topic title and thought maybe this was a whole different kind of problem.   :-D  


You can fix that by putting the clip-path on a group rather than the rectangle itself. 

<g id="beerWrap" clip-path="url(#SVGID_2_)">
  <rect id="beer" x="27.3" y="72.7"  fill="#FFB241" width="177.6" height="183.8"/>

Here's a fork of your pen with that solution:


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


Hopefully that helps a bit.


Happy tweening.


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