Animations don't get triggered until the page is fully loaded