Jump to content
GreenSock

gmw

Problem filling beer glass

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

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"/>
</g>

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

Perfect! Thank you!

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