diff --git a/index.html b/index.html
index 821b955..9775333 100644
--- a/index.html
+++ b/index.html
@@ -19,8 +19,7 @@
color: inherit;
background: transparent;
}
- /*pass window height (w/o scroll bars) down to react app, note can't use vh because that
- includes scroll bars and mobile browser footer, etc so doesn't give viewable area*/
+ /*pass window height (w/o scroll bars) down to react app, note can't use vh because that includes scroll bars and mobile browser footer, etc so doesn't give viewable area*/
html, body { height: 100%; }
html { background-color:#494949; }
#root { min-height: 100%; }
diff --git a/src/components/collection/Search.js b/src/components/collection/Search.js
index ce52b57..a9b7e53 100644
--- a/src/components/collection/Search.js
+++ b/src/components/collection/Search.js
@@ -3,6 +3,7 @@ import API from '../SpreadsheetData';
import {observable} from "mobx";
import {observer, inject} from 'mobx-react';
import loki from 'lokijs';
+import Collapsible from 'react-collapsible';
@inject((stores, props, context) => props) @observer
export default class SearchForm extends React.Component {
@@ -101,7 +102,6 @@ export default class SearchForm extends React.Component {
Text: this.stones.text = input} />
- {card_types}
Subtypes | Initiative:
this.stones.subtypes = input} />
@@ -110,15 +110,7 @@ export default class SearchForm extends React.Component {
this.stones.mirage = input}/>Mirage
- {setsInput}
-
- {card_rarity}
-
-
- this.stones.unique = input}/>Unique
- this.stones.loyal = input}/>Loyal
- this.stones.legendary = input}/>Legendary
-
+ {card_types}
{card_tribes}
@@ -127,29 +119,31 @@ export default class SearchForm extends React.Component {
{card_disciplines}
- Energy
+ Energy
Min: this.energy.min = input} />
Max: this.energy.max = input} />
- Mugic Counters/Cost
- Min: this.mc.min = input} />
- Max: this.mc.max = input} />
+ Mugic Counters/Cost | Build Points
+ Min: this.mc.min = input} />
+ Max: this.mc.max = input} />
- Build Points
- Min: this.bp.min = input} />
- Max: this.bp.max = input} />
+ this.stones.unique = input}/>Unique
+ this.stones.loyal = input}/>Loyal
+ this.stones.mixed = input}/>Mixed
+ this.stones.legendary = input}/>Legendary
-
- Gender (fan content):
+ {card_rarity}
+ {setsInput}
+
this.gender.Ambiguous = input}/>Ambiguous
this.gender.Female = input}/>Female
this.gender.Male = input}/>Male
-
+
@@ -329,16 +323,17 @@ export default class SearchForm extends React.Component {
}
if (this.mc.min.value !== "" && this.mc.min.value >= 0) {
+ attackResults = attackResults.find({'gsx$bp': {'$gte': this.mc.min.value}});
creatureResults = creatureResults.find({'gsx$mugicability': {'$gte': this.mc.min.value}});
mugicResults = mugicResults.find({'gsx$cost': {'$gte': this.mc.min.value}});
}
if (this.mc.max.value !== "" && this.mc.max.value >= 0 && this.mc.max.value >= this.mc.min.value) {
+ attackResults = attackResults.find({'gsx$bp': {'$lte': this.mc.max.value}});
creatureResults = creatureResults.find({'gsx$mugicability': {'$lte': this.mc.max.value}});
mugicResults = mugicResults.find({'gsx$cost': {'$lte': this.mc.max.value}});
}
if (this.mc.max.value !== "" || this.mc.min.value !== "") {
- attackResults = attackResults.limit(0);
battlegearResults = battlegearResults.limit(0);
locationResults = locationResults.limit(0);
}
@@ -370,21 +365,6 @@ export default class SearchForm extends React.Component {
mugicResults = mugicResults.limit(0);
}
- if (this.bp.min.value !== "" && this.bp.min.value >= 0) {
- attackResults = attackResults.find({'gsx$bp': {'$gte': this.bp.min.value}});
- }
- if (this.bp.max.value !== "" && this.bp.max.value >= 0 && this.bp.max.value >= this.bp.min.value) {
- attackResults = attackResults.find({'gsx$bp': {'$lte': this.bp.max.value}});
- }
-
-
- if (this.bp.min.value !== "" || this.bp.max.value !== "") {
- battlegearResults = battlegearResults.limit(0);
- creatureResults = creatureResults.limit(0);
- locationResults = locationResults.limit(0);
- mugicResults = mugicResults.limit(0);
- }
-
if (this.stones.unique.checked) {
attackResults = attackResults.find({'gsx$unique': {'$gt': 0}});
battlegearResults = battlegearResults.find({'gsx$unique': {'$gt': 0}});
@@ -400,6 +380,10 @@ export default class SearchForm extends React.Component {
mugicResults = mugicResults.find({'gsx$loyal': {'$gt': 0}});
}
+ if (this.stones.mixed.checked) {
+ creatureResults = creatureResults.find({'gsx$loyal': {'$lte': 0}});
+ }
+
if (this.stones.legendary.checked) {
attackResults = attackResults.find({'gsx$legendary': {'$gt': 0}});
battlegearResults = battlegearResults.find({'gsx$legendary': {'$gt': 0}});
diff --git a/src/css/collection.css b/src/css/collection.css
index 54f16bb..f17b6a0 100644
--- a/src/css/collection.css
+++ b/src/css/collection.css
@@ -111,3 +111,20 @@
width: 100px;
height: 98px;
}
+
+.Collapsible {
+ margin-bottom: 10px;
+}
+
+.Collapsible__trigger {
+ background-color: #333;
+ width: 250px;
+ display: inline-block;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ text-indent: 5px;
+}
+
+.Collapsible__trigger:hover {
+ background-color: red;
+}