Hey!
I got a Section on a homepage where background colours are changing by scrolling.
The first transition is working fine, but with the second scrollTrigger it´s just changing without any transition.
Why does this happen?
Here´s the live site link: https://fairnergy.webkonditorei.de/ --> It´s about the 4th section where the text is sticky on the left and cards are moving up on the right.
Here´s the GSAP i wrote for animating the elements:
/* First Trigger */
gsap.to('#partners', {
scrollTrigger: {
trigger: '#trigger-color',
toggleActions: 'play none none reverse',
},
background: "#6B6B6B",
ease: "power4.inOut",
});
gsap.to('.toggle-text', {
scrollTrigger: {
trigger: '#trigger-color',
toggleActions: 'play none none reverse',
},
color: "#F6F6F6",
ease: "power4.inOut",
});
gsap.to('.partner-box', {
scrollTrigger: {
trigger: '#trigger-color',
toggleActions: 'play none none reverse',
},
background: "#505050",
duration: 1,
});
/* Second Trigger */
gsap.to('#partners', {
scrollTrigger: {
trigger: '#trigger-color1',
toggleActions: 'play none none reverse',
},
background: "white",
ease: "power4.inOut",
});
gsap.to('.toggle-text', {
scrollTrigger: {
trigger: '#trigger-color1',
toggleActions: 'play none none reverse',
},
color: "#E29863",
});
gsap.to('.partner-box', {
scrollTrigger: {
trigger: '#trigger-color1',
toggleActions: 'play none none reverse',
},
background: "#F9E8DC",
duration: 1,
});