Angular animation ng-view3 D Cube Effect
HTML
<script src="http://code.angularjs.org/1.2.0-rc.3/angular.min.js"></script>
<script src="http://code.angularjs.org/1.2.0-rc.3/angular-animate.min.js"></script>
<script src="http://code.angularjs.org/1.2.0-rc.3/angular-route.min.js"></script>
<link rel="stylesheet" href="http://twbs.github.io/bootstrap/dist/css/bootstrap.css">
<div ng-view class="fadethis container"></div>
<script type="text/ng-template" id="page1.html">
<h1 class="muted">PAGE 1</h1>
<button class="btn display-button" ng-click="direction('front');go('/two')">Go Page 2</button>
</script>
<script type="text/ng-template" id="page2.html">
<h1 class="muted">PAGE 2</h1>
<button class="btn display-button" ng-click="direction('back');go('/one')" >Go page 1</button>
</script>
SCSS
.fadethis {
&.ng-enter, &.ng-leave {
-webkit-transition: all linear 1s;
-moz-transition: all linear 1s;
transition: all linear 1s;
display: block !important;
}
&.ng-enter, &.ng-leave.ng-leave-active {
opacity:0;
}
&.ng-leave, &.ng-enter.ng-enter-active {
opacity:1;
}
}
html, body, .container {
height: 100%;
}
JavaScript
var app = angular.module('demo', ['ngRoute', 'ngAnimate']);
app.config(function ($routeProvider) {
$routeProvider
.when('/one', {
templateUrl:'page1.html'
})
.when('/two', {
templateUrl:'page2.html'
})
.otherwise({
redirectTo:'/one'
});
});
app.controller('MainCtrl', function($scope, $location) {
$scope.go = function(path) {
$location.path(path);
}
});