Updated navigation menu animation functionality