summaryrefslogtreecommitdiff
path: root/www/js/html5ks.js
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-02-14 08:05:27 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-02-14 08:05:27 -0500
commitf5ccc58a9ad9b2e5c65806bc2c52217e8e3fff68 (patch)
tree5b12682f459735dfbdd8e0f5ba230f537f1526bc /www/js/html5ks.js
parent1f069412967c751d288cdf63508bb65ad367e3b1 (diff)
downloadhtml5ks-f5ccc58a9ad9b2e5c65806bc2c52217e8e3fff68.tar.xz
html5ks-f5ccc58a9ad9b2e5c65806bc2c52217e8e3fff68.zip
add spinner
Diffstat (limited to 'www/js/html5ks.js')
-rw-r--r--www/js/html5ks.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/www/js/html5ks.js b/www/js/html5ks.js
index 1f52c52..40765e1 100644
--- a/www/js/html5ks.js
+++ b/www/js/html5ks.js
@@ -77,8 +77,26 @@ window.html5ks = {
nvlsay: document.getElementById("nvlsay"),
nvlctc: document.getElementById("nvlctc"),
choices: document.getElementById("choices"),
- show: document.getElementById("show")
+ show: document.getElementById("show"),
};
+ this.elements.spinner = new Spinner({
+ color: '#CC7C2A',
+ hwaccel: true,
+ length: 30,
+ lines: 15,
+ radius: 60,
+ width: 15
+ }).spin(this.elements.container).el;
+ },
+ _spinners: 0,
+ _spintm: null,
+ spin: function (mod) {
+ clearTimeout(this._spintm);
+ this._spintm = setTimeout(function () {
+ html5ks.elements.spinner.style.opacity = html5ks._spinners === 0 ? 0 : 1;
+ }, 1000);
+ this._spinners += mod;
+ console.assert(this._spinners >= 0);
},
scale: function () {
var newScale = 1;