cleanup
This commit is contained in:
parent
c12c49d4d1
commit
f3490dc8d5
1 changed files with 23 additions and 21 deletions
44
index.js
44
index.js
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
Ox.load(function() {
|
||||
|
||||
var app = {
|
||||
|
@ -37,26 +39,6 @@ Ox.load(function() {
|
|||
);
|
||||
});
|
||||
},
|
||||
animateLoading: function() {
|
||||
var css, deg = 0,
|
||||
previousTime = +new Date();
|
||||
animationInterval = setInterval(function() {
|
||||
var currentTime = +new Date(),
|
||||
delta = (currentTime - previousTime) / 1000,
|
||||
loadingIcon = document.getElementById('loadingIcon');
|
||||
if(loadingIcon) {
|
||||
previousTime = currentTime;
|
||||
deg = Math.round((deg + delta * 360) % 360 / 30) * 30;
|
||||
css = 'rotate(' + deg + 'deg)';
|
||||
loadingIcon.style.MozTransform = css;
|
||||
loadingIcon.style.MSTransform = css;
|
||||
loadingIcon.style.OTransform = css;
|
||||
loadingIcon.style.WebkitTransform = css;
|
||||
} else {
|
||||
clearInterval(animationInterval);
|
||||
}
|
||||
}, 83);
|
||||
},
|
||||
data: {
|
||||
html: {},
|
||||
pages: [
|
||||
|
@ -258,7 +240,7 @@ Ox.load(function() {
|
|||
.append(app.$ui.screen)
|
||||
.append(app.$ui.logo)
|
||||
.append(app.$ui.loading);
|
||||
app.animateLoading();
|
||||
app.rotate();
|
||||
callback();
|
||||
}
|
||||
});
|
||||
|
@ -321,6 +303,26 @@ Ox.load(function() {
|
|||
app.$ui[element] && app.$ui[element].css(app.getCSS(element));
|
||||
});
|
||||
},
|
||||
rotate: function() {
|
||||
var css, deg = 0,
|
||||
previousTime = +new Date(),
|
||||
interval = setInterval(function() {
|
||||
var currentTime = +new Date(),
|
||||
delta = (currentTime - previousTime) / 1000,
|
||||
loadingIcon = document.getElementById('loadingIcon');
|
||||
if (loadingIcon) {
|
||||
previousTime = currentTime;
|
||||
deg = Math.round((deg + delta * 360) % 360 / 30) * 30;
|
||||
css = 'rotate(' + deg + 'deg)';
|
||||
loadingIcon.style.MozTransform = css;
|
||||
loadingIcon.style.MSTransform = css;
|
||||
loadingIcon.style.OTransform = css;
|
||||
loadingIcon.style.WebkitTransform = css;
|
||||
} else {
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 83);
|
||||
},
|
||||
setTheme: function(theme) {
|
||||
app.user.theme = theme;
|
||||
app.db(app.user);
|
||||
|
|
Loading…
Reference in a new issue