Jump to content
Search Community

pjay79

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by pjay79

  1. So i am new to front end development, self taught last 6 months, and got a job at a design agency where I was animating perhaps simple things like hamburger menu / overlay menus with gsap and was told that i should be using more css animations for these things for better performance. Does anyone work at a commercial level where they have been using gsap for all animations perhaps except simple hover / button transitions? How do you decide when to use gsap vs css?

     

     

  2. Hi

     

    I have a landing page animation that i want to start after all the images and files have been downloaded.

     

    So... my js file looks like this

     

      window.onload = function() {
      var main = new TimelineMax({paused:true});
      main.set($('.main__content'), {visibility: "visible"})
          .from($('.main__content img'), 0.3, {autoAlpha: 0, scale: 0, ease: Power4.easeOut})
          .staggerFrom($('.main__content h1 span'), 0.3, {autoAlpha: 0, ease: Power4.easeIn}, 0.15, 0)
          .from($('.main__content p'), 0.3, {autoAlpha: 0, ease: Power4.easeOut})
          .from($('.main__content .call-to-action'), 0.3, {autoAlpha: 0, y: 50, ease: Power1.easeOut})
          .from($('.main__social'), 0.3, {autoAlpha: 0, ease: Power4.easeOut})
          .add('headerIn');
      main.play();
      };

    and the '.main__content' has visibility : hidden in the css file

     

    when the page loads, the main__content remains hidden... and the animation is not seen...

     

    Any ideas what could be wrong.

     

    If i  remove the gsap code from the window.onload function, it works fine, but i prefer to have the images load first.

     

    Many thanks!

×
×
  • Create New...