Jump to content
GreenSock

PointC last won the day on May 26

PointC had the most liked content!

PointC

Moderators
  • Posts

    5,074
  • Joined

  • Last visited

  • Days Won

    411

Everything posted by PointC

  1. If you want a total of 3 seconds for all elements, you'd take your duration (let's say 1 for this example) and subtract that from your desired total duration. That leaves you with 2 for your stagger amount. You'd then write: gsap.to(yourtargets, { duration: 1, yourProperty: xx, stagger: { amount: 2 } }); Using that method, you could change from 3 to 20 targets and the duration would still be 3 seconds as GSAP will calculate the stagger for each target based on your total amount. Happy staggering.
  2. I'd recommend investing in a Club GreenSock membership so you have access to SplitText. Makes this animation fairly easy. Split into chars. Grab the innerText and place it into 2 identical divs in each char div Set parent char div overflow to hidden Move the clone yPercent -100 or 100 depending on odd/even in the array Animate the 2 child divs yPercent +=100 or -=100 again depending on odd/even in the array Set tween repeat to your liking Place the tweens on a parent timeline (optional) and animate the progress Each column is its own tween so you can randomize or offset the times a bit if you need a more organic feel. Always lots of options with GSAP. https://codepen.io/PointC/pen/ZEmOKvP Happy tweening.
  3. Getting things to animate at the same time involves the position property. I see you're adding some labels but I'm not seeing multiple tweens using the same label unless I missed something in your code. If I'm panning and zooming around an SVG, I usually reach for the viewBox. I find it easier to art direct those types of animations with this technique. I have a tutorial here: https://www.motiontricks.com/basic-svg-viewbox-animation/ https://codepen.io/PointC/pen/abddXBR/bc5bb5c85338b629f3106a89585d02c9 A couple other older demos showing various ways to use the viewBox to animate. https://codepen.io/PointC/pen/OMabPa https://codepen.io/PointC/pen/wvpObWa https://codepen.io/PointC/pen/LmOvEQ Hopefully that points you in the right direction. Happy tweening.
  4. Just modify your start/end percentages: https://codepen.io/PointC/pen/qBJzeYJ/892842f1056c3bd18093804305c0d32c Happy tweening.
  5. Here's a quick demo with a loop through the targets and creating a simple timeline for each. Then we add the enter/leave listener to play/reverse the timeline on hover. https://codepen.io/PointC/pen/rNqbOxm Happy tweening.
  6. In addition to @Rodrigo's sound advice, I'd add that you don't really need to worry about initial values with hover animations. You'd generally just create a tween or timeline and play/reverse on hover in/out. Thanks for being a Club member and welcome to the forum.
  7. When you're clipping an H1 separate from the SVG, I'd recommend just using a container div for the H1 and setting overflow to hidden. Something like this: https://codepen.io/PointC/pen/EMOwaO Just a few other notes: You could save a lot of JS if you apply a common class or select an array of groups to apply your autoAlpha set(). Currently you have 20 identical set() tweens in a row. I'm not sure setting the autoAlpha:1 is necessary as that would be its default state. No need for <body> tags in the HTML panel of CodePen You can load scripts via the little gear icon on the JS panel rather than pasting the script tags in the HTML panel Happy tweening.
  8. You'd really need to boil that down to a minimal demo and have a GSAP related question for us to answer. We just don't have the bandwidth to look through entire projects and 3rd party libraries. Just FYI - looks like you're loading a really old version of TweenMax (1.20.3) I'd strongly recommend using the latest GSAP version (3.11.5) If you have a specific GSAP related question, we're happy to help. Best of luck with your project.
  9. Yep - the relative value on each iteration is the culprit here. There are a few ways to solve it, but I think the easiest is just to set the lines back to 0 after they fade out. Add this to the end of the timeline in the clearData() function and you'll be good to go. You also won't need relative y values on the tweens in that function with this change. Just y:20 will work perfectly. tl.set("#para-long-line, #para-short-line", { y: 0}); Happy tweening.
  10. I'm not quite sure I follow. So the lines are supposed to only move on the first tween? Is that after the morph? If you can clarify the desired outcome a bit, I'll try to point you in the right direction. Thanks.
  11. Since the morph already happened on the first tween of the timeline, it appears nothing is morphing for tweens 2 & 3. Easiest solution is to use a .fromto() tween rather than a .to() tween. https://codepen.io/PointC/pen/Jjmzdxp/6382a2db1d9550ba86e6e33f3f318b9a Happy tweening.
  12. I'm not quite sure what you're trying to accomplish with the infinite repeats on some of the tweens, but this thread may offer some helpful info too.
  13. Sounds like a good use case for clamp() https://codepen.io/PointC/pen/dygQaPj/da853be09052e3296cc321b566e75353
  14. Looks like they have a waves section with two SVGs in it and then they animate the wave container div along the x axis. You can inspect the CSS to see how they've lined up the images. There are multiple ways to go about it. x translation, morphing, animate individual points of the wave. All can work. You would just use the same fill color for the waves as the next section of the page and it'll look like the waves are along the top of it. There are many wave animation threads around the forum. Here's one to get you started.
  15. I'm not seeing anything move to the left. It all looks correct to me. Just my two cent approach, but for little arcs and circles, I like to use type:rotation for these types of interactions. Here are a few examples from a Motion Tricks tutorial that never got published. Maybe they will give you some ideas too. https://codepen.io/PointC/pen/dyggEJE https://codepen.io/PointC/pen/NWOOVYd https://codepen.io/PointC/pen/rNqqgvK Happy dragging.
  16. PointC

    SVG Masking

    There are a bunch of videos on YouTube to teach you how to use SVG masks. https://www.youtube.com/results?search_query=svg+masking
  17. PointC

    Draggable hit wall

    You're looking for collision detection. There are several threads about the topic around the forum. Here are a few to get you started.
  18. y transforms with the element you're using as the trigger can be a little confusing. Especially with two ScrollTriggers on the same element. IMHO it would probably be easiest to use a parent element around your .events and use that as the trigger. That way you're not animating the actual trigger element. Something like this should work. https://codepen.io/PointC/pen/VwEGVLK Hopefully that helps. Happy tweening.
  19. No - there isn't a tutorial video, but searching YouTube should give you plenty of options. https://www.youtube.com/results?search_query=svg+clip-path
  20. Sounds like you're looking for these: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute https://developer.mozilla.org/en-US/docs/Web/API/Element/classList https://developer.mozilla.org/en-US/docs/Web/API/Element/className
  21. I'm not sure I follow the question, but it sounds like you may be looking for the the isInViewport() method. https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.isInViewport() If not, a minimal demo would be helpful. Thanks.
  22. 1. Yes - that's usually accomplished with overflow:hidden. 2. Yes - but remember zIndex only applies to positioned elements.
  23. Sorry - what do you mean a video? Like a tutorial?
  24. Here's something similar from my demos: https://codepen.io/PointC/pen/MWwqrjO Notice the two lines move at the same time as the clip-path reveal. That's how you'll get the same reveal effect from your video.
  25. Glad you got it sorted. Just FYI - I think there were two issues. One was the FOUC. The other was starting the lines at "50% 50%". The former is easily fixed with a quick autoAlpha. The latter may not be so obvious. You were seeing the "dots" of each line at 50/50 because the stroke-linecap is set to round. If you need to start at 50/50 like that, you need simply add a quick scale tween before the stroke animates. Something like this: https://codepen.io/PointC/pen/YzJjMyJ/e9a42d9c21dac238ab76c0bd4d36e524 Hopefully that makes sense. Happy tweening and thanks again for being a Club member.
×