Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

328
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda