diff --git a/index.html b/index.html
index 5b7cbab..fc5465f 100644
--- a/index.html
+++ b/index.html
@@ -10,30 +10,7 @@
-
- Costs:
-
-
-
-
-
-
-
-
- Rewards:
-
-
-
-
-
-
-
-
-
-
- Other:
-
-
+
diff --git a/index.ts b/index.ts
index 93eb187..f57a72c 100644
--- a/index.ts
+++ b/index.ts
@@ -4,6 +4,7 @@ let costs = ["sheep", "cow", "wool", "bread", "cheese", "whisky"]
let rewards = ["cotton", "tobacco", "sugarCane", "upgrade", "expansion", "gold", "hops"]
function init() {
+ buildHeader();
fetch('contracts.json')
.then(response => response.json())
.then(json => {
@@ -32,6 +33,37 @@ function init() {
});
}
+function buildHeader() {
+ document.getElementById("header").innerHTML = `
+
+ Costs:
+ ${buildCheckBoxes(costs)}
+
+
+ Rewards:
+ ${buildCheckBoxes(rewards)}
+
+
+
+ Other:
+ ${buildCheckBoxes(["discarded"])}
+
+ `;
+}
+
+function buildCheckBoxes(filters: string[]) : string {
+ let result = "";
+ for (const filter of filters) {
+ result += buildCheckBox(filter);
+ }
+ return result;
+}
+
+function buildCheckBox(filterKey: string): string {
+ let capitalized = filterKey[0].toUpperCase() + filterKey.slice(1);
+ return ``;
+}
+
function update() {
let includedContracts = "";
let excludedContracts = "";