Jump to content
Search Community

takachan

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by takachan

  1. thank you for the reply, I have read the article and tested the codepen.

    as i mentioned above I have no experience with javascript but I did my best.

    Could you tell me what I am doing wrong here?

     

    const texts = gsap.utils.toArray('.scrollingText');
    texts.forEach(text => {
      gsap.to(text, { 
      x:1000,
      duration:50,
      repeat:-1,
      ease:'linear',
        scrollTrigger: {
          trigger: text,
        }
      })
    });
    
    gsap.utils.toArray('.scrollingText');
    texts.forEach(text => {
      gsap.to(text, { 
      xPercent:15,
      scrollTrigger:{
      trigger:".scrollingText",
      scrub:1,
        scrollTrigger: {
          trigger: text,
          scrub: true
        }
      }
    });

     

  2. Good day, 

     

    I am fairy new to javascript and having difficulties figuring out how to create  a multiple scroll trigger. 

    I have found the perfect codepen,  and what I want to do is to use this for multiple sections of my webpage to work individually

    but currently, if I use it as it is, it applies to the whole section. 

    I have tired to edit it, but sadly I did not have enough skill to make it to work on multiple section. 

     

    The only thing I know what I must do is to, change the id to class for both html and js...

     

    Any help is appreciated. 

     

    heres what I have done so far:

    See the Pen GRvpoYE by jpholic_ty (@jpholic_ty) on CodePen

     

    original

    See the Pen qBrJENy by ooblek (@ooblek) on CodePen

  3. Quote

    It's okay, everybody was new to it at some point. And don't worry, once you get the hang of it, it will become more intuitive every time you use a concept like this.

    Thank you! (T_T) 

     

     

    Am I going the right direction here?  

    Tried my best to do what you explained to me here.

     

    gsap.registerPlugin(ScrollTrigger);
    const items = gsap.utils.toArray('.wrapper') 
    var line = gsap.timeline({ 
        scrollTrigger: {
        trigger: line,
        start: "center 90%"
      }
    });
    
    
    items.forEach(function(item) {   
    let line = item.querySelector('.line')
    tl.from(line, { scaleX: 0, transformOrigin: "right center" });
    })
    
    items.forEach(function(item) {   
    let upper = item.querySelector('.line')
    tl.from(upper, { duration: 0.75, y: 30 }, "text");
    })
    
    items.forEach(function(item) {   
    let lower = item.querySelector('.line')
    tl.from(lower, { duration: 0.75, y: -30 }, "text");
    })

     

×
×
  • Create New...