Capítulo 32 de 411
gsap.timeline() creates a Timeline — a container that sequences tweens/timelines with precise relative timing, replacing fragile manual delay chains.
delay.repeat / repeatDelay: timeline-level options to loop the whole sequence.pause(), restart(), reverse() operate on everything inside the timeline at once.// without timelines — fragile delay chain
gsap.to("#id", { x: 100, duration: 1 });
gsap.to("#id", { y: 50, duration: 1, delay: 1 });
gsap.to("#id", { opacity: 0, duration: 1, delay: 2 });
// with a timeline — durations auto-cascade, whole thing is controllable
let tl = gsap.timeline({ repeat: 2, repeatDelay: 1 });
tl.to("#id", { x: 100, duration: 1 });
tl.to("#id", { y: 50, duration: 1 });
delay math..to(), .add(), labels, .play(), etc.).