i feel like the following code would do 90% of what stretchback does you could probably clean it up into a factory that would take an array of img links and an interval
<body ng-style="changeBack">
<body>
.controller('PageCtrl', function($rootScope, $scope, $timeout, $log) {
var someImages = [
{'url':'./assets/img/bg/1.jpg'},
{'url':'./assets/img/bg/2.jpg'},
{'url':'./assets/img/bg/3.jpg'},
{'url':'./assets/img/bg/4.jpg'}
];
var switchBack = function(){
var num = Math.floor(Math.random()*4)+1;
$rootScope.changeBack = {
'background-image' : 'url('+someImages[num].url+')',
'background-size' :'cover',
'transition':'background-image 4s'
};
///$log.log(someImages);
$timeout(switchBack,7000)
}
switchBack();
})
don't get me wrong my css probably needs work.
i feel like the following code would do 90% of what stretchback does you could probably clean it up into a factory that would take an array of img links and an interval
don't get me wrong my css probably needs work.