Greatly simplified code using angular animation and ng-show