Hey y'all! 👋
Got an odd one. I could be missing something straightforward. But, in this pen, I'm animating a set of squares on a trail on a canvas. I want to create a seamless loop so I've constructed the timeline by looping over the squares three times and then tweening the `totalTime`. In the code, It currently tweens from `totalTime: 0` to `totalTime: 7` and the entire timeline is shown as expected.
But, as soon as I tweak the `totalTime` values, mainly the starting value, it breaks the animation window that I'd expect to see 🤔 Not sure if I'm missing something clear and obvious. But, the technique should work in this scenario I imagine.
The looping code is at the bottom, try changing the initial `totalTime` to something like `1` and it doesn't show the `TRAIL` timeline window of `1` to `7`.
Are my timings off? Or, do I perhaps need to do something different when working with plain Objects like this?
Thanks in advance!
– Jhey
const TRAIL_LOOP = gsap.fromTo(
TRAIL,
{ totalTime: 0 },
{
totalTime: 7,
repeat: -1,
ease: 'none',
duration: 6,
}
)