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

335
Visualizações
GSAP ScrollTrigger background color change animation not working well on Safari

I'm trying to make a gsap animation that switches the viewport's background color depending on your scrolling position. The animation works great on Chrome and on FireFox, but on Safari it just looks bad, very laggy and the colors don't transition into the page, but rather just pop up with a delay.

Here is my animation (I am using Vue.js)

backgroundAnimation() {
      let $projects = gsap.utils.toArray(this.htmlID + " .project-wrapper");
      let projectListTl = gsap.timeline({
        scrollTrigger: {
          trigger: this.htmlID,
          start: "top center",
          end: "bottom center",
          ease: "none",
          scrub: true,
          markers: false,
          onLeave: ({ progress, direction, isActive }) =>
            document.documentElement.style.setProperty("--background", "white"),
        },
      });
      $projects.forEach(($project, i) => {
        projectListTl.to("html", {
          duration: 0.1,
          "--background": $project.dataset.projectColor,
        });
        projectListTl.to("html", {
          delay: 0.3,
          duration: 0.2,
          "--background": "transparent",
        });
      });
    },
      
      
(The method above runs when there is an update on the component)
  updated: function () {
    this.$nextTick(function () {
      this.backgroundAnimation();
      const self = this;
      ScrollTrigger.matchMedia({
        "(min-width: 1024px)": function () {
          self.scrollAnimation();
        },
      });
    });
  },

Does anybody have any ideas as to why this is happening on Safari?

about 4 years ago · Santiago Gelvez
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