diff options
Diffstat (limited to 'www')
-rw-r--r-- | www/css/index.css | 6 | ||||
-rw-r--r-- | www/index.html | 2 | ||||
-rw-r--r-- | www/js/api.js | 7 | ||||
-rw-r--r-- | www/js/menu.js | 8 |
4 files changed, 18 insertions, 5 deletions
diff --git a/www/css/index.css b/www/css/index.css index 3f6e64c..8b59a6b 100644 --- a/www/css/index.css +++ b/www/css/index.css @@ -167,6 +167,12 @@ html.no-js #gotit { left: 50%; top: 50%; } +.status { + position: absolute; + top: 10px; + right: 10px; + display: none; +} .choice { background: url("../dump/ui/bg-choice.png") no-repeat top center; height: 35px; diff --git a/www/index.html b/www/index.html index 92a2611..595bcbb 100644 --- a/www/index.html +++ b/www/index.html @@ -54,6 +54,8 @@ </div> <div id="choices" class="centered"></div> <div id="centered" class="say"></div> + <img class="status" id="auto" src="dump/ui/sd-auto.png"> + <img class="status" id="skip" src="dump/ui/sd-skip.png"> <div id="main-menu" style="display: none;"> <div id="main-menu-buttons" style="top: 377px; position: absolute; left: 81px;"> <div id="start" class="button">Start</div> diff --git a/www/js/api.js b/www/js/api.js index 4c5a48f..44923ac 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -392,7 +392,7 @@ window.html5ks.api = { if (html5ks.state.skip || str.indexOf("{nw}") > -1) { html5ks.next(); } else if (html5ks.state.auto) { - setTimeout(html5ks.next, 1000 + html5ks.persistent.autospeed * text.length); + setTimeout(html5ks.next, 1000 + html5ks.persistent.autoModeDelay * text.length); } } return deferred.promise; @@ -465,5 +465,10 @@ window.html5ks.api = { html5ks.elements.choices.appendChild(frag); return deferred.promise; + }, + + speed: function (type, status) { + html5ks.state[type] = status; + document.getElementById(type).style.display = status ? "block" : "none"; } }; diff --git a/www/js/menu.js b/www/js/menu.js index c8e9bd4..c03212e 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -87,8 +87,8 @@ switch (html5ks.state.status) { case "scene": case "context": - html5ks.state.skip = false; - html5ks.state.auto = false; + html5ks.api.speed("skip", false); + html5ks.api.speed("auto", false); this.context(); } e.preventDefault(); @@ -136,13 +136,13 @@ document.getElementById("skip-mode").addEventListener("click", function () { html5ks.menu.context(false); - html5ks.state.skip = true; + html5ks.api.speed("skip", true); html5ks.next(); }, false); document.getElementById("auto-mode").addEventListener("click", function () { html5ks.menu.context(false); - html5ks.state.auto = true; + html5ks.api.speed("auto", true); html5ks.next(); }, false); |