Timeline とは
複数のアニメーションを順番に並べて管理 できるコンテナ
Timeline を使わない場合(delay で管理)
gsap.to(".box1", { x: 100, duration: 1 });
gsap.to(".box2", { x: 100, duration: 1, delay: 1 });
gsap.to(".box3", { x: 100, duration: 1, delay: 2 });
Timeline を使う場合
const tl = gsap.timeline();
tl.to(".box1", { x: 100, duration: 1 })
.to(".box2", { x: 100, duration: 1 })
.to(".box3", { x: 100, duration: 1 });
Timeline なら 順番の変更・挿入・削除が簡単