added scroll-to-top animation and loading logic