Jump to content
Search Community

Trouble w/ an animated SVG Mask

JoseCordova test
Moderator Tag

Recommended Posts

Wrap your masked path in a <g> tag and mask the group.

 

       <g mask="url(#scene-1-bottom-left-to-right-mask)">
         <path  id="scene-1-bottom-left-to-right" d="M2692,2545.51l-5314.76,743" transform="translate(2673.51 2994.97)" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width="100" stroke-dasharray="12.51 12.51" />
       </g>

Just FYI - I cranked the mask and path stroke-width up to 100 so I could see the path. Your viewBox is 9696 x 8277 so a 1.5 unit stroke is almost invisible.

 

My advice is always mask a group rather than individual elements. It will give you far fewer headaches.

 

Happy tweening.

:)

 

  • Like 4
Link to comment
Share on other sites

There are additional lines that I need to mask, but you're right about the viewbox. I'm reducing the size now and seeing if that is a part of my issue. I'll circle back if I still can't resolve it. Again, thanks for your help.

Link to comment
Share on other sites

Good job. 👍

 

Yeah sorry, I didn't mean to abandon you in this thread - I had to jump on a conference call. Masks can be weird like that. We also talked about it in our big SVG Gotchas thread.

I'm glad you got it working. Let us know if you have any additional GSAP related problems or questions and thanks for being a Club member.

 

Happy tweening.

:)

 

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