diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | lighttpd.conf | 5 | ||||
-rw-r--r-- | www/css/index.css | 9 | ||||
-rw-r--r-- | www/index.html | 10 | ||||
-rw-r--r-- | www/js/api.js | 49 | ||||
-rw-r--r-- | www/js/html5ks.js | 65 | ||||
-rw-r--r-- | www/js/lib/modernizr.custom.44609.js | 4 | ||||
-rw-r--r-- | www/js/lib/modernizr.custom.71672.js | 4 | ||||
-rw-r--r-- | www/js/play.js | 5 |
9 files changed, 90 insertions, 63 deletions
@@ -0,0 +1,2 @@ +- fix cursor to apply to all document +- cache script.json files diff --git a/lighttpd.conf b/lighttpd.conf index 24b2bf2..de0328a 100644 --- a/lighttpd.conf +++ b/lighttpd.conf @@ -5,7 +5,8 @@ mimetype.assign = ( ".css" => "text/css", ".html" => "text/html; charset=utf-8", ".jpg" => "image/jpeg", - ".js" => "text/javascript", + ".js" => "application/javascript", + ".json" => "application/json", # ".mkv" => "video/x-matroska", ".ogg" => "audio/ogg", ".png" => "image/png", @@ -29,4 +30,4 @@ setenv.add-response-header += ( ) compress.cache-dir = "/tmp/lighttpd-compress" -compress.filetype = ("text/html", "text/plain", "text/css", "text/javascript") +compress.filetype = ("text/html", "text/plain", "text/css", "application/javascript", "application/json") diff --git a/www/css/index.css b/www/css/index.css index 9a96f3b..b1e1a78 100644 --- a/www/css/index.css +++ b/www/css/index.css @@ -15,11 +15,11 @@ body { margin: 0; padding: 0; - overflow: hidden; background: gray; font: 22px/27px Playtime, sans-serif; } #container { + cursor: url("/dump/ui/mousecursor.png"), auto; width: 800px; height: 600px; position: absolute; @@ -27,8 +27,6 @@ body { margin-top: -300px; left: 50%; margin-left: -400px; - overflow: hidden; - cursor: url("/dump/ui/mousecursor.png"), default; } @keyframes toright { from { @@ -79,6 +77,9 @@ body { visibility: hidden; cursor: auto; } +html.no-js #warn-container { + visibility: visible; +} #warn { background-color: rgb(128, 128, 128); background-color: rgba(128, 128, 128, 0.8); @@ -97,7 +98,7 @@ body { font: 28px/34px Playtime; font-weight: bold; } -html.js #warn li#js { display: none; } +html.no-js #warn li:not(#js) { display: none; } html.video #warn li#video { display: none; } html.audio #warn li#audio { display: none; } html.fontface #warn li#fontface { display: none; } diff --git a/www/index.html b/www/index.html index 824347d..62d790f 100644 --- a/www/index.html +++ b/www/index.html @@ -17,20 +17,20 @@ <link rel="stylesheet" type="text/css" href="/css/index.css"> <script src="/js/lib/when/when.js"></script> <script src="/js/lib/jquery-2.0.2.min.js"></script> - <script src="/js/lib/modernizr.custom.71672.js"></script> + <script src="/js/lib/modernizr.custom.44609.js"></script> <script src="/js/html5ks.js"></script> <script src="/js/api.js"></script> <script src="/js/play.js"></script> <script src="/js/images.js"></script> <script src="/js/characters.js"></script> </head> - <body> + <body><div id="all"> <div id="warn-container"> <div id="gray"></div> <div id="warn"> <div id="notwork">We use a lot of new features in this; your browser seems to have some issues...</div> <ul id="warns"> - <li id="js">It doesn't seem to have JavaScript enabled. This site doesn't work at all without it. Really. <a href="http://enable-javascript.com">Don't know how to enable JS?</a></li> + <noscript><li id="js">It doesn't seem to have JavaScript enabled. This site doesn't work at all without it. Really. <a href="http://enable-javascript.com">Don't know how to enable JS?</a></li></noscript> <li id="video">It doesn't seem to support <a href="https://en.wikipedia.org/wiki/HTML5_video">HTML5 video</a>, which means that you won't be able to see any of the videos (obviously). Unless stated below, though, transitions should still work. <a href="http://caniuse.com/#feat=video">You should strongly consider upgrading.</a></li> <li id="audio">It doesn't seem to support <a href="https://en.wikipedia.org/wiki/HTML5_audio">HTML5 audio</a>, which means you won't be able to hear any of the amazing music. <a href="http://caniuse.com/#feat=audio">You should strongly consider upgrading.</a></li> <li id="fontface">It doesn't seem to support <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face">the @font-face at-rule</a>, which lets us display the Playtime and Gentium fonts used in Katawa Shoujo. <a href="http://caniuse.com/#feat=fontface">Any browser released in the last 2 years or so should support it.</a></li> @@ -43,7 +43,7 @@ </div> <div id="container"> <div id="img"> - <img id="bg" src="/loading.png" alt=""> + <img id="bg" src="/loading.jpg" alt=""> <div id="solid"></div> </div> <div id="window" style="display: none;"> @@ -53,5 +53,5 @@ </div> <video id="vid"></video> </div> - </body> + </div></body> </html> diff --git a/www/js/api.js b/www/js/api.js index 1738ddf..1171533 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -17,7 +17,7 @@ window.html5ks.api = { } else { audio.volume += step * dir; setTimeout(function () { - this.fading(audio, dir, fade); + html5ks.api.fading(audio, dir, fade); }, fadeSet); } }, @@ -34,7 +34,7 @@ window.html5ks.api = { audio.addEventListener("playing", function playing() { audio.removeEventListener("playing", playing, false); deferred.resolve(); - html5ks.fading(audio, 1, fade); + html5ks.api.fading(audio, 1, fade); }, false); audio.addEventListener("error", function error() { audio.removeEventListener("error", error, false); @@ -136,31 +136,26 @@ window.html5ks.api = { deferred.resolve(); return deferred.promise; }, - run: function (label) { - label.forEach(function (inst) { - var cmd = inst[0], - args = inst.slice(1); - switch (cmd) { - case "extend": - case "hide": - case "ksgallery_unlock": - case "nvl": - case "play": - case "scene": - case "set_volume": - case "show": - case "stop": - case "window": - html5ks.api[cmd].apply(html5ks, args); - break; - default: - if (html5ks.data.characters[cmd]) { - this.character(cmd, args); - } else { - console.error("instruction not implemented: %o", inst); - } - } - }); + with: function (transition, action) { + return this.runInst(action); + }, + runInst: function (inst) { + var cmd = inst[0], + args = inst.slice(1); + if (html5ks.data.characters[cmd]) { + return this.character(cmd, args); + } else { + console.log(arguments); + return this[cmd].apply(this, args); + } + }, + runScript: function (label) { + var i = 0; + (function run() { + console.log(label[i]); + html5ks.api.runInst(label[i]).then(run, console.error); + i++; + }()); }, character: function (name, str) { var deferred = when.defer(), diff --git a/www/js/html5ks.js b/www/js/html5ks.js index 4c87763..08b8e73 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -1,6 +1,9 @@ (function () { "use strict"; window.html5ks = { + data: { + scripts: {} + }, persistent: { seen_scenes: {}, attraction: { @@ -13,7 +16,8 @@ // ms per character autospeed: 20, fade: 100, - gotit: false + gotit: false, + scale: true } }, state: { @@ -46,22 +50,28 @@ localStorage.persistent = JSON.stringify(this.persistent); }, scale: function () { - var height = document.documentElement.clientHeight, - width = document.documentElement.clientWidth, - newScale = 1; - if (height / width <= 0.75) { // widescreen - newScale = height / 600; + var newScale = 1; + if (html5ks.persistent.settings.scale) { + var height = document.documentElement.clientHeight, + width = document.documentElement.clientWidth; + if (height / width <= 0.75) { // widescreen + newScale = height / 600; + } else { + newScale = width / 800; + } } else { - newScale = width / 800; + newScale = 1; } html5ks.elements.container.style.webkitTransform = "scale(" + newScale + ")"; html5ks.elements.container.style.mozTransform = "scale(" + newScale + ")"; html5ks.elements.container.style.transform = "scale(" + newScale + ")"; }, next: function () {}, - loadChars: function () { - for (var character in this.characters) { - } + initEvents: function () { + window.addEventListener("resize", html5ks.scale, false); + this.elements.container.addEventListener("mouseup", function () { + html5ks.next(); + }, false); }, warnUnsupported: function () { if (!html5ks.persistent.settings.gotit) { @@ -84,25 +94,44 @@ } } }, - initEvents: function () { - window.addEventListener("resize", html5ks.scale, false); - this.elements.container.addEventListener("mouseup", function () { - html5ks.next(); - }, false); - }, onload: function () { this.initElements(); - this.loadChars(); this.load(); this.scale(); this.initEvents(); this.warnUnsupported(); }, winload: function () { + this.fetch("script", "a1-monday").then(function () { + html5ks.api.runScript(html5ks.data.scripts["a1-monday"].en_NOP1) + }); this.elements.img.bg.src = ""; + }, + fetch: function (type, name) { + var deferred = when.defer(); + switch (type) { + case "script": + var scripts = html5ks.data.scripts; + if (typeof scripts[name] === "object") { + deferred.resolve(); + } else { + var xhr = new XMLHttpRequest(); + xhr.open("GET", "/scripts/script-" + name + ".json"); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + scripts[name] = JSON.parse(xhr.responseText); + deferred.resolve(); + } + }; + xhr.send(); + } + break; + default: + throw new Error("fetchtype " + type + " not implemented"); + } + return deferred.promise; } }; - window.html5ks.data = {}; document.addEventListener("DOMContentLoaded", function () { html5ks.onload(); }, false); diff --git a/www/js/lib/modernizr.custom.44609.js b/www/js/lib/modernizr.custom.44609.js new file mode 100644 index 0000000..01c9ed0 --- /dev/null +++ b/www/js/lib/modernizr.custom.44609.js @@ -0,0 +1,4 @@ +/* Modernizr 2.6.2 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-fontface-csstransforms-csstransforms3d-csstransitions-canvas-audio-video-localstorage-inlinesvg-svg-svgclippaths-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-img_webp-json-svg_filters + */ +;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v=u.slice,w,x=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e}),r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.csstransforms=function(){return!!G("transform")},r.csstransforms3d=function(){var a=!!G("perspective");return a&&"webkitPerspective"in g.style&&x("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},r.csstransitions=function(){return G("transition")},r.fontface=function(){var a;return x('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},r.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(l.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(w=H.toLowerCase(),e[w]=r[H](),u.push((e[w]?"":"no-")+w));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=x,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+u.join(" "):""),e}(this,this.document),function(){var a=new Image;a.onerror=function(){Modernizr.addTest("webp",!1)},a.onload=function(){Modernizr.addTest("webp",function(){return a.width==1})},a.src="data:image/webp;base64,UklGRiwAAABXRUJQVlA4ICAAAAAUAgCdASoBAAEAL/3+/3+CAB/AAAFzrNsAAP5QAAAAAA=="}(),Modernizr.addTest("json",!!window.JSON&&!!JSON.parse),Modernizr.addTest("svgfilters",function(){var a=!1;try{a=typeof SVGFEColorMatrixElement!==undefined&&SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE==2}catch(b){}return a});
\ No newline at end of file diff --git a/www/js/lib/modernizr.custom.71672.js b/www/js/lib/modernizr.custom.71672.js deleted file mode 100644 index cef48ac..0000000 --- a/www/js/lib/modernizr.custom.71672.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.6.2 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-fontface-borderradius-boxshadow-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-hashchange-history-audio-video-input-inputtypes-localstorage-inlinesvg-svg-svgclippaths-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load - */ -;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return I("animationName")},s.csscolumns=function(){return I("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},s.cssreflections=function(){return I("boxReflect")},s.csstransforms=function(){return!!I("transform")},s.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return I("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,e.prefixed=function(a,b,c){return b?I(a,b,c):I(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
\ No newline at end of file diff --git a/www/js/play.js b/www/js/play.js index c0fb2e0..2be38ab 100644 --- a/www/js/play.js +++ b/www/js/play.js @@ -1,5 +1,4 @@ -if (!window.html5ks) window.html5ks = {}; -html5ks.music = { +html5ks.data.music = { "music_tranquil": "Afternoon", "music_nurse": "Ah_Eh_I_Oh_You", "music_soothing": "Air_Guitar", @@ -39,7 +38,7 @@ html5ks.music = { "music_one": "To_Become_One", "music_menus": "Wiosna" }; -html5ks.sfx = { +html5ks.data.sfx = { sfx_tcard: "sfx/tcard.ogg", sfx_4lslogo: "sfx/4lsaudiologo.ogg", sfx_alarmclock: "sfx/alarm.ogg", |