I am animating only the container of the photos, not the photos themselves. So I cannot use stagger. I was able to do it like this:
bannerPhotos = [
'assets/img/carousel1.png',
'assets/img/carousel2.jpg',
'assets/img/carousel3.jpg'
];
tlm = new TimelineLite({
paused: true,
repeat: -1,
onRepeat: () => (this.counter = 0)
});
animateBanner() {
for (let i of this.bannerPhotos) {
this.tlm.to(this.banner.nativeElement, 1, {
x: '-=100vw',
delay: 3,
ease: Power1.easeInOut,
onComplete: () => (this.counter += 1)
});
}
this.tlm.play();
}
}
Thanks for the help!