Jump to content
Search Community

dagda1

Premium
  • Posts

    26
  • Joined

  • Last visited

Posts posted by dagda1

  1. I'm definitely not denying it is complex but I still think the code lacks readability and rather than just blindly copy and pasting this code (which I have done :).

     

    If people understood it, then maybe they would post fewer support questions.

     

    I would like to understand it but the way it is written makes that hard.

     

    Would it be possible to get a typescript version of the seamlessLoop?

    I've tried to type it and it is not easy.  Performant code does not have to be illegible.
     

     
  2. One thing that frustrates me about gsap is that the answer to forum questions is often a big mush of pretty illegible code like the loop function in this.

    I find this loop code in lots of answers, the code is not well-formatted and very hard to read.  Worse than that, it is slightly different more times than not depending on the context.


    I think having this big slab of code as the answer is a bad answer and does not educate anyone on how to get the best of gsap.

     

    Could this loop be turned into a primitive or something to stop this copy-whack of code to cure problem that is happening?
     

  3. I've removed `node_modules` multiple times and all the usual fixes.

     

    I am using pnpm and I have gsap declared like this in the package.json file

     

    "gsap": "^3.12.4",

     

    and I have this override for the `gsap/shockingly`

     

    "pnpm": {
      "overrides": {
        "gsap": "npm:@gsap/shockingly@^3.12.4"
      }
    }

     

    If you look at the stacktrace, it cannot find `gsap` in `node_modules/gsap`.

     

    Quote

    > Error: Error: Cannot find module '/Users/paulcowan/projects/cuttingedge/apps/frontendsupport/node_modules/gsap/ScrollTrigger' imported from /Users/paulcowan/projects/cuttingedge/apps/frontendsupport/server/index.mjs Did you mean to import gsap+shockingly@3.12.4/node_modules/@gsap/shockingly/ScrollTrigger.js?

     

     

    Should there be a `@gsap/shockingly` folder in `node_modules?

     

     

     

  4. I have the club account and I have this in my package.json
     

    "gsap": "npm:@gsap/shockingly@3.12.4",


    I used to be able to load ScrollTirgger and ScrollText without error but I have changed the project type to esm and I Now get this error
     
    Quote


    > Error: Error: Cannot find module '/Users/paulcowan/projects/cuttingedge/apps/frontendsupport/node_modules/gsap/ScrollTrigger' imported from /Users/paulcowan/projects/cuttingedge/apps/frontendsupport/server/index.mjs Did you mean to import gsap+shockingly@3.12.4/node_modules/@gsap/shockingly/ScrollTrigger.js?


    I am not sure how to debug this

  5. You need to scroll right to the end to see the problem.  I tried creating a codepen with just the last section but it seemed to work well on its own but in the more complex example like the codepen in this post, the scrollTrigger animation happens way to quickly.

    What I want to happen is:

     

    1.  An image splits in half and moves to the side of the page (I've used divs in this example).

    2.  I would like a delay to happen before the 2 elements at the side of the page fade out and another div fades in slowly.

    I have it working the way I want,  the problem is, it all happens to fast.

    I would like a delay between each of the `.to` and `.fromTo` pieces of the timeline but I don't know how to do that.  Should I have a separate timeline for each one?

     

        let tl = gsap
          .timeline({
            scrollTrigger: {
              trigger: ".breaking",
              start: "center 65%",
              end: "center 51%",
              scrub: 1
            }
          })
          .to(".breaking", { justifyContent: "space-between", ease: "none" })
          .to(".breaking .glass", { autoAlpha: 0, ease: "none" })
          .fromTo(
            ".services",
            { opacity: 0, ease: "none" },
            { opacity: 1, ease: "none" }
          );

     

    See the Pen NWOaEGX by dagda1 (@dagda1) on CodePen

  6. I am having this problem a lot.  I try and add some greensock animations to a react app and it does not work so.....I create a react codepen example and then it magically works but the problem is, it won't work outside of the codepen.

     

    Below is a codepen working perfectly and here is a codesandbox with the same code that does not trigger the animations in the same way..

     

    I really like the look of gsap but I cannot get any of the examples to work outside of the codepen that showcases them.

     

    Can anyone shine any light on why this may be?

     

    See the Pen ExdwoXm by dagda1 (@dagda1) on CodePen

×
×
  • Create New...