Separate Matchday balance colours from the skin accent (by Codex)

This commit is contained in:
Codex committed 2026-10-27 22:28:28 +01:00
1 parent 85a1fe5a95
commit 94dc5ecbc4
8 files changed
+42 -10

No files matched your search

+7 -4
View File
@@ -3,20 +3,20 @@
div,h1,h2,h3,p,label,header,section,aside,footer,nav {display:block;}
span,small,strong {display:inline-block;}
body {
--text:#e9f0f6;--muted:#afbfcd;--accent:#a5e2cf;--desk-top:#3c5264a8;--desk-bottom:#172b3ee0;
--text:#e9f0f6;--muted:#afbfcd;--accent:#a5e2cf;--money:#a5e2cf;--desk-top:#3c5264a8;--desk-bottom:#172b3ee0;
--strong:#152a3af5;--soft:#d4eaff0b;--border:#e0f0ff2b;
--menu-top:#303c49eb;--menu-bottom:#1a2531f2;--panel:#12243155;--input:#172633b0;
--hover:#bad5f21a;--selected:#477f7c77;--danger:#f0aaa7;--on-accent:#152a3a;
margin:0;width:100%;height:100%;overflow:hidden;font-family:Modern;font-size:32dp;color:var(--text);background-color:#0b121c;
}
body.silver {
--text:#233443;--muted:#526779;--accent:#25617a;--desk-top:#f4f9f3e6;--desk-bottom:#d6e1e9e8;
--text:#233443;--muted:#526779;--accent:#25617a;--money:#25617a;--desk-top:#f4f9f3e6;--desk-bottom:#d6e1e9e8;
--strong:#e7f0f5fc;--soft:#315b7110;--border:#6c879c4a;
--menu-top:#f0f5f9f5;--menu-bottom:#d4e0eaf5;--panel:#f1f6fa80;--input:#ffffffad;
--hover:#9eb9d43b;--selected:#a3c3dd54;--danger:#a23f45;--on-accent:#f7fcff;
}
body.matchday {
--text:#efeded;--muted:#b7b4b9;--accent:#efb2aa;--desk-top:#303238f5;--desk-bottom:#1d2025f2;
--text:#efeded;--muted:#b7b4b9;--accent:#efb2aa;--money:#efeded;--desk-top:#303238f5;--desk-bottom:#1d2025f2;
--strong:#272a30fc;--soft:#f9f4ed0b;--border:#ead9da29;
--menu-top:#343338f5;--menu-bottom:#202126f7;--panel:#1d1e2466;--input:#191a208a;
--hover:#d5b3b423;--selected:#d48c7b26;--danger:#f0a6a7;--on-accent:#2a2022;
@@ -61,6 +61,9 @@ h3 {font-size:31dp;font-weight:bold;}
.small {font-size:26dp;color:var(--muted);}
.muted {color:var(--muted);}
.accent {color:var(--accent);}
/* Monetary meaning stays independent of the skin highlight colour. */
.money-amount {color:var(--money);}
.money-amount.is-negative {color:var(--danger);}
.row {display:flex;align-items:center;gap:24dp;}
.column {display:flex;flex-direction:column;gap:24dp;}
.center {text-align:center;}
@@ -117,7 +120,7 @@ h3 {font-size:31dp;font-weight:bold;}
.info-date small {display:block;font-size:27dp;color:var(--muted);margin-top:8dp;}
.info-cash {min-width:450dp;padding-left:58dp;border-left:2dp var(--border);}
.info-cash small {display:block;font-size:27dp;color:var(--muted);}
.info-cash strong {font-size:40dp;color:var(--accent);}
.info-cash strong {font-size:40dp;color:var(--money);}
.desktop-card {position:absolute;border:2dp var(--border);border-radius:36dp;decorator:linear-gradient(145deg,var(--desk-top),var(--desk-bottom));backdrop-filter:blur(34dp);overflow:hidden;}
.desktop-card.pinned {border-color:var(--border);}
.card-heading {position:absolute;left:30dp;right:30dp;top:22dp;color:var(--muted);font-size:25dp;}
+1 -1
View File
@@ -21,7 +21,7 @@ body.silver .desk-calendar-month {background-color:#b76264;}body.matchday .desk-
[data-widget=calendar][data-size=s] .desk-calendar-foot {height:60dp;font-size:20dp;gap:10dp;padding:8dp 18dp;}
.desk-account-main {padding:16dp 34dp 20dp;display:flex;flex-direction:column;gap:10dp;}
.desk-account-main>span {display:block;font-size:25dp;color:var(--muted);}
.desk-account-main>strong {display:block;font-size:65dp;letter-spacing:-2dp;font-weight:normal;line-height:1.1;color:var(--accent);}
.desk-account-main>strong {display:block;font-size:65dp;letter-spacing:-2dp;font-weight:normal;line-height:1.1;color:var(--money);}
.desk-account-bottom {position:absolute;bottom:0;left:0;right:0;height:132dp;display:flex;align-items:center;justify-content:space-between;gap:30dp;padding:20dp 34dp;border-top:2dp var(--border);background-color:var(--soft);}
.desk-account-bottom>div {display:flex;flex-direction:column;gap:8dp;}
.desk-account-bottom span {display:block;font-size:24dp;color:var(--muted);}
+12
View File
@@ -60,3 +60,15 @@ bleibt vollständig mit seitlichen Rändern innerhalb des quadratischen Widgets
sichtbar. Damit werden Kopf und Schultern nicht stärker als in der HTML-Referenz
angeschnitten. Bildquelle, ausgewählte Person und Widgetanordnung bleiben gleich;
keine neue Assetgenerierung oder Datenänderung ist damit verbunden.
## Geldfarben
Guthaben in Statusleiste und Kontowidget verwenden die semantische Geldfarbe
`--money` statt der allgemeinen Theme-Akzentfarbe. Matchday zeigt positive
Beträge und Nullwerte neutral hell; negative Kontostände tragen zusätzlich
`is-negative` und verwenden die Warnfarbe. Midnight und Silver behalten ihre
bisherigen positiven Geldfarben. Das gilt für Demo- und Engine-Einstieg;
Beträge und Spielregeln werden dadurch nicht verändert. Die synthetische
RmlUI-Kontrollprüfung deckt positive, null und negative Werte in allen drei
Themes bei vier Pixeldichten ab.
+2 -2
View File
@@ -48,7 +48,7 @@ void App::engine_render() {
out = "<div class=\"desktop-layer\"><div class=\"info-bar\"><div class=\"identity\">" + crest(club, 82) +
"<span><strong>" + esc(engine_text(team.at("name"))) + "</strong><small>" + esc(engine_text(person.at("name"))) +
"</small></span></div><div class=\"info-date\">" + esc(meta.at("date").get<std::string>()) + "<small>" +
esc(meta.at("season").at("label").get<std::string>()) + "</small></div><div class=\"info-cash\"><small>Guthaben</small><strong id=\"engine-cash\">" +
esc(meta.at("season").at("label").get<std::string>()) + "</small></div><div class=\"info-cash\"><small>Guthaben</small><strong id=\"engine-cash\" class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" +
esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div></div>";
init_desktop();
for (const auto &[id, o] : desktop_.at("objects").items()) {
@@ -71,7 +71,7 @@ void App::engine_render() {
body = "<div class=\"desk-calendar-month\"><span>" + std::string(months[size_t(m - 1)]) + " " + std::to_string(y) + "</span></div><div class=\"desk-calendar-body\"><span>" + weekdays[std::chrono::weekday{std::chrono::sys_days(ymd)}.c_encoding()] + "</span><strong>" + std::to_string(d) + "</strong><small>" + esc(meta.at("season").at("label").get<std::string>()) + "</small></div>";
} else if (id == "account") {
const auto savings = desk.at("accounts").at("savings");
body = widget_heading("Vereinskasse", false) + "<div class=\"desk-account-main\"><span>Guthaben</span><strong>" + esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div><div class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" + (savings.is_null() ? std::string("—") : esc(engine_price(savings))) + "</strong></div>" + btn("engine-unavailable", glyph("ticket", 36) + "<span><span>Eintritt</span><strong>—</strong></span>", "desk-ticket", "disabled") + "</div>";
body = widget_heading("Vereinskasse", false) + "<div class=\"desk-account-main\"><span>Guthaben</span><strong class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" + esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div><div class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" + (savings.is_null() ? std::string("—") : esc(engine_price(savings))) + "</strong></div>" + btn("engine-unavailable", glyph("ticket", 36) + "<span><span>Eintritt</span><strong>—</strong></span>", "desk-ticket", "disabled") + "</div>";
} else if (id == "opponent-crest" && desk.at("nextFixture").is_object()) {
const auto &next = desk.at("nextFixture");
const auto &other = next.at(next.at("home").at("id") == team.at("id") ? "away" : "home");
+2 -2
View File
@@ -55,7 +55,7 @@ std::string App::render_desktop() {
"identity", "id=\"desktop-identity\"") +
"<div class=\"info-date\">" + std::string(widget_data_.at("matchday")==0?"Saisonvorbereitung":std::to_string(widget_data_.at("matchday").get<int>())+". Spieltag") + "<small>" +
esc(widget_data_.at("season").get<std::string>()) +
"</small></div><div class=\"info-cash\"><small>"+std::string(national?"Aufgabenbereich":"Guthaben")+"</small><strong>" +
"</small></div><div class=\"info-cash\"><small>"+std::string(national?"Aufgabenbereich":"Guthaben")+"</small><strong class=\"" + money_classes(national ? 0 : s.state.at("cash").get<int64_t>()) + "\">" +
(national?std::string("Nationalmannschaft"):cash(s.state.value("cash", int64_t(0)))) + "</strong></div></div>";
if(desktop_.value("grid",true))for(int row=0;row<7;++row)for(int col=0;col<15;++col)out+="<span class=\"desktop-grid-dot\" style=\"left:"+std::to_string(64+col*248)+"dp;top:"+std::to_string(224+row*248)+"dp;\"></span>";
for (const auto &[id, o] : desktop_["objects"].items()) {
@@ -139,7 +139,7 @@ std::string App::render_camp() {
stars + "</span></div>";
}
body += "<div class=\"field-row\"><strong>Preis</strong><strong "
"class=\"accent\">" +
"class=\"money-amount\">" +
(chosen->at("price").is_null() ? std::string("—") : (engine_mode_ ? money(chosen->at("price").get<int64_t>(), {{"code", "EUR"}, {"minor_units", 2}}) : cash(chosen->at("price").get<int64_t>()))) + "</strong></div>";
const std::array<const char *, 4> focus = {"Kondition", "Technik", "Spiel",
"Erholung"};
+1
View File
@@ -66,6 +66,7 @@
namespace bmh::modern_ui {
namespace {
std::string esc(std::string_view value) { return editor::escaped(value); }
std::string money_classes(int64_t value) { return value < 0 ? "money-amount is-negative" : "money-amount"; }
std::string scalar(double n) {
std::ostringstream s;
s.imbue(std::locale::classic());
+1 -1
View File
@@ -97,7 +97,7 @@ std::string App::widget(const std::string &id, const Json &o) {
glyph("arrow-diagonal", 26) + "</span></div>";
if (id == "account")
return heading("Vereinskasse") +
"<div class=\"desk-account-main\"><span>Guthaben</span><strong>" +
"<div class=\"desk-account-main\"><span>Guthaben</span><strong class=\"" + money_classes(s.state.at("cash").get<int64_t>()) + "\">" +
cash(s.state.at("cash")) +
"</strong></div><div "
"class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" +
+16
View File
@@ -281,6 +281,12 @@ int main(int argc, char **argv) try {
button_markup("load", "<span id='front-test-label'>Spiel laden</span><span class='front-hover-arrow'>›</span>", "front-menu-action", "id='front-test-button'") + "</div>"
"<div class='front-mod-entry' style='position:absolute;left:2100dp;top:1800dp;width:1100dp;'>"
"<span class='front-mod-copy'><strong id='mod-test-name'>Synthetic world</strong><small><span>OpenBMH</span></small></span><span class='front-mod-type'>Modern</span></div>";
content += "<div class='info-cash'><strong id='cash-positive' class='money-amount'>1.000 €</strong>"
"<strong id='cash-zero' class='money-amount'>0 €</strong><strong id='cash-negative' class='money-amount is-negative'>-1.000 €</strong></div>"
"<div class='desk-account-main'><strong id='widget-positive' class='money-amount'>1.000 €</strong>"
"<strong id='widget-negative' class='money-amount is-negative'>-1.000 €</strong></div>"
"<span id='money-reference' class='money-amount'>Money</span><span id='negative-reference' style='color:var(--danger);'>Negative</span>"
"<span id='text-reference'>Text</span>";
auto *doc = context->LoadDocumentFromMemory(
"<rml><head><style>" + css.str() + "</style></head><body class='" +
theme + "'>" + content + "</body></rml>");
@@ -297,6 +303,16 @@ int main(int argc, char **argv) try {
}
require(doc->GetElementById("gallery-scroll-test")->GetScrollHeight() > doc->GetElementById("gallery-scroll-test")->GetClientHeight()*2,"Gallery content does not contribute to scroll extent");
require(!center_selects(*doc), "Control centering does not settle");
const auto money_color = doc->GetElementById("money-reference")->GetComputedValues().color();
const auto negative_color = doc->GetElementById("negative-reference")->GetComputedValues().color();
for (const auto *id : {"cash-positive", "cash-zero", "widget-positive"})
require(doc->GetElementById(id)->GetComputedValues().color() == money_color, "Positive/zero balance uses another colour");
for (const auto *id : {"cash-negative", "widget-negative"})
require(doc->GetElementById(id)->GetComputedValues().color() == negative_color, "Negative balance lost its warning colour");
require(money_color != negative_color, "Money and negative colours are indistinguishable");
if (std::string(theme) == "matchday")
require(money_color == doc->GetElementById("text-reference")->GetComputedValues().color(), "Matchday positive money must use neutral text colour");
for (const auto *id : {"stats-scale-label", "stats-legend-label", "stats-player-label", "stats-world-label", "stats-from-label", "stats-winner-label", "news-brand-test", "settings-row-label", "settings-row-help", "month-label", "warning-label", "fixture-label", "front-test-label", "mod-test-name"}) {
auto *label = doc->GetElementById(id);
require(label && label->GetBox().GetSize(Rml::BoxArea::Content).x > 0 && visible_text_lines(*label) > 0,