Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
Barba.js is sporadically skipping transitions when page loads quicker than transition time

I have the following site - https://pinelake.org - where I'm hooking into a barba.js instance to trigger GSAP page "wipe" transitions. I'm relatively new to Barba and I'm running into an issue where, if the page takes long enough to load, the transition works as intended, but if the page loads quicker (such as when it is cached by the browser) it just decides to skip the animation altogether. Below is my barba init function -

barba.init({
    timeout: 50000,
    cacheIgnore: true,
    transitions: [{
      name: 'main', 
      leave(data){
        gsap.timeline()
        .to('.masthead__nav > *', {
          opacity: 0,
          duration: 0.3,
        })
  
        .to(
          '.wrapper__transition',
          {
            x: 0,
            duration: 0.3,
          },
          '-=0.2'
        )
  
        .set('#header, #content, #footer', {
          opacity: 0,
        })
  
        .set('#nav-overlay', {
          x: '100%',
        })
  
        .set('.wrapper__dimmer', {
          autoAlpha: 0,
          opacity: 0,
        })
  
        .to(
          '.wrapper__transition',
          {
            x: '-100%',
            duration: 0.5,
            ease: 'expo.out',
          },
          '+=0.4'
        );
      },
      beforeEnter: ({ next }) => {
        window.scrollTo(0, 0);
      }, 
      enter(data){
        gsap.timeline()
      .set('body', {
        overflow: 'inherit',
      })

      .to('#header, #content, #footer', {
        opacity: 1,
        duration: 0.5,
      })

      .set('.wrapper__transition', {
        x: '100%',
      })

      .set('#nav-overlay', {
        x: '100%',
      });
      },
      after(){
      initSplit();
      initHeroReveal();
      initActions();
      initVue();

      initSliders();
      initResponsiveEmbeds();
      initGoogleMaps();

      onYouTubeIframeAPIReady();

      initScroller();
      ScrollTrigger.refresh();

      if ($(window).width() < 1200) {
      } else {
        initFocusAlt();
      }
      }
    }]
  })

Anybody have some insight on what I can do to fix this? Thanks!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda