Jump to content
Search Community

paro

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by paro

  1. I've been working on it for hours but I couldn't come with a solution. I am really tired, maybe move without it is the easy option for me 😴

     

    I updated css/html code and implemented scrollTrigger plugin,
     

    gsap.registerPlugin(ScrollTrigger);
    
    const rev_left = document.querySelector(".column-reverse-left");
    const rev_right = document.querySelector(".column-reverse-right");
    const center = document.querySelector(".column-section");
    
    let tl = gsap.timeline({scrollTrigger:{trigger:".column-section",start:"top top",end:"bottom bottom",scrub: true,markers: true}});
    
    tl.to([rev_left], {
        duration: 1,
        yPercent: 200,
    }, 0);
    tl.to([rev_right], {
        duration: 1,
        yPercent: 200,
    }, 0);

     

  2. 8 hours ago, OSUblake said:

    Create a timeline that animates all the columns at the same, and then hook it up to ScrollTrigger.

    i don't really understand how can i do that, can you give an example? 
    I did try something but don't know how concept should be,
     

    var offset = 0;
    let tl = gsap.timeline({duration:1, scrollTrigger: {trigger: "main"}});
    
    window.addEventListener('scroll', function(e) {
        offset = window.pageYOffset;
        tl.to([rev_left,center,rev_right], {y: gsap.utils.wrap([offset,-(offset),offset])});
    })

     

  3. I ran into a new problem while working on my previous topic.
    I want the two boxes moving from top to bottom and bottom to top to always move vertically towards the exact center even if the screen size changes. Some calculations are needed here, but I couldn't find which variable I can use to calculate it.
    I mean, even if the screen height changes, the moving objects will be above and below the middle text.

    See the Pen GRQJGvZ by tw_parodia (@tw_parodia) on CodePen

  4. Hello there,

    I am trying to achieve animate two element in same time but i want to give them different value for each.
    The first element will move from the top to the center and the second element will move from the bottom to the center.

     

    var tl = new TimelineMax({ repeat: -1, repeatDelay: 1 });
    tl.to([up,down], 1, {y: (winsize.height/3)}); // i need negative value here for down element
×
×
  • Create New...