Compare commits
5 Commits
fea9007a01
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c945efeb5 | ||
|
|
d34c13dfa6 | ||
|
|
e32cf5b817 | ||
|
|
877304a19e | ||
|
|
9d2cf4c264 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
.idea
|
||||
index.js
|
||||
index.js
|
||||
update.sh
|
||||
|
||||
@@ -265,12 +265,12 @@
|
||||
"sugarCane": 0,
|
||||
"tobacco": 0,
|
||||
"upgrade": 0}},
|
||||
{"costs": {"bread": 0,
|
||||
{"costs": {"bread": 2,
|
||||
"cheese": 0,
|
||||
"cow": 0,
|
||||
"sheep": 3,
|
||||
"whisky": 0,
|
||||
"wool": 2},
|
||||
"wool": 0},
|
||||
"id": 20,
|
||||
"rewards": {"cotton": 0,
|
||||
"expansion": 0,
|
||||
@@ -402,8 +402,8 @@
|
||||
"expansion": 0,
|
||||
"gold": 5,
|
||||
"hops": 2,
|
||||
"sugarCane": 4,
|
||||
"tobacco": 0,
|
||||
"sugarCane": 0,
|
||||
"tobacco": 4,
|
||||
"upgrade": 0}},
|
||||
{"costs": {"bread": 0,
|
||||
"cheese": 0,
|
||||
@@ -447,9 +447,9 @@
|
||||
"sugarCane": 0,
|
||||
"tobacco": 4,
|
||||
"upgrade": 0}},
|
||||
{"costs": {"bread": 0,
|
||||
{"costs": {"bread": 3,
|
||||
"cheese": 0,
|
||||
"cow": 3,
|
||||
"cow": 0,
|
||||
"sheep": 1,
|
||||
"whisky": 0,
|
||||
"wool": 0},
|
||||
|
||||
20
index.ts
20
index.ts
@@ -2,7 +2,7 @@ let contracts;
|
||||
|
||||
let costs = ["sheep", "cow", "wool", "bread", "cheese", "whisky"]
|
||||
let rewards = ["cotton", "tobacco", "sugarCane", "upgrade", "expansion", "gold", "hops"]
|
||||
let exports = ["cotton", "tobacco", "sugarCane"]
|
||||
let imports = ["cotton", "tobacco", "sugarCane"]
|
||||
let bonuses = ["upgrade", "expansion", "gold", "hops"]
|
||||
|
||||
function init() {
|
||||
@@ -43,11 +43,11 @@ function buildHeader() {
|
||||
<span>Costs:</span>
|
||||
${buildCheckBoxes(costs)}
|
||||
</div>
|
||||
<div id="exports" class="filters">
|
||||
<button type="button" id="rewardsNone" onclick="setAllExportsCheckboxes(false)">None</button>
|
||||
<button type="button" id="rewardsAll" onclick="setAllExportsCheckboxes(true)">All</button>
|
||||
<span>Exports:</span>
|
||||
${buildCheckBoxes(exports)}
|
||||
<div id="imports" class="filters">
|
||||
<button type="button" id="rewardsNone" onclick="setAllImportsCheckboxes(false)">None</button>
|
||||
<button type="button" id="rewardsAll" onclick="setAllImportsCheckboxes(true)">All</button>
|
||||
<span>Imports:</span>
|
||||
${buildCheckBoxes(imports)}
|
||||
</div>
|
||||
<div id="bonuses" class="filters">
|
||||
<button type="button" id="bonusesNone" onclick="setAllBonusesCheckboxes(false)">None</button>
|
||||
@@ -71,8 +71,8 @@ function setAllCostsCheckboxes(value: boolean) {
|
||||
update();
|
||||
}
|
||||
|
||||
function setAllExportsCheckboxes(value: boolean) {
|
||||
for (const filter of exports) {
|
||||
function setAllImportsCheckboxes(value: boolean) {
|
||||
for (const filter of imports) {
|
||||
let checkBox = document.getElementById(filter) as HTMLInputElement;
|
||||
checkBox.checked = value;
|
||||
}
|
||||
@@ -97,9 +97,9 @@ function buildCheckBoxes(filters: string[]): string {
|
||||
|
||||
function buildCheckBox(filterKey: string): string {
|
||||
let capitalized = filterKey[0].toUpperCase() + filterKey.slice(1);
|
||||
return `<input id="${filterKey}" type="checkbox" checked="checked"/>
|
||||
return `<span class="filterElement"><input id="${filterKey}" type="checkbox" checked="checked"/>
|
||||
<label for="${filterKey}">${capitalized}</label>
|
||||
<span id="${filterKey}Count"></span>`;
|
||||
<span id="${filterKey}Count"></span></span>`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user