optimization of menu animation