document.querySelectorAll(".black-block").forEach((item) => {
item.addEventListener("mouseenter", function () {
gsap.to(".ball", {
toggleClass: '.class-ball',
backgroundColor: '#ffffff'
});
});
item.addEventListener("mouseleave", function () {
gsap.to(".ball", {
backgroundColor: '#DE002B'
});
});
});
For some reason, toggleClass is not added