From 5f8f49869a62ce92baf91a75723227ee7afca7d9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 2 Jan 2025 17:39:48 +0100 Subject: fix indentation and semicolons --- play.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 0471007..d78cfd4 100644 --- a/play.js +++ b/play.js @@ -624,7 +624,7 @@ function layout_vp_marker() { } function layout_country(id) { - // TODO: what number to display? + // TODO: what number to display? if (view.revolutions[id]) ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id] else if (view.times_held[id] > 0) @@ -992,7 +992,7 @@ function sub_icon(match) { return ICONS[match] || match } -function sub_arrow(match) { +function sub_arrow(_match) { return ' → ' } @@ -1122,7 +1122,7 @@ function on_log(text, ix) { log_event = 0 } -//Group events + // Group events // Reset group box counters (when log is rewound) if (ix <= log_event) log_event = 0 -- cgit v1.2.3 From d25d7e33e2ff1260a607c49a7e0a0ffaf3e03221 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 2 Jan 2025 20:30:46 +0100 Subject: tweak logging --- play.css | 38 ++++++++++++++++++-------------------- play.js | 2 +- rules.js | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 21 deletions(-) (limited to 'play.js') diff --git a/play.css b/play.css index afee2c4..aaf8abf 100644 --- a/play.css +++ b/play.css @@ -37,39 +37,38 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log .h5 { text-decoration: underline; } #log { background-color: floralwhite } -#log .h1 { background-color: tan ;} +#log .h1 { background-color: tan } #log .h2 { background-color: wheat } #log .h3 { background-color: wheat } -#log .h1, .h2:not(.group), .h3 { - text-transform: uppercase; +#log .h1, .h2, .h3 { + font-variant-caps: small-caps; border-top: 1px solid black; border-bottom: 1px solid black; - font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; } -#log .h2:not(.group).dem { - font-size: 10px; - background-color: hsl(206, 85%, 80%); border-top: 1px solid hsl(206, 85%, 25%); border-bottom: 1px solid hsl(206, 85%, 25%);} -#log .h2:not(.group).com { - font-size: 10px; - background-color: hsl(355, 70%, 80%); - border-top: 1px solid hsl(355, 70%, 25%); +#log .h2.dem { + background-color: hsl(206, 85%, 80%); + border-top: 1px solid hsl(206, 85%, 25%); + border-bottom: 1px solid hsl(206, 85%, 25%); +} +#log .h2.com { + background-color: hsl(355, 70%, 80%); + border-top: 1px solid hsl(355, 70%, 25%); border-bottom: 1px solid hsl(355, 70%, 25%); } #log .group.dem { background-color: hsl(206, 85%, 90%); } #log .group.com { background-color: hsl(355, 70%, 90%); } #log .group.both { background-color: gainsboro; } -#log .h1, #log .h2, #log .h3 { margin: 6px 0; } - -#log .group {margin: 0 6px} +#log .group { margin: 0 6px; } +#log .header.group.dem { background-color: hsl(206, 85%, 85%); } +#log .header.group.com { background-color: hsl(355, 70%, 85%); } #log div { padding-left: 20px; text-indent: -12px; } #log div.i { padding-left: 32px; text-indent: -12px; } #log div.ii { padding-left: 44px; text-indent: -12px; } #log .card_name { font-style: italic; } -#log div.h2 .card_name { font-style: normal; } #log .card_name:hover { text-decoration: underline; } #log .space_tip:hover { cursor: pointer; text-decoration: underline; } @@ -100,18 +99,17 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } } #log .icon.number { - background-color: white; + background-color: white; border: 1px solid #444; width: 10px; height: 10px; -} +} #log .com_nc { background-image: url(images/SVd_blank.gif);} #log .com_c {background-image: url(images/SV_blank.gif);} #log .dem_nc { background-image: url(images/USd_blank.gif);} #log .dem_c {background-image: url(images/favicon_dem.svg);} - /* MAP */ #mapwrap { @@ -179,7 +177,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } height: 15px; width: 100px; } - + .box.d_pres { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, transparent 100%); } .box.c_pres { background: linear-gradient(to right, transparent 0%, transparent 80%,rgba(255, 0, 0, 0.75) 80%, rgba(255, 0, 0, 0.75) 100%); } @@ -197,7 +195,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .box.c_pres.c_dom { background: linear-gradient(to right, transparent 50%, rgba(255, 0, 0, 0.75) 50%, rgba(255, 0, 0, 0.75) 100%); } .box.d_pres.c_pres.c_dom { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, transparent 50%, rgba(255, 0, 0, 0.75) 50%, rgba(255, 0, 0, 0.75) 100%); } - + .box.c_pres.c_ctrl { background: linear-gradient(to right, transparent 20%, rgba(255, 0, 0, 0.75) 20%, rgba(255, 0, 0, 0.75) 100%); } .box.d_pres.c_pres.c_ctrl { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, rgba(255, 0, 0, 0.75) 20%, rgba(255, 0, 0, 0.75) 100%); } diff --git a/play.js b/play.js index d78cfd4..12470c5 100644 --- a/play.js +++ b/play.js @@ -1128,7 +1128,7 @@ function on_log(text, ix) { if (!scoring_cards.includes(event_n)) { if (text.match(/^.E:/)) { - p.classList.add("h2") + p.classList.add("header") log_event = ix text = text.replace(".E:", "") } diff --git a/rules.js b/rules.js index b78c137..095008b 100644 --- a/rules.js +++ b/rules.js @@ -4289,32 +4289,40 @@ function log(msg) { } function log_ops_banner() { + log_br() if (game.active === DEM) log('.O.d') else log('.O.c') + log_br() finish_select_card() } function log_event_banner() { + log_br() if (game.active === DEM) log('.V.d') else log('.V.c') + log_br() } function log_struggle_banner(n) { + log_br() if (game.active === DEM) log('.S.dC' + n) else log('.S.cC' + n) + log_br() } function log_tst_8_banner() { + log_br() if (game.active === DEM) log('.T.d') else log('.T.c') + log_br() finish_select_card() } @@ -4343,15 +4351,21 @@ function logii(msg) { } function log_h1(msg) { + log_br() log(".h1 " + msg) + log_br() } function log_h2(msg) { + log_br() log(".h2 " + msg) + log_br() } function log_h3(msg) { + log_br() log(".h3 " + msg) + log_br() } function log_h4(msg) { -- cgit v1.2.3 From 22f2de3e25c082aa16a8d741f6457af9cf59bb68 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 3 Jan 2025 22:44:19 +0100 Subject: put influence change in margin --- play.css | 17 ++++++++++++++++- play.js | 12 +++++------- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'play.js') diff --git a/play.css b/play.css index aaf8abf..7e63f9f 100644 --- a/play.css +++ b/play.css @@ -41,6 +41,21 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log .h2 { background-color: wheat } #log .h3 { background-color: wheat } +#log .marginalia { + display: block; + float: right; + text-indent: 0; + margin: 0; + margin-right: 6px; + padding: 0; +} + +#log .group .marginalia { + margin-right: 0; +} + +#log > div { clear: right } + #log .h1, .h2, .h3 { font-variant-caps: small-caps; border-top: 1px solid black; @@ -538,4 +553,4 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.power_50 { background-image: url(cards75/power_50.avif) } .card.power_51 { background-image: url(cards75/power_51.avif) } .card.power_52 { background-image: url(cards75/power_52.avif) } -.card.power_53 { background-image: url(cards75/power_back.avif) } \ No newline at end of file +.card.power_53 { background-image: url(cards75/power_back.avif) } diff --git a/play.js b/play.js index 12470c5..f15659e 100644 --- a/play.js +++ b/play.js @@ -848,11 +848,12 @@ function on_update() { ui.hand.appendChild(ui.cards[c]) ui.power_hand.replaceChildren() - if (view.is_pwr_struggle) + if (view.is_pwr_struggle) { ui.power_hand.appendChild(ui.power_cards[53]) if (view.power_hand.length > 0) for (let c of view.power_hand) ui.power_hand.appendChild(ui.power_cards[c]) + } ui.power_discard.replaceChildren() if (view.power_struggle_discard) @@ -993,14 +994,13 @@ function sub_icon(match) { } function sub_arrow(_match) { - return ' → ' + return " \u2192 " } function wrap_icons(match) { - return `${match}`; + return `${match.replace("(", "").replace(")", "")}` } - const ICONS = { '£CC': '', '£CU': '', @@ -1045,9 +1045,7 @@ function on_log(text, ix) { p.className = "i" } -/* - text = text.replace(/(\(£[CDU][CU]\s\.to\s£[CDU][CU]\))/g, wrap_icons) -*/ + text = text.replace(/(\(£[CDU][CU]\s\.to\s£[CDU][CU]\))/g, wrap_icons) text = text.replace(/_/g, " ") text = text.replace(/C(\d+)/g, sub_card_name) -- cgit v1.2.3