Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
React+GSAP When using ScrollTrigger with MotionPath on mobile the element starts going back before scroll reaches bottom path

I'm using GSAP on React, making an animation with ScrollTrigger and MotionPath, I need the coin to follow the SVG path scrolling down from start to end and then go back when scrolling up. While the coin is on the path needs to always be on screen (ideally center), until the end and then stop there, only going up again when scrolling up from the bottom. Nothing too special really.

My animation is almost there, but I'm having a problem at the end, the coin starts going back up before you scroll past the bottom of the path, and I need for it to stay there. I think if I set the scroll end to the size of the SVG (4000) then it should work like that, but when I do that the coin starts going faster in the middle and goes offscreen, so in order for it to stay onscreen while scrolling down the path I had to set the end to 7500. I don't know how to make both things work

Here is a codesandbox with what I've been trying, my code so far

https://codesandbox.io/s/dark-fast-bu7bgu?file=/src/App.js&resolutionWidth=526&resolutionHeight=675T

Thank you!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda