mirror of https://github.com/bra1n/townsquare.git
2 lines
9.5 KiB
JavaScript
2 lines
9.5 KiB
JavaScript
|
(function(e){function t(t){for(var i,o,n=t[0],l=t[1],u=t[2],f=0,c=[];f<n.length;f++)o=n[f],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&c.push(a[o][0]),a[o]=0;for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i]);h&&h(t);while(c.length)c.shift()();return s.push.apply(s,u||[]),r()}function r(){for(var e,t=0;t<s.length;t++){for(var r=s[t],i=!0,n=1;n<r.length;n++){var l=r[n];0!==a[l]&&(i=!1)}i&&(s.splice(t--,1),e=o(o.s=r[0]))}return e}var i={},a={app:0},s=[];function o(t){if(i[t])return i[t].exports;var r=i[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=i,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(r,i,function(t){return e[t]}.bind(null,i));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/townsquare/";var n=window["webpackJsonp"]=window["webpackJsonp"]||[],l=n.push.bind(n);n.push=t,n=n.slice();for(var u=0;u<n.length;u++)t(n[u]);var h=l;s.push(["1d50","chunk-vendors"]),r()})({"1d50":function(e,t,r){"use strict";r.r(t);var i=r("2b0e"),a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"square",class:{public:e.isPublic},attrs:{id:"townsquare"}},[r("TownSquare",{attrs:{"is-public":e.isPublic}}),r("div",{staticClass:"controls"},[r("button",{on:{click:e.togglePublic}},[e._v("Toggle")])])],1)},s=[],o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ul",{staticClass:"circle",class:["size-"+e.players.length]},e._l(e.players,(function(t){return r("Player",{key:t.name,attrs:{player:t,roles:e.roles,"is-public":e.isPublic}})})),1)},n=[],l=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("li",[r("div",{staticClass:"player",class:{dead:e.player.hasDied,"no-vote":e.player.hasVoted}},[r("div",{staticClass:"shroud",on:{click:function(t){return e.toggleStatus()}}}),r("div",{staticClass:"token",class:[e.player.role],on:{click:function(t){return e.changeRole()}}},[e.role.firstNight?r("span",{staticClass:"leaf-left"}):e._e(),e.role.otherNight?r("span",{staticClass:"leaf-right"}):e._e(),e.role.reminders.length?r("span",{class:["leaf-top"+e.role.reminders.length]}):e._e(),e.role.setup?r("span",{staticClass:"leaf-orange"}):e._e(),r("div",[e._v(e._s(e.role.name))])]),e.role.ability?r("div",{staticClass:"ability"},[e._v(e._s(e.role.ability))]):e._e(),r("div",{staticClass:"name"},[e._v(e._s(e.player.name))])]),r("div",{staticClass:"reminder add"})])},u=[],h={props:{player:{type:Object,required:!0},roles:{type:Map,required:!0},isPublic:{type:Boolean,required:!0}},data(){return{role:this.roles.get(this.player.role)||{reminders:[]}}},methods:{toggleStatus(){this.isPublic&&this.player.hasDied?this.$set(this.player,"hasVoted",!this.player.hasVoted):(this.$set(this.player,"hasDied",!this.player.hasDied),this.player.hasDied||this.$set(this.player,"hasVoted",!1))},changeRole(){this.isPublic?this.toggleStatus():console.log("role change")}}},f=h,c=(r("3dc8"),r("2877")),d=Object(c["a"])(f,l,u,!1,null,null,null),m=d.exports,p=r("3107"),y={components:{Player:m},props:["isPublic"],data(){return{players:[{name:"Steffen",role:"baron"},{name:"Tino",role:"imp"},{name:"Basti",role:"chef"},{name:"Bernd",role:"ravenkeeper"},{name:"Tim",role:"drunk"},{name:"Yann",role:"librarian"},{name:"Marie",role:"empath"},{name:"Bogdan",role:"scarletwoman"},{name:"Sean",role:"recluse"},{name:"Petra",role:"undertaker"}],roles:new Map(p.map(e=>[e.id,e]))}}},g=y,b=(r("213a"),Object(c["a"])(g,o,n,!1,null,null,null)),v=b.exports,w={components:{TownSquare:v},data:()=>({
|
||
|
//# sourceMappingURL=app.36085a96.js.map
|