summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/play.js b/play.js
new file mode 100644
index 0000000..96a53b9
--- /dev/null
+++ b/play.js
@@ -0,0 +1,19 @@
+const cities = data.cities
+const last_city = cities.name.length - 1
+
+const ui = {
+ map_pieces: document.getElementById("pieces"),
+ cities: [],
+}
+
+function on_init() {
+ for (let s = 0; s <= last_city; ++s) {
+ let e = ui.cities[s] = document.createElement("div")
+ e.className = "city"
+ e.style.left = (cities.x[s] - 9) + "px"
+ e.style.top = (cities.y[s] - 9) + "px"
+ map_pieces.appendChild(e)
+ }
+}
+
+on_init()