From 7c9f7762de75ead2793ca9cae9499dc5cf23f2df Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 16 Oct 2020 18:21:55 -0400 Subject: [PATCH 1/3] search includes thumbs --- .eslintrc | 9 +- src/components/Snippets/Ability.js | 48 +-- src/components/Snippets/Initiative.js | 30 +- src/components/Snippets/Unique.js | 38 +- src/components/Snippets/_icons.js | 22 +- src/components/Snippets/_text.js | 16 +- src/components/Snippets/index.js | 2 +- src/components/SpreadsheetData.js | 24 +- src/components/collection/List.js | 26 +- src/components/collection/index.js | 48 +-- src/components/collection/search/index.js | 45 +-- src/components/collection/search/search.js | 70 ++-- src/components/collection/types/Attack.js | 4 +- src/components/collection/types/Battlegear.js | 2 +- src/components/collection/types/Creature.js | 14 +- src/components/collection/types/Location.js | 4 +- src/components/collection/types/Mugic.js | 6 +- src/components/debounce.js | 40 +-- src/components/entercode/EnterTheCode.js | 24 +- .../entercode/PackSimulator/generate.js | 234 ++++++------ .../entercode/PackSimulator/index.js | 125 +++---- src/components/home/index.js | 7 +- .../mugicplayer/mugicparser.spec.ts | 28 +- src/components/mugicplayer/mugicparser.ts | 340 +++++++++--------- src/components/mugicplayer/mugicplayer.ts | 98 ++--- src/components/mugicplayer/playbutton.tsx | 8 +- src/components/portal/Category.js | 19 +- src/components/portal/Home.js | 32 +- src/components/portal/Search.js | 91 +++-- src/components/portal/Single/Attack.js | 10 +- src/components/portal/Single/Battlegear.js | 10 +- src/components/portal/Single/Creature.js | 12 +- src/components/portal/Single/Location.js | 8 +- src/components/portal/Single/Mugic.js | 8 +- src/components/portal/Single/_base.js | 167 ++++----- src/components/portal/Tribes.js | 8 +- src/components/portal/portal.scss | 48 ++- webpack.config.babel.js | 1 + 38 files changed, 885 insertions(+), 841 deletions(-) diff --git a/.eslintrc b/.eslintrc index b2c77b6..4e459d3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -41,6 +41,11 @@ "dot-notation": "off", "eqeqeq": "off", "import/no-extraneous-dependencies": ["error", {"devDependencies": ["./webpack.config.babel.js"]}], + "indent": ["error", 2, { + "SwitchCase": 1, + "MemberExpression": "off" + }], + "keyword-spacing": ["error"], "linebreak-style": "off", "no-plusplus": "off", "no-prototype-builtins": "off", @@ -56,6 +61,7 @@ }, { "enforceForRenamedProperties": false }], + "prefer-const": "warn", "promise/always-return": "off", "promise/catch-or-return": ["warn", { "allowFinally": true @@ -68,7 +74,8 @@ "react/jsx-indent": ["warn", 2, { "indentLogicalExpressions": true }], "react/jsx-indent-props": ["warn", 2], "react/no-unescaped-entities": "off", - "react/prop-types": "off" + "react/prop-types": "off", + "semi": ["warn", "always", { "omitLastInOneLineBlock": true }] }, "overrides": [ { diff --git a/src/components/Snippets/Ability.js b/src/components/Snippets/Ability.js index 7f0ab05..dd4577a 100644 --- a/src/components/Snippets/Ability.js +++ b/src/components/Snippets/Ability.js @@ -3,38 +3,38 @@ import processString from 'react-process-string'; import { Mugic, Element, Discipline, Tribe } from "./_text"; export function Ability(props) { - const mugic_counters = { - regex: /([0-9x]*){{mc}}/i, - fn: (key, result) => { - if (result.length > 1 && result[1] != "") { - return (); - } - return (); + const mugic_counters = { + regex: /([0-9x]*){{mc}}/i, + fn: (key, result) => { + if (result.length > 1 && result[1] != "") { + return (); } + return (); } + }; - const elements = { - regex: new RegExp(/(\b((fire)|(air)|(earth)|(water)))/i), - fn: (key, result) => { - return ({result[0]}); - } + const elements = { + regex: new RegExp(/(\b((fire)|(air)|(earth)|(water)))/i), + fn: (key, result) => { + return ({result[0]}); } + }; - const disciplines = { - regex: /(courage)|(power)|(wisdom)|(speed)/i, - fn: (key, result) => { - return ({result[0]}); - } + const disciplines = { + regex: /(courage)|(power)|(wisdom)|(speed)/i, + fn: (key, result) => { + return ({result[0]}); } + }; - const tribes = { - regex: /(danian)|(generic)|(mipedian)|(overworld)|(underworld)|(m'arrillian)/i, - fn: (key, result) => { - return ({result[0]}); - } + const tribes = { + regex: /(danian)|(generic)|(mipedian)|(overworld)|(underworld)|(m'arrillian)/i, + fn: (key, result) => { + return ({result[0]}); } + }; - const filters = [mugic_counters, elements, disciplines, tribes]; + const filters = [mugic_counters, elements, disciplines, tribes]; - return
{processString(filters)(props.ability)}
+ return
{processString(filters)(props.ability)}
; } diff --git a/src/components/Snippets/Initiative.js b/src/components/Snippets/Initiative.js index a085a7f..d492f7b 100644 --- a/src/components/Snippets/Initiative.js +++ b/src/components/Snippets/Initiative.js @@ -1,19 +1,19 @@ import React from 'react'; export function Initiative(props) { - let { initiative } = props; - let image = null; - if (["Danian", "Generic", "Mipedian", "OverWorld", "UnderWorld", "M'arrillian"].indexOf(initiative) > -1) { - image = - } - else if (["courage", "power", "speed", "wisdom"].indexOf(initiative.toLowerCase()) > -1) { - image = - } - else if (["fire", "air", "earth", "water"].indexOf(initiative.toLowerCase()) > -1) { - image = - } - else if (initiative.toLowerCase() == "mugic counter") { - image = - } - return ({!props.notitle && ("Initiative: ")}{image} {initiative}); + const { initiative } = props; + let image = null; + if (["Danian", "Generic", "Mipedian", "OverWorld", "UnderWorld", "M'arrillian"].indexOf(initiative) > -1) { + image = ; } + else if (["courage", "power", "speed", "wisdom"].indexOf(initiative.toLowerCase()) > -1) { + image = ; + } + else if (["fire", "air", "earth", "water"].indexOf(initiative.toLowerCase()) > -1) { + image = ; + } + else if (initiative.toLowerCase() == "mugic counter") { + image = ; + } + return ({!props.notitle && ("Initiative: ")}{image} {initiative}); +} diff --git a/src/components/Snippets/Unique.js b/src/components/Snippets/Unique.js index 21fba00..cf8ca67 100644 --- a/src/components/Snippets/Unique.js +++ b/src/components/Snippets/Unique.js @@ -1,25 +1,25 @@ import React from 'react'; export function Unique(props) { - let string = ""; - if (props.data.unique) { - string += "Unique, "; + let string = ""; + if (props.data.unique) { + string += "Unique, "; + } + if (props.data.loyal) { + string += "Loyal"; + if (props.data.tribe == 'M\'arrillian') { + string += " - M'arrillians or Minions"; } - if (props.data.loyal) { - string += "Loyal"; - if (props.data.tribe == 'M\'arrillian') { - string += " - M'arrillians or Minions"; - } - // Battlegear loyality - if (props.data.loyal != "1") { - string += " - " + props.data.loyal; - } + // Battlegear loyality + if (props.data.loyal != "1") { + string += " - " + props.data.loyal; } - if (props.data.legendary) { - string = (string) ? ("Legendary, " + string) : "Legendary"; - } - string = string.replace(/,\s+$/, ""); - return ( - {string}{string &&
}
- ); + } + if (props.data.legendary) { + string = (string) ? ("Legendary, " + string) : "Legendary"; + } + string = string.replace(/,\s+$/, ""); + return ( + {string}{string &&
}
+ ); } diff --git a/src/components/Snippets/_icons.js b/src/components/Snippets/_icons.js index 53ecd33..332bfc6 100644 --- a/src/components/Snippets/_icons.js +++ b/src/components/Snippets/_icons.js @@ -2,24 +2,24 @@ import React from 'react'; import API from '../SpreadsheetData'; export function AttackIcon(props) { - let attack = "attack" + ((props.bp && props.bp >= 0) ? "_" + props.bp : ""); - return + const attack = "attack" + ((props.bp && props.bp >= 0) ? "_" + props.bp : ""); + return ; } export function BattlegearIcon(props) { - return + return ; } export function LocationIcon(props) { - return + return ; } export function Rarity(props) { - let { set, rarity } = props; - return ( - - {set !== 'PE1' && } - {!props.notext && <>{API.sets[props.set]} | {props.rarity}} - - ); + const { set, rarity } = props; + return ( + + {set !== 'PE1' && } + {!props.notext && <>{API.sets[props.set]} | {props.rarity}} + + ); } diff --git a/src/components/Snippets/_text.js b/src/components/Snippets/_text.js index 94f87cf..362618a 100644 --- a/src/components/Snippets/_text.js +++ b/src/components/Snippets/_text.js @@ -1,7 +1,7 @@ import React from 'react'; export function Name(props) { - let name = props.name.split(","); + const name = props.name.split(","); return ( {name[0]} {name.length > 1 && @@ -14,24 +14,24 @@ export function Name(props) { } export function Mugic(props) { - let type = (props.tribe || "generic") + (props.amount != undefined ? `_${props.amount}` : ""); - let src = ("/src/img/icons/mugic/" + type + ".png").toLowerCase(); - return {"MC"} + const type = (props.tribe || "generic") + (props.amount != undefined ? `_${props.amount}` : ""); + const src = ("/src/img/icons/mugic/" + type + ".png").toLowerCase(); + return {"MC"}; } export function Element(props) { if (props.value) { - return + return ; } else { - return + return ; } } export function Tribe(props) { - return + return ; } export function Discipline(props) { - return + return ; } diff --git a/src/components/Snippets/index.js b/src/components/Snippets/index.js index 0eba7b7..5bc791b 100644 --- a/src/components/Snippets/index.js +++ b/src/components/Snippets/index.js @@ -26,7 +26,7 @@ export function Loading(props) { } export function Splash(props) { - let { image } = props; + const { image } = props; return (
); diff --git a/src/components/SpreadsheetData.js b/src/components/SpreadsheetData.js index 584a852..a1da5f0 100644 --- a/src/components/SpreadsheetData.js +++ b/src/components/SpreadsheetData.js @@ -17,7 +17,7 @@ class CollectionDB { async getSpreadsheetData(spreadsheet, type, callback) { this.api.getSpreadsheet(spreadsheet, (data) => { callback(data.map((item) => { - let temp = {}; + const temp = {}; delete item.content; for (const key of Object.keys(item)) { temp[key] = item[key].$t; @@ -33,11 +33,11 @@ class CollectionDB { @action async setupType(type, resolve) { if (this.building.hasOwnProperty(type)) { - let uc_type = type.charAt(0).toUpperCase() + type.slice(1); + const uc_type = type.charAt(0).toUpperCase() + type.slice(1); if (this.building[type].get() == "built") { // Check if data has been updated this.getSpreadsheetData(this.api.urls[uc_type][this.format], uc_type, (data) => { - let cookie = cookies.get(`${this.format}_${type}`); + const cookie = cookies.get(`${this.format}_${type}`); if (cookie) { if ((new Date(data[0].updated)) > (new Date(cookie))) { this[type].clear(); @@ -87,7 +87,7 @@ class CollectionDB { @action setupDB(format) { - let db = new loki(`chaotic_${format}.db`, { + const db = new loki(`chaotic_${format}.db`, { autosave: true, autoload: true, autoloadCallback: databaseInitialize.bind(this), @@ -101,7 +101,7 @@ class CollectionDB { ["attacks","battlegear", "creatures", "locations", "mugic"] .forEach((type) => { // check if the db already exists in memory - let entries = db.getCollection(type); + const entries = db.getCollection(type); if (entries === null || entries.data.length === 0) { this[type] = db.addCollection(type); if (this.building[type]) @@ -116,7 +116,7 @@ class CollectionDB { else this.building[type] = observable.box("built"); } - }); + }); } } @@ -134,13 +134,13 @@ class API { static base_url = "https://spreadsheets.google.com/feeds/list/"; static data_format = "/od6/public/values?alt=json"; // + "/od6/public/basic?alt=json"; // Alternate data format - get base_image() { return "https://drive.google.com/uc?id="; } - get thumb_missing() { return "1JYjPzkv74IhzlHTyVh2niTDyui73HSfp"; } - get card_back() { return "https://i.imgur.com/xbeDBRJ.png"; } + get base_image() { return "https://drive.google.com/uc?id=" } + get thumb_missing() { return "1JYjPzkv74IhzlHTyVh2niTDyui73HSfp" } + get card_back() { return "https://i.imgur.com/xbeDBRJ.png" } // Singleton static getInstance() { - if (!this.instance) { this.instance = new API(); } + if (!this.instance) { this.instance = new API() } return this.instance; } @@ -173,8 +173,8 @@ class API { setupDB() { // let base_spreadsheet = "1cUNmwV693zl2zqbH_IG4Wz8o9Va_sOHe7pAZF6M59Es"; try { - let urls = {}; - let data = require('./meta_spreadsheet.json'); + const urls = {}; + const data = require('./meta_spreadsheet.json'); // this.getSpreadsheet(API.path(API.base_spreadsheet), (data) => { // if (data == null) throw "no data from base_spreadsheet"; data.forEach((d) => { diff --git a/src/components/collection/List.js b/src/components/collection/List.js index ed9c220..1096788 100644 --- a/src/components/collection/List.js +++ b/src/components/collection/List.js @@ -16,7 +16,7 @@ export default class CardList extends React.Component { } render() { - let { cards } = this.props; + const { cards } = this.props; if (cards.length == 1 && cards[0].text) { return ( @@ -25,18 +25,18 @@ export default class CardList extends React.Component { } return cards.map((card, i) => { switch (card.gsx$type) { - case "Attacks": - return (); - case "Battlegear": - return (); - case "Creatures": - return (); - case "Locations": - return (); - case "Mugic": - return (); - default: - return (
Invalid Card Type
); + case "Attacks": + return (); + case "Battlegear": + return (); + case "Creatures": + return (); + case "Locations": + return (); + case "Mugic": + return (); + default: + return (
Invalid Card Type
); } }); } diff --git a/src/components/collection/index.js b/src/components/collection/index.js index 49a15dd..d5394b2 100644 --- a/src/components/collection/index.js +++ b/src/components/collection/index.js @@ -4,7 +4,7 @@ import { observable, action } from "mobx"; import { observer, inject } from 'mobx-react'; import CardList from './List'; import SearchForm from './search/index.js'; -import './collection.scss' +import './collection.scss'; // https://mobx.js.org/refguide/object.html const fixedStyles = observable({ @@ -13,8 +13,8 @@ const fixedStyles = observable({ get isFixed() {return (Object.entries(this.style).length !== 0)}, setFixed(height) { if (!window.matchMedia("(min-width: 975px)").matches) return; - let left = document.getElementById('player').getBoundingClientRect().left + 4; - let width = document.querySelector('.collection > .left').getBoundingClientRect().width + 2; + const left = document.getElementById('player').getBoundingClientRect().left + 4; + const width = document.querySelector('.collection > .left').getBoundingClientRect().width + 2; this.style = { position: "fixed", top: 0, @@ -22,7 +22,7 @@ const fixedStyles = observable({ overflowY: "auto", height: `${height}px`, width: `${width}px`, - } + }; }, removeFixed() {this.style = {}} }, { @@ -45,7 +45,7 @@ export default class Home extends React.Component { constructor() { super(); - let ext = localStorage.getItem("extended"); + const ext = localStorage.getItem("extended"); if (ext == null) this.ext = false; this.ext = (/true/i).test(ext); } @@ -81,11 +81,11 @@ export default class Home extends React.Component { // Fix the side menu in place when scrolling down if (window.pageYOffset >= 235) { const - h = document.documentElement, - // b = document.body, - st = 'scrollTop', - sh = 'scrollHeight', - ch = 'clientHeight'; + h = document.documentElement, + // b = document.body, + st = 'scrollTop', + sh = 'scrollHeight', + ch = 'clientHeight'; // const percent = (h[st]||b[st]) / ((h[sh]||b[sh]) - h[ch]) * 100; // let exp = h[ch] - (h[ch] * (percent - 85) / 100); const sm = document.getElementById("side-menu"); @@ -100,13 +100,13 @@ export default class Home extends React.Component { else if (list.style.minHeight) { list.style.minHeight = null; } - } + }; // When nearing the end of the screen // (if element height offset is higher then height of screen) // reduce height by difference so that it doesn't leak past body if (scrollBottom <= 90) { - let exp = h[ch] - (90 - scrollBottom); + const exp = h[ch] - (90 - scrollBottom); fixedStyles.setFixed(exp); } // Fix with height of side menu to height of viewport @@ -131,7 +131,7 @@ export default class Home extends React.Component {
- {if (n) this.changeImage = n.getInstance().changeImage}} /> + {if (n) this.changeImage = n.getInstance().changeImage;}} />
@@ -153,23 +153,23 @@ export default class Home extends React.Component { return (
+ >{this.ext ? "Short Format" : "Extended Format"}
); } navigation() { - let numpages = Math.ceil(this.content.length / this.n); + const numpages = Math.ceil(this.content.length / this.n); - let next = () => { - if (this.p < numpages) return(); - else return(); - } + const next = () => { + if (this.p < numpages) return (); + else return (); + }; - let prev = () => { - if (this.p > 1) return(); - else return(); - } + const prev = () => { + if (this.p > 1) return (); + else return (); + }; return (
@@ -201,7 +201,7 @@ class imgbase extends React.Component { } render() { - return( + return (
diff --git a/src/components/collection/search/index.js b/src/components/collection/search/index.js index f6909eb..a10f8b1 100644 --- a/src/components/collection/search/index.js +++ b/src/components/collection/search/index.js @@ -31,7 +31,7 @@ export default class SearchCollection extends React.Component { } fetchCollapsed = () => { - let collapsed = localStorage.getItem("collapsed") + let collapsed = localStorage.getItem("collapsed"); if (collapsed) collapsed = JSON.parse(collapsed); else collapsed = { @@ -41,19 +41,19 @@ export default class SearchCollection extends React.Component { types: true, rarity: false, sets: false - } + }; this.collapsed = collapsed; } handleTriggerClick = (type) => { - let stored_collapse = this.collapsed; + const stored_collapse = this.collapsed; stored_collapse[type] = !this.collapsed[type]; localStorage.setItem("collapsed", JSON.stringify(stored_collapse)); } cleanInput = () => { - let input = { + const input = { name: "", text: "", subtypes: "", @@ -77,10 +77,10 @@ export default class SearchCollection extends React.Component { parseQuery = () => { const queryString = this.props.location.search.toLowerCase(); - let query = {}; - let pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&'); + const query = {}; + const pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&'); for (let i = 0; i < pairs.length; i++) { - let pair = pairs[i].split('='); + const pair = pairs[i].split('='); query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || ''); } @@ -102,12 +102,12 @@ export default class SearchCollection extends React.Component { if (query.hasOwnProperty('speed')) this.input.disciplines.speed = query.speed; if (query.hasOwnProperty('disc_max')) this.input.disciplines.max = !!query.disc_max; if (query.hasOwnProperty('energy')) { - let q = query.energy.split(','); + const q = query.energy.split(','); if (q[0] >= 0) this.input.energy.min = q[0]; if (q[1] >= 0) this.input.energy.max = q[1]; } if (query.hasOwnProperty('mcbp')) { - let q = query.mcbp.split(','); + const q = query.mcbp.split(','); if (q[0] >= 0) this.input.mcbp.min = q[0]; if (q[1] >= 0) this.input.mcbp.max = q[1]; } @@ -117,14 +117,14 @@ export default class SearchCollection extends React.Component { async updateQuery() { let queryString = ""; - let update = (query) => { + const update = (query) => { let temp = ""; Object.keys(this.input[query]).forEach((item) => { if (this.input[query][item] == true) temp += item + ","; }); if (temp.length > 0) return query + "=" + temp.replace(/\,$/, '&'); else return ""; - } + }; this.list.forEach(item => queryString += update(item)); @@ -179,30 +179,31 @@ export default class SearchCollection extends React.Component { this.updateQuery(); } - let results = search_api(this.input); + const results = search_api(this.input); if (results.length > 0) this.props.handleContent(results); else this.props.handleContent([{ 'text': 'No Results Found' }]); } render() { - if (this.loaded == false) { - API.LoadDB([{ 'cards': 'attacks' }, { 'cards': 'battlegear' }, { 'cards': 'creatures' }, { 'cards': 'locations' }, { 'cards': 'mugic' }]) + if (this.loaded == false) { + API.LoadDB([{ 'cards': 'attacks' }, { 'cards': 'battlegear' }, { 'cards': 'creatures' }, { 'cards': 'locations' }, { 'cards': 'mugic' }]) .then(() => { this.loaded = true; this.search(); - }); - return (); - } + }) + .catch(() => {}); + return (); + } const gen = (d, display, text) => { - let tmp = []; + const tmp = []; Object.keys(this.input[d]).forEach((item, i) => { tmp.push( ); }); return tmp; - } + }; const sets = gen("sets", "block", (item) => { return API.sets[item.toUpperCase()]; @@ -228,7 +229,7 @@ export default class SearchCollection extends React.Component { return ( ); }).slice(0, -2); - let disciplines = []; + const disciplines = []; Object.keys(this.input.disciplines).forEach((item, i) => { if (i == 4) return; disciplines.push(
- {this.input.elements.and=false;}} /> - {this.input.elements.and=true;}} /> + {this.input.elements.and=false}} /> + {this.input.elements.and=true}} />

("\\"+match)); - // .replace(/~(\w+)/, (match) => (`\(?!${match}\)`)); + // .replace(/~(\w+)/, (match) => (`\(?!${match}\)`)); return new RegExp(input.trim(), 'i'); } @@ -14,7 +14,7 @@ function cleanInputRegex(input) { export default function search_api(input) { // Sort data descending alphabetically - let filter = (new loki("filter.db")).addCollection('filter'); + const filter = (new loki("filter.db")).addCollection('filter'); var pview = filter.addDynamicView('filter'); pview.applySimpleSort('gsx$name'); @@ -31,21 +31,21 @@ export default function search_api(input) { }); battlegearResults = battlegearResults.where((obj) => { return obj.gsx$set != (''); - }); + }); creatureResults = creatureResults.where((obj) => { return obj.gsx$set != (''); - }); + }); locationResults = locationResults.where((obj) => { return obj.gsx$set != (''); - }); + }); mugicResults = mugicResults.where((obj) => { return obj.gsx$set != (''); - }); + }); // Search by name if (input.name.length > 0) { const negates = []; - let inputname = input.name.replace(/(?:~)([\w,()]+)/g, (_, p1) => { negates.push(p1); return ""; }); + let inputname = input.name.replace(/(?:~)([\w,()]+)/g, (_, p1) => { negates.push(p1); return "" }); if (inputname.length > 0) { inputname = cleanInputRegex(inputname); @@ -79,7 +79,7 @@ export default function search_api(input) { truth |= (obj.gsx$name.toLowerCase().indexOf(word.toLowerCase().replace('_', ' ')) > -1); }); return !truth; - } + }; attackResults = attackResults.where(ignoreText); battlegearResults = battlegearResults.where(ignoreText); @@ -94,7 +94,7 @@ export default function search_api(input) { // Card Text if (input.text.length > 0) { const negates = []; - let inputtext = input.text.replace(/(?:~)(\w+)/g, (_, p1) => { negates.push(p1); return ""; }); + let inputtext = input.text.replace(/(?:~)(\w+)/g, (_, p1) => { negates.push(p1); return "" }); if (inputtext.length > 0) { inputtext = cleanInputRegex(inputtext); @@ -103,7 +103,7 @@ export default function search_api(input) { const list = [ { 'gsx$tags': { '$regex': inputtext }}, { 'gsx$ability': { '$regex': inputtext }} - ] + ]; if (input.flavor) { list.push({ 'gsx$flavortext': { '$regex': inputtext }}); list.push({ 'gsx$artist': { '$regex': inputtext }}); @@ -111,7 +111,7 @@ export default function search_api(input) { return list; })(); - attackResults = attackResults.find({ '$or': parm }) + attackResults = attackResults.find({ '$or': parm }); battlegearResults = battlegearResults.find({ '$or': parm }); creatureResults = creatureResults.find({ '$or': (parm.concat([{ 'gsx$brainwashed': { '$regex': inputtext }}])) @@ -127,9 +127,9 @@ export default function search_api(input) { truth |= (obj.gsx$ability.toLowerCase().indexOf(word.toLowerCase()) > -1); truth |= (obj.gsx$flavortext.toLowerCase().indexOf(word.toLowerCase()) > -1); if (creature) truth |= (obj.gsx$brainwashed.toLowerCase().indexOf(word.toLowerCase()) > -1); - }) + }); return !truth; - } + }; attackResults = attackResults.where(ignoreText); battlegearResults = battlegearResults.where(ignoreText); @@ -142,7 +142,7 @@ export default function search_api(input) { // Subtypes / Initiative if (input.subtypes.length > 0) { - let subtypesList = input.subtypes.split(",").filter(Boolean).map((item) => { + const subtypesList = input.subtypes.split(",").filter(Boolean).map((item) => { return ({ '$regex': cleanInputRegex(item) }); }); @@ -154,7 +154,7 @@ export default function search_api(input) { } // Search by tribe - let tribesList = []; + const tribesList = []; for (const tribe in input.tribes) { if (input.tribes[tribe]) tribesList.push({ '$regex': new RegExp(tribe, 'i') }); @@ -181,13 +181,13 @@ export default function search_api(input) { } else { attackResults = attackResults.where( - (obj) => {return (input.elements.fire ? obj.gsx$fire != ('') : obj.gsx$fire == (''));} + (obj) => {return (input.elements.fire ? obj.gsx$fire != ('') : obj.gsx$fire == (''))} ).where( - (obj) => {return (input.elements.air ? obj.gsx$air != ('') : obj.gsx$air == (''));} + (obj) => {return (input.elements.air ? obj.gsx$air != ('') : obj.gsx$air == (''))} ).where( - (obj) => {return (input.elements.earth ? obj.gsx$earth != ('') : obj.gsx$earth == (''));} + (obj) => {return (input.elements.earth ? obj.gsx$earth != ('') : obj.gsx$earth == (''))} ).where( - (obj) => {return (input.elements.water ? obj.gsx$water != ('') : obj.gsx$water == (''));} + (obj) => {return (input.elements.water ? obj.gsx$water != ('') : obj.gsx$water == (''))} ); let el = ""; @@ -208,19 +208,19 @@ export default function search_api(input) { mugicResults = mugicResults.limit(0); } else { - let elementsList = []; - let elementsList2 = []; + const elementsList = []; + const elementsList2 = []; for (const element in input.elements) { if (element === "none" || element === "and") continue; if (input.elements[element]) { elementsList.push({ '$regex': new RegExp(element, 'i') }); - elementsList2.push({ ['gsx$'+element]: { '$gte': 0 }}) + elementsList2.push({ ['gsx$'+element]: { '$gte': 0 }}); } } if (elementsList.length > 0) { if (input.elements.and) { - creatureResults = creatureResults.find({ 'gsx$elements': { '$and': elementsList }}); - attackResults = attackResults.find({ '$and': elementsList2 }); + creatureResults = creatureResults.find({ 'gsx$elements': { '$and': elementsList }}); + attackResults = attackResults.find({ '$and': elementsList2 }); } else { creatureResults = creatureResults.find({ 'gsx$elements': { '$or': elementsList }}); @@ -316,17 +316,17 @@ export default function search_api(input) { } // Sets - let setsList = []; + const setsList = []; - for (let key in input.sets) { + for (const key in input.sets) { if (input.sets[key]) setsList.push({ '$eq': key.toUpperCase() }); } if (setsList.length === 0) { // Only show prototype cards when explicitly selected - let keys = Object.keys(input.sets); + const keys = Object.keys(input.sets); if (!input.sets.proto) keys.splice(keys.indexOf("proto")); - for (let i in keys) { + for (const i in keys) { setsList.push({ '$eq': keys[i].toUpperCase() }); } } @@ -339,7 +339,7 @@ export default function search_api(input) { } // Rarity - let rarityList = []; + const rarityList = []; for (const key in input.rarity) { if (input.rarity[key]) rarityList.push({ '$eq': key.split(" ").map(st => {return st.charAt(0).toUpperCase()+st.slice(1)}).join(" ") }); @@ -367,30 +367,30 @@ export default function search_api(input) { // } // Merge data - let types = !(input.types.attack | input.types.battlegear | input.types.creature | input.types.location | input.types.mugic); + const types = !(input.types.attack | input.types.battlegear | input.types.creature | input.types.location | input.types.mugic); if (types || input.types.attack) { - let temp = attackResults.data(); + const temp = attackResults.data(); temp.forEach((v) => { delete v.$loki }); filter.insert(temp); } if (types || input.types.battlegear) { - let temp = battlegearResults.data(); + const temp = battlegearResults.data(); temp.forEach((v) => { delete v.$loki }); filter.insert(temp); } if (types || input.types.creature) { - let temp = creatureResults.data() + const temp = creatureResults.data(); temp.forEach((v) => { delete v.$loki }); filter.insert(temp); } if (types || input.types.location) { - let temp = locationResults.data() + const temp = locationResults.data(); temp.forEach((v) => { delete v.$loki }); filter.insert(temp); } if (types || input.types.mugic) { - let temp = mugicResults.data() + const temp = mugicResults.data(); temp.forEach((v) => { delete v.$loki }); filter.insert(temp); } diff --git a/src/components/collection/types/Attack.js b/src/components/collection/types/Attack.js index 45056e2..de2db3f 100644 --- a/src/components/collection/types/Attack.js +++ b/src/components/collection/types/Attack.js @@ -7,7 +7,7 @@ import { Rarity, Unique, Name, Element, Ability, AttackIcon } from '../../Snippe export default class Attack extends React.Component { render() { - let { card } = this.props; + const { card } = this.props; if (this.props.ext == false) return (
@@ -31,7 +31,7 @@ export default class Attack extends React.Component { {card.gsx$flavortext}
- ) + ); else return (
diff --git a/src/components/collection/types/Battlegear.js b/src/components/collection/types/Battlegear.js index 45ed7e7..eac8c6a 100644 --- a/src/components/collection/types/Battlegear.js +++ b/src/components/collection/types/Battlegear.js @@ -7,7 +7,7 @@ import { Rarity, Unique, Name, Ability, BattlegearIcon } from '../../Snippets'; export default class Battlegear extends React.Component { render() { - let { card } = this.props; + const { card } = this.props; if (this.props.ext == false) return (
diff --git a/src/components/collection/types/Creature.js b/src/components/collection/types/Creature.js index 0da29cc..04fdb38 100644 --- a/src/components/collection/types/Creature.js +++ b/src/components/collection/types/Creature.js @@ -7,15 +7,15 @@ import { Rarity, Unique, Name, Element, Mugic, Discipline, Ability, Tribe } from export default class Creature extends React.Component { render() { - let { card } = this.props; + const { card } = this.props; - let mugic = []; + const mugic = []; for (let i = 0; i < card.gsx$mugicability; i++) { mugic.push(); } const TribeLine = () => { - let tribe = card.gsx$tribe; + const tribe = card.gsx$tribe; let types = card.gsx$types; let past = false; if (types.toLowerCase().includes("past")) { @@ -24,10 +24,10 @@ export default class Creature extends React.Component { } // - let line = " " + (past ? "Past " : "") + (tribe == "Generic" ? "" : tribe + " ") + types; + const line = " " + (past ? "Past " : "") + (tribe == "Generic" ? "" : tribe + " ") + types; - return {line} - } + return {line}; + }; if (this.props.ext == false) return (
@@ -78,7 +78,7 @@ export default class Creature extends React.Component {
- ) + ); else return (
diff --git a/src/components/collection/types/Location.js b/src/components/collection/types/Location.js index 286c2fb..8119c08 100644 --- a/src/components/collection/types/Location.js +++ b/src/components/collection/types/Location.js @@ -8,7 +8,7 @@ import API from '../../SpreadsheetData'; export default class Location extends React.Component { render() { - let { card } = this.props; + const { card } = this.props; if (this.props.ext == false) return (
@@ -25,7 +25,7 @@ export default class Location extends React.Component { {card.gsx$flavortext}
- ) + ); else return (
diff --git a/src/components/collection/types/Mugic.js b/src/components/collection/types/Mugic.js index 5e50c09..0f3aebf 100644 --- a/src/components/collection/types/Mugic.js +++ b/src/components/collection/types/Mugic.js @@ -9,9 +9,9 @@ import { withRouter } from 'react-router'; class Attack extends React.Component { render() { - let { card, history } = this.props; + const { card, history } = this.props; - let mugicCounters = []; + const mugicCounters = []; if (card.gsx$cost == 0) { mugicCounters.push(); } @@ -45,7 +45,7 @@ class Attack extends React.Component { {card.gsx$flavortext}
- ) + ); else return (
diff --git a/src/components/debounce.js b/src/components/debounce.js index ca9151b..e897cde 100644 --- a/src/components/debounce.js +++ b/src/components/debounce.js @@ -24,25 +24,25 @@ // } - /* https://codeburst.io/throttling-and-debouncing-in-javascript-646d076d0a44 */ - export function debounced(delay, fn) { - let timerId; - return function (...args) { - if (timerId) clearTimeout(timerId); - timerId = setTimeout(() => { - fn(...args); - timerId = null; - }, delay); - } - } +/* https://codeburst.io/throttling-and-debouncing-in-javascript-646d076d0a44 */ +export function debounced(delay, fn) { + let timerId; + return function (...args) { + if (timerId) clearTimeout(timerId); + timerId = setTimeout(() => { + fn(...args); + timerId = null; + }, delay); + }; +} - export function throttled(delay, fn) { - let lastCall = 0; - return function (...args) { - const now = (new Date).getTime(); - if (now - lastCall < delay) return; - lastCall = now; - return fn(...args); - } - } +export function throttled(delay, fn) { + let lastCall = 0; + return function (...args) { + const now = (new Date).getTime(); + if (now - lastCall < delay) return; + lastCall = now; + return fn(...args); + }; +} \ No newline at end of file diff --git a/src/components/entercode/EnterTheCode.js b/src/components/entercode/EnterTheCode.js index ed0d282..18d08a6 100644 --- a/src/components/entercode/EnterTheCode.js +++ b/src/components/entercode/EnterTheCode.js @@ -18,19 +18,19 @@ s.input = { margin: '0.05em', backgroundColor: "rgba(0,0,0,0)", color: "white", -} +}; s.inputGroup = { // display: 'flex', alignItems: 'center', -} +}; s.hyphen = { background: 'white', height: '0.1em', width: '.5em', display: 'inline-block', -} +}; @inject((stores, props, context) => props) @observer export default class EnterTheCode extends React.Component { @@ -46,14 +46,14 @@ export default class EnterTheCode extends React.Component { return (); } - let getRandomInt = (min, max) => { + const getRandomInt = (min, max) => { min = Math.ceil(min); max = Math.floor(max); //The maximum is exclusive and the minimum is inclusive return Math.floor(Math.random() * (max - min)) + min; - } + }; - let validate = (e) => { + const validate = (e) => { e.preventDefault(); e.stopPropagation(); @@ -63,9 +63,9 @@ export default class EnterTheCode extends React.Component { ); } else { - let card = this.fan[getRandomInt(0, this.fan.length)]; - let rgx = /.*.png|.*.jpg/i; - let img = (rgx.test(card.gsx$image.$t) ? card.gsx$image.$t : API.base_image + card.gsx$image.$t); + const card = this.fan[getRandomInt(0, this.fan.length)]; + const rgx = /.*.png|.*.jpg/i; + const img = (rgx.test(card.gsx$image.$t) ? card.gsx$image.$t : API.base_image + card.gsx$image.$t); this.message.contents = (

Congrats on your scan!


@@ -74,9 +74,9 @@ export default class EnterTheCode extends React.Component {
); } - } + }; - return( + return (
Pack Simulator @@ -104,7 +104,7 @@ export default class EnterTheCode extends React.Component {
- )} + )}
diff --git a/src/components/entercode/PackSimulator/generate.js b/src/components/entercode/PackSimulator/generate.js index 53b67f4..cde65a0 100644 --- a/src/components/entercode/PackSimulator/generate.js +++ b/src/components/entercode/PackSimulator/generate.js @@ -7,147 +7,147 @@ class GenerateCard { @observable filter = null; setupDB = () => { - let filter = (new loki("filter.db")).addCollection('filter'); + const filter = (new loki("filter.db")).addCollection('filter'); - // Sort data descending alphabetically - var pview = filter.addDynamicView('alphabetical'); - pview.applySimpleSort('gsx$name'); + // Sort data descending alphabetically + var pview = filter.addDynamicView('alphabetical'); + pview.applySimpleSort('gsx$name'); - let temp; + let temp; - temp = API.cards.attacks.find(); - temp.forEach((v) => delete v.$loki); - filter.insert(temp); + temp = API.cards.attacks.find(); + temp.forEach((v) => delete v.$loki); + filter.insert(temp); - temp = API.cards.battlegear.find(); - temp.forEach((v) => delete v.$loki); - filter.insert(temp); + temp = API.cards.battlegear.find(); + temp.forEach((v) => delete v.$loki); + filter.insert(temp); - temp = API.cards.creatures.find(); - temp.forEach((v) => delete v.$loki); - filter.insert(temp); + temp = API.cards.creatures.find(); + temp.forEach((v) => delete v.$loki); + filter.insert(temp); - temp = API.cards.locations.find(); - temp.forEach((v) => delete v.$loki); - filter.insert(temp); + temp = API.cards.locations.find(); + temp.forEach((v) => delete v.$loki); + filter.insert(temp); - temp = API.cards.mugic.find(); - temp.forEach((v) => delete v.$loki); - filter.insert(temp); + temp = API.cards.mugic.find(); + temp.forEach((v) => delete v.$loki); + filter.insert(temp); - this.filter = filter; + this.filter = filter; } generate = ({ packs, set }) => { - let cards = []; // Returned list of card divs - let card_names = []; // Prevent duplicates in pack - let key = 0; // React key iterator uniqueness + const cards = []; // Returned list of card divs + let card_names = []; // Prevent duplicates in pack + let key = 0; // React key iterator uniqueness - let pview = this.filter.addDynamicView('set'); + const pview = this.filter.addDynamicView('set'); - const gendisp = (avg) => { - let min = parseInt(avg) - 10; - if (min < 0) min = 0; - return (Math.floor(Math.random() * 5)) * 5 + min; - } - const geneng = (avg) => { - let min = parseInt(avg) - 5; - if (min < 0) min = 0; - return (Math.floor(Math.random() * 3)) * 5 + min; + const gendisp = (avg) => { + let min = parseInt(avg) - 10; + if (min < 0) min = 0; + return (Math.floor(Math.random() * 5)) * 5 + min; + }; + const geneng = (avg) => { + let min = parseInt(avg) - 5; + if (min < 0) min = 0; + return (Math.floor(Math.random() * 3)) * 5 + min; + }; + + const gencard = (results) => { + const id = Math.floor(Math.random() * results.length); + const card = results[id]; + + if (!card) { + cards.push(
); + return; } - const gencard = (results) => { - let id = Math.floor(Math.random() * results.length); - let card = results[id]; - - if (!card) { - cards.push(
); - return; - } - - if (card_names.indexOf(card.gsx$name) > -1 || card.gsx$exclusive.toLowerCase().includes("starter")) { - gencard(results); - return; - } + if (card_names.indexOf(card.gsx$name) > -1 || card.gsx$exclusive.toLowerCase().includes("starter")) { + gencard(results); + return; + } - card_names.push(card.gsx$name); - - if (card.gsx$type != "Creatures") { - cards.push(
); - } - else { - cards.push( -
-
- {gendisp(card.gsx$courage)} - {gendisp(card.gsx$power)} - {gendisp(card.gsx$wisdom)} - {gendisp(card.gsx$speed)} - {geneng(card.gsx$energy)} -
-
- ); - } + card_names.push(card.gsx$name); + if (card.gsx$type != "Creatures") { + cards.push(
); + } + else { + cards.push( +
+
+ {gendisp(card.gsx$courage)} + {gendisp(card.gsx$power)} + {gendisp(card.gsx$wisdom)} + {gendisp(card.gsx$speed)} + {geneng(card.gsx$energy)} +
+
+ ); } - const genrarity = (rarity, num) => { - pview.applyFind({ 'gsx$set': set }) + }; + + const genrarity = (rarity, num) => { + pview.applyFind({ 'gsx$set': set }) .applyFind({ 'gsx$rarity': rarity }); - let results = pview.data(); - for (let i = 0; i < num; i++) gencard(results); - pview.removeFilters(); + const results = pview.data(); + for (let i = 0; i < num; i++) gencard(results); + pview.removeFilters(); + }; + + + + // DOP to FUN had 9 cards: 4 Common, 3 Uncommon, 2 Rare+ + // OP1 had 3 cards: 2 Common, 1 Uncommon+ + // Premium Packs had 6 cards, 5 Super and 1 Ultra + // AU sets had 9 cards: 6 Common and 3 Rare+ + const randomRare = () => { + const randomNumber = Math.floor(Math.random() * 24) + 1; + if (randomNumber == 24) return "Ultra Rare"; + else if (randomNumber % 3 == 0) return "Super Rare"; + else return "Rare"; + }; + + const newSets = ["AU", "FAS"]; + + for (let i = 0; i < packs; i++) { + if (set === "OP1") { + genrarity("Common", 2); + genrarity((() => { + const rnd = Math.floor(Math.random() * 75) + 1; + if (rnd == 75) return "Ultra Rare"; + else if (rnd < 19) return "Super Rare"; + else if (rnd < 44) return "Rare"; + else return "Uncommon"; + })(), 1); } - - - - // DOP to FUN had 9 cards: 4 Common, 3 Uncommon, 2 Rare+ - // OP1 had 3 cards: 2 Common, 1 Uncommon+ - // Premium Packs had 6 cards, 5 Super and 1 Ultra - // AU sets had 9 cards: 6 Common and 3 Rare+ - const randomRare = () => { - let randomNumber = Math.floor(Math.random() * 24) + 1; - if (randomNumber == 24) return "Ultra Rare"; - else if (randomNumber % 3 == 0) return "Super Rare"; - else return "Rare"; - }; - - const newSets = ["AU", "FAS"]; - - for (let i = 0; i < packs; i++) { - if (set === "OP1") { - genrarity("Common", 2); - genrarity((() => { - const rnd = Math.floor(Math.random() * 75) + 1; - if (rnd == 75) return "Ultra Rare"; - else if (rnd < 19) return "Super Rare"; - else if (rnd < 44) return "Rare"; - else return "Uncommon"; - })(), 1); - } - else if (set === "PE1") { - genrarity("Super Rare", 5); - genrarity("Ultra Rare", 1); - } - // AU sets and after - else if (newSets.indexOf(set) > -1) { - genrarity('Common', 6); - genrarity('Rare', 2); - genrarity(randomRare(), 1); - } - else { - // Before AU sets - genrarity('Common', 4); - genrarity('Uncommon', 3); - genrarity('Rare', 1); - genrarity(randomRare(), 1); - } - card_names = []; + else if (set === "PE1") { + genrarity("Super Rare", 5); + genrarity("Ultra Rare", 1); } + // AU sets and after + else if (newSets.indexOf(set) > -1) { + genrarity('Common', 6); + genrarity('Rare', 2); + genrarity(randomRare(), 1); + } + else { + // Before AU sets + genrarity('Common', 4); + genrarity('Uncommon', 3); + genrarity('Rare', 1); + genrarity(randomRare(), 1); + } + card_names = []; + } - this.filter.removeDynamicView('set'); + this.filter.removeDynamicView('set'); - return cards; + return cards; } } diff --git a/src/components/entercode/PackSimulator/index.js b/src/components/entercode/PackSimulator/index.js index 5509730..98c5ef7 100644 --- a/src/components/entercode/PackSimulator/index.js +++ b/src/components/entercode/PackSimulator/index.js @@ -8,75 +8,76 @@ import s from '../../../styles/style'; import '../packs.scss'; export default function (props) { - const [loaded, setLoaded] = useState(false); - const [set, setSet] = useState(""); - const [setsInput, setSetsInput] = useState([]); - const [cards, setCards] = useState([]); - const [packs, setPacks] = useState(1); + const [loaded, setLoaded] = useState(false); + const [set, setSet] = useState(""); + const [setsInput, setSetsInput] = useState([]); + const [cards, setCards] = useState([]); + const [packs, setPacks] = useState(1); - useEffect(() => { - API.LoadDB([{ 'cards': 'attacks' }, { 'cards': 'battlegear' }, { 'cards': 'creatures' }, { 'cards': 'locations' }, { 'cards': 'mugic' }]) - .then(() => { - setupDB(); - setLoaded(true); - }); + useEffect(() => { + API.LoadDB([{ 'cards': 'attacks' }, { 'cards': 'battlegear' }, { 'cards': 'creatures' }, { 'cards': 'locations' }, { 'cards': 'mugic' }]) + .then(() => { + setupDB(); + setLoaded(true); + }) + .catch(() => {}); - let cards = []; - for (let i = 0; i < 9; i++) { - cards.push(
); - } - setCards(cards); - - let setsInput = []; - let i = 1; - for (const set in API.sets) { - setsInput.push(); - if (set === "PE1") break; - } - setSetsInput(setsInput); - }, []); - - if (loaded == false) { - return (); + const cards = []; + for (let i = 0; i < 9; i++) { + cards.push(
); } + setCards(cards); - const onPacksChange = (e) => { - if (e.target.value > 24) e.target.value = 24; - setPacks(e.target.value); + const setsInput = []; + let i = 1; + for (const set in API.sets) { + setsInput.push(); + if (set === "PE1") break; } + setSetsInput(setsInput); + }, []); - const onSetChange = (e) => { - setSet(e.target.value); - } + if (loaded == false) { + return (); + } - const handleSubmit = (e) => { - event.preventDefault(); - event.stopPropagation(); + const onPacksChange = (e) => { + if (e.target.value > 24) e.target.value = 24; + setPacks(e.target.value); + }; - setCards(generate({ packs, set })); - } + const onSetChange = (e) => { + setSet(e.target.value); + }; - return ( -
- Enter The Code + const handleSubmit = (e) => { + event.preventDefault(); + event.stopPropagation(); + + setCards(generate({ packs, set })); + }; + + return ( +
+ Enter The Code +

+
+ +

- - - -

- -
-

-
{cards}
-
- ); -} \ No newline at end of file + + +

+
{cards}
+
+ ); +} diff --git a/src/components/home/index.js b/src/components/home/index.js index 50801ea..be45784 100644 --- a/src/components/home/index.js +++ b/src/components/home/index.js @@ -28,7 +28,7 @@ const LoreEntry = ({ block, text, sets }) => { })}
); -} +}; export default class Home extends React.Component { state = { lore: []}; @@ -40,10 +40,9 @@ export default class Home extends React.Component { }) .then((lore) => { this.setState({ "lore": lore }); - return; }) .catch(() => { - this.setState({ "lore": [{ "block": "Unable to load lore...", "text": []}]}) + this.setState({ "lore": [{ "block": "Unable to load lore...", "text": []}]}); }); } @@ -62,7 +61,7 @@ export default class Home extends React.Component {
Do you like the site? You can donate to support it!
-
We were unsatisfied with the options on how to search for cards. I took the design of the old Chaotic website and added my own modernizations. With an extensive lists of search options in the collection, you'll find deck building mores streamlined than ever before. Chaotic is full of rich lore, but unfortunately the best database of official lore disapeared when the Portal to Perim disapeared along with the site. You can again explore the official lore and information of Creatures! +
We were unsatisfied with the options on how to search for cards. I took the design of the old Chaotic website and added my own modernizations. With an extensive lists of search options in the collection, you'll find deck building mores streamlined than ever before. Chaotic is full of rich lore, but unfortunately the best database of official lore disapeared when the Portal to Perim disapeared along with the official site. You can again explore the official lore and information!

{this.state.lore.length > 0 diff --git a/src/components/mugicplayer/mugicparser.spec.ts b/src/components/mugicplayer/mugicparser.spec.ts index 4e0c7de..a986acc 100644 --- a/src/components/mugicplayer/mugicparser.spec.ts +++ b/src/components/mugicplayer/mugicparser.spec.ts @@ -4,21 +4,21 @@ import { expect } from 'chai'; import { parseTune, output } from './mugicparser'; const cases = { - "Canon of Casuality": { - input: "2Eb 2F 2D 2G 2Bb 1A 3D", - output: ["2Eb4", "2F4", "2D4", "2G4", "2Bb5", "1A5", "3D5"] - }, - "Fortissimo": { - input: "2G#4 1C#5 2E5 2C#5 2D#5 1G#4 4F#5", - output: ["2G#4", "1C#5", "2E5", "2C#5", "2D#5", "1G#4", "4F#5"] - } -} + "Canon of Casuality": { + input: "2Eb 2F 2D 2G 2Bb 1A 3D", + output: ["2Eb4", "2F4", "2D4", "2G4", "2Bb5", "1A5", "3D5"] + }, + "Fortissimo": { + input: "2G#4 1C#5 2E5 2C#5 2D#5 1G#4 4F#5", + output: ["2G#4", "1C#5", "2E5", "2C#5", "2D#5", "1G#4", "4F#5"] + } +}; Object.entries(cases).forEach(([key, value]) => { - describe(key, () => { - it(`should return ${value.output}`, () => { - const tune = output(parseTune(value.input)); - expect(tune).to.deep.equal(value.output); - }); + describe(key, () => { + it(`should return ${value.output}`, () => { + const tune = output(parseTune(value.input)); + expect(tune).to.deep.equal(value.output); }); + }); }); diff --git a/src/components/mugicplayer/mugicparser.ts b/src/components/mugicplayer/mugicparser.ts index af91537..339abb6 100644 --- a/src/components/mugicplayer/mugicparser.ts +++ b/src/components/mugicplayer/mugicparser.ts @@ -6,61 +6,61 @@ export class Note { velocity: number; constructor(duration: number, time: number, value: {pitch: string, octave: number}, velocity?: number) { - this.duration = duration; - this.time = time; - this.pitch = value.pitch; - this.octave = value.octave; - if (velocity) this.velocity = velocity; + this.duration = duration; + this.time = time; + this.pitch = value.pitch; + this.octave = value.octave; + if (velocity) this.velocity = velocity; } } export const output = (seq: Note[]) => { - return seq.map(n => n.duration + n.pitch + n.octave.toString()) -} + return seq.map(n => n.duration + n.pitch + n.octave.toString()); +}; // db notation uses duration (quarter notes) and pitch // 2Eb => E flat for 2 quarter notes export const parseTune = (input: string): Note[] => { - const seq: Note[] = []; - let time = 0; - console.log(input.split(" ")); - input.split(" ").forEach((note) => { - const splitter = /(?:[1-8]{1})/; + const seq: Note[] = []; + let time = 0; + console.log(input.split(" ")); + input.split(" ").forEach((note) => { + const splitter = /(?:[1-8]{1})/; - const match = note.match(splitter); - if (match === null) throw new Error("invalid_input"); + const match = note.match(splitter); + if (match === null) throw new Error("invalid_input"); - const dur = parseInt(match[0]); - const pitch = note.split(splitter)[1]; + const dur = parseInt(match[0]); + const pitch = note.split(splitter)[1]; - const full_note = /[1-8]{1}[A-Za-z#]{1,2}([1-8]{1})/; - if (full_note.test(note)) { - const sp = note.match(full_note); - if (sp === null) throw new Error("invalid_input"); - seq.push(new Note(dur, time, { pitch, octave: parseInt(sp[1]) })); - } - else { - seq.push(new Note(dur, time, parseNote(pitch, seq))); - } + const full_note = /[1-8]{1}[A-Za-z#]{1,2}([1-8]{1})/; + if (full_note.test(note)) { + const sp = note.match(full_note); + if (sp === null) throw new Error("invalid_input"); + seq.push(new Note(dur, time, { pitch, octave: parseInt(sp[1]) })); + } + else { + seq.push(new Note(dur, time, parseNote(pitch, seq))); + } - time += dur; - }); + time += dur; + }); - // If a note is repeated at the same octave, look at trend of last two notes - // for (let i = 2; i < seq.length; i++) { - // const note = seq[i]; - // const comp = seq[i-2]; - // if (note.pitch === comp.pitch && note.octave === comp.octave) { - // const pitch = letter_to_number(note.pitch); - // seq[i].octave = trend(pitch, i, seq); - // } - // } + // If a note is repeated at the same octave, look at trend of last two notes + // for (let i = 2; i < seq.length; i++) { + // const note = seq[i]; + // const comp = seq[i-2]; + // if (note.pitch === comp.pitch && note.octave === comp.octave) { + // const pitch = letter_to_number(note.pitch); + // seq[i].octave = trend(pitch, i, seq); + // } + // } - console.log(output(seq)); + console.log(output(seq)); - return seq; -} + return seq; +}; /* We have an array of previous notes; for the first to cases the octave is middle (4). @@ -74,63 +74,63 @@ export const parseTune = (input: string): Note[] => { * @note The note's */ const parseNote = (pitch: string, seq: Note[]): {pitch: string, octave: number} => { - let octave: number = (() => { - // If its the first note its "middle octave" - if (seq.length === 0) return 4; + let octave: number = (() => { + // If its the first note its "middle octave" + if (seq.length === 0) return 4; - const l = seq.length - 1; - const { octave } = seq[l]; + const l = seq.length - 1; + const { octave } = seq[l]; - const current = pitchValue(pitch, octave); - const previous = pitchValue(seq[l]); - const distance = compare(previous, current); + const current = pitchValue(pitch, octave); + const previous = pitchValue(seq[l]); + const distance = compare(previous, current); - // If its less than 3 pitches of the previous note, use the closest pitch - if (distance < 3) { - if (distance === 0) return octave; + // If its less than 3 pitches of the previous note, use the closest pitch + if (distance < 3) { + if (distance === 0) return octave; - if (previous > pitchValue(5, octave)) { - if (current < pitchValue(3, octave)) { - return octave + 1; - } - else { - return octave; - } - } - else if (previous < pitchValue(3, octave)) { - if (current > pitchValue(5, octave)) { - return octave - 1; - } - else { - return octave; - } - } - return octave; - } else if (l === 0) { - if (distance === 3) { - if (current > previous) { - return octave; - } - else { - return octave + 1; - } - } - else if (current > previous) { - return octave; - } - else if (current < previous) { - return octave - 1; - } + if (previous > pitchValue(5, octave)) { + if (current < pitchValue(3, octave)) { + return octave + 1; } + else { + return octave; + } + } + else if (previous < pitchValue(3, octave)) { + if (current > pitchValue(5, octave)) { + return octave - 1; + } + else { + return octave; + } + } + return octave; + } else if (l === 0) { + if (distance === 3) { + if (current > previous) { + return octave; + } + else { + return octave + 1; + } + } + else if (current > previous) { + return octave; + } + else if (current < previous) { + return octave - 1; + } + } - // If its further away, look at the previous notes for a trend - return trend(current, l, seq); - })(); + // If its further away, look at the previous notes for a trend + return trend(current, l, seq); + })(); - if (octave > 5) octave = 5; + if (octave > 5) octave = 5; - return { pitch, octave }; -} + return { pitch, octave }; +}; /* * Is the last note a step down from the note before? @@ -146,106 +146,106 @@ const parseNote = (pitch: string, seq: Note[]): {pitch: string, octave: number} * @param l The index of the array to be compared */ const trend = (current: number, l: number, seq: Note[]): number => { - if (l < 1) return seq[l].octave; + if (l < 1) return seq[l].octave; - const prev = pitchValue(seq[l]); - const prev2 = pitchValue(seq[l-1]); - console.log(prev2, prev, current); + const prev = pitchValue(seq[l]); + const prev2 = pitchValue(seq[l-1]); + console.log(prev2, prev, current); - // downward trend - if (prev2 > prev) { - if (prev < current) { - return seq[l].octave; - } - return seq[l].octave - 1; + // downward trend + if (prev2 > prev) { + if (prev < current) { + return seq[l].octave; } - // upward trend - else if (prev2 < prev) { - if (prev < current) { - return seq[l].octave; - } - return seq[l].octave + 1; + return seq[l].octave - 1; + } + // upward trend + else if (prev2 < prev) { + if (prev < current) { + return seq[l].octave; } - // same notes - else { - return trend(current, l-1, seq); - } -} + return seq[l].octave + 1; + } + // same notes + else { + return trend(current, l-1, seq); + } +}; /** * Takes two pitches and returns the distance between them */ const compare = (one: number, two: number): number => { - const res = Math.abs(one - two); - if (res < 4) { - return res; - } - else if (res > 3.5) { - return res - 1; - } - else if (res > 4.5) { - return res - 2; - } - else if (res > 5.5) { - return res - 3; - } - else if (res > 6.5) { - return res - 4; - } - + const res = Math.abs(one - two); + if (res < 4) { return res; -} + } + else if (res > 3.5) { + return res - 1; + } + else if (res > 4.5) { + return res - 2; + } + else if (res > 5.5) { + return res - 3; + } + else if (res > 6.5) { + return res - 4; + } + + return res; +}; function pitchValue(note: Note): number; function pitchValue(letter: number, octave: number): number; function pitchValue(pitch: string, octave: number): number; function pitchValue(arg1: number | string | Note, arg2?: number): number { - let pitch: number; - let octave: number; - if (arg1 instanceof Note) { - pitch = letter_to_number(arg1.pitch); - octave = arg1.octave; - } else { - pitch = (typeof arg1 === 'number') ? arg1 : letter_to_number(arg1); - octave = arg2 as number; - } - return pitch + (octave - 1) * 8; + let pitch: number; + let octave: number; + if (arg1 instanceof Note) { + pitch = letter_to_number(arg1.pitch); + octave = arg1.octave; + } else { + pitch = (typeof arg1 === 'number') ? arg1 : letter_to_number(arg1); + octave = arg2 as number; + } + return pitch + (octave - 1) * 8; } /** * Converts a pitch to numerical value for calculations */ const letter_to_number = (pitch: string): number => { - let num: number; - switch (pitch.charAt(0).toUpperCase()) { - case "A": - num = 1; - break; - case "B": - num = 2; - break; - case "C": - num = 3; - break; - case "D": - num = 4; - break; - case "E": - num = 5; - break; - case "F": - num = 6; - break; - case "G": - num = 7; - break; - // In the case of incorrect input, coerce note to a C - default: - num = 3; - } - if (pitch.length > 1) { - if (pitch.charAt(1).toLowerCase() === "b") num -= .5; - else if (pitch.charAt(1) === "#") num += .5; - } - return num; -} + let num: number; + switch (pitch.charAt(0).toUpperCase()) { + case "A": + num = 1; + break; + case "B": + num = 2; + break; + case "C": + num = 3; + break; + case "D": + num = 4; + break; + case "E": + num = 5; + break; + case "F": + num = 6; + break; + case "G": + num = 7; + break; + // In the case of incorrect input, coerce note to a C + default: + num = 3; + } + if (pitch.length > 1) { + if (pitch.charAt(1).toLowerCase() === "b") num -= .5; + else if (pitch.charAt(1) === "#") num += .5; + } + return num; +}; diff --git a/src/components/mugicplayer/mugicplayer.ts b/src/components/mugicplayer/mugicplayer.ts index d726573..bed8fcd 100644 --- a/src/components/mugicplayer/mugicplayer.ts +++ b/src/components/mugicplayer/mugicplayer.ts @@ -14,19 +14,19 @@ interface note_value { } class Note_Value extends Note { - constructor(note: Note) { - const { duration, time, pitch, octave, velocity } = note; - super(duration, time, { pitch, octave }, velocity); - } + constructor(note: Note) { + const { duration, time, pitch, octave, velocity } = note; + super(duration, time, { pitch, octave }, velocity); + } - get value(): note_value { - return { - time: Time(this.time).quantize("4n") / 4, - pitch: this.pitch + this.octave.toString(), - duration: Time(this.duration).quantize("4n") / 4, - velocity: this.velocity, - } - } + get value(): note_value { + return { + time: Time(this.time).quantize("4n") / 4, + pitch: this.pitch + this.octave.toString(), + duration: Time(this.duration).quantize("4n") / 4, + velocity: this.velocity, + }; + } } export class MugicPlayer { @@ -36,29 +36,29 @@ export class MugicPlayer { // Singleton static getInstance() { - if (!MugicPlayer.instance) MugicPlayer.instance = new MugicPlayer(); - return MugicPlayer.instance; + if (!MugicPlayer.instance) MugicPlayer.instance = new MugicPlayer(); + return MugicPlayer.instance; } constructor() { - const options = { - frequency: 440, - oscillator: { - type: "sine" as any - }, - envelope: { - attack: 0.40, - decay: 0.10, - release: 0.5, - sustain: 1, - attackCurve: "cosine" as EnvelopeCurve, - releaseCurve: "exponential" as EnvelopeCurve, - decayCurve: "exponential" as BasicEnvelopeCurve - }, - pitchDecay: 0.05 - }; - this.synth = new Synth(options).toDestination(); - Transport.bpm.value = 140; + const options = { + frequency: 440, + oscillator: { + type: "sine" as any + }, + envelope: { + attack: 0.40, + decay: 0.10, + release: 0.5, + sustain: 1, + attackCurve: "cosine" as EnvelopeCurve, + releaseCurve: "exponential" as EnvelopeCurve, + decayCurve: "exponential" as BasicEnvelopeCurve + }, + pitchDecay: 0.05 + }; + this.synth = new Synth(options).toDestination(); + Transport.bpm.value = 140; } /** @@ -69,25 +69,25 @@ export class MugicPlayer { // 2Eb 2F 2D 2G 2Bb 1A 3D // up down up up down up play(input: string) { - Transport.stop(); - if (this.part) this.part.dispose(); + Transport.stop(); + if (this.part) this.part.dispose(); - try { - const tune = parseTune(input).map(note => new Note_Value(note)); - this.part = new Part( - (time, val) => { - this.synth.triggerAttackRelease(val.pitch, val.duration, time, val.velocity); - }, - tune.map((n) => n.value) - ).start(); + try { + const tune = parseTune(input).map(note => new Note_Value(note)); + this.part = new Part( + (time, val) => { + this.synth.triggerAttackRelease(val.pitch, val.duration, time, val.velocity); + }, + tune.map((n) => n.value) + ).start(); - Transport.start(); - } - catch (error) { - console.log(error); - // TODO show user the error - return; - } + Transport.start(); + } + catch (error) { + console.log(error); + // TODO show user the error + return; + } } diff --git a/src/components/mugicplayer/playbutton.tsx b/src/components/mugicplayer/playbutton.tsx index 635f9df..d8d5900 100644 --- a/src/components/mugicplayer/playbutton.tsx +++ b/src/components/mugicplayer/playbutton.tsx @@ -4,8 +4,8 @@ import { MugicPlayer } from './mugicplayer'; const player = MugicPlayer.getInstance(); export default (props: any) => { - const play = debounced(200, () => { player.play(props.notes); }); - return ( - { play() }} /> - ); + const play = debounced(200, () => { player.play(props.notes) }); + return ( + { play() }} /> + ); }; diff --git a/src/components/portal/Category.js b/src/components/portal/Category.js index 6b06a15..011da5a 100644 --- a/src/components/portal/Category.js +++ b/src/components/portal/Category.js @@ -25,11 +25,14 @@ export default class Category extends React.Component { API.LoadDB([{ 'cards': this.type }, { 'portal': this.type }]) .then(() => { this.loaded = true; - }); + }) + .catch(() => {}); return (); } - const create_link = (card, data, i, url) => { + const create_link = (card, i, url) => { + const data = API.cards[this.type].findOne({ 'gsx$name': card.gsx$name }); + // Prevent site from crashing due to misspelled/missing data if (!data) return (
); @@ -37,7 +40,7 @@ export default class Category extends React.Component { + > {card.gsx$name.split(",")[0]}
@@ -49,7 +52,7 @@ export default class Category extends React.Component { let top_content = (
); let bottom_nav = []; - let path = this.props.location.pathname.split("/"); + const path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash // ** Process the tribe ** // @@ -87,13 +90,12 @@ export default class Category extends React.Component { : API.portal[this.type].chain().simplesort('gsx$name').data() ).map((card_portal, i) => { - let card_data = API.cards[this.type].findOne({ 'gsx$name': card_portal.gsx$name }); - let url = ((tribe) ? + const url = ((tribe) ? `/portal/${this.props.type}/${card_portal.gsx$tribe}/${encodeURIComponent(card_portal.gsx$name)}` : `/portal/${this.props.type}/${encodeURIComponent(card_portal.gsx$name)}` ); - return create_link(card_portal, card_data, i, url); + return create_link(card_portal, i, url); }); } else { @@ -107,8 +109,7 @@ export default class Category extends React.Component { bottom_nav = API.portal[this.type].data .sort((a, b) => (a.gsx$name > b.gsx$name) ? 1 : -1) .map((card_portal, i) => { - let card_data = API.cards[this.type].findOne({ 'gsx$name': card_portal.gsx$name }); - return create_link(card_portal, card_data, i); + return create_link(card_portal, i); }); } diff --git a/src/components/portal/Home.js b/src/components/portal/Home.js index 326446f..e8904b0 100644 --- a/src/components/portal/Home.js +++ b/src/components/portal/Home.js @@ -17,28 +17,28 @@ export default class Home extends React.Component { const ctx = canvas.getContext('2d'); - let Logo = new Image(); + const Logo = new Image(); Logo.src = "/src/img/portal.png"; - let Creatures = (() => { - let Chaor = new Image(); + const Creatures = (() => { + const Chaor = new Image(); Chaor.src = API.base_image + "0B6oyUfwoM3u1LWtvNUZ2NVdjTGc"; - Chaor.onload = (() => { ctx.drawImage(Chaor, 50, 350); }); + Chaor.onload = (() => { ctx.drawImage(Chaor, 50, 350) }); - let Iflar = new Image(); + const Iflar = new Image(); Iflar.src = API.base_image + "0B6oyUfwoM3u1bFVIclZscHlHTVE"; - Iflar.onload = (() => { ctx.drawImage(Iflar, canvas.width - 300, 350); }); + Iflar.onload = (() => { ctx.drawImage(Iflar, canvas.width - 300, 350) }); - let Illexia = new Image(); + const Illexia = new Image(); Illexia.src = API.base_image + "0B6oyUfwoM3u1YzNhLUdSMHlmdFE"; - Illexia.onload = (() => { ctx.drawImage(Illexia, canvas.width - 350, Logo.height + 10); }); + Illexia.onload = (() => { ctx.drawImage(Illexia, canvas.width - 350, Logo.height + 10) }); - let Maxxor = new Image(); + const Maxxor = new Image(); Maxxor.src = API.base_image + "0B6oyUfwoM3u1MVVqQlpqYldsVDQ"; - Maxxor.onload = (() => { ctx.drawImage(Maxxor, 50, Logo.height + 10); }); + Maxxor.onload = (() => { ctx.drawImage(Maxxor, 50, Logo.height + 10) }); }); - let background = new Image(); + const background = new Image(); // background.src = API.base_image + "0B6oyUfwoM3u1VXZOdV9QUXlCclU"; // lighter background.src = API.base_image + "1iu0GFaJQ0UsSN8yYWi77VY1cXsQpM4o7"; //darker background.onload = (() => { @@ -96,10 +96,10 @@ export default class Home extends React.Component { }; that.render = function () { - let s_width = that.width / w_frames; - let s_height = that.height / h_frames; - let c_width = canvas.width/2 - s_width/2; - let c_height = canvas.height/2 - s_height/2; + const s_width = that.width / w_frames; + const s_height = that.height / h_frames; + const c_width = canvas.width/2 - s_width/2; + const c_height = canvas.height/2 - s_height/2; // Clear the canvas that.context.clearRect(c_width, c_height, s_width, s_height); @@ -127,7 +127,7 @@ export default class Home extends React.Component { this.coin.update(); this.coin.render(); } - } + }; // Create sprite sheet const coinImage = new Image(); diff --git a/src/components/portal/Search.js b/src/components/portal/Search.js index cba789a..08c6485 100644 --- a/src/components/portal/Search.js +++ b/src/components/portal/Search.js @@ -20,13 +20,13 @@ export default class SearchPortal extends React.Component { } render() { - return (
-
- this.query = e.target.value} /> - -
- -
); + return (
+
+ this.query = e.target.value} /> + +
+ +
); } search = (event) => { @@ -55,58 +55,56 @@ class DBSearch extends React.Component { ]).then(() => { this.loaded = true; }) - .catch(() => {}) + .catch(() => {}); return (Loading...); } - let { string } = this.props; + const { string } = this.props; // No search if (string == "") { return (
); } - const makeLink = (card, i) => { - let link = "/portal"; - switch (card.gsx$type) { - case "Attacks": - link += '/Attacks/' + encodeURIComponent(card.gsx$name); - break; - case "Battlegear": - link += '/Battlegear/' + encodeURIComponent(card.gsx$name); - break; - case "Creatures": - link += '/Creatures/' + encodeURIComponent(card.gsx$name); - break; - case "Locations": - link += '/Locations/' + encodeURIComponent(card.gsx$name); - break; - case "Mugic": - link += '/Mugic/' + encodeURIComponent(card.gsx$name); - break; + const text_link = (card, i) => { + let url; + if (["Attacks", "Battlegear", "Creatures", "Locations", "Mugic"].includes(card.gsx$type)) { + url = `/portal/${card.gsx$type}/${card.gsx$name}`; } + + if (!url) return (); + return (
- {card.gsx$name} + {card.gsx$name}
); }; - const create_link = (card, data, i, url) => { + const thumb_link = (card, i) => { + let url; + let data; + if (["Attacks", "Battlegear", "Creatures", "Locations", "Mugic"].includes(card.gsx$type)) { + url = `/portal/${card.gsx$type}/${card.gsx$name}`; + data = API.cards[card.gsx$type.toLowerCase()].findOne({ 'gsx$name': card.gsx$name }); + } + // Prevent site from crashing due to misspelled/missing data - if (!data) return (
); + if (!data || !url) return (); + + const name = card.gsx$name.split(",")[0].replace(/\(Unused\)/, ""); return (
- {card.gsx$name.split(",")[0]}
- + > + {name}
+
); }; - let filter = this.filter.addCollection('filter'); + const filter = this.filter.addCollection('filter'); var pview = filter.addDynamicView('filter'); pview.applySimpleSort('gsx$name'); @@ -170,13 +168,13 @@ class DBSearch extends React.Component { temp.forEach(function(v){ delete v.$loki }); filter.insert(temp); - let content = pview.data().map(makeLink); + let content = pview.data().map(text_link); this.filter.removeCollection('filter'); let header; // This prioritizes names in the results - let names = [].concat( + const names = [].concat( API.portal.attacks.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), API.portal.battlegear.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), API.portal.creatures.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), @@ -199,15 +197,16 @@ class DBSearch extends React.Component { .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) .where((obj) => {return (obj.gsx$splash != ('') )}).data() ).sort((a, b) => { - a = a.gsx$name.toLowerCase(); - b = b.gsx$name.toLowerCase(); - if (a < b) return -1; - else if (a > b) return 1; - else return 0; - }).map(makeLink); + a = a.gsx$name.toLowerCase(); + b = b.gsx$name.toLowerCase(); + if (a < b) return -1; + else if (a > b) return 1; + else return 0; + }).map(thumb_link); + // Check Artists if (content.length == 0) { - let artists = [].concat( + const artists = [].concat( API.cards.attacks.chain() .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) .where((obj) => {return (obj.gsx$splash != ('') )}).data(), @@ -229,7 +228,7 @@ class DBSearch extends React.Component { if (a < b) return -1; else if (a > b) return 1; else return 0; - }).map(makeLink); + }).map(text_link); if (artists.length > 0) { header = `Art contributed by ${string}:`; @@ -247,7 +246,7 @@ class DBSearch extends React.Component {
{names.length > 0 && <>
Entries
- {names} +
{names}

}
{header}
diff --git a/src/components/portal/Single/Attack.js b/src/components/portal/Single/Attack.js index c44c5fe..f31be67 100644 --- a/src/components/portal/Single/Attack.js +++ b/src/components/portal/Single/Attack.js @@ -10,15 +10,15 @@ export default class SingleAttack extends React.Component { render() { - let path = this.props.location.pathname.split("/"); + const path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash // Path too long if ( path.length !== 4 ) { - return(); + return (); } - let name = decodeURIComponent(path[3]); + const name = decodeURIComponent(path[3]); const attack = API.portal.attacks.findOne({ 'gsx$name': name }); const card_data = API.cards.attacks.findOne({ 'gsx$name': name }); @@ -42,7 +42,7 @@ export default class SingleAttack extends React.Component { {attack.gsx$details}
} - /> + /> ); } else if (card_data) { @@ -51,6 +51,6 @@ export default class SingleAttack extends React.Component { } } - return(); + return (); } } diff --git a/src/components/portal/Single/Battlegear.js b/src/components/portal/Single/Battlegear.js index bf0501f..e37ed65 100644 --- a/src/components/portal/Single/Battlegear.js +++ b/src/components/portal/Single/Battlegear.js @@ -10,19 +10,19 @@ export default class SingleBattlegear extends React.Component { render() { - let path = this.props.location.pathname.split("/"); + const path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash // Path too long if ( path.length !== 4 ) { - return(); + return (); } - let name = decodeURIComponent(path[3]); + const name = decodeURIComponent(path[3]); const battlegear = API.portal.battlegear.findOne({ 'gsx$name': name }); const card_data = API.cards.battlegear.findOne({ 'gsx$name': name }); - + if (battlegear) { return (); + return (); } } diff --git a/src/components/portal/Single/Creature.js b/src/components/portal/Single/Creature.js index 102a3e1..c497e1a 100644 --- a/src/components/portal/Single/Creature.js +++ b/src/components/portal/Single/Creature.js @@ -8,11 +8,11 @@ import Single from './_base'; import { PageNotFound, Element, Mugic, Discipline, Ability, Tribe } from '../../Snippets'; function Artist(props) { - let artists = []; + const artists = []; props.artist.split(/(?=, )/).forEach((artist, i) => { artists.push({artist}); }); - return (
{artists}
) + return (
{artists}
); } @inject((stores, props, context) => props) @observer @@ -24,7 +24,7 @@ export default class SingleCreature extends React.Component { // The first / gets counted render() { - let path = this.props.location.pathname.split("/"); + const path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash const name = (() => { @@ -35,7 +35,7 @@ export default class SingleCreature extends React.Component { const creature = API.portal.creatures.findOne({ 'gsx$name': name }); if (!creature) { - return(); + return (); } const tribe = creature.gsx$tribe; @@ -50,12 +50,12 @@ export default class SingleCreature extends React.Component { return

{item}

; }); - let mugic = []; + const mugic = []; for (let i = 0; i < card_data.gsx$mugicability; i++) { mugic.push(); } - // TODO readd creature to Portal Search after rewrite + // TODO readd creature to Portal Search after rewrite return (); + return (); } - let name = decodeURIComponent(path[3]); + const name = decodeURIComponent(path[3]); const location = API.portal.locations.findOne({ 'gsx$name': name }); const card_data = API.cards.locations.findOne({ 'gsx$name': name }); @@ -63,6 +63,6 @@ export default class SingleLocation extends React.Component { } } - return(); + return (); } } diff --git a/src/components/portal/Single/Mugic.js b/src/components/portal/Single/Mugic.js index 97e3f4d..2df99d3 100644 --- a/src/components/portal/Single/Mugic.js +++ b/src/components/portal/Single/Mugic.js @@ -14,7 +14,7 @@ export default class SingleMugic extends React.Component { // The first / gets counted render() { - let path = this.props.location.pathname.split("/"); + const path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash const name = (() => { @@ -26,7 +26,7 @@ export default class SingleMugic extends React.Component { const card_data = API.cards.mugic.findOne({ 'gsx$name': name }); const cost = () => { - let cost = []; + const cost = []; if (card_data.gsx$cost == 0) { cost.push(0); } @@ -39,7 +39,7 @@ export default class SingleMugic extends React.Component { } } return cost; - } + }; if (mugic) { return (); + return (); } } diff --git a/src/components/portal/Single/_base.js b/src/components/portal/Single/_base.js index fe6209c..a65c7d3 100644 --- a/src/components/portal/Single/_base.js +++ b/src/components/portal/Single/_base.js @@ -8,21 +8,21 @@ import s from '../../../styles/app.style'; // own "name" display function function Name(props) { - let name = props.name.split(","); - return (<> - {name[0]} - { name.length > 1 && -
{name[1].trim()}
- } - ); + const name = props.name.split(","); + return (<> + {name[0]} + { name.length > 1 && +
{name[1].trim()}
+ } + ); } function Artist(props) { - let artists = []; - props.artist.split(/(?=, )/).forEach((artist, i) => { - artists.push({artist}); - }); - return (
{artists}
) + const artists = []; + props.artist.split(/(?=, )/).forEach((artist, i) => { + artists.push({artist}); + }); + return (
{artists}
); } @inject((stores, props, context) => props) @observer @@ -30,91 +30,96 @@ export default class Single extends React.Component { @observable fullscreen = false; expand(e) { - this.fullscreen = true; + this.fullscreen = true; } close(e) { - this.fullscreen = false; + this.fullscreen = false; } render() { - let { card } = this.props; - return (<> -
- × - + const { card } = this.props; + + return (<> +
+ × + +
+ {card.gsx$splash && ( +
+ {/**/} +
- {card.gsx$splash && ( -
- {/**/} - -
- )} -
-
- -
-
- {this.props.text && -
{this.props.text}
- } - {!this.props.text && -
- {card.gsx$artist && <> -
- Artist(s): - -
-
- } - {card.gsx$set && <> -
- Set: - {`${API.sets[card.gsx$set]} (${card.gsx$set})`} -
-
- - } + )} +
+
+ +
+
+ {this.props.text && +
{this.props.text}
+ } + {!this.props.text && +
+ {card.gsx$artist && <> +
+ Artist(s): + +
+
+ } + {card.gsx$set && <> +
+ Set: + {`${API.sets[card.gsx$set]} (${card.gsx$set})`} +
+
+ + } + {card.gsx$rarity && <>
Rarity: {card.gsx$rarity}

+ } + {card.gsx$id && <>
Card ID: {card.gsx$id}
- {this.props.col0 && <> -
- {this.props.col0} - } - {card.gsx$ability && <> -
-
- Ability: - -
- } - {card.gsx$flavortext && <> -
-
- Card Flavor:
- {card.gsx$flavortext} -
- } - {this.props.col1 && <> -
- this.props.col1 - } -
- } - {!this.props.text && -
- {this.props.col2} -
- } -
- ); + } + {this.props.col0 && <> +
+ {this.props.col0} + } + {card.gsx$ability && <> +
+
+ Ability: + +
+ } + {card.gsx$flavortext && <> +
+
+ Card Flavor:
+ {card.gsx$flavortext} +
+ } + {this.props.col1 && <> +
+ this.props.col1 + } +
+ } + {!this.props.text && +
+ {this.props.col2} +
+ } +
+ ); } } diff --git a/src/components/portal/Tribes.js b/src/components/portal/Tribes.js index 0bcf188..3b3a348 100644 --- a/src/components/portal/Tribes.js +++ b/src/components/portal/Tribes.js @@ -33,12 +33,12 @@ export default class Tribes extends React.Component { return (); } - let path = this.props.location.pathname.split("/"); + const path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash - let tribe = path[2]; + const tribe = path[2]; - let filter = this.filter.addCollection('filter'); + const filter = this.filter.addCollection('filter'); var pview = filter.addDynamicView('filter'); pview.applySimpleSort('gsx$name'); @@ -52,7 +52,7 @@ export default class Tribes extends React.Component { temp.forEach((v) => { delete v.$loki }); filter.insert(temp); - let results = pview.data(); + const results = pview.data(); this.filter.removeCollection('filter'); const bottom_nav = results.map((card, i) => { diff --git a/src/components/portal/portal.scss b/src/components/portal/portal.scss index 2b38840..20b7a38 100644 --- a/src/components/portal/portal.scss +++ b/src/components/portal/portal.scss @@ -71,13 +71,44 @@ width: 18px; } -.search .results div { - padding-bottom: 10px; -} +.search { + .results { + &> div { + padding-bottom: 10px; + } + + a { + font-size: 16px; + line-height: 20px; + } -.search .results a { - font-size: 16px; - line-height: 20px; + .entry_nav { + background-color: inherit; + overflow-y: auto; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + align-content: space-between; + position: relative; + + .nav_item { + margin: 3px; + max-width: 106px; + white-space: initial; + overflow-wrap: break-word; + + display: flex; + justify-content: flex-end; + flex-direction: column; + + .thumb { + height: 100px; + width: 96px; + } + } + } + } } .entry { @@ -235,14 +266,13 @@ } &.base_path { - .entry_nav, .cat_title { - background-color: inherit; - } .cat_title { + background-color: inherit; padding-top: 1em; padding-bottom: 1em; } .entry_nav { + background-color: inherit; overflow-y: auto; display: flex; flex-direction: row; diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 8965213..5d2b005 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -22,6 +22,7 @@ module.exports = { port: 8000, publicPath: '/build/', contentBase: __dirname, + watchContentBase: true, historyApiFallback: { index: 'index.html', }, From 8ef4ea9d9420f5e1e1f5ebe1e0b1085e006af1b1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 19 Oct 2020 10:26:52 -0400 Subject: [PATCH 2/3] move to public folder --- index.html | 2 +- {src => public}/css/legacy.css | 0 {src => public}/css/legacy/Army_Builder.css | 0 {src => public}/css/legacy/Collection.css | 0 {src => public}/css/legacy/Enter_the_Code.css | 0 .../img/base/accordion_content_btm-left.jpg | Bin .../base/accordion_content_btm-repeat-x.jpg | Bin .../img/base/accordion_content_btm-right.jpg | Bin .../base/accordion_content_left-repeat-y.jpg | Bin .../img/base/accordion_content_repeat-x.jpg | Bin .../base/accordion_content_right-repeat-y.jpg | Bin .../img/base/accordion_content_top-left.jpg | Bin .../img/base/accordion_content_top-right.jpg | Bin .../img/base/accordion_toggle-left2.jpg | Bin .../img/base/accordion_toggle-right2.jpg | Bin .../img/base/accordion_toggle-x-repeat2.jpg | Bin .../base/accordion_toggle_active-left2.jpg | Bin .../base/accordion_toggle_active-right2.jpg | Bin .../accordion_toggle_active-x-repeat2.jpg | Bin {src => public}/img/base/adsPod-btm.gif | Bin {src => public}/img/base/adsPod-btmLeft.gif | Bin {src => public}/img/base/adsPod-btmRight.gif | Bin {src => public}/img/base/adsPod-left.gif | Bin {src => public}/img/base/adsPod-right.gif | Bin {src => public}/img/base/adsPod-top.gif | Bin {src => public}/img/base/adsPod-topLeft.gif | Bin {src => public}/img/base/adsPod-topRight.gif | Bin {src => public}/img/base/alert.gif | Bin {src => public}/img/base/army-help-left.jpg | Bin .../img/base/army-help-repeat-x.jpg | Bin {src => public}/img/base/army-help-right.jpg | Bin {src => public}/img/base/bkgrnd-repeat-x.jpg | Bin {src => public}/img/base/black-70.png | Bin {src => public}/img/base/blackAnimBack.png | Bin .../img/base/card-select-bkgrnd.jpg | Bin .../img/base/content-area-left-repeat-y.jpg | Bin .../img/base/content-area-right-repeat-y.jpg | Bin .../img/base/content-area-top-repeat-x.jpg | Bin {src => public}/img/base/content-btm-left.gif | Bin .../img/base/content-btm-repeat-x.jpg | Bin .../img/base/content-btm-right.gif | Bin .../base/content-heading-base-repeat-x.jpg | Bin .../img/base/content-heading-left-rise.jpg | Bin .../img/base/content-heading-left.gif | Bin .../base/content-heading-right-repeat-x.jpg | Bin .../img/base/content-heading-right-rise.jpg | Bin .../img/base/content-heading-right.gif | Bin {src => public}/img/base/content-top-left.jpg | Bin .../img/base/content-top-right.jpg | Bin {src => public}/img/base/footer-left.gif | Bin {src => public}/img/base/footer-repeat-x.gif | Bin {src => public}/img/base/footer-right.gif | Bin .../img/base/login-bkgrnd-left.jpg | Bin .../img/base/login-bkgrnd-right.jpg | Bin .../img/base/login-center-left.jpg | Bin .../img/base/login-center-repeat-x.jpg | Bin .../img/base/login-center-right.jpg | Bin {src => public}/img/base/login-repeat-x.jpg | Bin .../img/base/loginBar-inputBtn.jpg | Bin {src => public}/img/base/lw-top-left.jpg | Bin {src => public}/img/base/lw-top-repeat-x.jpg | Bin {src => public}/img/base/lw-top-right.jpg | Bin .../img/base/mrViewArchive-Left.jpg | Bin .../img/base/mrViewArchive-Right.jpg | Bin .../img/base/mrViewArchive-hover-repeat-x.jpg | Bin .../img/base/mrViewArchive-hoverLeft.jpg | Bin .../img/base/mrViewArchive-hoverRight.jpg | Bin .../img/base/mrViewArchive-repeat-x.jpg | Bin .../img/base/pod-btm-center-repeat-x.jpg | Bin {src => public}/img/base/pod-btm-left.gif | Bin {src => public}/img/base/pod-btm-right.gif | Bin .../img/base/pod-left-repeat-y.jpg | Bin .../img/base/pod-right-repeat-y.jpg | Bin .../img/base/pod-top-center-divide.jpg | Bin .../img/base/pod-top-left-repeat-x.jpg | Bin {src => public}/img/base/pod-top-left.gif | Bin {src => public}/img/base/pod-top-left2.gif | Bin .../img/base/pod-top-right-repeat-x.jpg | Bin {src => public}/img/base/pod-top-right.gif | Bin .../img/base/trade-search-bkgrnd.jpg | Bin {src => public}/img/base/unity-sprite-nav.png | Bin .../img/base/videoPod-repeat-x.gif | Bin {src => public}/img/base/videoPod-topLeft.gif | Bin .../img/base/videoPod-topRight.gif | Bin {src => public}/img/base/visual-bkgrnd.jpg | Bin {src => public}/img/base/visual-bkgrnd_02.jpg | Bin {src => public}/img/base/visual-bkgrnd_03.jpg | Bin {src => public}/img/base/visual-bkgrnd_04.jpg | Bin {src => public}/img/base/visual-bkgrnd_05.jpg | Bin {src => public}/img/base/visual-bkgrnd_06.jpg | Bin .../img/base/visual-bkgrnd_german_01.jpg | Bin {src => public}/img/btn_donate_SM.gif | Bin {src => public}/img/flag_usa_.gif | Bin {src => public}/img/icons/attack/attack.png | Bin {src => public}/img/icons/attack/attack_0.png | Bin {src => public}/img/icons/attack/attack_1.png | Bin {src => public}/img/icons/attack/attack_2.png | Bin {src => public}/img/icons/attack/attack_3.png | Bin {src => public}/img/icons/attack/attack_4.png | Bin {src => public}/img/icons/attack/attack_5.png | Bin {src => public}/img/icons/battlegear.png | Bin .../img/icons/disciplines/courage.png | Bin .../img/icons/disciplines/power.png | Bin .../img/icons/disciplines/speed.png | Bin .../img/icons/disciplines/wisdom.png | Bin .../img/icons/elements/air-inactive.png | Bin {src => public}/img/icons/elements/air.png | Bin .../img/icons/elements/earth-inactive.png | Bin {src => public}/img/icons/elements/earth.png | Bin .../img/icons/elements/fire-inactive.png | Bin {src => public}/img/icons/elements/fire.png | Bin .../img/icons/elements/water-inactive.png | Bin {src => public}/img/icons/elements/water.png | Bin {src => public}/img/icons/location.png | Bin .../img/icons/mugic/128px/danian.png | Bin .../img/icons/mugic/128px/generic.png | Bin .../img/icons/mugic/128px/m'arrillian.png | Bin .../img/icons/mugic/128px/mipedian.png | Bin .../img/icons/mugic/128px/overworld.png | Bin .../img/icons/mugic/128px/underworld.png | Bin {src => public}/img/icons/mugic/danian.png | Bin {src => public}/img/icons/mugic/danian_0.png | Bin {src => public}/img/icons/mugic/danian_x.png | Bin {src => public}/img/icons/mugic/generic.png | Bin {src => public}/img/icons/mugic/generic_0.png | Bin {src => public}/img/icons/mugic/generic_x.png | Bin .../img/icons/mugic/m'arrillian.png | Bin .../img/icons/mugic/m'arrillian_10.png | Bin .../img/icons/mugic/m'arrillian_6.png | Bin .../img/icons/mugic/marrillian.png | Bin {src => public}/img/icons/mugic/mipedian.png | Bin .../img/icons/mugic/mipedian_0.png | Bin {src => public}/img/icons/mugic/overworld.png | Bin .../img/icons/mugic/overworld_0.png | Bin {src => public}/img/icons/mugic/tl.png | Bin .../img/icons/mugic/underworld.png | Bin .../img/icons/mugic/underworld_0.png | Bin .../img/icons/mugic/underworld_x.png | Bin {src => public}/img/icons/set/au/common.png | Bin {src => public}/img/icons/set/au/rare.png | Bin .../img/icons/set/au/super rare.png | Bin .../img/icons/set/au/ultra rare.png | Bin {src => public}/img/icons/set/au/uncommon.png | Bin {src => public}/img/icons/set/br/common.png | Bin {src => public}/img/icons/set/br/rare.png | Bin .../img/icons/set/br/super rare.png | Bin .../img/icons/set/br/ultra rare.png | Bin {src => public}/img/icons/set/br/uncommon.png | Bin {src => public}/img/icons/set/dop/common.png | Bin {src => public}/img/icons/set/dop/promo.png | Bin {src => public}/img/icons/set/dop/rare.png | Bin .../img/icons/set/dop/super rare.png | Bin .../img/icons/set/dop/ultra rare.png | Bin .../img/icons/set/dop/uncommon.png | Bin {src => public}/img/icons/set/ee/common.png | Bin {src => public}/img/icons/set/ee/rare.png | Bin .../img/icons/set/ee/super rare.png | Bin .../img/icons/set/ee/ultra rare.png | Bin .../img/icons/set/ee/unavailable.png | Bin {src => public}/img/icons/set/ee/uncommon.png | Bin {src => public}/img/icons/set/fas/common.png | Bin {src => public}/img/icons/set/fas/rare.png | Bin .../img/icons/set/fas/super rare.png | Bin .../img/icons/set/fas/ultra rare.png | Bin .../img/icons/set/fas/uncommon.png | Bin {src => public}/img/icons/set/fun/common.png | Bin {src => public}/img/icons/set/fun/promo.png | Bin {src => public}/img/icons/set/fun/rare.png | Bin .../img/icons/set/fun/super rare.png | Bin .../img/icons/set/fun/ultra rare.png | Bin .../img/icons/set/fun/uncommon.png | Bin {src => public}/img/icons/set/lr/common.png | Bin {src => public}/img/icons/set/lr/rare.png | Bin .../img/icons/set/lr/super rare.png | Bin .../img/icons/set/lr/ultra rare.png | Bin {src => public}/img/icons/set/lr/uncommon.png | Bin {src => public}/img/icons/set/mi/common.png | Bin {src => public}/img/icons/set/mi/promo.png | Bin {src => public}/img/icons/set/mi/rare.png | Bin .../img/icons/set/mi/super rare.png | Bin .../img/icons/set/mi/ultra rare.png | Bin {src => public}/img/icons/set/mi/uncommon.png | Bin {src => public}/img/icons/set/op1/common.png | Bin {src => public}/img/icons/set/op1/promo.png | Bin {src => public}/img/icons/set/op1/rare.png | Bin .../img/icons/set/op1/super rare.png | Bin .../img/icons/set/op1/ultra rare.png | Bin .../img/icons/set/op1/uncommon.png | Bin {src => public}/img/icons/set/promo/promo.png | Bin {src => public}/img/icons/set/promo/rare.png | Bin .../img/icons/set/promo/super rare.png | Bin .../img/icons/set/proto/common.png | Bin {src => public}/img/icons/set/proto/promo.png | Bin {src => public}/img/icons/set/proto/rare.png | Bin .../img/icons/set/proto/super rare.png | Bin .../img/icons/set/proto/ultra rare.png | Bin .../img/icons/set/proto/uncommon.png | Bin {src => public}/img/icons/set/roto/common.png | Bin {src => public}/img/icons/set/roto/promo.png | Bin {src => public}/img/icons/set/roto/rare.png | Bin .../img/icons/set/roto/super rare.png | Bin .../img/icons/set/roto/ultra rare.png | Bin .../img/icons/set/roto/uncommon.png | Bin {src => public}/img/icons/set/sas/common.png | Bin {src => public}/img/icons/set/sas/rare.png | Bin .../img/icons/set/sas/super rare.png | Bin .../img/icons/set/sas/ultra rare.png | Bin .../img/icons/set/sas/unavailable.png | Bin .../img/icons/set/sas/uncommon.png | Bin {src => public}/img/icons/set/ss/common.png | Bin {src => public}/img/icons/set/ss/rare.png | Bin .../img/icons/set/ss/super rare.png | Bin .../img/icons/set/ss/ultra rare.png | Bin {src => public}/img/icons/set/ss/uncommon.png | Bin {src => public}/img/icons/set/tott/common.png | Bin {src => public}/img/icons/set/tott/promo.png | Bin {src => public}/img/icons/set/tott/rare.png | Bin .../img/icons/set/tott/super rare.png | Bin .../img/icons/set/tott/ultra rare.png | Bin .../img/icons/set/tott/uncommon.png | Bin {src => public}/img/icons/set/zoth/common.png | Bin {src => public}/img/icons/set/zoth/rare.png | Bin .../img/icons/set/zoth/super rare.png | Bin .../img/icons/set/zoth/ultra rare.png | Bin .../img/icons/set/zoth/uncommon.png | Bin {src => public}/img/icons/tribes/danian.png | Bin {src => public}/img/icons/tribes/generic.png | Bin .../img/icons/tribes/m'arrillian.png | Bin {src => public}/img/icons/tribes/mipedian.png | Bin .../img/icons/tribes/overworld.png | Bin .../img/icons/tribes/underworld.png | Bin {src => public}/img/logo.png | Bin {src => public}/img/portal.png | Bin {src => public}/json/starter_lore.json | 0 src/components/home/index.js | 2 +- src/components/portal/Home.js | 2 +- src/{components => }/index.js | 17 +++++++-------- webpack.config.babel.js | 20 +++++++++--------- 238 files changed, 21 insertions(+), 22 deletions(-) rename {src => public}/css/legacy.css (100%) rename {src => public}/css/legacy/Army_Builder.css (100%) rename {src => public}/css/legacy/Collection.css (100%) rename {src => public}/css/legacy/Enter_the_Code.css (100%) rename {src => public}/img/base/accordion_content_btm-left.jpg (100%) rename {src => public}/img/base/accordion_content_btm-repeat-x.jpg (100%) rename {src => public}/img/base/accordion_content_btm-right.jpg (100%) rename {src => public}/img/base/accordion_content_left-repeat-y.jpg (100%) rename {src => public}/img/base/accordion_content_repeat-x.jpg (100%) rename {src => public}/img/base/accordion_content_right-repeat-y.jpg (100%) rename {src => public}/img/base/accordion_content_top-left.jpg (100%) rename {src => public}/img/base/accordion_content_top-right.jpg (100%) rename {src => public}/img/base/accordion_toggle-left2.jpg (100%) rename {src => public}/img/base/accordion_toggle-right2.jpg (100%) rename {src => public}/img/base/accordion_toggle-x-repeat2.jpg (100%) rename {src => public}/img/base/accordion_toggle_active-left2.jpg (100%) rename {src => public}/img/base/accordion_toggle_active-right2.jpg (100%) rename {src => public}/img/base/accordion_toggle_active-x-repeat2.jpg (100%) rename {src => public}/img/base/adsPod-btm.gif (100%) rename {src => public}/img/base/adsPod-btmLeft.gif (100%) rename {src => public}/img/base/adsPod-btmRight.gif (100%) rename {src => public}/img/base/adsPod-left.gif (100%) rename {src => public}/img/base/adsPod-right.gif (100%) rename {src => public}/img/base/adsPod-top.gif (100%) rename {src => public}/img/base/adsPod-topLeft.gif (100%) rename {src => public}/img/base/adsPod-topRight.gif (100%) rename {src => public}/img/base/alert.gif (100%) rename {src => public}/img/base/army-help-left.jpg (100%) rename {src => public}/img/base/army-help-repeat-x.jpg (100%) rename {src => public}/img/base/army-help-right.jpg (100%) rename {src => public}/img/base/bkgrnd-repeat-x.jpg (100%) rename {src => public}/img/base/black-70.png (100%) rename {src => public}/img/base/blackAnimBack.png (100%) rename {src => public}/img/base/card-select-bkgrnd.jpg (100%) rename {src => public}/img/base/content-area-left-repeat-y.jpg (100%) rename {src => public}/img/base/content-area-right-repeat-y.jpg (100%) rename {src => public}/img/base/content-area-top-repeat-x.jpg (100%) rename {src => public}/img/base/content-btm-left.gif (100%) rename {src => public}/img/base/content-btm-repeat-x.jpg (100%) rename {src => public}/img/base/content-btm-right.gif (100%) rename {src => public}/img/base/content-heading-base-repeat-x.jpg (100%) rename {src => public}/img/base/content-heading-left-rise.jpg (100%) rename {src => public}/img/base/content-heading-left.gif (100%) rename {src => public}/img/base/content-heading-right-repeat-x.jpg (100%) rename {src => public}/img/base/content-heading-right-rise.jpg (100%) rename {src => public}/img/base/content-heading-right.gif (100%) rename {src => public}/img/base/content-top-left.jpg (100%) rename {src => public}/img/base/content-top-right.jpg (100%) rename {src => public}/img/base/footer-left.gif (100%) rename {src => public}/img/base/footer-repeat-x.gif (100%) rename {src => public}/img/base/footer-right.gif (100%) rename {src => public}/img/base/login-bkgrnd-left.jpg (100%) rename {src => public}/img/base/login-bkgrnd-right.jpg (100%) rename {src => public}/img/base/login-center-left.jpg (100%) rename {src => public}/img/base/login-center-repeat-x.jpg (100%) rename {src => public}/img/base/login-center-right.jpg (100%) rename {src => public}/img/base/login-repeat-x.jpg (100%) rename {src => public}/img/base/loginBar-inputBtn.jpg (100%) rename {src => public}/img/base/lw-top-left.jpg (100%) rename {src => public}/img/base/lw-top-repeat-x.jpg (100%) rename {src => public}/img/base/lw-top-right.jpg (100%) rename {src => public}/img/base/mrViewArchive-Left.jpg (100%) rename {src => public}/img/base/mrViewArchive-Right.jpg (100%) rename {src => public}/img/base/mrViewArchive-hover-repeat-x.jpg (100%) rename {src => public}/img/base/mrViewArchive-hoverLeft.jpg (100%) rename {src => public}/img/base/mrViewArchive-hoverRight.jpg (100%) rename {src => public}/img/base/mrViewArchive-repeat-x.jpg (100%) rename {src => public}/img/base/pod-btm-center-repeat-x.jpg (100%) rename {src => public}/img/base/pod-btm-left.gif (100%) rename {src => public}/img/base/pod-btm-right.gif (100%) rename {src => public}/img/base/pod-left-repeat-y.jpg (100%) rename {src => public}/img/base/pod-right-repeat-y.jpg (100%) rename {src => public}/img/base/pod-top-center-divide.jpg (100%) rename {src => public}/img/base/pod-top-left-repeat-x.jpg (100%) rename {src => public}/img/base/pod-top-left.gif (100%) rename {src => public}/img/base/pod-top-left2.gif (100%) rename {src => public}/img/base/pod-top-right-repeat-x.jpg (100%) rename {src => public}/img/base/pod-top-right.gif (100%) rename {src => public}/img/base/trade-search-bkgrnd.jpg (100%) rename {src => public}/img/base/unity-sprite-nav.png (100%) rename {src => public}/img/base/videoPod-repeat-x.gif (100%) rename {src => public}/img/base/videoPod-topLeft.gif (100%) rename {src => public}/img/base/videoPod-topRight.gif (100%) rename {src => public}/img/base/visual-bkgrnd.jpg (100%) rename {src => public}/img/base/visual-bkgrnd_02.jpg (100%) rename {src => public}/img/base/visual-bkgrnd_03.jpg (100%) rename {src => public}/img/base/visual-bkgrnd_04.jpg (100%) rename {src => public}/img/base/visual-bkgrnd_05.jpg (100%) rename {src => public}/img/base/visual-bkgrnd_06.jpg (100%) rename {src => public}/img/base/visual-bkgrnd_german_01.jpg (100%) rename {src => public}/img/btn_donate_SM.gif (100%) rename {src => public}/img/flag_usa_.gif (100%) rename {src => public}/img/icons/attack/attack.png (100%) rename {src => public}/img/icons/attack/attack_0.png (100%) rename {src => public}/img/icons/attack/attack_1.png (100%) rename {src => public}/img/icons/attack/attack_2.png (100%) rename {src => public}/img/icons/attack/attack_3.png (100%) rename {src => public}/img/icons/attack/attack_4.png (100%) rename {src => public}/img/icons/attack/attack_5.png (100%) rename {src => public}/img/icons/battlegear.png (100%) rename {src => public}/img/icons/disciplines/courage.png (100%) rename {src => public}/img/icons/disciplines/power.png (100%) rename {src => public}/img/icons/disciplines/speed.png (100%) rename {src => public}/img/icons/disciplines/wisdom.png (100%) rename {src => public}/img/icons/elements/air-inactive.png (100%) rename {src => public}/img/icons/elements/air.png (100%) rename {src => public}/img/icons/elements/earth-inactive.png (100%) rename {src => public}/img/icons/elements/earth.png (100%) rename {src => public}/img/icons/elements/fire-inactive.png (100%) rename {src => public}/img/icons/elements/fire.png (100%) rename {src => public}/img/icons/elements/water-inactive.png (100%) rename {src => public}/img/icons/elements/water.png (100%) rename {src => public}/img/icons/location.png (100%) rename {src => public}/img/icons/mugic/128px/danian.png (100%) rename {src => public}/img/icons/mugic/128px/generic.png (100%) rename {src => public}/img/icons/mugic/128px/m'arrillian.png (100%) rename {src => public}/img/icons/mugic/128px/mipedian.png (100%) rename {src => public}/img/icons/mugic/128px/overworld.png (100%) rename {src => public}/img/icons/mugic/128px/underworld.png (100%) rename {src => public}/img/icons/mugic/danian.png (100%) rename {src => public}/img/icons/mugic/danian_0.png (100%) rename {src => public}/img/icons/mugic/danian_x.png (100%) rename {src => public}/img/icons/mugic/generic.png (100%) rename {src => public}/img/icons/mugic/generic_0.png (100%) rename {src => public}/img/icons/mugic/generic_x.png (100%) rename {src => public}/img/icons/mugic/m'arrillian.png (100%) rename {src => public}/img/icons/mugic/m'arrillian_10.png (100%) rename {src => public}/img/icons/mugic/m'arrillian_6.png (100%) rename {src => public}/img/icons/mugic/marrillian.png (100%) rename {src => public}/img/icons/mugic/mipedian.png (100%) rename {src => public}/img/icons/mugic/mipedian_0.png (100%) rename {src => public}/img/icons/mugic/overworld.png (100%) rename {src => public}/img/icons/mugic/overworld_0.png (100%) rename {src => public}/img/icons/mugic/tl.png (100%) rename {src => public}/img/icons/mugic/underworld.png (100%) rename {src => public}/img/icons/mugic/underworld_0.png (100%) rename {src => public}/img/icons/mugic/underworld_x.png (100%) rename {src => public}/img/icons/set/au/common.png (100%) rename {src => public}/img/icons/set/au/rare.png (100%) rename {src => public}/img/icons/set/au/super rare.png (100%) rename {src => public}/img/icons/set/au/ultra rare.png (100%) rename {src => public}/img/icons/set/au/uncommon.png (100%) rename {src => public}/img/icons/set/br/common.png (100%) rename {src => public}/img/icons/set/br/rare.png (100%) rename {src => public}/img/icons/set/br/super rare.png (100%) rename {src => public}/img/icons/set/br/ultra rare.png (100%) rename {src => public}/img/icons/set/br/uncommon.png (100%) rename {src => public}/img/icons/set/dop/common.png (100%) rename {src => public}/img/icons/set/dop/promo.png (100%) rename {src => public}/img/icons/set/dop/rare.png (100%) rename {src => public}/img/icons/set/dop/super rare.png (100%) rename {src => public}/img/icons/set/dop/ultra rare.png (100%) rename {src => public}/img/icons/set/dop/uncommon.png (100%) rename {src => public}/img/icons/set/ee/common.png (100%) rename {src => public}/img/icons/set/ee/rare.png (100%) rename {src => public}/img/icons/set/ee/super rare.png (100%) rename {src => public}/img/icons/set/ee/ultra rare.png (100%) rename {src => public}/img/icons/set/ee/unavailable.png (100%) rename {src => public}/img/icons/set/ee/uncommon.png (100%) rename {src => public}/img/icons/set/fas/common.png (100%) rename {src => public}/img/icons/set/fas/rare.png (100%) rename {src => public}/img/icons/set/fas/super rare.png (100%) rename {src => public}/img/icons/set/fas/ultra rare.png (100%) rename {src => public}/img/icons/set/fas/uncommon.png (100%) rename {src => public}/img/icons/set/fun/common.png (100%) rename {src => public}/img/icons/set/fun/promo.png (100%) rename {src => public}/img/icons/set/fun/rare.png (100%) rename {src => public}/img/icons/set/fun/super rare.png (100%) rename {src => public}/img/icons/set/fun/ultra rare.png (100%) rename {src => public}/img/icons/set/fun/uncommon.png (100%) rename {src => public}/img/icons/set/lr/common.png (100%) rename {src => public}/img/icons/set/lr/rare.png (100%) rename {src => public}/img/icons/set/lr/super rare.png (100%) rename {src => public}/img/icons/set/lr/ultra rare.png (100%) rename {src => public}/img/icons/set/lr/uncommon.png (100%) rename {src => public}/img/icons/set/mi/common.png (100%) rename {src => public}/img/icons/set/mi/promo.png (100%) rename {src => public}/img/icons/set/mi/rare.png (100%) rename {src => public}/img/icons/set/mi/super rare.png (100%) rename {src => public}/img/icons/set/mi/ultra rare.png (100%) rename {src => public}/img/icons/set/mi/uncommon.png (100%) rename {src => public}/img/icons/set/op1/common.png (100%) rename {src => public}/img/icons/set/op1/promo.png (100%) rename {src => public}/img/icons/set/op1/rare.png (100%) rename {src => public}/img/icons/set/op1/super rare.png (100%) rename {src => public}/img/icons/set/op1/ultra rare.png (100%) rename {src => public}/img/icons/set/op1/uncommon.png (100%) rename {src => public}/img/icons/set/promo/promo.png (100%) rename {src => public}/img/icons/set/promo/rare.png (100%) rename {src => public}/img/icons/set/promo/super rare.png (100%) rename {src => public}/img/icons/set/proto/common.png (100%) rename {src => public}/img/icons/set/proto/promo.png (100%) rename {src => public}/img/icons/set/proto/rare.png (100%) rename {src => public}/img/icons/set/proto/super rare.png (100%) rename {src => public}/img/icons/set/proto/ultra rare.png (100%) rename {src => public}/img/icons/set/proto/uncommon.png (100%) rename {src => public}/img/icons/set/roto/common.png (100%) rename {src => public}/img/icons/set/roto/promo.png (100%) rename {src => public}/img/icons/set/roto/rare.png (100%) rename {src => public}/img/icons/set/roto/super rare.png (100%) rename {src => public}/img/icons/set/roto/ultra rare.png (100%) rename {src => public}/img/icons/set/roto/uncommon.png (100%) rename {src => public}/img/icons/set/sas/common.png (100%) rename {src => public}/img/icons/set/sas/rare.png (100%) rename {src => public}/img/icons/set/sas/super rare.png (100%) rename {src => public}/img/icons/set/sas/ultra rare.png (100%) rename {src => public}/img/icons/set/sas/unavailable.png (100%) rename {src => public}/img/icons/set/sas/uncommon.png (100%) rename {src => public}/img/icons/set/ss/common.png (100%) rename {src => public}/img/icons/set/ss/rare.png (100%) rename {src => public}/img/icons/set/ss/super rare.png (100%) rename {src => public}/img/icons/set/ss/ultra rare.png (100%) rename {src => public}/img/icons/set/ss/uncommon.png (100%) rename {src => public}/img/icons/set/tott/common.png (100%) rename {src => public}/img/icons/set/tott/promo.png (100%) rename {src => public}/img/icons/set/tott/rare.png (100%) rename {src => public}/img/icons/set/tott/super rare.png (100%) rename {src => public}/img/icons/set/tott/ultra rare.png (100%) rename {src => public}/img/icons/set/tott/uncommon.png (100%) rename {src => public}/img/icons/set/zoth/common.png (100%) rename {src => public}/img/icons/set/zoth/rare.png (100%) rename {src => public}/img/icons/set/zoth/super rare.png (100%) rename {src => public}/img/icons/set/zoth/ultra rare.png (100%) rename {src => public}/img/icons/set/zoth/uncommon.png (100%) rename {src => public}/img/icons/tribes/danian.png (100%) rename {src => public}/img/icons/tribes/generic.png (100%) rename {src => public}/img/icons/tribes/m'arrillian.png (100%) rename {src => public}/img/icons/tribes/mipedian.png (100%) rename {src => public}/img/icons/tribes/overworld.png (100%) rename {src => public}/img/icons/tribes/underworld.png (100%) rename {src => public}/img/logo.png (100%) rename {src => public}/img/portal.png (100%) rename {src => public}/json/starter_lore.json (100%) rename src/{components => }/index.js (94%) diff --git a/index.html b/index.html index b6e8e8c..2b88af6 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - +