diff --git a/infoscreen/static/css/infoscreen.css b/infoscreen/static/css/infoscreen.css index 1df6617..ef39121 100644 --- a/infoscreen/static/css/infoscreen.css +++ b/infoscreen/static/css/infoscreen.css @@ -18,4 +18,20 @@ display: block; margin-left: auto; margin-right: auto; -} \ No newline at end of file +} + +.swap-animation.ng-enter, .swap-animation.ng-leave { + transition:0.5s linear all; +} +.swap-animation.ng-enter { + opacity:0; +} +.swap-animation.ng-enter-active { + opacity:1; +} +.swap-animation.ng-leave { + opacity:1; +} +.swap-animation.ng-leave-active { + opacity:0; +} diff --git a/infoscreen/static/js/infoscreen_controllers.js b/infoscreen/static/js/infoscreen_controllers.js index 9ecfbc1..75dab24 100644 --- a/infoscreen/static/js/infoscreen_controllers.js +++ b/infoscreen/static/js/infoscreen_controllers.js @@ -1,9 +1,9 @@ -var app = angular.module('infoApp', []); +var app = angular.module('infoApp', ['ngAnimate']); -app.controller('infoscreen_main', function($scope, $http,$timeout){ - var index = -1; +app.controller('infoscreen_main', function($scope,$timeout){ + $scope.index = -1; var templates = [ { template: "/static/html/test1.html?img=siklogo", @@ -17,8 +17,8 @@ app.controller('infoscreen_main', function($scope, $http,$timeout){ }, ]; $scope.next = function(){ - index = (index + 1) % templates.length; - $scope.active = templates[index]; + $scope.index = ($scope.index + 1) % templates.length; + $scope.active = templates[$scope.index]; $timeout($scope.next,5000); } $scope.next() diff --git a/infoscreen/templates/infoscreen_index.html b/infoscreen/templates/infoscreen_index.html index 3ac5a3b..ae55891 100644 --- a/infoscreen/templates/infoscreen_index.html +++ b/infoscreen/templates/infoscreen_index.html @@ -7,6 +7,7 @@