{"size": 6581, "ext": "js", "max_stars_repo_path": "dest/main.min.js", "max_stars_repo_name": "sugarshin/lightsaber", "max_stars_repo_stars_event_min_datetime": "2015-03-21T11:48:35.000Z", "max_stars_repo_stars_event_max_datetime": "2015-03-21T11:48:35.000Z", "max_issues_repo_path": "dest/main.min.js", "max_issues_repo_name": "sugarshin/lightsaber", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dest/main.min.js", "max_forks_repo_name": "sugarshin/lightsaber", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 1096.8333333333, "max_line_length": 3461, "alphanum_fraction": 0.7474547941}
!function t(e,n,o){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[s]={exports:{}};e[s][0].call(d.exports,function(t){var n=e[s][1][t];return i(n?n:t)},d,d.exports,t,e,n,o)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(t,e,n){var o={};e.exports=function(t,e){if(!o[t]){o[t]=!0;var n=document.createElement("style");n.setAttribute("type","text/css"),"textContent"in n?n.textContent=t:n.styleSheet.cssText=t;var i=document.getElementsByTagName("head")[0];e&&e.prepend?i.insertBefore(n,i.childNodes[0]):i.appendChild(n)}}},{}],2:[function(t,e,n){"use strict";var o;e.exports=o=function(){function t(t,e){this.context=t,this.urlList=e,this.bufferList=[]}return t.prototype.loadBuffer=function(t,e){var n,o,i;return i=new XMLHttpRequest,i.open("GET",t,!0),i.responseType="arraybuffer",o=function(n){return function(o){return o?n.bufferList[e]=o:console.log("ondecodesuccess",t)}}(this),n=function(t){return console.log("ondecodeerror",t)},i.onload=function(t){return function(){return t.context.decodeAudioData(i.response,o,n)}}(this),i.onerror=function(t){return console.log("req.onload",t)},i.send()},t.prototype.load=function(){var t,e,n,o,i,r;for(o=this.urlList,i=[],t=e=0,n=o.length;n>e;t=++e)r=o[t],i.push(this.loadBuffer(r,t));return i},t}()},{}],3:[function(t,e,n){"use strict";var o,i,r,s,a,u,c=function(t,e){return function(){return t.apply(e,arguments)}};a=t("./util"),s=a.addEvent,u=a.rmEvent,i=t("./bufferloader"),o=window.AudioContext||window.webkitAudioContext,e.exports=r=function(){function t(t,e){this.startBtn=e,this.onShake=c(this.onShake,this),this.context=new o,this.bufferLoader=new i(this.context,t),this.bufferLoader.load(),this.isPlaying=!1,this.isStart=!1,this.events()}return t.prototype.soundPlay=function(t,e){return this.source=this.context.createBufferSource(),this.gainNode=this.context.createGain(),this.source.buffer=t,this.source.connect(this.gainNode),this.gainNode.connect(this.context.destination),this.gainNode.gain.value=null!=e?e:0,this.isStart===!1&&this.source.start(0),this.isPlaying===!1&&this.isStart===!0?(this.source.start(0),this.isPlaying=!0,this.source.onended=function(t){return function(e){return t.isPlaying=!1}}(this)):void 0},t.prototype.start=function(){return this.soundPlay(this.bufferLoader.bufferList[0],1),this.addMotionEvent(),this.isStart=!0,document.getElementById("sword").style.display="block"},t.prototype.end=function(){return this.soundPlay(this.bufferLoader.bufferList[4],1),this.rmMotionEvent(),this.isStart=!1,document.getElementById("sword").style.display="none"},t.prototype.toggle=function(){return this.isStart===!1?this.start():this.end()},t.prototype.onShake=function(t){var e,n,o,i;return e=t.accelerationIncludingGravity,20>(n=e.x)&&n>15||20>(o=e.y)&&o>15||20>(i=e.z)&&i>15?this.soundPlay(this.bufferLoader.bufferList[2],1):e.x>30||e.y>30||e.z>30?this.soundPlay(this.bufferLoader.bufferList[3],1):void 0},t.prototype.events=function(){return s(this.startBtn,"click",function(t){return function(){return t.toggle()}}(this))},t.prototype.addMotionEvent=function(){return s(window,"devicemotion",this.onShake)},t.prototype.rmMotionEvent=function(){return u(window,"devicemotion",this.onShake)},t}()},{"./bufferloader":2,"./util":5}],4:[function(t,e,n){/*!
 * @license lightsaber
 * (c) sugarshin
 * License: MIT
 */
"use strict";var o;t("insert-css")(t("../index.styl")),new(o=t("./lightsaber"))(["start.mp3","slow.mp3","normal.mp3","clash.mp3","stop.mp3"],document.getElementById("start"))},{"../index.styl":6,"./lightsaber":3,"insert-css":1}],5:[function(t,e,n){"use strict";e.exports={addEvent:function(t,e,n,o){return null==o&&(o=!1),t.addEventListener(e,n,o)},rmEvent:function(t,e,n,o){return null==o&&(o=!1),t.removeEventListener(e,n,o)}}},{}],6:[function(t,e,n){e.exports="@charset \"utf-8\";\nhtml{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,details,section,summary,aside,main,menu,nav,figcaption,figure,footer,header,hgroup{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent;}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}dfn{font-style:italic}mark{background:#ff0;color:#000}b,strong{font-weight:bold}h1{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type='button'],input[type='reset'],input[type='submit']{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type='checkbox'],input[type='radio']{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{height:auto}input[type='search']{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type='search']::-webkit-search-cancel-button,input[type='search']::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{height:100%}body{margin:0;background:#fff;color:#2c3e50;font-family:\"Open Sans\",sans-serif;height:100%}.wrap{height:100%}#start{text-align:center;position:absolute;bottom:0;width:100%}#sword{width:2.5%;height:100%;background:#fff;margin:0 auto;-webkit-box-shadow:0 0 14px 3px #15ffff;box-shadow:0 0 14px 3px #15ffff;display:none}button{width:50%;display:inline-block;font-size:1.6em}img{width:10%;height:auto;vertical-align:bottom}"},{}]},{},[4]);