Added animation to the window closing and opening