From 5eb2975315a50c585eb048479c4fdc765a24a20c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 9 Jun 2024 00:29:33 +0200 Subject: new marker css --- play.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 9d396ec..cd613d8 100644 --- a/play.js +++ b/play.js @@ -181,7 +181,7 @@ function build_map() { e.addEventListener("click", on_space) ui.spaces[i] = e document.getElementById("spaces").appendChild(e) - ui.pc[i] = build_marker("pc", name + "-pc", space.x, space.y, 67, 58.5, [ "pc" ]) + ui.pc[i] = build_marker("pc", name + "-pc", space.x, space.y, 58, 66, [ "pc" ]) } } @@ -193,7 +193,7 @@ function build_map() { ui.blockade[zone] = e } - ui.turn = build_marker("markers", "GameTurn", BOXES["Game Turn 1775"].x, BOXES["Game Turn 1775"].y, 56.5, 56.5, [ + ui.turn = build_marker("markers", "GameTurn", BOXES["Game Turn 1775"].x, BOXES["Game Turn 1775"].y, 55, 55, [ "turn", ]) @@ -202,8 +202,8 @@ function build_map() { "FrenchAlliance", BOXES["French Alliance Track 0"].x, BOXES["French Alliance Track 0"].y, - 56.5, - 56.5, + 55, + 55, [ "french-alliance" ] ) @@ -212,8 +212,8 @@ function build_map() { "FrenchNavy", SPACES[data.space_index["French Reinforcements"]].x - 130 / 2 - 10, SPACES[data.space_index["French Reinforcements"]].y - 32, - 126 / 2, - 252 / 2, + 64, + 130, [ "french-navy" ] ) @@ -222,14 +222,14 @@ function build_map() { "Congress", SPACES[data.space_index["Philadelphia"]].x, SPACES[data.space_index["Philadelphia"]].y, - 113 / 2, - 113 / 2, + 55, + 55, [ "congress" ] ) for (let c = 0; c <= 13; ++c) { let name = data.colony_name[c] - ui.control[c] = build_marker("markers", "control_" + name, BOXES[name].x, BOXES[name].y, 38 + 8, 38 + 8, [ "control" ]) + ui.control[c] = build_marker("markers", "control_" + name, BOXES[name].x, BOXES[name].y, 45, 45, [ "control" ]) } for (let c = 1; c <= 110; ++c) { @@ -240,7 +240,8 @@ function build_map() { for (let g = 0; g < general_count; ++g) { let color = GENERALS[g].owner.toLowerCase() let name = GENERALS[g].name - ui.generals[g] = build_marker("generals", g, 0, 0, 126 / 2, 252 / 2, [ "general", color, name, "offmap" ]) + //ui.generals[g] = build_marker("generals", g, 0, 0, 64, 130, [ "general", "tall", color, name, "offmap" ]) + ui.generals[g] = build_marker("generals", g, 0, 0, 45, 45, [ "general", "small", color, name, "offmap" ]) ui.generals[g].addEventListener("click", on_general) } } @@ -262,8 +263,6 @@ function count_french_cu(s) { } function update_units() { - const unitW = 130 / 2 - const unitH = 263 / 2 const generalX = -22 const generalY = 22 const cuX = 20 @@ -337,7 +336,8 @@ function update_units() { let space = SPACES[loc] || BOXES[loc] if (space) { let o = offset[loc] | 0 - update_marker_xy(e, space.x + o * generalX, space.y + o * generalY - 32) + // update_marker_xy(e, space.x + o * generalX, space.y + o * generalY - 32) + update_marker_xy(e, space.x + o * generalX + 20, space.y + o * generalY - 20) e.classList.remove("offmap") offset[loc] = ++o } else { @@ -357,7 +357,7 @@ function update_units() { let o = offset[s] | 0 let x = space.x + o * cuX let y = space.y + o * cuY - let e = build_marker("cu", null, x, y, 122 / 2, 122 / 2, cn) + let e = build_marker("cu", null, x, y, 60, 60, cn) e.textContent = n offset[s] = ++o } -- cgit v1.2.3