Custom cursor trail html code

broken image
broken image
broken image

The createLine function is returning the _gsTransform object for that line, so the next createLine call will pass in the previous line's _gsTransform object.įor ( var i = 0 i ) let pos = gsap. Notice in the loop how the leader changes. The way I set that demo up made more sense in GSAP prior to version 3 as the leader object is the old _gsTransform object except for the first one, which is the just a simple object with x and y properties. I didn't do a deep dive into your code, but I noticed that you are passing the same leader to every line.

broken image