text: (function(t){function e(e){for(var r,i,o=e[0],c=e[1],u=e[2],f=0,p=[];f<o.length;f++)i=o[f],s[i]&&p.push(s[i][0]),s[i]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(t[r]=c[r]);l&&l(e);while(p.length)p.shift()();return a.push.apply(a,u||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],r=!0,o=1;o<n.length;o++){var c=n[o];0!==s[c]&&(r=!1)}r&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var r={},s={app:0},a=[];function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/vue-number-finder-game/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var u=0;u<o.length;u++)e(o[u]);var l=c;a.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"034f":function(t,e,n){"use strict";var r=n("64a9"),s=n.n(r);s.a},"56d7":function(t,e,n){"use strict";n.r(e);var r=n("2b0e"),s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{staticClass:"container"},[n(t.currentComponent,{tag:"div",attrs:{"swap-component":t.swapComponent}})],1)])},a=[],i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mainmenu"},[n("p",[t._v("An vue-number-finder-game")]),n("i",{staticClass:"fas fa-play-circle",on:{click:function(e){return t.swapComponent("game")}}}),n("i",{staticClass:"second fas fa-list-ol",on:{click:function(e){return t.swapComponent("sb")}}}),t._m(0),n("p",[t._v("Best score: "+t._s(t.score))])])},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a",{attrs:{href:"http://github.com/tabmk/vue-number-finder-game"}},[n("i",{staticClass:"second fab fa-github"})])}],c={name:"MainMenu",props:["swapComponent"],data(){return{score:"0.00"}},created(){this.score=this.$parent.test()[0]||"0.00"}},u=c,l=(n("93e5"),n("2877")),f=Object(l["a"])(u,i,o,!1,null,"ca515266",null),p=f.exports,m=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"game"},[n("div",{staticClass:"numbers"},[n("a",{staticClass:"nav",staticStyle:{float:"left"},on:{click:function(e){return t.swapComponent("mainmenu")}}},[n("i",{staticClass:"fas fa-home"})]),n("button",{staticClass:"number"},[t._v("\n        "+t._s(t.next)+"\n      ")]),n("a",{staticClass:"nav",staticStyle:{float:"right"},on:{click:function(e){return t.refresh()}}},[n("i",{staticClass:"fas fa-sync-alt"})]),n("div",{attrs:{id:"timer"}},[n("p",{class:{"heartBeat animated":t.over}},[t._v(t._s(t.time))])]),n("transition-group",{attrs:{name:"number"}},t._l(t.list,function(e,r){return n("button",{key:e.id,staticClass:"number",class:{"shake animated":t.incor,touched:e.state},on:{click:function(n){e.id==t.next&&!t.over&&t.time>0?t.updateCurrent(e.id,r):t.incor=1},animationend:function(e){t.incor=0}}},[t._v("\n        "+t._s(e.id)+"\n      ")])}),0)],1)])},d=[],h={name:"Game",props:["swapComponent"],data(){return{over:!1,time:"0.00",count:26,list:[],next:1,timer:null,incor:0,saves:5,tolose:90}},methods:{startTimer(){this.next=1,this.time="0.00",this.over=!1,this.suffle(),setTimeout(()=>{let t=Date.now();this.timer=setInterval(()=>{let e=(parseInt(Date.now()-t)/1e3).toFixed(2);e>90?(clearInterval(this.timer),this.time="Game over!",this.over=!0):this.time=e},10)},1700)},refresh(){clearInterval(this.timer),this.createList(),this.startTimer()},createList(){this.list=[...Array(this.count).keys()].slice(1).map(t=>{return{id:t,state:!1}})},suffle(){this.list=this.list.sort(()=>{return.5-Math.random()})},updateCurrent(t,e){let n=t+1;n==this.count?(clearInterval(this.timer),this.over=!0,this.saveScore(),setTimeout(()=>{this.swapComponent("sb")},2500)):this.next=n,this.list[e].state=!0},saveScore(){let t=localStorage.getItem("score"),e=t?JSON.parse(t).sort((t,e)=>{return t-e}).slice(0,this.saves-1):[];e.push(this.time),localStorage.setItem("score",JSON.stringify(e))}},created(){this.createList()},mounted(){this.startTimer()}},v=h,b=(n("8e89"),Object(l["a"])(v,m,d,!1,null,"7ae4b1a8",null)),_=b.exports,C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"scoreboard"},[n("table",[t._m(0),t._l(t.score,function(e,r){return n("tr",{key:e},[n("td",[t._v(t._s(r+1))]),n("td",[t._v(t._s(e))])])})],2),n("a",{on:{click:function(e){return t.swapComponent("mainmenu")}}},[n("i",{staticClass:"fas fa-home"})])])},g=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("tr",[n("th",{staticStyle:{"font-size":"30px"},attrs:{colspan:"2"}},[t._v("Scoreboard")])])}],y={name:"Scoreboard",props:["swapComponent"],data(){return{scores:[]}},created(){this.score=this.$parent.test()||[]}},w=y,S=(n("d56f"),Object(l["a"])(w,C,g,!1,null,"462e78fe",null)),x=S.exports,O={name:"app",components:{mainmenu:p,game:_,sb:x},data(){return{currentComponent:"mainmenu"}},methods:{swapComponent(t){this.currentComponent=t},test(t){try{let t=JSON.parse(localStorage.getItem("score"));if("object"==typeof t)return t}catch(e){return!1}}}},k=O,j=(n("034f"),Object(l["a"])(k,s,a,!1,null,null,null)),$=j.exports;r["a"].config.productionTip=!1,new r["a"]({render:function(t){return t($)}}).$mount("#app")},"64a9":function(t,e,n){},"7c73":function(t,e,n){},"8e89":function(t,e,n){"use strict";var r=n("7c73"),s=n.n(r);s.a},"93e5":function(t,e,n){"use strict";var r=n("99e7"),s=n.n(r);s.a},"99e7":function(t,e,n){},d56f:function(t,e,n){"use strict";var r=n("d7f7"),s=n.n(r);s.a},d7f7:function(t,e,n){}});
  //# sourceMappingURL=app.6771d061.js.map