add animation effect when loading or switching