how can you toggle a class on a different element? like here for example on this.btn and not on the trigger element this.el, is this the best possible solution?
gsap.to(
this.btn,
{
scrollTrigger: {
trigger: this.el,
start: () => '-=150px',
onEnter: () => this.btn.classList.add('active'),
onEnterBack: () => this.btn.classList.add('active'),
onLeave: () => this.btn.classList.remove('active'),
onLeaveBack: () => this.btn.classList.remove('active'),
end: () => '+=' + this.el.parentElement.getBoundingClientRect().height
}
}
)