<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-example83-production</title>
  <link href="animations.css" rel="stylesheet" type="text/css">
  

  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.7/angular.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.7/angular-animate.js"></script>
  

  
</head>
<body ng-app="ngAnimate">
 
<input type="text" ng-model="successtext" />
<input type="text" ng-model="failuretext" />
<input type="text" ng-model="warningtext" />
<div ng-class="{ 'animate-if-red': successtext , 'animate-if-blue': failuretext, 'animate-if-green':warningtext }"
    ng-if="successtext.length > 0 || failuretext.length > 0 || warningtext.length > 0">
  HELLO WORLD
  <div>
    HELLO SAM
  </div>
  <div>
    Hello My Wilson
  </div>
</div>
</body>
</html>
.animate-if-red {
  background:red;
  border:1px solid black;
  padding:10px;
}
.animate-if-blue {
  background:blue;
  border:1px solid black;
  padding:10px;
}

.animate-if-green {
  background:green;
  border:1px solid black;
  padding:10px;
}
.animate-if.ng-enter, .animate-if.ng-leave {
  -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
  transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
}

.animate-if.ng-enter,
.animate-if.ng-leave.ng-leave-active {
  opacity:0;
}

.animate-if.ng-leave,
.animate-if.ng-enter.ng-enter-active {
  opacity:1;
}