Jump to content
Search Community

richiCoder

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by richiCoder

  1. 1 hour ago, GreenSock said:

    What code are you talking about? Do you have a minimal demo? If you're redirecting a particular value a lot, it's usually best to use a gsap.quickTo() instead of creating a new tween instance every time. But in order to offer you the best feedback, I'd need to know what you're talking about and see the code. 

     

    Simple version of the code you wrote above. Here, goToPanel function is called with onEnter or onEnterBack and it creates a new tween every time the ScrollTrigger gets into the ".swipe-section". 

    function gotoPanel(index, isScrollingDown) {
      ...// 
      gsap.to(target, {
        xPercent: isScrollingDown ? 0 : 100,
        duration: 0.75,
        onComplete: () => {
          animating = false;
        }
      });
      ...//
    }
    
    
    ScrollTrigger.create({
      trigger: ".swipe-section",
      pin: true,
      anticipatePin: true,
      start: "top top",
      end: "+=50%",
      onEnter: (self) => {
        intentObserver.enable();
        gotoPanel(currentIndex + 1, true);
      },
      onEnterBack: (self) => {
        intentObserver.enable();
        gotoPanel(currentIndex - 1, false);
      }
    });

     

  2. @Rodrigo Hi! Well, recently I was struggling with a project including gsap and three js, with no smooth scroll in mobile and many images, with a 3d model in the order of 30k polygons. So, it was resizing on mobile scrolling, and producing crashes in iOS. Since I was including Smooth Scrollbar (third party), I tried it on mobile and it worked great! Currently, I am dealing with lag in scrolling in some iOS devices, so I am going to implement the "will-change" workaround, hoping it will work.!

  3. On 3/29/2022 at 12:45 AM, OSUblake said:

     

    Safari is just a super difficult browser to work with, and there probably isn't a good solution. We spent several weeks trying to solve issues dealing with the address bar on iPhones and couldn't find a way to prevent it from resizing. iPads isn't an issue, just iPhones. 

     

    As you mentioned OSUblake, your issue on dealing with the address bar, I solved it partially using Smooth Scrollbar. As it is not a native scrollbar, it does not produce the viewport resizing.

     

×
×
  • Create New...