Jump to content
Search Community

Quircky behaviour of SVG image

jellevrswk test
Moderator Tag

Go to solution Solved by Diaco,

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

For a school assignment I have to make blinking eyes using GS. I figured that If a make an SVG image with seperate eyelids I could use ScaleY to enlarge the eyelids and give the illusion that they're blinking. But for some reason the lower eyelids are acting strange and moving to different location while they're not told to.

I hope anyone can tell me what I'm doing wrong and explain what to do.

See the Pen EVOZom?editors=001 by jellevrswk (@jellevrswk) on CodePen

Link to comment
Share on other sites

Hello jellevrswk, and Welcome to the GreenSock Forum!

 

I'm not near my computer right now.

 

But have a look at this codepen example for blinking eyes:

 

See the Pen dYwLXK by jonathan (@jonathan) on CodePen

 

You can probably just grab the blinking bits and integrate into your scene. You might have to adjust the SVG lid polygon points attribute so you get the right dimensions and position. And change the eye lid fill color to black. But its a good starting point.

 

:)

  • Like 4
Link to comment
Share on other sites

  • Solution

Hi jellevrswk  :)

 

in addition to Jonathan's advice :

 

the problem come from your SVG ( your SVG already has transforms )

 

pls check Jack's answer and detailed explanation here : http://greensock.com/forums/topic/12732-svg-tweenmaxto-animation-distorts-initial-scale-and-transform-values/

 

btw , you can fix your svg issues with this online tool : https://jakearchibald.github.io/svgomg/

paste your svg in " Paste markup " field and don't forget to turn off the " Clean IDs " in options menu 

 

your demo with fixed svg : 

See the Pen gaZJzg by anon (@anon) on CodePen

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