Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

ZachSaucier last won the day on November 12

ZachSaucier had the most liked content!

ZachSaucier

Administrators
  • Content Count

    895
  • Joined

  • Last visited

  • Days Won

    23

ZachSaucier last won the day on November 12

ZachSaucier had the most liked content!

Community Reputation

1,202 Superhero

7 Followers

About ZachSaucier

  • Rank
    Advanced Member

Contact Methods

Profile Information

  • Gender
    Male
  • Location
    USA
  • Interests
    Frontend development, soccer, board games, theology

Recent Profile Visitors

3,108 profile views
  1. The repo is private until the next version is released. Maybe Jack can send you a copy? Tomorrow is Sunday for us so he might not be as available as usual.
  2. First off, where the heck did you get that curve from? That's an insane amount of points for a shape so simple, haha. The main difficulty is setting up your SVG correctly. So you should go ahead and recreate the exact shape that you need. To create a fade like that you could create two ovals (probably using <ellipse>s), one with the blueish color fill and one with a white fill (or whatever the background color is going to be). Then offset the white one, maybe adjust its height, and make sure it's on top. Once you have that, then create a path that goes around all of the visible (blue) area. You can do that by duplicating the blue oval and then converting it to a path. GSAP's MorphSVG has that conversion functionality built in. Make sure that it has a thick enough stroke-width to cover the blue in all sections. If you constructed your SVG like I described, then you don't even have to turn the path into a mask, you can just leave the stroke as white. Thus in your SVG you shouldn't see anything because the white oval and path with stroke should be covering your blue part. But if you delete the path with stroke you should see the shape that you have above. Then in your JS you can use drawSVG on the path with stroke to hide it, i.e. something like TweenLite.to("#pathWithStroke", 1, { drawSVG: 0}); or in GSAP 3 gsap.to("#pathWithStroke", { duration: 1, drawSVG: 0});. And voilà! You will have the animation that you need. Here's a really rough implementation of it. https://codepen.io/GreenSock/pen/BaaGvqW If you need help animating it from a certain point see this thread, but hopefully you create your SVG in such a way that this isn't necessary
  3. Can confirm this bug @GreenSock. Thanks for posting Jon.
  4. I really don't understand what you're trying to do here Some notes about your code though: It's good to use gsap.timeline instead of new TimelineMax. GSAP's delayedCall is more reliable than a setTimeout. If all you have is one tween within a timeline there's usually not much of a point of adding it to a timeline. You can assign the ID to the tween if you'd like and it'd work the same way. You have gsap.set(source, {...target}) but target is already an object so you could just do gsap.set(source, target) if you want. I'm glad you got it working for your needs!
  5. We moved it into the vars parameter so that it can be used with defaults/inheritance. The v2 syntax may not be supported whenever GSAP eventually moves on to v4. Maybe passing in specific values to the clearProps would be viable?
  6. Hey Shakespeare and welcome. You can do this sort of thing by animating a mask. The thread below gives more info on how to do it: Let us know if you need more help!
  7. Or kill the animation and start the new version right where they were when it stopped? AFAIK, without modification to how timelines work, yes. Timelines are meant to be set so they can be seeked through forwards and backwards. Otherwise you should be using chained tweens.
  8. If they change the window size, you should kill the old timeline and create a new one with the correct values.
  9. I understand that is your setup. I don't understand why you can't use one of the approaches that I've outlines in the posts above.
  10. Can you just put the function call in the fromTo's onComplete? https://codepen.io/GreenSock/pen/rNNQGva?editors=0010
  11. Hey PinzOne and welcome to the forums! We're so glad that the forums have been able to help you without the need of posting I think it'd be helpful to see a basic demo of your setup. But using onComplete to create a new random animation is likely what you need to do. It's just hard to give more info past that without a demo
  12. It's hard to say without the ability to see it for ourselves. Guessing somewhat blindly, it could be because the overwrite property has a different default in GSAP3. In GSAP 2 it was "auto" by default but in GSAP 3 it's false. You can test it by putting gsap.defaults({overwrite:"auto"}); to the top of your script. Side note, it's good to put the duration inside of the vars parameter.
  13. Hey Sichtweise and welcome to the GreenSock forums. A few notes: I recommend GSAP's delayedCall over a setTimeout for the increased reliability. I personally prefer using GSAP's .set() over jQuery's .css() (jQuery is not really necessary too helpful in most projects these days) but you can use whichever. In GSAP 3 you should be using gsap.timeline instead of TimelineMax. The duration should go in the vars parameter in GSAP 3. Now to the core of your question: Why does it fire twice? You can figure it out yourself by console.logging the values of window.scrollY, scrollYOld, and complete inside of your function that checks whether or not to run your animation. You will notice that both times window.scrollY != scrollYOld. This is because in your logic you are updating scrollYOld as soon as you run the animation instead of after the last update to the scroll position. So if you update scrollYOld inside of your onComplete (like where you update complete) it will work as you want it to. https://codepen.io/GreenSock/pen/gOOQmxr?editors=0010
  14. Hey Jon, a couple things are going on here. First, you have a timeline with no duration. You only have .set() and .call() in it, so it has no duration and GSAP is likely to not play it (why use a timeline for that if you can just do it without a timeline? @GreenSock the same issue popped up again). Second, tweens and timelines run on the next animation frame. calls like console.log('setMe:',setMe); run immediately. So there's a (good) chance in your setup that the console.log runs before the first requestAnimationFrame call of the timeline, thus the values are not as you'd expect. You can remedy these issues by adding an empty tween to your timeline (so that the timeline has a duration) and putting the console.log inside of a requestAnimationFrame call: https://codepen.io/GreenSock/pen/wvvQJKW?editors=0010
  15. That's a good suggestion and we hope to be able to do it without having to manually keep the two duplicate pages in sync soon. Thanks for the suggestions!
×