Jump to content

PointC last won the day on October 30 2022

PointC had the most liked content!


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by PointC

  1. Probably easier to loop through and give each one its own timeline. https://codepen.io/PointC/pen/BaPyQdg I also used the GSAP utils.toArray method to select the <rect> targets. That way you don't need to manually create an array or give each one its own ID. You can add as many rectangles as you want and it'll still work as the delay is based on the length of the array. I added a few just for fun. Happy tweening.
  2. I'd put that on one timeline and use the latest version of GSAP and the MotionPath plugin so you can use alignOrigin. https://codepen.io/PointC/pen/oNMgzxx I wasn't' sure if it was supposed to scale down again before the loop, but I added it. Happy tweening.
  3. PointC

    Hover animation

    I'd drop the text into a span, make a couple clones with clip-paths and stagger the clones while the original (non-clipped) moves out of view. Maybe something like this. https://codepen.io/PointC/pen/bGKqKGo Happy tweening.
  4. You'll need to up your filter width/height. I used 150% but you can set it to your liking. https://codepen.io/PointC/pen/OJEpzpM/6ac6bf4810ef1c0892f473088e6c6a46 But as @Rodrigo mentioned, I'd recommend restraint with that kind of animation when it's so large. Happy tweening.
  5. 1. attr:{} is the attribute plugin. I'm more in the habit of specifically targeting attributes that way, but in this case, yes - simply using stroke without that wrapper will work just fine. Sometimes a property and an attribute may seem the same but they aren't. A rectangle for example has an x attribute. These 2 lines may appear the same but they are not. One will translate x:100 while the other targets the x attribute. .to("rect", {x:100}) .to("rect", {attr:{x:100}}) If you specifically want to target an attribute, use the attr:{} wrapper. 2. You'll generally switch hyphenated properties to camelCase. So stroke-width becomes strokeWidth. If that's not to your liking you can also use the hyphenated version, but you'll need to use quotes. These two lines are effectively the same. .to("rect", { "stroke-width": 40 }) .to("rect", { strokeWidth: 40 }); 3. You can use GSAP to set a gradient fill with no problem. That will work with or without the attr:{} wrapper. // add a fill this way gsap.set("rect", {attr:{fill:"url(#someGradient)"}}) // inspect the element and you'll find this fill="url(#someGradient)" // add a fill this way gsap.set("rect", {fill:"url(#someGradient)"}) // inspect the element and you'll find this style="fill: url("#someGradient");" 4. I don't know that you could smoothly interpolate between a linear and radial gradient. A crossfade would probably be a better way to go. You can dynamically add stops with JS by creating the element and adding offset/color attributes, but since the gradient isn't rendered, I don't think it would refresh the changes. If you want to go from a couple stops to multiple stops, I'd probably add all the stops at the beginning and just set the color and offset the same on some of them so it will appear to only have two. You can then loop though and target any or all of the stops offsets/colors . I'd also add that animating gradients is pretty intensive so my recommendation would be to use it sparingly. Good luck.
  6. You can target any or all of the stops in your gradient. Here's a fork of my demo you posted above. Instead of a tweening the gradient to a solid fill, I've now tweened it to a new gradient. Happy tweening. https://codepen.io/PointC/pen/RwJWwQQ
  7. You'll want a stroked path for that with a separate arrowhead element. The tricky bit with masks and motionPaths is that Firefox doesn't like them. To get around that you'll most likely need a proxy element that follows the path and set the position of the masked path to the proxy when the animation updates. Here's a quick example. https://codepen.io/PointC/pen/rNKaXEq Some additional reading. https://www.motiontricks.com/svg-calligraphy-handwriting-animation/ https://www.motiontricks.com/adobe-illustrator-path-direction-quick-tip/ https://www.motiontricks.com/svg-masks-and-clippaths/ https://www.motiontricks.com/svg-dashed-line-animation/ Happy tweening.
  8. I'm not really sure what the problem is there, but I just wanted to point out that most of the time, using CSS variables is a much easier way to handle pseudo elements. No CSSRule plugin required. Here's a basic wired-up example. https://codepen.io/PointC/pen/rNpXXWq Hopefully that helps. Happy tweening.
  9. Yes, it's a member plugin. https://greensock.com/club/ Happy tweening.
  10. Use DrawSVG. https://codepen.io/PointC/pen/ExQJPRd/8d978de955d47404422a3c3037dab2ed
  11. I would think a simple stagger from a "random" start point would work just fine. Unless I'm missing something. https://codepen.io/PointC/pen/OJQGyZq/7ba0001b0a0436bece4757570b8b52ca Happy tweening.
  12. What are you trying to randomize? Duration, delay, repeatDelay, level of opacity, repeat count? I'm just not sure what the desired outcome is here. Any more info would be helpful. Thanks.
  13. Hi @Lollibomber Welcome to the forum and thanks for being a Club member. 🎉 I don't think that will work. @GreenSock will correct me if I'm wrong but I believe the Flip plugin is only for CSS properties. You can certainly set that attribute with GSAP and the Attr plugin. MDN docs does list preserveAspectRatio as animatable, but in my experiments, using the SVG built-in <animate> element produces a result that is no different than setting it with GSAP. You can animate the viewBox with GSAP if you like. Happy tweening and welcome aboard.
  14. Of course: Observer 🤦‍♂️ I still don't have the muscle (or brain) memory to reach for that one. Just my two cent opinion from a user perspective but that lucid site always feels odd to me. Like my mouse wheel is slipping or something. You get used to your wheel taking you a certain distance down the page and now you have to spin it twice as much. Again just my 2 cents though. Happy tweening.
  15. I guess you could do something like this: document.addEventListener("wheel", function (e) { e.preventDefault(); gsap.to(window, { scrollTo: "+=" + e.deltaY / 2 }); }); Though I'm not sure how well that would work with ScrollSmoother as it has the fixed wrapper and scrolls the inner content.
  16. Looks good. Use your new powers responsibly. Happy tweening.
  17. Welcome to the forum I'm not really sure what's going on with all your JS, but here's a simplified fork of your pen with a blur filter scrubbed with ScrollTrigger. https://codepen.io/PointC/pen/QWQoxZz/3e7e8e609e92cf29af7b0ea4841049a5 Simplified demos are greatly appreciated with questions. Happy tweening.
  18. Hi @klyvoon Welcome to the forum and thanks for joining Club GreenSock. 🎉 The issue here is an empty clip-path. If you want the yellow morph to reveal text, you'll need to use a duplicate path in the clip-path. I've forked your pen and just used one path to show you how to do it. https://codepen.io/PointC/pen/ExQMRba/1b01743fc6aa3e078c7d3cd2937967f6 A few other things: I'd recommend updating to the GSAP3 syntax. Stagger is a bit different now so be sure to check out that difference. Your pen was loading the latest GSAP, but also a really old TweenMax file. (could cause problems) Hopefully that gets you morphing. If you have other GSAP questions, let us know and we'll get you sorted out. Happy tweening and welcome aboard.
  19. Hi @WolfLTC Welcome to the forum and thanks for being a Club member. 🎉 Are you referring to how far the page scrolls on each mousewheel on that site? If so, I'm not 100% sure, but I'd think you'd need to intercept the wheel event and preventDefault. Then scroll the page as far as you'd like. Happy tweening and welcome aboard.
  20. Time to learn then. This is how I'd set it up. A couple big circles and eight smaller ones. Using svgOrigin we can rotate the small ones into place and use drawSVG to animate the path. This should get you started. https://codepen.io/PointC/pen/xxYBPYP Happy tweening.
  21. You should create your timeline outside of your click handler. All you're doing right now is adding tweens on each click and creating a longer and longer timeline.
  22. Exactly. You wouldn't need to do it with JS. You could also just set a height for the <li> elements and manually set a height for the <ul> in your CSS. The trialWarn:false thing is just for CodePen so you don't see any warnings in the console. Nothing at all to do with the animations. Happy tweening.
  23. Is there any reason you're not using SVG? That would be quite easy with DrawSVG. I'd also recommend using ScrollSmoother. You're a Club member so you already have access to all those awesome plugins. Happy tweening.
  24. Hi @Ves Welcome to the forum. I think I'd wire this up a bit differently. I'd create a timeline and scrub through it rather than add individual triggers to each element. Something like this. https://codepen.io/PointC/pen/BaYbaNb Hopefully that helps. Happy tweening and welcome aboard.
  25. PS I should also mention that our own @Carl is doing a whole summer of SVG training thing. Check out his tweets and website. Here's one showing the basics of Boxy SVG.