Jump to content
Search Community

ryan_labar

Moderators
  • Posts

    50
  • Joined

  • Last visited

Posts posted by ryan_labar

  1. There's two approaches for this. The path of least math would be to use FLIP https://gsap.com/docs/v3/Plugins/Flip/, having your target container set at 500vw (seeing as your target white space is 1/5 the width of the SVG) (for mobile devices you could set a breakpoint for portrait mode). The other approach would be to calculate the amount it needs to scale based on viewport width... The math would look something like: (window.innerWidth / svgElement.offsetWidth) * 5. Note that this would need to be recalculated on each screen resize. (Also note you may need to re-math this for mobile devices.)

    • Like 1
  2. Most fonts have different widths for each character, which will cause the text to change widths as the characters change. A Monospace typeface will is the easiest fix for this: most font libraries have a filter for this if you need something more custom, but you can use your system's default by this to your CSS:

    font-family: monospace;

    • Like 1
  3. 2 hours ago, n00bie said:

    I would like for when my horizontal scrolling section is done scrolling, to have enough time to see the "GSAP Left to Right" section's animations. If I scroll super slowly I can see them, however if I scroll very fast I can't. Any idea on how to solve this? Thanks!

    scrub: true is one way to solve this. You'll loose the smoothing effect, but it'll tie the animation directly to the scroll, otherwise it's taking .8s for the animation to catch up, and if you scroll too fast, you're missing the end.

     

    2 hours ago, n00bie said:

    Also, any way to have my "Item 7" to show up inside the container, depending on the resolution it's not always fully visible

    Your math isn't accounting for the 64px gap. You'll want your math to be: (offerItems[0].offsetWidth * offerItems.length) - (64 * (offerItems.length - 1))

    • Like 2
  4. Please avoid @-ing specific moderators, as it's rather impolite. I'm not seeing a button on your website's example, and your CodePen still isn't properly linking the the distortion image, but I'm assuming you're looking to improve the distortion effect on the '0' in '404', is that correct?

    It would be easier for us to help debug this if you updated your CodePen with the actual effect you're looking for—my guess is that the differences you're seeing in the effect are due to timing, scale, and that your image has a solid fill rather than an outline, but without a codepen properly showing this it's rather difficult to debug.

  5. You look to be on the right track. You'll want to make sure, in your useEffect, that TL exists (I didn't have a chance to fork your demo, so I'm shooting slightly in the dark) with  if (!tl.current) return;--this should, hopfully get rid of your console errors on load.

    And also your play reverse code could be improved to something like: showMenu ? tl.current.play() : tl.current.reverse()

×
×
  • Create New...