Jump to content
Search Community

GSAP Helper last won the day on January 1

GSAP Helper had the most liked content!

GSAP Helper

Moderators
  • Posts

    0
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by GSAP Helper

  1. Hi there! I see you're using React -

    Proper cleanup is very important with frameworks, but especially with React. React 18 runs in strict mode locally by default which causes your useEffect() and useLayoutEffect() to get called TWICE.

     

    Since GSAP 3.12, we have the useGSAP() hook (the NPM package is here) that simplifies creating and cleaning up animations in React (including Next, Remix, etc). It's a drop-in replacement for useEffect()/useLayoutEffect(). All the GSAP-related objects (animations, ScrollTriggers, etc.) created while the function executes get collected and then reverted when the hook gets torn down.

     

    Here is how it works:

    const container = useRef(); // the root level element of your component (for scoping selector text which is optional)
    
    useGSAP(() => {
      // gsap code here...
    }, { dependencies: [endX], scope: container }); // config object offers maximum flexibility

    Or if you prefer, you can use the same method signature as useEffect():

    useGSAP(() => {
      // gsap code here...
    }, [endX]); // simple dependency Array setup like useEffect()

    This pattern follows React's best practices.

     

    We strongly recommend reading the React guide we've put together at https://gsap.com/resources/React/

     

    If you still need help, here's a React starter template that you can fork to create a minimal demo illustrating whatever issue you're running into. Post a link to your fork back here and we'd be happy to take a peek and answer any GSAP-related questions you have. Just use simple colored <div> elements in your demo; no need to recreate your whole project with client artwork, etc. The simpler the better. 

  2. Hi there! I see you're using React -

    Proper cleanup is very important with frameworks, but especially with React. React 18 runs in strict mode locally by default which causes your useEffect() and useLayoutEffect() to get called TWICE.

     

    Since GSAP 3.12, we have the useGSAP() hook (the NPM package is here) that simplifies creating and cleaning up animations in React (including Next, Remix, etc). It's a drop-in replacement for useEffect()/useLayoutEffect(). All the GSAP-related objects (animations, ScrollTriggers, etc.) created while the function executes get collected and then reverted when the hook gets torn down.

     

    Here is how it works:

    const container = useRef(); // the root level element of your component (for scoping selector text which is optional)
    
    useGSAP(() => {
      // gsap code here...
    }, { dependencies: [endX], scope: container }); // config object offers maximum flexibility

    Or if you prefer, you can use the same method signature as useEffect():

    useGSAP(() => {
      // gsap code here...
    }, [endX]); // simple dependency Array setup like useEffect()

    This pattern follows React's best practices.

     

    We strongly recommend reading the React guide we've put together at https://gsap.com/resources/React/

     

    If you still need help, here's a React starter template that you can fork to create a minimal demo illustrating whatever issue you're running into. Post a link to your fork back here and we'd be happy to take a peek and answer any GSAP-related questions you have. Just use simple colored <div> elements in your demo; no need to recreate your whole project with client artwork, etc. The simpler the better. 

    • Like 1
  3. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  4. Hi there! I see you're using React -

    Proper cleanup is very important with frameworks, but especially with React. React 18 runs in strict mode locally by default which causes your useEffect() and useLayoutEffect() to get called TWICE.

     

    Since GSAP 3.12, we have the useGSAP() hook (the NPM package is here) that simplifies creating and cleaning up animations in React (including Next, Remix, etc). It's a drop-in replacement for useEffect()/useLayoutEffect(). All the GSAP-related objects (animations, ScrollTriggers, etc.) created while the function executes get collected and then reverted when the hook gets torn down.

     

    Here is how it works:

    const container = useRef(); // the root level element of your component (for scoping selector text which is optional)
    
    useGSAP(() => {
      // gsap code here...
    }, { dependencies: [endX], scope: container }); // config object offers maximum flexibility

    Or if you prefer, you can use the same method signature as useEffect():

    useGSAP(() => {
      // gsap code here...
    }, [endX]); // simple dependency Array setup like useEffect()

    This pattern follows React's best practices.

     

    We strongly recommend reading the React guide we've put together at https://gsap.com/resources/React/

     

    If you still need help, here's a React starter template that you can fork to create a minimal demo illustrating whatever issue you're running into. Post a link to your fork back here and we'd be happy to take a peek and answer any GSAP-related questions you have. Just use simple colored <div> elements in your demo; no need to recreate your whole project with client artwork, etc. The simpler the better. 

  5. We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general consulting, logic troubleshooting, or "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer - we just want to manage expectations.  

     

    If you're looking for ScrollTrigger effects, I'd recommend looking at the demos at https://codepen.io/collection/DkvGzg and https://codepen.io/collection/AEbkkJ - you may be able to use one of those as a jumping-off point. 

     

    You are welcome to post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

     

    Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

  6. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  7. Hi there! I see you're using React -

    Proper cleanup is very important with frameworks, but especially with React. React 18 runs in strict mode locally by default which causes your useEffect() and useLayoutEffect() to get called TWICE.

     

    Since GSAP 3.12, we have the useGSAP() hook (the NPM package is here) that simplifies creating and cleaning up animations in React (including Next, Remix, etc). It's a drop-in replacement for useEffect()/useLayoutEffect(). All the GSAP-related objects (animations, ScrollTriggers, etc.) created while the function executes get collected and then reverted when the hook gets torn down.

     

    Here is how it works:

    const container = useRef(); // the root level element of your component (for scoping selector text which is optional)
    
    useGSAP(() => {
      // gsap code here...
    }, { dependencies: [endX], scope: container }); // config object offers maximum flexibility

    Or if you prefer, you can use the same method signature as useEffect():

    useGSAP(() => {
      // gsap code here...
    }, [endX]); // simple dependency Array setup like useEffect()

    This pattern follows React's best practices.

     

    We strongly recommend reading the React guide we've put together at https://gsap.com/resources/React/

     

    If you still need help, here's a React starter template that you can fork to create a minimal demo illustrating whatever issue you're running into. Post a link to your fork back here and we'd be happy to take a peek and answer any GSAP-related questions you have. Just use simple colored <div> elements in your demo; no need to recreate your whole project with client artwork, etc. The simpler the better. 

  8. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  9. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  10. We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general consulting, logic troubleshooting, or "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer - we just want to manage expectations.  

     

    If you're looking for ScrollTrigger effects, I'd recommend looking at the demos at https://codepen.io/collection/DkvGzg and https://codepen.io/collection/AEbkkJ - you may be able to use one of those as a jumping-off point. 

     

    You are welcome to post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

     

    Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

  11. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  12. We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general consulting, logic troubleshooting, or "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer - we just want to manage expectations.  

     

    If you're looking for ScrollTrigger effects, I'd recommend looking at the demos at https://codepen.io/collection/DkvGzg and https://codepen.io/collection/AEbkkJ - you may be able to use one of those as a jumping-off point. 

     

    You are welcome to post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

     

    Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

  13. Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  14. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  15. Hi there! I see you're using React -

    Proper cleanup is very important with frameworks, but especially with React. React 18 runs in strict mode locally by default which causes your useEffect() and useLayoutEffect() to get called TWICE.

     

    Since GSAP 3.12, we have the useGSAP() hook (the NPM package is here) that simplifies creating and cleaning up animations in React (including Next, Remix, etc). It's a drop-in replacement for useEffect()/useLayoutEffect(). All the GSAP-related objects (animations, ScrollTriggers, etc.) created while the function executes get collected and then reverted when the hook gets torn down.

     

    Here is how it works:

    const container = useRef(); // the root level element of your component (for scoping selector text which is optional)
    
    useGSAP(() => {
      // gsap code here...
    }, { dependencies: [endX], scope: container }); // config object offers maximum flexibility

    Or if you prefer, you can use the same method signature as useEffect():

    useGSAP(() => {
      // gsap code here...
    }, [endX]); // simple dependency Array setup like useEffect()

    This pattern follows React's best practices.

     

    We strongly recommend reading the React guide we've put together at https://gsap.com/resources/React/

     

    If you still need help, here's a React starter template that you can fork to create a minimal demo illustrating whatever issue you're running into. Post a link to your fork back here and we'd be happy to take a peek and answer any GSAP-related questions you have. Just use simple colored <div> elements in your demo; no need to recreate your whole project with client artwork, etc. The simpler the better. 

  16. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  17. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  18. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

    • Like 1
  19. Hm, I'm not seeing any weirdness or flickering on my iPhone. Is there a secret to getting it to misbehave? 

     

    You're using the latest version of GSAP on your site, right?

     

    One thing you could try (at least on mobile devices) would be:

    ScrollTrigger.normalizeScroll(true);

    Does that help at all? 

     

    Oh, and I'd recommend removing Lenis to see if that's involved in the problems. 

  20. Hi @Umberto. I read your question a few times and I'm not quite sure what you're asking, sorry.

     

    Without a minimal demo, it's very difficult to follow or make suggestions. 

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

    Once we see an isolated demo and get more clarification of what exactly you're looking for, we'll do our best to jump in and help with your GSAP-specific questions. 

  21. Hi @Chrisdag21. Welcome to the forums!

     

    Sure, that's all doable with GSAP. It looks like just doing calculations to apply transforms to center the element in the viewport, and then they get rid of the scrollbar, probably by setting overflow-y (CSS). The mouse follower rotation effect is more complicated, but very doable. 

     

    Unfortunately we just don't have the resources to provide free "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer - we just want to manage expectations.  

     

    You are welcome to post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

     

    Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

  22. Perhaps you can just edit the helper function to add dragClickables: true on the Draggable. If you need more help, please make sure you provide a minimal demo that clearly illustrates the problem you're facing.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

  23. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  24. CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  25. Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

     

    Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

     

    See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

    that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

     

    Using a framework/library like React, Vue, Next, etc.? 

    CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

     

    Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

     

    Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

×
×
  • Create New...