I have simple animations on a homepage component that works amazingly when I first visit the page or if I just refresh with F5:
@ViewChild('section1', {static: true}) section1: ElementRef<HTMLDivElement>;
@ViewChild('section2', {static: true}) section2: ElementRef<HTMLDivElement>;
ngOnInit(): void {
this.initScrollAnimation();
}
ngOnDestroy() {
ScrollTrigger.refresh();
}
initScrollAnimation(): void {
gsap.utils.toArray<HTMLElement>(".defil