summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-03-17 14:30:04 +0100
committerTor Andersson <tor@ccxvii.net>2024-03-17 14:30:04 +0100
commit7b98e9c6efd97470248fb244a20c3dacb2942cd1 (patch)
treee9ecc42fc55c296208bf0f18ccb4ca55d938b6a6 /play.js
parenteb1b52100cc054f7ddbeb865e8b001828b07704d (diff)
downloadmaria-7b98e9c6efd97470248fb244a20c3dacb2942cd1.tar.gz
Add initial client.
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()