diff options
author | teisuru <31881306+teisuru@users.noreply.github.com> | 2023-08-27 14:20:15 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-10 18:16:55 +0100 |
commit | 334806029f81684611bd0c5d52445b0981cab691 (patch) | |
tree | bda5cbcd7efc2e04d12a2e4aee5dea5683315209 /play.js | |
parent | 71b35aab731eea9999a4b4081172ee9f274ebd9f (diff) | |
download | plantagenet-334806029f81684611bd0c5d52445b0981cab691.tar.gz |
lord seats
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 36 |
1 files changed, 20 insertions, 16 deletions
@@ -522,6 +522,7 @@ const ui = { cards: [], calendar: [], track: [], + seat: [], plan_panel: document.getElementById("plan_panel"), plan: document.getElementById("plan"), @@ -700,27 +701,30 @@ function build_map() { e.style.border = "2px solid aqua" e.style.backgroundSize = small + "px" document.getElementById("pieces").appendChild(e) - - - /* - if (locale.name == London) { - if {data.lords == - e = ui.locale_markers[ix] = document.createElement("div") - e.className = "locale marker seat " + locale.name // Depleted to be removed - depleted/exhausted to add markers - e.style.top = y+h-small-offsetdeplete + "px" - e.style.left = offsetdeplete+x+ (w-small)/2 + "px" - e.style.width = small + "px" - e.style.height = small + "px" - e.style.border = "2px solid aqua" - e.style.backgroundSize = small + "px" - document.getElementById("pieces").appendChild(e) - } */ }) +// Lord seats + data.seat.forEach((seat, ix) => { + let e = ui.seat[ix] = document.createElement("div") + let { x, y, w, h } = seat.box + let xc = Math.round(x + w / 2) + let yc = Math.round(y + h / 2) + let small = 54 + locale_xy[ix] = [ xc, yc ] - + e.className = seat.name + e.style.position = "absolute" + e.style.top = y + "px" + e.style.left = x + "px" + e.style.width = w + "px" + e.style.height = h + "px" + e.style.border = "1px solid black" + e.style.backgroundSize = small + "px" + e.style.backgroundColor = "red" + document.getElementById("pieces").appendChild(e) + }) data.lords.forEach((lord, ix) => { |