Capítulo 12 de 411
gsap.effects is where registered custom animation effects (via gsap.registerEffect()) become callable, e.g. gsap.effects.explode(targets, config).
name, an effect function, and optional defaults before it appears on gsap.effects.extendTimeline: true: when set during registration, the effect also becomes callable directly on any timeline instance, inserting its result at the position you specify.gsap.registerEffect({
name: "fade",
effect: (targets, config) => gsap.to(targets, { duration: config.duration, opacity: 0 }),
defaults: { duration: 2 },
extendTimeline: true,
});
gsap.effects.fade(".box");
let tl = gsap.timeline();
tl.fade(".box", { duration: 3 }).fade(".box2", { duration: 1 }, "+=2");
extendTimeline: true is what makes an effect usable as a timeline method (tl.fade(...)) instead of only gsap.effects.fade(...).