refactor nav animation scripts