Apologies if this is dumb - I'm only familiarising myself with GS but it looks very promising. I've taken the below from an example codepen, but the 'onComplete' callback executes once for every character in the div I animate. I thought 'completeAll' might be the ticket, but I didn't get that happening. Am I missing something obvious?
Thanks
// Takes a text div id eg #myDiv or .blah
export function DivPerspectiveAppear(identifier: string): void {
var tl = new TimelineLite,
mySplitText = new SplitText(identifier, { type: "words,chars" }),
chars = mySplitText.chars; //an array of all the divs that wrap each character
TweenLite.set(identifier, { perspective: 400 });
tl.staggerFrom(chars, 2, { opacity: 0, scale: 0, y: 80, rotationX: 180, transformOrigin: "0% 50% -50", ease: g.Back, onComplete: doStuff }, 0.01, "+=0");
}
export function doStuff(): void {
console.log("it is done.")
}