diff --git a/build/2.css b/build/2.css index d74bce2..1a9119f 100644 --- a/build/2.css +++ b/build/2.css @@ -1 +1 @@ -.icon14{height:14px;padding-bottom:2px}.icon16{height:16px}.icon20{height:20px}.icon24{height:24px}.bigger{font-size:14px}.name{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.name .subname:before{content:"\a ";white-space:pre}.name .subname{font-size:13px;padding-bottom:4px;display:inherit}@media only screen and (min-width:975px){.collection{margin-top:5px;margin-right:5px;margin-left:5px}}@media only screen and (min-width:975px){.collection>.left{font-family:Roboto,Arial,sans-serif;float:left;width:30%}.collection>.right{font-family:Roboto,Arial,sans-serif;float:right;width:70%}.collection #buttons{margin:0 0 2% 1%}.collection #buttons,.collection .button,.collection input[type=button],.collection input[type=text]{border-radius:5px;border-color:transparent;text-align:center;outline:none}.collection input[type=text]{margin-bottom:2px}.collection .centeredCheckBox,.collection input[type=text]{width:220px}.collection .text-entry{display:flex;justify-content:center;align-items:center}.collection .text-entry input:focus{outline:none}.collection .card{text-align:left;display:flex;border:1px solid #aeaeae}.collection .card .left,.collection .card .right,.collection .card .stats{padding-top:4px}.collection .card .bigger{text-align:center;font-weight:700}.collection .card .energy{display:flex;width:20px!important}.collection .card .left{vertical-align:text-top;float:left;width:210px;padding-left:4px}.collection .card .right{float:left;width:calc(100% - 322px);border-left:2px solid #aeaeae;padding-left:4px;padding-right:4px;padding-bottom:6px;white-space:pre-line}.collection .creature .right{width:calc(100% - 366px)}.collection .creature .stats{vertical-align:text-top;float:left;text-align:right;width:40px}.collection .SearchForm{padding-top:3px;font-family:Roboto,Arial,sans-serif}.collection .searchName{display:flex;justify-content:center;align-items:center;padding:2%;font-size:16pt}.collection .centeredCheckBox{margin:0 auto;text-align:left}.collection .centeredSpacing{display:flex;justify-content:space-between}.collection .setBox{width:80%;float:right}.collection #sets{width:80%}.collection .centeredButtons{display:flex;justify-content:center;align-items:center}.collection #search{width:25%;margin:2%;border-radius:5px;border-color:transparent;text-align:center}.collection .minMax{display:flex;justify-content:space-between;margin:0 auto;width:50%;text-align:right}.collection .brainwashed{border-radius:3px;background-color:#dcdddf;color:#000!important}.collection .chieftain,.collection .flavortext{font-style:italic}.collection .mull input{margin-left:0;margin-top:1px}.collection .Collapsible__contentInner input,.collection .mull input{vertical-align:middle}.collection .Collapsible__contentInner .centeredCheckBox{width:50%}.collection .tribes{width:96%;text-align:center}.collection .and,.collection .disciplines{text-align:center}.collection .and{vertical-align:text-bottom;width:15%;border-radius:5px;border-color:transparent;margin:2%}}.collection .disciplines input{width:30px;height:14px;text-align:center;margin-top:2px}.collection .mcbp input{width:24px;height:14px;padding:unset;text-align:center;margin-top:2px}.collection .card .icon14,.collection .card .icon16,.collection .card .icon20,.collection .card .icon24{vertical-align:middle}.collection .thumb{width:100px;height:98px}.collection .card .thumb{float:left}.collection .Collapsible{margin-bottom:5px;margin-top:5px;width:96%}.collection .Collapsible__trigger{background-color:#333;display:block;position:relative;padding-top:5px;padding-bottom:5px;text-indent:5px;font-weight:700;white-space:pre}.collection .Collapsible__trigger:hover{background-color:red}.collection .Collapsible__trigger:after{content:"^";position:absolute;right:10px;top:10px;display:block;transition:transform .4s}.collection .Collapsible__trigger.is-open:after{transform:rotate(180deg);right:5px;top:5px}.collection .Collapsible__trigger.is-disabled{opacity:.5;background-color:grey}.collection .Collapsible__contentInner{margin-top:5px}.collection .left{position:relative}.collection .card_img{position:absolute;width:100%;z-index:2;left:-11px}.collection .card_img .hidden{display:none;max-height:0}.collection .card_img img{max-width:250px;max-height:350px}.collection .entries{text-align:left;width:100%}.collection .entries input[type=button]{margin:0 0 2% 1%}.collection .list-nav-top{display:flex}.collection .extended .fullcard{max-width:250px;max-height:350px}.collection hr{width:96%;margin-inline-start:0}.collection .none{display:inline}.collection .none>span{top:-3px;position:relative}.collection label{user-select:none;-webkit-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-o-user-select:none;-moz-user-select:none} \ No newline at end of file +.icon14{height:14px;padding-bottom:2px}.icon16{height:16px}.icon20{height:20px}.icon24{height:24px}.bigger{font-size:14px}.name{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.name .subname:before{content:"\a ";white-space:pre}.name .subname{font-size:13px;padding-bottom:4px;display:inherit}@media only screen and (min-width:975px){.collection{margin-top:5px;margin-right:5px;margin-left:5px}}@media only screen and (min-width:975px){.collection>.left{font-family:Roboto,Arial,sans-serif;float:left;width:30%}.collection>.right{font-family:Roboto,Arial,sans-serif;float:right;width:70%}.collection #buttons{margin:0 0 2% 1%}.collection #buttons,.collection .button,.collection input[type=button],.collection input[type=text]{border-radius:5px;border-color:transparent;text-align:center;outline:none}.collection input[type=text]{margin-bottom:2px}.collection .centeredCheckBox,.collection input[type=text]{width:220px}.collection .text-entry{display:flex;justify-content:center;align-items:center}.collection .text-entry input:focus{outline:none}.collection .card{text-align:left;display:flex;border:1px solid #aeaeae}.collection .card .left,.collection .card .right,.collection .card .stats{padding-top:4px}.collection .card .bigger{text-align:center;font-weight:700}.collection .card .energy{display:flex;width:20px!important}.collection .card .left{vertical-align:text-top;float:left;width:210px;padding-left:4px}.collection .card .right{float:left;width:calc(100% - 322px);border-left:2px solid #aeaeae;padding-left:4px;padding-right:4px;padding-bottom:6px;white-space:pre-line}.collection .creature .right{width:calc(100% - 366px)}.collection .creature .stats{vertical-align:text-top;float:left;text-align:right;width:40px}.collection .SearchForm{padding-top:3px;font-family:Roboto,Arial,sans-serif}.collection .searchName{display:flex;justify-content:center;align-items:center;padding:2%;font-size:16pt}.collection .centeredCheckBox{margin:0 auto;text-align:left}.collection .centeredSpacing{display:flex;justify-content:space-between}.collection .setBox{width:80%;float:right}.collection #sets{width:80%}.collection .centeredButtons{display:flex;justify-content:center;align-items:center}.collection #search{width:25%;margin:2%;border-radius:5px;border-color:transparent;text-align:center}.collection .minMax{display:flex;justify-content:space-between;margin:0 auto;width:50%;text-align:right}.collection .brainwashed{border-radius:3px;background-color:#dcdddf;color:#000!important}.collection .chieftain,.collection .flavortext{font-style:italic}.collection .mull input{margin-left:0;margin-top:1px}.collection .Collapsible__contentInner input,.collection .mull input{vertical-align:middle}.collection .Collapsible__contentInner .centeredCheckBox{width:50%}.collection .tribes{width:96%;text-align:center}.collection .and,.collection .disciplines{text-align:center}.collection .and{vertical-align:text-bottom;width:15%;border-radius:5px;border-color:transparent;margin:2%}}.collection .disciplines input{width:30px;height:14px;text-align:center;margin-top:2px}.collection .mcbp input{width:24px;height:14px;padding:unset;text-align:center;margin-top:2px}.collection .card .icon14,.collection .card .icon16,.collection .card .icon20,.collection .card .icon24{vertical-align:middle}.collection .thumb{width:100px;height:98px}.collection .card .thumb{float:left}.collection .attack .bp{vertical-align:middle}.collection .Collapsible{margin-bottom:5px;margin-top:5px;width:96%}.collection .Collapsible__trigger{background-color:#333;display:block;position:relative;padding-top:5px;padding-bottom:5px;text-indent:5px;font-weight:700;white-space:pre}.collection .Collapsible__trigger:hover{background-color:red}.collection .Collapsible__trigger:after{content:"^";position:absolute;right:10px;top:10px;display:block;transition:transform .4s}.collection .Collapsible__trigger.is-open:after{transform:rotate(180deg);right:5px;top:5px}.collection .Collapsible__trigger.is-disabled{opacity:.5;background-color:grey}.collection .Collapsible__contentInner{margin-top:5px}.collection .left{position:relative}.collection .card_img{position:absolute;width:100%;z-index:2;left:-11px}.collection .card_img .hidden{display:none;max-height:0}.collection .card_img img{max-width:250px;max-height:350px}.collection .entries{text-align:left;width:100%}.collection .entries input[type=button]{margin:0 0 2% 1%}.collection .list-nav-top{display:flex}.collection .extended .fullcard{max-width:250px;max-height:350px}.collection hr{width:96%;margin-inline-start:0}.collection .none{display:inline}.collection .none>span{top:-3px;position:relative}.collection label{user-select:none;-webkit-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-o-user-select:none;-moz-user-select:none} \ No newline at end of file diff --git a/build/2.js b/build/2.js index 4d42efd..be1ba6f 100644 --- a/build/2.js +++ b/build/2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{387:function(e,t,a){},390:function(e,t,a){"use strict";a.r(t);var n,r,i,l,s,c,m,u,o,g,p,d=a(122),h=a.n(d),x=a(64),f=a.n(x),b=a(62),y=a.n(b),$=a(52),E=a.n($),v=a(119),k=a.n(v),w=a(120),C=a.n(w),N=a(165),q=a.n(N),I=a(121),O=a.n(I),_=a(39),R=a.n(_),j=(a(164),a(0)),B=a.n(j),M=a(70),S=a(6),A=a(85),L=a(35),T=Object(A.a)(function(e,t,a){return t})(n=Object(A.b)(n=function(e){function t(){return y()(this,t),k()(this,C()(t).apply(this,arguments))}return O()(t,e),E()(t,[{key:"render",value:function(){var e=this,t=this.props.card;return 0==this.props.ext?B.a.createElement("div",{className:"card attack"},B.a.createElement("img",{className:"thumb",src:M.a.base_image+(t.gsx$thumb||M.a.thumb_missing),onClick:function(){return e.props.setImage(t.gsx$image)}}),B.a.createElement("div",{className:"left"},B.a.createElement(L.k,{name:t.gsx$name}),B.a.createElement("br",null),B.a.createElement(L.m,{set:t.gsx$set,rarity:t.gsx$rarity}),B.a.createElement("br",null),B.a.createElement("span",null,B.a.createElement(L.b,null)," Attack - ",t.gsx$bp),B.a.createElement("br",null),B.a.createElement("div",null,B.a.createElement("span",{className:"bigger"},t.gsx$base)," | ",B.a.createElement(L.f,{element:"fire",value:t.gsx$fire}),t.gsx$fire," ",B.a.createElement(L.f,{element:"air",value:t.gsx$air}),t.gsx$air," ",B.a.createElement(L.f,{element:"earth",value:t.gsx$earth}),t.gsx$earth," ",B.a.createElement(L.f,{element:"water",value:t.gsx$water}),t.gsx$water)),B.a.createElement("br",null),B.a.createElement("div",{className:"right"},B.a.createElement(L.a,{ability:t.gsx$ability}),B.a.createElement(L.q,{data:{unique:t.gsx$unique,loyal:t.gsx$loyal,legendary:t.gsx$legendary}}),B.a.createElement("span",{className:"flavortext"},t.gsx$flavortext))):B.a.createElement("div",{className:"card attack"},B.a.createElement("img",{className:"fullcard",src:M.a.base_image+(t.gsx$image||M.a.card_back)}),B.a.createElement("div",{className:"right"},B.a.createElement(L.k,{name:t.gsx$name}),B.a.createElement("br",null),B.a.createElement(L.a,{ability:t.gsx$ability}),B.a.createElement(L.q,{data:{unique:t.gsx$unique,loyal:t.gsx$loyal,legendary:t.gsx$legendary}}),t.gsx$flavortext&&B.a.createElement(B.a.Fragment,null,B.a.createElement("span",{className:"flavortext"},t.gsx$flavortext),B.a.createElement("br",null)),B.a.createElement("span",null,"Art By: ",t.gsx$artist)))}}]),t}(B.a.Component))||n)||n,P=Object(A.a)(function(e,t,a){return t})(r=Object(A.b)(r=function(e){function t(){return y()(this,t),k()(this,C()(t).apply(this,arguments))}return O()(t,e),E()(t,[{key:"render",value:function(){var e=this,t=this.props.card;return 0==this.props.ext?B.a.createElement("div",{className:"card battlegear"},B.a.createElement("img",{className:"thumb",style:{float:"left"},src:M.a.base_image+(t.gsx$thumb||M.a.thumb_missing),onClick:function(){return e.props.setImage(t.gsx$image)}}),B.a.createElement("div",{className:"left"},B.a.createElement(L.k,{name:t.gsx$name}),B.a.createElement("br",null),B.a.createElement(L.m,{set:t.gsx$set,rarity:t.gsx$rarity}),B.a.createElement("br",null),B.a.createElement("span",null,B.a.createElement(L.c,null)," Battlegear",0=t.energy.min&&(l=l.find({gsx$energy:{$lte:t.energy.max}})),(0=t.mcbp.min&&(r=r.find({gsx$bp:{$lte:t.mcbp.max}}),l=l.find({gsx$mugicability:{$lte:t.mcbp.max}}),c=c.find({gsx$cost:{$lte:t.mcbp.max}})),(0=t.energy.min&&(l=l.find({gsx$energy:{$lte:t.energy.max}})),(0=t.mcbp.min&&(r=r.find({gsx$bp:{$lte:t.mcbp.max}}),l=l.find({gsx$mugicability:{$lte:t.mcbp.max}}),c=c.find({gsx$cost:{$lte:t.mcbp.max}})),(0new Date(t)&&(l[a].clear(),l[a].insert(e),k.set("".concat(l.format,"_").concat(a),e[0].updated,{path:"/"})):k.set("".concat(l.format,"_").concat(a),e[0].updated,{path:"/"})}),e.abrupt("return",t());e.next=5;break;case 5:if("building"==this.building[a].get())return r=Object(N.l)(this.building[a],function(e){r(),t()}),e.abrupt("return",r);e.next=8;break;case 8:if("setup"!=this.building[a].get()){e.next=16;break}if(this.building[a].set("building"),0==this[a].data.length)return e.abrupt("return",this.getSpreadsheetData(this.api.urls[n][this.format],n,function(e){return l[a].insert(e),l.building[a].set("built"),t()}));e.next=14;break;case 14:return this.building[a].set("built"),e.abrupt("return",t());case 16:e.next=21;break;case 18:return this.building[a]=N.k.box("wait"),i=Object(N.l)(this.building[a],function(){return i(),l.setupType(a,t)}),e.abrupt("return",i);case 21:case"end":return e.stop()}},e,this)})),function(e,t){return a.apply(this,arguments)})},{key:"setupDB",value:function(e){var n=new B.a("chaotic_".concat(e,".db"),{autosave:!0,autoload:!0,autoloadCallback:function(){var a=this;["attacks","battlegear","creatures","locations","mugic"].forEach(function(e){var t=n.getCollection(e);null===t||0===t.data.length?(a[e]=n.addCollection(e),a.building[e]?a.building[e].set("setup"):a.building[e]=N.k.box("setup")):(a[e]=t,a.building[e]?a.building[e].set("built"):a.building[e]=N.k.box("built"))})}.bind(this),autosaveInterval:4e3,persistenceMethod:"localStorage"});this.db=n}}]),n}(),l=A()(a.prototype,"building",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),A()(a.prototype,"setupType",[N.d],Object.getOwnPropertyDescriptor(a.prototype,"setupType"),a.prototype),A()(a.prototype,"setupDB",[N.d],Object.getOwnPropertyDescriptor(a.prototype,"setupDB"),a.prototype),a),C=(u=r=function(){function a(){b()(this,a),h()(this,"portal",c,this),h()(this,"cards",o,this),h()(this,"urls",s,this),this.instance=null,this.setupDB()}var t,n,r;return y()(a,[{key:"path",value:function(e){return a.path(e)}},{key:"base_image",get:function(){return"https://drive.google.com/uc?id="}},{key:"thumb_missing",get:function(){return"1JYjPzkv74IhzlHTyVh2niTDyui73HSfp"}},{key:"card_back",get:function(){return"1_MgWDPsPGf-gPBArn2v6ideJcqOPsSYC"}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new a),this.instance}},{key:"path",value:function(e){return a.base_url+e+a.data_format}}]),y()(a,[{key:"getSpreadsheet",value:(r=g()(p.a.mark(function e(t,a){return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:fetch(t).then(function(e){return e.json()}).then(function(e){return a(e.feed.entry)}).catch(function(e){return console.error("parsing failed",e),a(null)});case 1:case"end":return e.stop()}},e)})),function(e,t){return r.apply(this,arguments)})},{key:"setupDB",value:function(){try{var t={};i(360).forEach(function(e){t[e.gsx$type.$t]||(t[e.gsx$type.$t]={}),t[e.gsx$type.$t][e.gsx$subtype.$t]=a.path(e.gsx$url.$t)}),this.urls=t,this.portal=new M(this,"portal"),this.cards=new M(this,"cards")}catch(e){console.error("setting up database failed",e)}}},{key:"LoadDB",value:(n=g()(p.a.mark(function e(a){var n=this;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){null!==n.urls&&null!==n.portal&&null!==n.cards?n.buildCollection(a).then(function(){e()}):e()}));case 1:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)})},{key:"buildCollection",value:(t=g()(p.a.mark(function e(t){var n=this;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(function(a){return new Promise(function(e,t){return"cards"in a?n.cards.setupType(a.cards,e):"portal"in a?n.portal.setupType(a.portal,e):(console.error("cards or portal"),t())})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})},{key:"purgeDB",value:function(){this.cards.purgeDB(),this.portal.purgeDB(),window.location.reload()}},{key:"tribes",get:function(){return["Danian","Generic","Mipedian","M'arrillian","OverWorld","UnderWorld"]}},{key:"sets",get:function(){return{DOP:"Dawn of Perim",ZOTH:"Zenith of the Hive",SS:"Silent Sands",MI:"Beyond the Doors",ROTO:"Rise of the Oligarch",TOTT:"Turn of the Tide",FUN:"Forged Unity",AU:"Alliance Unraveled",FAS:"Fire and Stone",SAS:"Storm and Sea",EE:"Elemental Emperors",BR:"Beyond Rare",LR:"League Rewards",OP1:"Organized Play 1",PROMO:"Promotional"}}}]),a}(),r.base_url="https://spreadsheets.google.com/feeds/list/",r.data_format="/od6/public/values?alt=json",n=u,c=A()(n.prototype,"portal",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),o=A()(n.prototype,"cards",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),s=A()(n.prototype,"urls",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),n);t.a=C.getInstance()}}); \ No newline at end of file +!function(o){function e(e){for(var t,a,n=e[0],r=e[1],i=e[2],l=0,c=[];lnew Date(t)&&(l[a].clear(),l[a].insert(e),k.set("".concat(l.format,"_").concat(a),e[0].updated,{path:"/"})):k.set("".concat(l.format,"_").concat(a),e[0].updated,{path:"/"})}),e.abrupt("return",t());e.next=5;break;case 5:if("building"==this.building[a].get())return r=Object(N.l)(this.building[a],function(e){r(),t()}),e.abrupt("return",r);e.next=8;break;case 8:if("setup"!=this.building[a].get()){e.next=16;break}if(this.building[a].set("building"),0==this[a].data.length)return e.abrupt("return",this.getSpreadsheetData(this.api.urls[n][this.format],n,function(e){return l[a].insert(e),l.building[a].set("built"),t()}));e.next=14;break;case 14:return this.building[a].set("built"),e.abrupt("return",t());case 16:e.next=21;break;case 18:return this.building[a]=N.k.box("wait"),i=Object(N.l)(this.building[a],function(){return i(),l.setupType(a,t)}),e.abrupt("return",i);case 21:case"end":return e.stop()}},e,this)})),function(e,t){return a.apply(this,arguments)})},{key:"setupDB",value:function(e){var n=new B.a("chaotic_".concat(e,".db"),{autosave:!0,autoload:!0,autoloadCallback:function(){var a=this;["attacks","battlegear","creatures","locations","mugic"].forEach(function(e){var t=n.getCollection(e);null===t||0===t.data.length?(a[e]=n.addCollection(e),a.building[e]?a.building[e].set("setup"):a.building[e]=N.k.box("setup")):(a[e]=t,a.building[e]?a.building[e].set("built"):a.building[e]=N.k.box("built"))})}.bind(this),autosaveInterval:4e3,persistenceMethod:"localStorage"});this.db=n}}]),n}(),l=A()(a.prototype,"building",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),A()(a.prototype,"setupType",[N.d],Object.getOwnPropertyDescriptor(a.prototype,"setupType"),a.prototype),A()(a.prototype,"setupDB",[N.d],Object.getOwnPropertyDescriptor(a.prototype,"setupDB"),a.prototype),a),C=(u=r=function(){function a(){b()(this,a),h()(this,"portal",c,this),h()(this,"cards",o,this),h()(this,"urls",s,this),this.instance=null,this.setupDB()}var t,n,r;return y()(a,[{key:"path",value:function(e){return a.path(e)}},{key:"base_image",get:function(){return"https://drive.google.com/uc?id="}},{key:"thumb_missing",get:function(){return"1JYjPzkv74IhzlHTyVh2niTDyui73HSfp"}},{key:"card_back",get:function(){return"1_MgWDPsPGf-gPBArn2v6ideJcqOPsSYC"}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new a),this.instance}},{key:"path",value:function(e){return a.base_url+e+a.data_format}}]),y()(a,[{key:"getSpreadsheet",value:(r=g()(p.a.mark(function e(t,a){return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:fetch(t).then(function(e){return e.json()}).then(function(e){return a(e.feed.entry)}).catch(function(e){return console.error("parsing failed",e),a(null)});case 1:case"end":return e.stop()}},e)})),function(e,t){return r.apply(this,arguments)})},{key:"setupDB",value:function(){try{var t={};i(360).forEach(function(e){t[e.gsx$type.$t]||(t[e.gsx$type.$t]={}),t[e.gsx$type.$t][e.gsx$subtype.$t]=a.path(e.gsx$url.$t)}),this.urls=t,this.portal=new M(this,"portal"),this.cards=new M(this,"cards")}catch(e){console.error("setting up database failed",e)}}},{key:"LoadDB",value:(n=g()(p.a.mark(function e(a){var n=this;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){null!==n.urls&&null!==n.portal&&null!==n.cards?n.buildCollection(a).then(function(){e()}):e()}));case 1:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)})},{key:"buildCollection",value:(t=g()(p.a.mark(function e(t){var n=this;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(function(a){return new Promise(function(e,t){return"cards"in a?n.cards.setupType(a.cards,e):"portal"in a?n.portal.setupType(a.portal,e):(console.error("cards or portal"),t())})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})},{key:"purgeDB",value:function(){this.cards.purgeDB(),this.portal.purgeDB(),window.location.reload()}},{key:"tribes",get:function(){return["Danian","Generic","Mipedian","M'arrillian","OverWorld","UnderWorld"]}},{key:"sets",get:function(){return{DOP:"Dawn of Perim",ZOTH:"Zenith of the Hive",SS:"Silent Sands",MI:"Beyond the Doors",ROTO:"Rise of the Oligarch",TOTT:"Turn of the Tide",FUN:"Forged Unity",AU:"Alliance Unraveled",FAS:"Fire and Stone",SAS:"Storm and Sea",EE:"Elemental Emperors",BR:"Beyond Rare",LR:"League Rewards",OP1:"Organized Play 1",PROMO:"Promotional"}}}]),a}(),r.base_url="https://spreadsheets.google.com/feeds/list/",r.data_format="/od6/public/values?alt=json",n=u,c=A()(n.prototype,"portal",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),o=A()(n.prototype,"cards",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),s=A()(n.prototype,"urls",[N.k],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),n);t.a=C.getInstance()}}); \ No newline at end of file diff --git a/src/components/Snippets.js b/src/components/Snippets.js index e43c09b..0963e08 100644 --- a/src/components/Snippets.js +++ b/src/components/Snippets.js @@ -70,7 +70,9 @@ export function Name(props) { } export function Mugic(props) { - return {"MC"} + let type = (props.tribe||"generic") + (props.amount != undefined ? `_${props.amount}` : ""); + let src = ("/src/img/icons/mugic/"+type+".png").toLowerCase(); + return {"MC"} } export function Element(props) { @@ -99,13 +101,17 @@ export function BattlegearIcon(props) { } export function AttackIcon(props) { - return + let attack = "attack" + ((props.bp && props.bp >= 0) ? "_" + props.bp : ""); + return } export function Ability(props) { const mugic_counters = { - regex: /{{mc}}/i, + regex: /([0-9x]*){{mc}}/i, fn: (key, result) => { + if (result.length > 1 && result[1] != "") { + return (); + } return (); } } diff --git a/src/components/collection/collection.scss b/src/components/collection/collection.scss index a2b602d..817a02a 100644 --- a/src/components/collection/collection.scss +++ b/src/components/collection/collection.scss @@ -243,6 +243,10 @@ float: left; } + .attack .bp { + vertical-align: middle; + } + .Collapsible { margin-bottom: 5px; margin-top: 5px; diff --git a/src/components/collection/types/Attack.js b/src/components/collection/types/Attack.js index 6ebb418..3463de7 100644 --- a/src/components/collection/types/Attack.js +++ b/src/components/collection/types/Attack.js @@ -15,9 +15,9 @@ export default class Attack extends React.Component {


- Attack - {card.gsx$bp}
+ Attack - {card.gsx$bp}
- {card.gsx$base} |  + {card.gsx$base}{card.gsx$fire}  {card.gsx$air}  {card.gsx$earth}  diff --git a/src/components/collection/types/Mugic.js b/src/components/collection/types/Mugic.js index ef13481..afe234c 100644 --- a/src/components/collection/types/Mugic.js +++ b/src/components/collection/types/Mugic.js @@ -11,14 +11,19 @@ export default class Attack extends React.Component { let mugicCounters = []; if (card.gsx$cost == 0) { - mugicCounters.push(0); + mugicCounters.push(); } else if (card.gsx$cost.toLowerCase() == 'x') { - mugicCounters.push(X); + mugicCounters.push(); } else { - for (let i = 0; i < card.gsx$cost; i++) { - mugicCounters.push(); + if (card.gsx$cost > 5) { + mugicCounters.push(); + } + else { + for (let i = 0; i < card.gsx$cost; i++) { + mugicCounters.push(); + } } } diff --git a/src/img/icons/attack.png b/src/img/icons/attack/attack.png similarity index 100% rename from src/img/icons/attack.png rename to src/img/icons/attack/attack.png diff --git a/src/img/icons/attack/attack_0.png b/src/img/icons/attack/attack_0.png new file mode 100644 index 0000000..b404fc8 Binary files /dev/null and b/src/img/icons/attack/attack_0.png differ diff --git a/src/img/icons/attack/attack_1.png b/src/img/icons/attack/attack_1.png new file mode 100644 index 0000000..cfdab87 Binary files /dev/null and b/src/img/icons/attack/attack_1.png differ diff --git a/src/img/icons/attack/attack_2.png b/src/img/icons/attack/attack_2.png new file mode 100644 index 0000000..4bc6e48 Binary files /dev/null and b/src/img/icons/attack/attack_2.png differ diff --git a/src/img/icons/attack/attack_3.png b/src/img/icons/attack/attack_3.png new file mode 100644 index 0000000..790cb10 Binary files /dev/null and b/src/img/icons/attack/attack_3.png differ diff --git a/src/img/icons/attack/attack_4.png b/src/img/icons/attack/attack_4.png new file mode 100644 index 0000000..49555f4 Binary files /dev/null and b/src/img/icons/attack/attack_4.png differ diff --git a/src/img/icons/attack/attack_5.png b/src/img/icons/attack/attack_5.png new file mode 100644 index 0000000..7f7f01d Binary files /dev/null and b/src/img/icons/attack/attack_5.png differ diff --git a/src/img/icons/mugic/128px/danian.png b/src/img/icons/mugic/128px/danian.png new file mode 100644 index 0000000..d3f062a Binary files /dev/null and b/src/img/icons/mugic/128px/danian.png differ diff --git a/src/img/icons/mugic/128px/generic.png b/src/img/icons/mugic/128px/generic.png new file mode 100644 index 0000000..742721b Binary files /dev/null and b/src/img/icons/mugic/128px/generic.png differ diff --git a/src/img/icons/mugic/128px/m'arrillian.png b/src/img/icons/mugic/128px/m'arrillian.png new file mode 100644 index 0000000..3216036 Binary files /dev/null and b/src/img/icons/mugic/128px/m'arrillian.png differ diff --git a/src/img/icons/mugic/128px/mipedian.png b/src/img/icons/mugic/128px/mipedian.png new file mode 100644 index 0000000..3120461 Binary files /dev/null and b/src/img/icons/mugic/128px/mipedian.png differ diff --git a/src/img/icons/mugic/128px/overworld.png b/src/img/icons/mugic/128px/overworld.png new file mode 100644 index 0000000..2a79b43 Binary files /dev/null and b/src/img/icons/mugic/128px/overworld.png differ diff --git a/src/img/icons/mugic/128px/underworld.png b/src/img/icons/mugic/128px/underworld.png new file mode 100644 index 0000000..d0973c6 Binary files /dev/null and b/src/img/icons/mugic/128px/underworld.png differ diff --git a/src/img/icons/mugic/danian_0.png b/src/img/icons/mugic/danian_0.png new file mode 100644 index 0000000..a9ae1cc Binary files /dev/null and b/src/img/icons/mugic/danian_0.png differ diff --git a/src/img/icons/mugic/danian_x.png b/src/img/icons/mugic/danian_x.png new file mode 100644 index 0000000..693e35d Binary files /dev/null and b/src/img/icons/mugic/danian_x.png differ diff --git a/src/img/icons/mugic/generic.png b/src/img/icons/mugic/generic.png index 0ae3940..a0facb2 100644 Binary files a/src/img/icons/mugic/generic.png and b/src/img/icons/mugic/generic.png differ diff --git a/src/img/icons/mugic/generic_0.png b/src/img/icons/mugic/generic_0.png new file mode 100644 index 0000000..a4a996f Binary files /dev/null and b/src/img/icons/mugic/generic_0.png differ diff --git a/src/img/icons/mugic/generic_x.png b/src/img/icons/mugic/generic_x.png new file mode 100644 index 0000000..5d0cf40 Binary files /dev/null and b/src/img/icons/mugic/generic_x.png differ diff --git a/src/img/icons/mugic/m'arrillian_10.png b/src/img/icons/mugic/m'arrillian_10.png new file mode 100644 index 0000000..db00c89 Binary files /dev/null and b/src/img/icons/mugic/m'arrillian_10.png differ diff --git a/src/img/icons/mugic/m'arrillian_6.png b/src/img/icons/mugic/m'arrillian_6.png new file mode 100644 index 0000000..8d19048 Binary files /dev/null and b/src/img/icons/mugic/m'arrillian_6.png differ diff --git a/src/img/icons/mugic/marrillian.png b/src/img/icons/mugic/marrillian.png new file mode 100644 index 0000000..08b7bb0 Binary files /dev/null and b/src/img/icons/mugic/marrillian.png differ diff --git a/src/img/icons/mugic/mipedian_0.png b/src/img/icons/mugic/mipedian_0.png new file mode 100644 index 0000000..abc75ba Binary files /dev/null and b/src/img/icons/mugic/mipedian_0.png differ diff --git a/src/img/icons/mugic/overworld_0.png b/src/img/icons/mugic/overworld_0.png new file mode 100644 index 0000000..2cc664a Binary files /dev/null and b/src/img/icons/mugic/overworld_0.png differ diff --git a/src/img/icons/mugic/tl.png b/src/img/icons/mugic/tl.png new file mode 100644 index 0000000..0ae3940 Binary files /dev/null and b/src/img/icons/mugic/tl.png differ diff --git a/src/img/icons/mugic/underworld_0.png b/src/img/icons/mugic/underworld_0.png new file mode 100644 index 0000000..fbf874d Binary files /dev/null and b/src/img/icons/mugic/underworld_0.png differ diff --git a/src/img/icons/mugic/underworld_x.png b/src/img/icons/mugic/underworld_x.png new file mode 100644 index 0000000..5486bb1 Binary files /dev/null and b/src/img/icons/mugic/underworld_x.png differ