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

18 lines
434 B
JavaScript
Raw Normal View History

2020-03-26 19:25:33 +00:00
const ids = {};
2020-03-27 09:31:56 +00:00
["map_holder", "name", "turns", "nop"].forEach(id => ids[id] = document.getElementById(id));
2020-03-26 19:25:33 +00: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 09:31:56 +00:00
}
async function start_game() {
2020-03-26 19:25:33 +00:00
}