planet-wars/backend/static/script/maps.js

18 lines
434 B
JavaScript
Raw Normal View History

2020-03-26 20:25:33 +01:00
const ids = {};
2020-03-27 10:31:56 +01:00
["map_holder", "name", "turns", "nop"].forEach(id => ids[id] = document.getElementById(id));
2020-03-26 20:25:33 +01:00
var last_map;
async function handle_map_click(url, event) {
if (last_map) {
last_map.classList.remove("selected");
}
last_map = event.target;
event.target.classList.add("selected");
const c = await fetch(url);
ids["map_holder"].innerHTML = await c.text();
2020-03-27 10:31:56 +01:00
}
async function start_game() {
2020-03-26 20:25:33 +01:00
}