Jump to content
Search Community

virtualvinay

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by virtualvinay

  1. Hi @Cassie

    Thanks for the reply, but as i said this is working fine when there is no scrolltrigger. But i guess i couldn't explain my requirement, my bad. Will try again.  As in the codepen i want to use both scrolltrigger and draggable plugins. I had done the same template using scrolltrigger, which jitters badly on mobile when a section is being snapped and swiped too fast. so i thought of mixing scrolltrigger and draggable, which is where i am stuck, how to implement both in different sections. For example the first section animations are done using scrolltrigger and then rest of the sections are dragged and on DragEnd the animations happen. then the bottom sections again scrolltrigger has to be called.

    Hope i am clear on my query.

     

    Thanks

  2. @Cassie yeah thats because i have added scrolltrigger to it. I have used the same example for my project.

    If i remove the section that has scrollbased animations, my example also runs as smooth as the one you had pointed out.

    My issue is to run both scrolltrigger and draggble plugin on sections. first section animation is loaded on scrollrigger and rest of the section's animations are loaded using draggable plugin

  3. Hi,

     

    I have a page with multiple sections, all the sections have inner animations, but the first section has to be scrolled to view the animations and then each sections are snapped and the animations would happen automatically. This code works fine on desktop when i scroll using mousewheel though there is a flicker while going in and out of the first section. But on mobile when i swipe it flickers a lot and doesnot snap properly.

     

    Can anyone help me on this.

    See the Pen MWmNVdq by vinayvasu (@vinayvasu) on CodePen

  4. Hi,

     

    I have a page with multiple sections (fullscreen) , each section has text and image animations.

    I have managed to get the animations played automatically as soon as the section is triggered. But these timelines cannot have duration to each elements as scrolltrigger then treats them to animate as per user scroll. 

     

    Can you please help me, how can i give a duration to the timeline so that the animation is smooth  and not fast.

     

    Below is the code snippet of what i am using

     

    gsap.utils.toArray(".panel").forEach((panel, i) => {
        ScrollTrigger.create({
            trigger: panel,
            snap: "labelsDirectional",
            id:"scroll-top"+i,
            //markers: true,
            start: "top 80%",
            onEnter: () => goToSection(i)
        });
        ScrollTrigger.create({
            trigger: panel,
            snap: "labelsDirectional",
            id: "scroll-bottom" + i,
            //markers: true,
            end: "center top",
            onEnterBack: () => goToSection(i)
        });
    });

     

    let openingSlide = gsap.timeline({
        scrollTrigger: {
            trigger: "#start",
            start: "top top",
            pin: true,
            scrub: true
        }
    });
    openingSlide.addLabel("start")
        .to(".hmbanner-overlay", { duration: 10, opacity: 0.2 })
        .to(".sun-icon", { duration: 5, top: 0 }, "<")
        .to(".hmbanner-first-slide", { duration: 10, opacity: 0 }, ">")
        .to(".horzline", { duration: 10, clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)" }, ">-0.5")
        .to(".appear-border", { duration: 10, opacity: 1 }, "<9")
     

    let switchesSlide = gsap.timeline({ // this type of timeline is being created for all other sections.
        scrollTrigger: {
            trigger: "#switches",
            start: "top 5%",
            toggleActions: "play none none reverse",
            onEnter: () => {
                switchesSlide.timeScale(1.2);
            },
            onEnterBack: () => {
                switchesSlide.timeScale(2);
            },
        }, duration:10
        });
    switchesSlide.addLabel("switch-blocked")
        .from('.switchvdobg', { opacity: 0})
        .to('.switchvdobg img', { x: totLength, ease: "steps(38)"})
        .from("#switches h2", {opacity: 0, y: 60 })
        .from("#switches .borderbtn", {opacity: 0, y: 60 })

     

     

  5. Hi,

    There seems to be an issue with my scrolltrigger or timelines, the moment i stop scrolling the page and i am in the middle of the slide, it jumps to the first slide. Quite weird as this doesn't happen in example is saw on codepen : 

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

     

    As i see the difference in the example, is the scrolltrigger is being called in the tweens (to/from) whereas in mine i am putting it in the timeline and the tweens are kept separate as i have multiple animations in each of my slides.

     

    Can anyone help me figure out whats going wrong with my code.

     

    Thanks in advance.

     

    See the Pen WNjgMNW by vinayvasu (@vinayvasu) on CodePen

×
×
  • Create New...