Jump to content
Search Community

scroll trigger svg clip path 😧

choma03 test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Please help me, I can’t find a solution to this problem.

It is necessary to implement an infinite svg so that when scrolling, each subsequent svg inherits the clip path . Now I

only have the first SVG with clip path, the next ones ignore the clip path. help me please))

See the Pen jORqYdO by choma-og (@choma-og) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @choma03 welcome to the forum!

 

Yes you're copying the #country path, but this doesn't inherit the clipPath that is outside of it. If you put your use elements inside the clipPath it already looks more like you want to. The clipPath is what gets cut from the background image. It doesn't draw your path element at all certainly not seeing it is in a <defs> element.

 

I've written a post that explains some gotchas with clipPahts, maks, ect. Maybe interesting for you 

 

 

The animation isn't infinite at the moment, you could check if you could line everything up and then call .restart() on your tween, so that it looks like it is infinate or you could look in to the Seamlessly loop elements along the x-axis, but I don't know if this will work for SVG elements. 

 

Also if this is the effect that needs to happen, just a white image with transparent letters cut out of it would also work and will probably be much easier to handle or look in to  creating transparent text with -webkit-background-clip: text;  -webkit-text-fill-color: transparent; https://cssgradient.io/blog/css-gradient-text/

 

Hope it helps and happy tweening! 

 

See the Pen VwNaQdR?editors=1010 by mvaneijgen (@mvaneijgen) on CodePen

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