diff options
-rw-r--r-- | play.html | 25 | ||||
-rw-r--r-- | play.js | 23 |
2 files changed, 23 insertions, 25 deletions
@@ -240,33 +240,23 @@ td img { vertical-align: middle } user-select: none; } -#calendar { +#calendar, #calendar2 { user-select: none; position: absolute; display: flex; top: 24px; - left: 1841px; - gap: 9px; -} - -#calendar2 { - display: flex; - user-select: none; - position: absolute; - top: 24px; - left: 1841px; - gap: 9px; + left: 1956px; + gap: 20px; } .month { visibility: hidden; - width: 68px; - height: 68px; + width: 46px; + height: 46px; background-color: #fee0bf; background-color: wheat; - color: black; - font-size: 40px; - line-height: 68px; + font-size: 28px; + line-height: 46px; font-weight: bold; text-align: center; border: 2px solid #222; @@ -279,6 +269,7 @@ td img { vertical-align: middle } .month.now { background-color: tan; + box-shadow: 0 0 0 4px #fff4; } /* MAP */ @@ -177,7 +177,7 @@ function is_unit_fired(u) { } function is_unit_revealed(u) { - let reinf = hexdeploy + view.month + let reinf = hexmonth + view.month if (player === AXIS) return is_axis_unit(u) || set_has(view.revealed, u) || unit_hex(u) > reinf else if (player === ALLIED) @@ -256,6 +256,10 @@ function is_setup_hex(hex) { return hex === DEPLOY } +function is_month_hex(hex) { + return hex >= hexmonth +} + function focus_stack(stack, hex) { if (ui.focus !== stack) { console.log("FOCUS STACK", stack, hex) @@ -453,7 +457,7 @@ const HIGHWAY = 4 const map_w = 25 const map_h = 9 -const hexdeploy = map_w * map_h +const hexmonth = map_w * map_h let hexnext = [ 1, map_w, map_w-1, -1, -map_w, -(map_w-1) ] @@ -584,13 +588,13 @@ function build_hexes() { } for (let month = 1; month <= 10; ++month) { - ui.hex_y[map_w * map_h + month] = 24 + 37 - ui.hex_x[map_w * map_h + month] = 1840 + 37 + (month-1) * 81 + ui.hex_y[map_w * map_h + month] = 25 + 24 + ui.hex_x[map_w * map_h + month] = 25 + 1956 + (month-1) * 70 ui.months[month] = document.getElementById("month" + month) } for (let month = 11; month <= 20; ++month) { - ui.hex_y[map_w * map_h + month] = 24 + 37 // + 81 - ui.hex_x[map_w * map_h + month] = 1840 + 37 + (month-11) * 81 + ui.hex_y[map_w * map_h + month] = 25 + 24 + ui.hex_x[map_w * map_h + month] = 25 + 1956 + (month-11) * 70 ui.months[month] = document.getElementById("month" + month) } @@ -693,7 +697,10 @@ function layout_stack(stack, hex, start_x, start_y, wrap, xdir) { y = start_y - 25 + (i % wrap) * 56 z = 200 } else { - if (stack.length <= 1) { + if (is_month_hex(hex)) { + x = start_x - 25 + i * 3 + y = start_y - 25 + i * 3 + } else if (stack.length <= 1) { x = start_x - 25 + i * 11 y = start_y - 25 + i * 14 } else if (stack.length <= 4) { @@ -764,7 +771,7 @@ function update_map() { else hex = 171 } - if (hex >= hexdeploy + view.month + 10) + if (hex >= hexmonth + view.month + 10) hex = 0 if (is_setup_hex(hex)) { if (player === "Axis" && !is_axis_unit(u)) |