This is my practice project in which I am using GSAP to change the colour of rectangle while moving cursor along x axis inside the rectangle from left(red) to right(blue).
Look this: https://gautampratap24.github.io/changing-the-colour-of-rectangle-effect/