blob: 96a53b9e56cb9984add36b48619f35b0a39c8e4f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()
|