Jump to content
Search Community

SvgDraw Window Resize Issues

Tribius test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

13 minutes ago, Tribius said:

SVG bugging out

What exactly do you mean with this? I've been resizing the browser from big to small and vice versa and I see no issue. Any particular browser version/OS you are looking at?

 

Maybe you have an issue with the default ease of "power1.out" if you set it to "none" it will be more consistent with a scrubbed ScrollTrigger, eg the rate it will grow will be linear for the whole duration. Hope it helps and happy tweening! 

 

See the Pen NWJWXEq?editors=0100 by mvaneijgen (@mvaneijgen) on CodePen

  • Like 2
Link to comment
Share on other sites

16 hours ago, mvaneijgen said:

What exactly do you mean with this? I've been resizing the browser from big to small and vice versa and I see no issue. Any particular browser version/OS you are looking at?

 

 

 

This is what I mean. When the SVG changes height (which it should do since it's supposed to cover the height of a div like you see in my screenshot from the real website) it starts over in the middle. I'm using Chrome.
 

Screenshot 2023-12-23 at 10.27.55.png

Screenshot 2023-12-23 at 10.32.05.png

Link to comment
Share on other sites

Hi,

 

I've been playing with your and Mitchel's demo for a bit and can't seem to reproduce the issue you mention.

 

I tested in the latest Chrome and Firefox on Ubuntu 20 & 22.

 

Maybe I'm missing something or you could give us the steps to reproduce this.

 

Happy Tweening!

Link to comment
Share on other sites

On 12/26/2023 at 9:42 PM, Rodrigo said:

Hi,

 

I've been playing with your and Mitchel's demo for a bit and can't seem to reproduce the issue you mention.

 

I tested in the latest Chrome and Firefox on Ubuntu 20 & 22.

 

Maybe I'm missing something or you could give us the steps to reproduce this.

 

Happy Tweening!

I did a screenrecording to show you the issue. I'm also running the latest Chrome version.

Link to comment
Share on other sites

You've got things set up so that the actual length of the SVG path changes on window resize, thus you need your tween to re-calculate the drawSVG length. I'd recommend doing a .fromTo() so you can control the start/end, and set invalidateOnRefresh: true on your ScrollTrigger: 

See the Pen oNVjdNX?editors=1010 by GreenSock (@GreenSock) on CodePen

 

Is that better? 

  • Like 1
Link to comment
Share on other sites

4 hours ago, GreenSock said:

You've got things set up so that the actual length of the SVG path changes on window resize, thus you need your tween to re-calculate the drawSVG length. I'd recommend doing a .fromTo() so you can control the start/end, and set invalidateOnRefresh: true on your ScrollTrigger: 

 

 

 

Is that better? 

That seemes to remove that issue but now when I resize the window the lines that aren't supposed to be drawn out yet, are. I'll show you in another screenrec:

Link to comment
Share on other sites

  • Solution

Ah yes, that should be fixed in the next release which you can preview at: 

https://assets.codepen.io/16327/gsap-latest-beta.min.js

 

(you may need to clear your cache)

 

As a workaround in the current version, you can just add this to your ScrollTrigger: 

onRefresh: self => self.animation.progress(self.progress)

See the Pen gOEaEoa?editors=1010 by GreenSock (@GreenSock) on CodePen

 

Better? 

  • Like 1
Link to comment
Share on other sites

8 hours ago, GreenSock said:

Ah yes, that should be fixed in the next release which you can preview at: 

https://assets.codepen.io/16327/gsap-latest-beta.min.js

 

(you may need to clear your cache)

 

As a workaround in the current version, you can just add this to your ScrollTrigger: 

onRefresh: self => self.animation.progress(self.progress)

 

 

 

Better? 

Worked like a charm. Thanks a lot you guys, best support there is.

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