diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-03-17 14:30:04 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-03-17 14:30:04 +0100 |
commit | 7b98e9c6efd97470248fb244a20c3dacb2942cd1 (patch) | |
tree | e9ecc42fc55c296208bf0f18ccb4ca55d938b6a6 /play.js | |
parent | eb1b52100cc054f7ddbeb865e8b001828b07704d (diff) | |
download | maria-7b98e9c6efd97470248fb244a20c3dacb2942cd1.tar.gz |
Add initial client.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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() |