Sequence animations with precision
// Create a timeline with defaults const tl = gsap.timeline({ defaults: { duration: 0.8, ease: 'power3.out' } }); // Sequence animations tl.from('.hero-title', { y: 100, opacity: 0 }) .from('.hero-subtitle', { y: 50, opacity: 0 }, '-=0.5') // Start 0.5s before previous ends .from('.hero-cta', { scale: 0, ease: 'back.out(2)' }, '-=0.3'); // Control the timeline tl.play(); // Play from current position tl.pause(); // Pause tl.reverse(); // Play backward tl.restart(); // Start from beginning tl.timeScale(2); // Double speed