diff --git a/assets/modern/art/gui-assets.json b/assets/modern/art/gui-assets.json index 3d9da28..38e9b16 100644 --- a/assets/modern/art/gui-assets.json +++ b/assets/modern/art/gui-assets.json @@ -341,6 +341,246 @@ 1, 1 ] + }, + "match.0-cloud-a": { + "file": "match-0-cloud-a.jpg", + "sha256": "4d4eceb28266faee1fa0d94c40e28cc5ceb8fc0575bf53858ac2ae0fca878fed", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.0-rain-a": { + "file": "match-0-rain-a.jpg", + "sha256": "15c5a0e282c1bffd926ae921508d6888454707ebced796634d0dcb0edf2aaff5", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.0-sun-a": { + "file": "match-0-sun-a.jpg", + "sha256": "d598289eb6f4ca0f2f384fd03d8a6efeeb3fa84515923291d2cd37be9625f133", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-cloud-a": { + "file": "match-1-cloud-a.jpg", + "sha256": "54f6742aee42bdfe2a154269df6655f9bfe17aba6c2f6500d3018dde7f799147", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-cloud-b": { + "file": "match-1-cloud-b.jpg", + "sha256": "87ce906f9b836cb0a4abf4bd36d727296cfdd01b78435926baa877ef2a2f8ba7", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-fair-a": { + "file": "match-1-fair-a.jpg", + "sha256": "e036af55bfc251a6b870a6c288840785c3666974c56bd4c3885758f760f0ae14", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-fair-b": { + "file": "match-1-fair-b.jpg", + "sha256": "b8e5d1fc116a3a6810e90a1924cbfe07edbc485d40fafc7e231166e18b182d6d", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-rain-a": { + "file": "match-1-rain-a.jpg", + "sha256": "8bd9f15f4d7376c299652a3926c0e5b8e1334961fe4a7f2c9f399855e6ad0e4c", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-snow-a": { + "file": "match-1-snow-a.jpg", + "sha256": "1eef2e5eef55341f774018670375e6f25bd90dba350618b3d3cb143567fe6971", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-snow-b": { + "file": "match-1-snow-b.jpg", + "sha256": "6d3755320065eb150605128275ed99fcd65e97280de0fddd2c7ae2daf4a83f36", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-sun-a": { + "file": "match-1-sun-a.jpg", + "sha256": "aca1eb0fb3464a3769ac84c53360e4dd9c03da9e93a53ae84f4d3e152ff8edf7", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-sun-b": { + "file": "match-1-sun-b.jpg", + "sha256": "27a97ff3ff63522cb0454750c4b8ea2e4bea67963b226652f76d10f2e1b6405f", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.1-sun-c": { + "file": "match-1-sun-c.jpg", + "sha256": "4456c84d0f99fbbf496c6f8f31c136a342273cec3e8cf8e2a3d9b0bf662ab510", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.2-fair-a": { + "file": "match-2-fair-a.jpg", + "sha256": "9a27fe7ae5b02b9ca6cf2337f9d59d09ca3cf1a45d27fd65bf41ece071ca66af", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.2-sun-a": { + "file": "match-2-sun-a.jpg", + "sha256": "581a50c03bd3e63f01cbbacb17ade7dfa653871a3dcf54c04a1d166adac6678c", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.2-sun-b": { + "file": "match-2-sun-b.jpg", + "sha256": "2cd1e8b80ac928c2f4e59620f4b0b08fb16da7a4b8dd1fe76c061c2b92584055", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.2-sun-c": { + "file": "match-2-sun-c.jpg", + "sha256": "6d1324fdc94624cf3bc0afc634497701f6337b4a80b3e6da795540bf4f26a697", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-cloud-a": { + "file": "match-3-cloud-a.jpg", + "sha256": "3d753387443d799b99481d0391a1480331a304fa2a67ed635360f23140d5fcde", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-fair-a": { + "file": "match-3-fair-a.jpg", + "sha256": "12bd8529ea65dc29ab5381281ae6a0dca527fcd170fb4529fc71f6b65c14fb0d", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-fair-b": { + "file": "match-3-fair-b.jpg", + "sha256": "1d53c4d2281c89bf4e88a976e6dbd8f89ef9482937eb26c39a79b2c799ea69bd", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-fair-c": { + "file": "match-3-fair-c.jpg", + "sha256": "9e97ad199d11c6643b9fbc76db830d04a72d74f1f923300944fdb37768964031", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-rain-a": { + "file": "match-3-rain-a.jpg", + "sha256": "93a4ba1d3f336c73a1a26853d2df9e1ee381a4453fb3bfbca4c438a52b0a9e3b", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-rain-b": { + "file": "match-3-rain-b.jpg", + "sha256": "6e58c10fda2e43f95ac7706d4d8f8a1ba00263217c4a4e288a5d2613225f3f67", + "crop": [ + 0, + 0, + 1, + 1 + ] + }, + "match.3-snow-a": { + "file": "match-3-snow-a.jpg", + "sha256": "dc6dd65380a5f4d00800c656805803306b58aef78b9f02f6c1ff7a86dd239c77", + "crop": [ + 0, + 0, + 1, + 1 + ] } } } diff --git a/assets/modern/art/match-0-cloud-a.jpg b/assets/modern/art/match-0-cloud-a.jpg new file mode 100644 index 0000000..a756731 Binary files /dev/null and b/assets/modern/art/match-0-cloud-a.jpg differ diff --git a/assets/modern/art/match-0-rain-a.jpg b/assets/modern/art/match-0-rain-a.jpg new file mode 100644 index 0000000..b9adfa5 Binary files /dev/null and b/assets/modern/art/match-0-rain-a.jpg differ diff --git a/assets/modern/art/match-0-sun-a.jpg b/assets/modern/art/match-0-sun-a.jpg new file mode 100644 index 0000000..809ce18 Binary files /dev/null and b/assets/modern/art/match-0-sun-a.jpg differ diff --git a/assets/modern/art/match-1-cloud-a.jpg b/assets/modern/art/match-1-cloud-a.jpg new file mode 100644 index 0000000..9ab63c3 Binary files /dev/null and b/assets/modern/art/match-1-cloud-a.jpg differ diff --git a/assets/modern/art/match-1-cloud-b.jpg b/assets/modern/art/match-1-cloud-b.jpg new file mode 100644 index 0000000..04e2363 Binary files /dev/null and b/assets/modern/art/match-1-cloud-b.jpg differ diff --git a/assets/modern/art/match-1-fair-a.jpg b/assets/modern/art/match-1-fair-a.jpg new file mode 100644 index 0000000..9d74425 Binary files /dev/null and b/assets/modern/art/match-1-fair-a.jpg differ diff --git a/assets/modern/art/match-1-fair-b.jpg b/assets/modern/art/match-1-fair-b.jpg new file mode 100644 index 0000000..f5c9296 Binary files /dev/null and b/assets/modern/art/match-1-fair-b.jpg differ diff --git a/assets/modern/art/match-1-rain-a.jpg b/assets/modern/art/match-1-rain-a.jpg new file mode 100644 index 0000000..5a29d88 Binary files /dev/null and b/assets/modern/art/match-1-rain-a.jpg differ diff --git a/assets/modern/art/match-1-snow-a.jpg b/assets/modern/art/match-1-snow-a.jpg new file mode 100644 index 0000000..0105b72 Binary files /dev/null and b/assets/modern/art/match-1-snow-a.jpg differ diff --git a/assets/modern/art/match-1-snow-b.jpg b/assets/modern/art/match-1-snow-b.jpg new file mode 100644 index 0000000..5a4c866 Binary files /dev/null and b/assets/modern/art/match-1-snow-b.jpg differ diff --git a/assets/modern/art/match-1-sun-a.jpg b/assets/modern/art/match-1-sun-a.jpg new file mode 100644 index 0000000..7be0d6c Binary files /dev/null and b/assets/modern/art/match-1-sun-a.jpg differ diff --git a/assets/modern/art/match-1-sun-b.jpg b/assets/modern/art/match-1-sun-b.jpg new file mode 100644 index 0000000..ee86f29 Binary files /dev/null and b/assets/modern/art/match-1-sun-b.jpg differ diff --git a/assets/modern/art/match-1-sun-c.jpg b/assets/modern/art/match-1-sun-c.jpg new file mode 100644 index 0000000..708f015 Binary files /dev/null and b/assets/modern/art/match-1-sun-c.jpg differ diff --git a/assets/modern/art/match-2-fair-a.jpg b/assets/modern/art/match-2-fair-a.jpg new file mode 100644 index 0000000..4bc330a Binary files /dev/null and b/assets/modern/art/match-2-fair-a.jpg differ diff --git a/assets/modern/art/match-2-sun-a.jpg b/assets/modern/art/match-2-sun-a.jpg new file mode 100644 index 0000000..68830fa Binary files /dev/null and b/assets/modern/art/match-2-sun-a.jpg differ diff --git a/assets/modern/art/match-2-sun-b.jpg b/assets/modern/art/match-2-sun-b.jpg new file mode 100644 index 0000000..04f0f51 Binary files /dev/null and b/assets/modern/art/match-2-sun-b.jpg differ diff --git a/assets/modern/art/match-2-sun-c.jpg b/assets/modern/art/match-2-sun-c.jpg new file mode 100644 index 0000000..0b3e1e3 Binary files /dev/null and b/assets/modern/art/match-2-sun-c.jpg differ diff --git a/assets/modern/art/match-3-cloud-a.jpg b/assets/modern/art/match-3-cloud-a.jpg new file mode 100644 index 0000000..eb547ed Binary files /dev/null and b/assets/modern/art/match-3-cloud-a.jpg differ diff --git a/assets/modern/art/match-3-fair-a.jpg b/assets/modern/art/match-3-fair-a.jpg new file mode 100644 index 0000000..49e31d0 Binary files /dev/null and b/assets/modern/art/match-3-fair-a.jpg differ diff --git a/assets/modern/art/match-3-fair-b.jpg b/assets/modern/art/match-3-fair-b.jpg new file mode 100644 index 0000000..809a80e Binary files /dev/null and b/assets/modern/art/match-3-fair-b.jpg differ diff --git a/assets/modern/art/match-3-fair-c.jpg b/assets/modern/art/match-3-fair-c.jpg new file mode 100644 index 0000000..4bba809 Binary files /dev/null and b/assets/modern/art/match-3-fair-c.jpg differ diff --git a/assets/modern/art/match-3-rain-a.jpg b/assets/modern/art/match-3-rain-a.jpg new file mode 100644 index 0000000..7f67678 Binary files /dev/null and b/assets/modern/art/match-3-rain-a.jpg differ diff --git a/assets/modern/art/match-3-rain-b.jpg b/assets/modern/art/match-3-rain-b.jpg new file mode 100644 index 0000000..d416996 Binary files /dev/null and b/assets/modern/art/match-3-rain-b.jpg differ diff --git a/assets/modern/art/match-3-snow-a.jpg b/assets/modern/art/match-3-snow-a.jpg new file mode 100644 index 0000000..9d92c40 Binary files /dev/null and b/assets/modern/art/match-3-snow-a.jpg differ diff --git a/assets/modern/live.rcss b/assets/modern/live.rcss index c7e6e19..378f6ef 100644 --- a/assets/modern/live.rcss +++ b/assets/modern/live.rcss @@ -1,264 +1,229 @@ /* SPDX-License-Identifier: GPL-3.0-only */ -/* Selected text-only Gold layout in the existing 3840x2160 logical canvas. */ -body {--live-bg:#0e1d27;--live-surface:#182b38e8;--live-wash:#d2e6f40b;--live-selected:#a0c8ba18;--live-line:#c2d8e52c;--live-accent:#b5dbd2;--live-muted:#a8bfcb;--live-text:#eaf2f6;} -body.silver {--live-bg:#e8eff5;--live-surface:#f6f2e8f5;--live-wash:#7595ac12;--live-selected:#6f9db128;--live-line:#617e9438;--live-accent:#376b84;--live-muted:#5a7181;--live-text:#293e4c;} -body.matchday {--live-bg:#242426;--live-surface:#302f34ec;--live-wash:#efc7ce0a;--live-selected:#efb2aa18;--live-line:#e6d2d52c;--live-accent:#efb2aa;--live-muted:#bbb6bb;--live-text:#f2ebee;} -.live-stage {position:absolute;left:0;top:0;width:3840dp;height:2160dp;color:var(--live-text);background-color:var(--live-bg);font-family:Modern;font-size:40dp;} -.live-stage h1,.live-stage h2,.live-stage h3,.live-stage p {margin:0;} -.live-stage button {display:flex;align-items:center;justify-content:center;min-width:0;gap:16dp;background-color:var(--live-wash);color:var(--live-text);border:2dp var(--live-line);border-radius:18dp;font-size:36dp;font-weight:normal;} -.live-stage button:hover,.live-stage button:focus-visible {border-color:var(--live-accent);background-color:var(--live-selected);} -.live-stage button:disabled {opacity:0.45;} -.live-stage .selected {background-color:var(--live-selected);color:var(--live-accent);border-color:var(--live-accent);} -.live-stage button>span,.live-stage h1>span,.live-stage h2>span,.live-stage h3>span,.live-stage p>span {display:block;min-width:0;} -.live-header {position:absolute;left:128dp;right:128dp;top:0;height:232dp;display:flex;align-items:center;justify-content:space-between;border-bottom:2dp var(--live-line);gap:40dp;} -.live-header>div {display:block;min-width:0;flex:1;} -.live-eyebrow {display:block;font-size:30dp;letter-spacing:4dp;color:var(--live-muted);margin-bottom:14dp;} -.live-header h1 {font-size:60dp;font-weight:normal;} -.live-demo-tag {display:block;font-size:28dp;color:var(--live-accent);border:2dp var(--live-line);border-radius:32dp;padding:14dp 24dp;flex-shrink:0;} -.live-body {position:absolute;left:128dp;right:128dp;top:280dp;height:1684dp;display:flex;gap:44dp;} -.live-left {width:2096dp;min-width:0;flex-shrink:0;display:flex;flex-direction:column;gap:36dp;height:100%;} -.live-panel {background-color:var(--live-surface);border:2dp var(--live-line);border-radius:32dp;overflow:hidden;min-width:0;min-height:0;} -.live-overview {flex-shrink:0;} -.live-coverage {height:110dp;display:flex;align-items:center;gap:14dp;padding:18dp 30dp;border-bottom:2dp var(--live-line);} -.live-coverage button {height:72dp;padding:0 26dp;font-size:32dp;} -.live-clock {display:block;margin-left:auto;color:var(--live-accent);font-size:44dp;flex-shrink:0;} -.live-cards {padding:24dp;display:flex;flex-wrap:wrap;gap:20dp;} -.live-stage .live-game {width:48%;flex-grow:1;flex-shrink:0;height:218dp;min-width:0;display:block;border:2dp var(--live-line);border-radius:22dp;background-color:var(--live-wash);padding:12dp 22dp;} -.live-coverage .live-match-arrow {width:70dp;padding:0;} -.live-cards.single .live-game {width:100%;} -.live-game.active {border-color:var(--live-accent);} -.live-owners {display:block;font-size:28dp;color:var(--live-accent);text-align:center;margin-bottom:8dp;height:30dp;overflow:hidden;white-space:nowrap;} -.live-scoreline {height:68dp;display:flex;align-items:center;justify-content:center;gap:16dp;min-width:0;} -.live-team-name {display:block;flex:1;min-width:0;font-size:31dp;max-height:78dp;overflow:hidden;line-height:1.2;} -.live-team-name.home {text-align:right;} -.live-team-name.away {text-align:left;} -.live-score {display:block;font-size:64dp;font-weight:normal;flex-shrink:0;text-align:center;min-width:134dp;white-space:nowrap;} -.live-card-caption {display:block;font-size:28dp;color:var(--live-muted);text-align:center;margin-top:8dp;} -.live-match-info {display:block;font-size:28dp;line-height:1.3;color:var(--live-muted);text-align:center;margin-top:8dp;white-space:nowrap;} +/* (No shadow under the sheet: where it reaches past the window's edge it is drawn as paper.) */ +/* The match day in text mode: an open match sheet (two pages) in front of the stadium. + Written in design units (1 unit = 2.25dp); the colours are the notebook's, so the skins apply. */ .live-badge {display:flex;align-items:center;justify-content:center;flex-shrink:0;} -.live-ticker {display:flex;flex-direction:column;flex:1;min-height:0;} -.live-panel-heading {height:108dp;padding:24dp 42dp;display:flex;align-items:center;justify-content:space-between;gap:24dp;border-bottom:2dp var(--live-line);flex-shrink:0;} -.live-panel-heading h2 {display:block;min-width:0;flex:1;font-size:42dp;font-weight:normal;} -.live-small {display:block;font-size:28dp;color:var(--live-muted);} -.live-filters {display:flex;align-items:center;gap:14dp;padding:18dp 32dp;border-bottom:2dp var(--live-line);flex-shrink:0;} -.live-filters button {height:64dp;padding:0 24dp;font-size:30dp;} -.live-event-list {display:block;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;} -.live-event {display:flex;align-items:flex-start;gap:24dp;padding:30dp 40dp;border-bottom:2dp var(--live-line);} -.live-event.is-goal {background-color:var(--live-selected);} -.live-event-time {display:block;width:116dp;flex-shrink:0;color:var(--live-muted);font-size:31dp;line-height:1.5;} -.live-event-copy {display:block;flex:1;min-width:0;} -.live-event-copy h3 {display:block;width:100%;font-size:38dp;font-weight:normal;line-height:1.25;} -.live-event-copy p {display:block;width:100%;font-size:32dp;line-height:1.4;color:var(--live-muted);margin-top:12dp;} -.live-event-owners {display:block;color:var(--live-accent);font-size:28dp;margin-bottom:10dp;} -.live-event-score {display:block;font-size:31dp;color:var(--live-muted);min-width:72dp;text-align:right;flex-shrink:0;} -.live-ticker-footer {height:94dp;display:flex;align-items:center;justify-content:space-between;gap:20dp;padding:20dp 38dp;border-top:2dp var(--live-line);flex-shrink:0;} -.live-detail {flex:1;min-width:0;display:flex;flex-direction:column;height:100%;} -.live-detail>.live-panel-heading {height:134dp;padding:24dp 42dp;} -.live-detail-heading {display:block;min-width:0;flex:1;} -.live-detail-heading h2 {display:block;width:100%;font-size:40dp;line-height:1.2;} -.live-detail-heading p {display:block;width:100%;font-size:28dp;color:var(--live-muted);margin-top:10dp;} -.live-team-switch {display:flex;gap:14dp;flex-shrink:0;} -.live-team-switch button {width:74dp;height:70dp;padding:0;} -.live-tabs {display:flex;gap:12dp;padding:24dp 26dp;border-bottom:2dp var(--live-line);flex-shrink:0;} -.live-tabs button {height:66dp;padding:0 14dp;font-size:31dp;flex:1;} -.live-detail-body {display:block;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;} -.live-detail-footer {height:112dp;display:flex;align-items:center;gap:20dp;padding:22dp 36dp;border-top:2dp var(--live-line);flex-shrink:0;} -.live-detail-footer button {height:70dp;padding:0 28dp;font-size:32dp;} -.live-roster {padding:18dp 36dp;} -.live-roster-row {height:66dp;display:flex;gap:16dp;align-items:center;border-bottom:2dp var(--live-line);font-size:32dp;} -.live-roster-row.heading {height:56dp;font-size:28dp;color:var(--live-muted);} -.live-roster-number {display:block;width:64dp;flex-shrink:0;} -.live-roster-name {display:block;min-width:0;flex:1;overflow:hidden;white-space:nowrap;} -.live-roster-stat {display:block;width:90dp;flex-shrink:0;text-align:right;} -.live-roster-note {display:block;margin:20dp 0 12dp;color:var(--live-accent);font-size:28dp;line-height:1.35;} -.live-note {display:block;color:var(--live-muted);font-size:28dp;line-height:1.5;padding:28dp 40dp;} -.live-note>span {display:block;} -.live-context {padding:36dp 42dp;} -.live-context h3 {display:block;font-size:40dp;font-weight:normal;line-height:1.3;} -.live-context p {display:block;font-size:31dp;color:var(--live-muted);line-height:1.5;margin-top:20dp;} -.live-context button {height:76dp;padding:0 32dp;margin-top:28dp;font-size:32dp;} -.live-pitch {width:100%;height:630dp;display:flex;align-items:center;justify-content:center;margin-top:30dp;} -.live-stat {padding:26dp 42dp;} -.live-stat-label {display:flex;justify-content:space-between;align-items:center;gap:20dp;font-size:36dp;} -.live-stat-label>span {display:block;min-width:0;} -.live-stat-label>.stat-title {font-size:31dp;color:var(--live-muted);text-align:center;flex:1;} -.live-stat-bar {margin-top:18dp;height:10dp;display:flex;gap:10dp;} -.live-stat-bar>.home {height:10dp;border-radius:6dp;background-color:var(--live-accent);} -.live-stat-bar>.away {height:10dp;border-radius:6dp;background-color:var(--live-muted);flex:1;opacity:0.4;} -.live-table-row {display:flex;align-items:center;gap:16dp;height:62dp;padding:6dp 24dp;border-bottom:2dp var(--live-line);font-size:30dp;} -.live-table-row.heading {height:78dp;font-size:28dp;color:var(--live-muted);} -.live-table-row.own {background-color:var(--live-selected);border-left:6dp var(--live-accent);padding-left:18dp;} -.live-table-pos {display:block;width:50dp;flex-shrink:0;text-align:center;} -.live-table-team {display:flex;align-items:center;gap:16dp;flex:1;min-width:0;} -.live-table-team>span {display:block;min-width:0;flex:1;overflow:hidden;white-space:nowrap;} -.live-table-number {display:block;width:78dp;flex-shrink:0;text-align:center;} -.live-table-goals {width:100dp;} -.live-speed {position:absolute;left:30dp;top:710dp;width:56dp;display:flex;flex-direction:column;align-items:center;gap:20dp;color:var(--live-muted);font-size:28dp;} -.live-speed>span {display:block;} -#live-speed {width:40dp;height:600dp;padding:0;border:0;background-color:transparent;} -#live-speed slidertrack {width:8dp;height:600dp;margin:0 16dp;border-radius:4dp;background-color:var(--live-line);} -#live-speed sliderbar {width:30dp;height:30dp;margin:0;border:0;border-radius:15dp;background-color:var(--live-accent);} -#live-speed sliderarrowdec,#live-speed sliderarrowinc {width:0;height:0;} -.live-speed-value {display:block;text-align:center;font-size:26dp;white-space:nowrap;} -.live-bottom {position:absolute;left:128dp;right:128dp;bottom:0;height:184dp;display:flex;align-items:center;justify-content:space-between;gap:30dp;} -.live-bottom-actions {display:flex;align-items:center;gap:24dp;flex-shrink:0;} -.live-bottom button {height:100dp;padding:0 40dp;font-size:36dp;} -.live-bottom-note {display:block;flex:1;min-width:0;text-align:center;font-size:28dp;color:var(--live-muted);line-height:1.4;} -.live-feedback {position:absolute;left:128dp;right:128dp;bottom:184dp;padding:18dp 32dp;background-color:var(--live-surface);border:2dp var(--live-line);border-radius:18dp;font-size:30dp;color:var(--live-accent);} -.live-dialog-layer {position:absolute;left:0;top:0;right:0;bottom:0;background-color:#051019a8;display:flex;align-items:center;justify-content:center;} -.live-dialog {width:2200dp;max-height:1780dp;padding:54dp;border:2dp var(--live-line);border-radius:28dp;background-color:var(--live-bg);display:flex;flex-direction:column;gap:30dp;} -.live-dialog h2 {display:block;width:100%;font-size:46dp;font-weight:normal;} -.live-dialog p {display:block;width:100%;color:var(--live-muted);font-size:32dp;line-height:1.4;} -.live-dialog label {display:block;width:100%;font-size:34dp;} -.live-dialog select {display:block;width:100%;height:88dp;font-size:36dp;margin-top:20dp;} -.live-dialog-actions {display:flex;justify-content:flex-end;gap:24dp;} -.live-dialog-actions button {height:90dp;padding:0 40dp;font-size:34dp;} -.live-tactic-row {display:flex;align-items:center;justify-content:space-between;gap:30dp;padding:16dp 0;border-bottom:2dp var(--live-line);font-size:36dp;} -.live-tactic-row>span {display:block;min-width:0;flex:1;} -.live-tactic-row button {height:76dp;width:760dp;font-size:34dp;} -.live-review {position:absolute;left:128dp;right:128dp;top:280dp;bottom:200dp;padding:50dp;display:flex;flex-direction:column;gap:32dp;overflow-y:auto;} -.live-review h2 {display:block;width:100%;font-size:48dp;font-weight:normal;} -.live-review-card {display:block;padding:36dp;border:2dp var(--live-line);border-radius:24dp;} -.live-review-card .live-scoreline {height:108dp;} -.live-review-card p {display:block;width:100%;font-size:31dp;color:var(--live-muted);margin-top:28dp;line-height:1.4;text-align:center;} -.live-coverage.solo {display:none;} -.live-lineups {display:flex;gap:60dp;padding:34dp 42dp;} -.live-lineup-side {display:block;flex:1;min-width:0;} -.live-lineup-side h3 {display:block;font-size:34dp;font-weight:normal;color:var(--live-accent);margin-bottom:14dp;} -.live-lineup-side p {display:block;font-size:30dp;color:var(--live-muted);} -.live-lineup-row {height:62dp;display:flex;gap:16dp;align-items:center;border-bottom:2dp var(--live-line);font-size:32dp;} -/* --- The match day as a sheet in the menus' 4:3 format: a stage of score boards on top - (one card per match of a human manager: 1, 2, or a 2 x 2 grid for 3-4), the ticker and - the manager's squad below, the controls at the foot. --- */ -.live-backdrop {position:absolute;left:0;top:0;width:3840dp;height:2160dp;background-color:#05090dc4;} -.live-stage {left:560dp;top:60dp;width:2720dp;height:2040dp;overflow:hidden;border:2dp var(--paper-edge);border-radius:10dp;background-color:transparent;decorator:linear-gradient(175deg,var(--paper-top),var(--paper-bottom));box-shadow:0dp 18dp 54dp var(--paper-shadow);font-size:36dp;} -.live-header {left:48dp;right:48dp;top:0;height:104dp;border-bottom:2dp var(--rule);} -.live-header h1 {font-family:Display;font-size:54dp;flex:1;min-width:0;} -.live-demo-tag {border-radius:10dp;padding:10dp 22dp;} -.live-body {left:48dp;right:48dp;top:128dp;bottom:150dp;height:auto;flex-direction:column;gap:28dp;} -.live-cards {padding:0;display:flex;flex-wrap:wrap;gap:16dp;flex-shrink:0;} -.live-stage .live-game,.postmatch-stage .live-game {position:relative;display:block;width:100%;height:600dp;flex-grow:0;flex-shrink:0;padding:18dp 40dp;border:2dp #00000090;border-radius:16dp;background-color:transparent;decorator:linear-gradient(180deg,#1d2832,#0f161d);color:#f1f4f6;overflow:hidden;} -.live-stage .live-game:hover,.live-stage .live-game:focus-visible {background-color:transparent;border-color:#ffffff66;} -.postmatch-stage {flex-shrink:0;margin-bottom:24dp;} -.postmatch-stage .live-game {pointer-events:none;font-size:36dp;} -.postmatch-stage .live-game .live-timeline {width:100%;} -.live-timeline-ticks {position:relative;height:30dp;margin:0 auto;color:#aab6c0;font-size:24dp;} -.live-timeline-ticks span {position:absolute;top:0;width:80dp;margin-left:-40dp;text-align:center;display:block;} -.live-stage .live-game.duo {width:1296dp;} -.live-stage .live-game.quad {width:1296dp;height:292dp;padding:10dp 28dp;} -.live-stage .live-game.active {border-color:#00000090;} -.live-stage .live-game.duo.active,.live-stage .live-game.quad.active {border-color:#f2c230;} -.live-card-top {height:48dp;display:flex;align-items:center;justify-content:space-between;gap:24dp;} -.live-game.quad .live-card-top {height:38dp;} -.live-card-competition {display:block;font-size:30dp;letter-spacing:2dp;color:#c8d2da;white-space:nowrap;} -.live-game .live-match-info {display:block;margin:0;font-size:28dp;color:#aab6c0;text-align:right;} -.live-card-main {height:348dp;display:flex;align-items:center;gap:24dp;} -.live-game.quad .live-card-main {height:146dp;} -.live-side {flex:1;min-width:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14dp;} -.live-game.quad .live-side {flex-direction:row;gap:20dp;} -.live-game.quad .live-side.home {justify-content:flex-end;} -.live-game.quad .live-side.away {flex-direction:row-reverse;justify-content:flex-end;} -.live-game .live-team-name {display:block;flex:0 0 auto;width:100%;max-height:none;font-family:Display;font-size:46dp;line-height:1.15;text-align:center;color:#f4f6f8;white-space:nowrap;overflow:hidden;} -.live-game.duo .live-team-name {font-size:36dp;} -.live-game.quad .live-team-name {font-size:32dp;width:auto;min-width:0;flex:1;white-space:normal;} -.live-game.quad .live-side.home .live-team-name {text-align:right;} -.live-game.quad .live-side.away .live-team-name {text-align:left;} -.live-centre {width:520dp;flex-shrink:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16dp;} -.live-game.duo .live-centre {width:360dp;} -.live-game.quad .live-centre {width:300dp;gap:4dp;} -.live-clock {display:flex;align-items:center;justify-content:center;gap:22dp;width:100%;height:96dp;} -.live-clock-text {display:block;font-family:Display;font-size:52dp;color:#f4f6f8;} -.live-clock-inline {display:block;font-size:28dp;color:#c8d2da;} -.live-plate {display:flex;width:420dp;height:150dp;border:3dp #ffffff30;border-radius:14dp;overflow:hidden;} -.live-game.duo .live-plate {width:330dp;height:130dp;} -.live-game.quad .live-plate {width:240dp;height:92dp;} -.live-plate-half {flex:1;display:flex;align-items:center;justify-content:center;} -.live-plate-half+.live-plate-half {border-left:3dp #ffffff40;} -.live-plate-half span {display:block;font-size:112dp;font-weight:bold;color:#ffffff;} -.live-game.duo .live-plate-half span {font-size:96dp;} -.live-game.quad .live-plate-half span {font-size:66dp;} -.live-press {display:flex;width:420dp;height:14dp;border-radius:7dp;overflow:hidden;background-color:#ffffff22;} -.live-game.duo .live-press {width:330dp;} -.live-press-home {height:100%;} -.live-press-away {flex:1;height:100%;} -.live-timeline {display:flex;justify-content:center;height:112dp;} -.live-game.quad .live-timeline {height:84dp;} -@keyframes live-moment-in {from {opacity:0;transform:translateX(-220dp);} to {opacity:1;transform:translateX(0dp);}} -.live-moment {position:absolute;left:0;right:0;top:120dp;height:260dp;display:flex;align-items:center;justify-content:center;gap:48dp;border-top:4dp #ffffffb0;border-bottom:4dp #ffffffb0;color:#ffffff;pointer-events:none;} -.live-game.quad .live-moment {top:44dp;height:150dp;gap:28dp;} -.live-moment.fresh {animation:0.45s cubic-out live-moment-in;} -body.calm .live-moment.fresh {animation:none;} -.live-moment>div {display:block;min-width:0;} -.live-moment strong {display:block;font-family:Display;font-size:96dp;letter-spacing:6dp;} -.live-game.quad .live-moment strong {font-size:56dp;} -.live-moment-text {display:block;font-size:36dp;margin-top:6dp;} -.live-game.quad .live-moment-text {font-size:28dp;} -.live-moment-score {display:block;font-size:120dp;font-weight:bold;} -.live-game.quad .live-moment-score {font-size:70dp;} -.live-columns {flex:1;min-height:0;display:flex;gap:28dp;} -.live-panel {border-radius:12dp;} -.live-columns .live-ticker {flex:1.5;min-width:0;height:100%;} -.live-columns .live-detail {flex:1;min-width:0;height:100%;} -.live-panel-heading {height:96dp;padding:16dp 30dp;} -.live-panel-heading h2 {font-family:Display;font-size:42dp;flex:0 0 auto;} -.live-panel-heading .live-filters {flex:1;justify-content:flex-end;padding:0;border-bottom-width:0;} -.live-filters button {height:60dp;padding:0 20dp;font-size:28dp;} -.live-detail>.live-panel-heading {height:112dp;padding:14dp 30dp;} -.live-detail-heading h2 {font-size:38dp;} -.live-tabs {padding:16dp 20dp;gap:10dp;} -.live-tabs button {height:62dp;font-size:28dp;padding:0 8dp;} -.live-event {align-items:center;gap:18dp;padding:16dp 28dp;border-left:8dp transparent;} -.live-event-time {width:78dp;font-size:30dp;text-align:right;} -.live-event-mark {width:36dp;height:44dp;flex-shrink:0;display:flex;align-items:center;justify-content:center;} -.live-event-mark .mark {width:16dp;height:16dp;border-radius:8dp;background-color:var(--live-muted);opacity:0.5;} -.kind-goal .live-event-mark .mark {width:30dp;height:30dp;border-radius:15dp;background-color:var(--live-text);opacity:1;border:5dp var(--live-accent);} -.kind-yellow .live-event-mark .mark,.kind-second_yellow .live-event-mark .mark {width:20dp;height:28dp;border-radius:3dp;background-color:#f2c230;opacity:1;} -.kind-red .live-event-mark .mark {width:20dp;height:28dp;border-radius:3dp;background-color:#d6453d;opacity:1;} -.kind-injury .live-event-mark .mark {width:26dp;height:26dp;border-radius:5dp;background-color:#d6453d;opacity:1;} -.kind-chance .live-event-mark .mark,.kind-miss .live-event-mark .mark {width:20dp;height:20dp;border-radius:10dp;background-color:transparent;border:4dp var(--live-muted);opacity:1;} -.is-whistle .live-event-mark .mark {width:28dp;height:6dp;border-radius:3dp;opacity:0.8;} -.live-event-copy h3 {font-size:32dp;} -.live-event-copy p {font-size:28dp;margin-top:4dp;line-height:1.3;} -.live-event.is-whistle .live-event-copy h3 {font-family:Display;color:var(--live-muted);} -.live-event-score {font-size:32dp;min-width:90dp;color:var(--live-text);} -.live-ticker-footer {height:64dp;padding:10dp 30dp;} -.live-detail-footer {height:96dp;padding:14dp 24dp;} -.live-roster {padding:8dp 24dp;} -.live-roster-row {height:58dp;font-size:30dp;} -.live-lineups {padding:20dp 30dp;gap:40dp;} -.live-lineup-side h3 {font-family:Display;font-size:34dp;} -.live-lineup-row {height:54dp;font-size:30dp;} -.live-bottom {left:48dp;right:48dp;height:150dp;gap:24dp;border-top:2dp var(--rule);} -.live-bottom button {height:92dp;padding:0 34dp;font-size:32dp;} -.live-speed {position:static;left:auto;top:auto;width:auto;flex-direction:row;align-items:center;gap:16dp;font-size:28dp;flex-shrink:0;} -#live-speed {width:300dp;height:60dp;} -#live-speed slidertrack {width:auto;height:8dp;margin:26dp 0;} -#live-speed sliderbar {width:32dp;height:32dp;margin-top:14dp;border-radius:16dp;} -.live-speed-value {font-size:28dp;min-width:90dp;text-align:left;} -.live-halts {display:flex;gap:12dp;flex-shrink:0;} -.live-halts button {height:70dp;padding:0 20dp;font-size:28dp;} -.live-bottom-note {text-align:right;} -.live-dialog-layer {border-radius:10dp;} -.live-dialog {width:1900dp;border-radius:12dp;} -.live-event {border-left-width:0dp;} -.live-table-row.own {border-left-width:0dp;} +.mv-stage {position:absolute;left:157.5dp;top:90dp;width:3523.5dp;height:1980dp;box-sizing:border-box;display:flex;flex-direction:column;gap:27dp;padding:49.5dp 67.5dp 45dp;border:3.38dp var(--p-n4);border-radius:31.5dp;background-color:var(--p-bg);decorator:linear-gradient(90deg,var(--p-bg) 0%,var(--p-bg) 57%,var(--p-surf) 60.9%,var(--p-bg) 62.6%,var(--p-bg) 100%);font-family:Modern;font-size:29.25dp;line-height:39.38dp;color:var(--p-text);} +.mv-stage h1,.mv-stage h2,.mv-stage h3,.mv-stage p {margin:0;font-weight:normal;} +.mv-stage button,.mv-stage button:hover,.mv-stage button:disabled {display:flex;align-items:center;justify-content:center;min-width:0;margin:0;padding:0;border:0dp transparent;border-radius:0dp;background-color:transparent;decorator:none;box-shadow:none;font-family:Modern;font-size:29.25dp;line-height:39.38dp;font-weight:normal;color:var(--p-text);} +.mv-stage button:disabled,.mv-stage button[disabled] {opacity:0.45;} +.mv-stage button .control-label {display:block;white-space:nowrap;} +.mv-k {display:block;font-size:23.63dp;line-height:31.5dp;letter-spacing:3.15dp;font-weight:bold;color:var(--p-a7);} +.mv-mut {color:var(--p-n7);} +.mv-head {display:flex;flex:none;align-items:flex-end;justify-content:space-between;gap:36dp;padding-bottom:18dp;border-bottom:3.38dp var(--p-div);} +.mv-head .ttl {display:block;min-width:0;} +.mv-head h1 {display:block;font-family:Display;font-size:60.75dp;line-height:67.5dp;white-space:nowrap;} +.mv-date {display:block;flex:none;font-family:Display;font-size:40.5dp;line-height:54dp;white-space:nowrap;} +.mv-body {display:flex;flex:1;min-height:0;gap:112.5dp;} +.mv-left {display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:27dp;} +.mv-right {display:flex;flex-direction:column;flex:none;width:1251dp;min-height:0;gap:22.5dp;} -/* the goal banner lies above everything on its card and keeps its three parts in one row */ -.live-moment {z-index:6;padding:0 48dp;gap:40dp;overflow:hidden;top:112dp;height:230dp;} -.live-moment>.live-badge {flex-shrink:0;} -.live-moment>.live-moment-copy {flex:1;min-width:0;text-align:left;} -.live-moment strong {font-size:72dp;line-height:84dp;} -.live-moment-text {font-size:32dp;line-height:40dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} -.live-moment-score {flex-shrink:0;white-space:nowrap;font-family:Display;font-size:96dp;} -.live-game.solo .live-moment {top:120dp;height:260dp;padding:0 120dp;} -.live-game.solo .live-moment strong {font-size:96dp;line-height:108dp;} -.live-game.solo .live-moment-text {font-size:38dp;line-height:48dp;} -.live-game.solo .live-moment-score {font-size:132dp;} -.live-game.quad .live-moment {top:44dp;height:150dp;gap:24dp;padding:0 28dp;} -.live-game.quad .live-moment strong {font-size:48dp;line-height:56dp;} -.live-game.quad .live-moment-text {font-size:26dp;line-height:32dp;} -.live-game.quad .live-moment-score {font-size:64dp;} -.live-moment {height:284dp;} -.live-game.solo .live-moment {height:340dp;} -.live-game.quad .live-moment {height:150dp;} -.live-game.solo .live-moment {top:92dp;height:372dp;} +/* match cards */ +.mv-cards {display:flex;flex:none;flex-wrap:wrap;gap:22.5dp;height:589.5dp;} +button.mv-card,button.mv-card:hover,.mv-stage button.mv-card,.mv-stage button.mv-card:hover {position:relative;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;box-sizing:border-box;width:2025dp;height:589.5dp;margin:0;padding:22.5dp 36dp 18dp;border:3.38dp var(--p-div);border-radius:27dp;background-color:var(--p-n1);decorator:none;color:var(--p-text);overflow:hidden;text-align:left;font-family:Modern;font-size:29.25dp;line-height:39.38dp;} +.mv-stage button.mv-card.duo {width:1001.25dp;padding:22.5dp 27dp 18dp;} +.mv-stage button.mv-card.quad {width:1001.25dp;height:283.5dp;padding:15.75dp 27dp 13.5dp;} +.mv-stage button.mv-card.duo.sel {border:6.75dp var(--p-accent);padding:19.13dp 23.63dp 14.63dp;background-color:var(--p-a1);} +.mv-stage button.mv-card.quad.sel {border:6.75dp var(--p-accent);padding:12.38dp 23.63dp 10.13dp;background-color:var(--p-a1);} +.mv-chead {display:flex;flex:none;justify-content:space-between;align-items:center;gap:22.5dp;height:36dp;white-space:nowrap;} +.mv-chead .l {display:block;min-width:0;font-size:23.63dp;letter-spacing:2.25dp;font-weight:bold;color:var(--p-a7);overflow:hidden;} +.mv-chead .r {display:block;flex:none;font-size:24.75dp;color:var(--p-n7);} +.mv-chead .r.now {font-size:27dp;font-weight:bold;color:var(--p-text);} +.mv-score {display:flex;flex:1;min-height:0;align-items:center;gap:40.5dp;} +.mv-team {display:flex;flex:1;min-width:0;align-items:center;gap:31.5dp;} +.mv-team.a {flex-direction:row-reverse;} +.mv-team-nm {display:block;flex:1;min-width:0;} +.mv-team.a .mv-team-nm {text-align:right;} +.mv-team-nm .n {display:block;font-family:Display;font-size:56.25dp;line-height:63dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-team-nm .bar {display:block;height:11.25dp;border-radius:6.75dp;margin:15.75dp 0 13.5dp;} +.mv-team-nm .s {display:block;font-size:25.88dp;line-height:33.75dp;color:var(--p-n7);white-space:nowrap;} +.mv-mid {display:flex;flex:none;flex-direction:column;align-items:center;gap:13.5dp;} +.mv-clock {display:flex;align-items:center;gap:15.75dp;height:67.5dp;} +.mv-clock span {display:block;font-size:29.25dp;font-weight:bold;white-space:nowrap;} +.mv-tiles {display:flex;align-items:center;gap:13.5dp;} +.mv-tile {display:flex;align-items:center;justify-content:center;width:130.5dp;height:139.5dp;box-sizing:border-box;border:3.38dp #2a211a59;border-radius:20.25dp;} +.mv-tile span {display:block;font-family:Display;font-size:94.5dp;line-height:103.5dp;} +.mv-tiles .c {display:block;font-family:Display;font-size:58.5dp;line-height:67.5dp;color:var(--p-n5);} +.mv-press {display:flex;gap:4.5dp;width:427.5dp;height:13.5dp;border-radius:6.75dp;overflow:hidden;background-color:var(--p-div);} +.mv-press div {height:100%;} +.mv-press .a {flex:1;} +.mv-tl {position:relative;display:block;flex:none;height:171dp;} +.mv-tl .t {position:absolute;top:81dp;display:block;font-size:24.75dp;line-height:31.5dp;font-weight:bold;color:#183014a6;} +.duo .mv-team {gap:18dp;} +.duo .mv-team-nm .n {font-size:38.25dp;line-height:45dp;white-space:normal;max-height:90dp;} +.duo .mv-team-nm .s {display:none;} +.duo .mv-team-nm .bar {margin:11.25dp 0 0;} +.duo .mv-score {gap:18dp;} +.duo .mv-tile {width:99dp;height:112.5dp;} +.duo .mv-tile span {font-size:72dp;line-height:81dp;} +.duo .mv-press {width:247.5dp;} +.quad .mv-team {gap:18dp;} +.quad .mv-team-nm .n {font-size:33.75dp;line-height:40.5dp;white-space:normal;max-height:81dp;} +.quad .mv-team-nm .s,.quad .mv-team-nm .bar {display:none;} +.quad .mv-score {gap:18dp;} +.quad .mv-tile {width:76.5dp;height:81dp;border-radius:15.75dp;} +.quad .mv-tile span {font-size:51.75dp;line-height:58.5dp;} +.quad .mv-tiles .c {font-size:36dp;line-height:45dp;} +.quad .mv-tl {height:76.5dp;} +@keyframes mv-goal-in {from {opacity:0;transform:translateX(-675dp);} to {opacity:1;transform:translateX(0dp);}} +.mv-goal {position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;gap:49.5dp;padding:0 76.5dp;z-index:6;pointer-events:none;} +.mv-goal.fresh {animation:0.45s cubic-out mv-goal-in;} +body.calm .mv-goal.fresh {animation:none;} +.mv-goal .tx {display:block;flex:1;min-width:0;} +.mv-goal .t {display:block;font-family:Display;font-size:144dp;line-height:153dp;} +.mv-goal .s {display:block;font-family:Display;font-size:47.25dp;line-height:56.25dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-goal .r {display:block;flex:none;font-family:Display;font-size:130.5dp;line-height:139.5dp;white-space:nowrap;} +.duo .mv-goal {gap:27dp;padding:0 36dp;} +.duo .mv-goal .t {font-size:90dp;line-height:99dp;} +.duo .mv-goal .s {font-size:33.75dp;line-height:42.75dp;} +.duo .mv-goal .r {font-size:85.5dp;line-height:94.5dp;} +.quad .mv-goal {gap:22.5dp;padding:0 31.5dp;} +.quad .mv-goal .t {font-size:67.5dp;line-height:74.25dp;} +.quad .mv-goal .s {font-size:29.25dp;line-height:36dp;} +.quad .mv-goal .r {font-size:67.5dp;line-height:74.25dp;} +.postmatch-stage {display:flex;flex-shrink:0;justify-content:center;margin-bottom:24dp;} +.postmatch-stage button.mv-card {pointer-events:none;} + +/* tabs and boxes */ +.mv-box {display:flex;flex-direction:column;flex:1;min-height:0;} +.mv-tabs {display:flex;flex:none;align-items:flex-end;gap:6.75dp;height:75.38dp;padding-left:22.5dp;} +.mv-tabs .ttl {display:block;flex:none;font-family:Display;font-size:42.75dp;line-height:54dp;padding:0 31.5dp 11.25dp 4.5dp;} +.mv-tabs .sp {display:block;flex:1;} +.mv-stage .mv-tab,.mv-stage .mv-tab:hover {flex:none;height:63dp;padding:0 33.75dp;border:3.38dp var(--p-div);border-bottom-width:0dp;border-radius:20.25dp 20.25dp 0dp 0dp;background-color:var(--p-row);font-size:28.13dp;font-weight:bold;color:var(--p-n7);} +.mv-stage .mv-tab:hover {color:var(--p-text);} +.mv-stage .mv-tab.selected,.mv-stage .mv-tab.selected:hover {height:75.38dp;background-color:var(--p-n1);color:var(--p-text);} +.mv-seg {display:flex;flex:none;border:3.38dp var(--p-n5);border-radius:31.5dp;overflow:hidden;} +.mv-stage .mv-seg button,.mv-stage .mv-seg button:hover {height:51.75dp;padding:0 24.75dp;font-size:27dp;font-weight:bold;} +.mv-stage .mv-seg button.selected,.mv-stage .mv-seg button.selected:hover {background-color:var(--p-n9);color:var(--p-bg);} +.mv-tabs .mv-seg {margin-bottom:11.25dp;} +.mv-in {display:flex;flex-direction:column;flex:1;min-height:0;border:3.38dp var(--p-div);border-radius:27dp;background-color:var(--p-n1);overflow:hidden;} +.mv-scroll {display:block;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;} +.mv-foot {display:flex;flex:none;justify-content:space-between;align-items:center;gap:22.5dp;min-height:67.5dp;box-sizing:border-box;padding:13.5dp 31.5dp;border-top:3.38dp var(--p-rule);background-color:var(--p-row);font-size:25.88dp;color:var(--p-n7);} +.mv-foot span {display:block;} +.mv-foot .b {font-weight:bold;color:var(--p-text);} + +/* ticker */ +.mv-ev {display:flex;align-items:flex-start;gap:18dp;padding:18dp 31.5dp;border-bottom:2.25dp var(--p-rule);} +.mv-ev:nth-child(even) {background-color:var(--p-row);} +.mv-ev.goal {background-color:#d9a44138;} +.mv-ev .m {display:block;flex:none;width:85.5dp;text-align:right;font-weight:bold;} +.mv-ev .i {display:block;flex:none;width:49.5dp;height:40.5dp;} +.mv-ev .c {display:block;flex:none;width:58.5dp;height:49.5dp;} +.mv-ev .tx {display:block;flex:1;min-width:0;} +.mv-ev .who {display:block;font-size:23.63dp;line-height:31.5dp;color:var(--p-a7);} +.mv-ev .hd {display:block;font-size:30.38dp;line-height:40.5dp;font-weight:bold;} +.mv-ev p {display:block;margin-top:2.25dp;color:var(--p-n8);} +.mv-ev .sc {display:block;flex:none;font-family:Display;font-size:33.75dp;white-space:nowrap;color:var(--p-n7);} +.mv-ev.goal .sc {color:var(--p-text);} +.mv-empty {display:block;padding:58.5dp 45dp;text-align:center;color:var(--p-n7);} +.mv-lineups {display:flex;gap:58.5dp;padding:31.5dp 40.5dp;} +.mv-lineups .side {display:block;flex:1;min-width:0;} +.mv-lineups h3 {display:block;font-family:Display;font-size:33.75dp;line-height:45dp;margin-bottom:11.25dp;color:var(--p-a7);} +.mv-lineups .row {display:flex;gap:18dp;align-items:center;height:54dp;border-bottom:2.25dp var(--p-rule);} +.mv-lineups .nr {display:block;flex:none;width:54dp;text-align:right;color:var(--p-n7);} +.mv-lineups .nm {display:block;flex:1;min-width:0;white-space:nowrap;overflow:hidden;} + +/* the line about the ground and the weather */ +.mv-info {display:flex;flex:none;align-items:center;gap:31.5dp;padding:22.5dp 36dp;border:3.38dp var(--p-div);border-radius:27dp;background-color:var(--p-row);} +.mv-info .main {display:block;flex:1;min-width:0;} +.mv-info .big {display:block;font-family:Display;font-size:45dp;line-height:54dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-info .sub {display:block;font-size:25.88dp;line-height:33.75dp;margin-top:6.75dp;color:var(--p-n7);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-wx {display:flex;flex:none;align-items:center;gap:22.5dp;padding-left:36dp;border-left:3.38dp var(--p-div);} +.mv-wx .v {display:block;} +.mv-wx .t {display:block;font-family:Display;font-size:49.5dp;line-height:56.25dp;white-space:nowrap;} +.mv-wx .l {display:block;font-size:27dp;line-height:33.75dp;color:var(--p-n7);white-space:nowrap;} + +/* the manager's team */ +.mv-phead {display:flex;flex:none;align-items:center;gap:27dp;padding:0 4.5dp;} +.mv-phead .nm {display:block;flex:1;min-width:0;} +.mv-phead h2 {display:block;font-family:Display;font-size:49.5dp;line-height:58.5dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-phead p {display:block;font-size:27dp;line-height:33.75dp;color:var(--p-n7);} +.mv-stage .mv-ic,.mv-stage .mv-ic:hover {flex:none;width:67.5dp;height:67.5dp;border:3.38dp var(--p-n5);border-radius:33.75dp;background-color:var(--p-row);font-size:36dp;} +.mv-stage .mv-ic:hover {background-color:var(--p-n1);} +.mv-tr {display:flex;align-items:center;gap:13.5dp;height:50.63dp;padding:0 18dp;border-bottom:2.25dp var(--p-rule);font-size:28.13dp;white-space:nowrap;} +.mv-tr span {display:block;flex:none;text-align:right;} +.mv-tr.hd {height:54dp;border-bottom-width:0dp;background-color:var(--p-n2);font-size:22.5dp;letter-spacing:1.8dp;font-weight:bold;color:var(--p-n7);} +.mv-tr.sec {height:58.5dp;padding-left:22.5dp;border-bottom-width:0dp;background-color:var(--p-n2);font-size:22.5dp;letter-spacing:2.25dp;font-weight:bold;color:var(--p-a7);} +.mv-tr .l {text-align:left;} +.mv-tr .g {flex:1;min-width:0;text-align:left;} +.mv-tr .nm {display:flex;flex:1;min-width:0;align-items:center;gap:11.25dp;text-align:left;overflow:hidden;} +.mv-tr .nm .t {flex:0 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;} +.mv-tr .w0 {width:31.5dp;font-size:20.25dp;text-align:center;} +.mv-tr .w1 {width:54dp;} +.mv-tr .w2 {width:76.5dp;} +.mv-tr .w3 {width:103.5dp;} +.mv-tr .w4 {width:189dp;} +.mv-tr .pos {font-size:24.75dp;color:var(--p-n7);} +.mv-tr.own {font-weight:bold;} +.mv-tr .up {color:#3f7a35;} +.mv-tr .dn {color:#b8402f;} +.mv-tr .eq {color:var(--p-n4);} +.mv-ko {display:flex;flex:none;align-items:center;justify-content:flex-end;gap:11.25dp;width:189dp;} +.mv-ko .bar {display:block;flex:none;width:103.5dp;height:11.25dp;border-radius:6.75dp;background-color:var(--p-div);overflow:hidden;} +.mv-ko .bar div {height:100%;border-radius:6.75dp;} +.mv-card-mark {display:block;flex:none;width:15.75dp;height:22.5dp;border:2.25dp #2a211a;border-radius:2.25dp;background-color:#e9c53a;} +.mv-tr .hurt {color:#c8372d;font-weight:bold;} +.mv-trow,.mv-stage button.mv-trow,.mv-stage button.mv-trow:hover {display:flex;align-items:center;justify-content:flex-start;gap:22.5dp;width:100%;box-sizing:border-box;height:90dp;padding:0 36dp;border-bottom:2.25dp var(--p-div);} +.mv-stage button.mv-trow:hover {background-color:#d9a44124;} +.mv-trow .k {display:block;flex:none;width:427.5dp;text-align:left;color:var(--p-n7);white-space:nowrap;overflow:hidden;} +.mv-trow .v {display:block;flex:1;min-width:0;text-align:left;font-weight:bold;white-space:nowrap;overflow:hidden;} +.mv-trow .go {display:block;flex:none;} +.mv-pad {display:block;padding:31.5dp 36dp;} +.mv-pad p {display:block;margin-bottom:22.5dp;color:var(--p-n7);} +.mv-cmp {display:flex;justify-content:space-between;align-items:center;gap:22.5dp;padding:31.5dp 40.5dp 9dp;} +.mv-cmp .t {display:flex;flex:1;min-width:0;align-items:center;gap:18dp;font-weight:bold;} +.mv-cmp .t.a {justify-content:flex-end;} +.mv-cmp .t span {display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-stat {display:block;padding:20.25dp 40.5dp 0;} +.mv-stat .lb {display:block;text-align:center;font-size:24.75dp;line-height:33.75dp;letter-spacing:2.25dp;font-weight:bold;color:var(--p-n7);} +.mv-stat .ln {display:flex;align-items:center;gap:22.5dp;} +.mv-stat .n {display:block;flex:none;width:76.5dp;font-family:Display;font-size:42.75dp;line-height:54dp;} +.mv-stat .n.h {text-align:right;} +.mv-stat .bar {display:flex;flex:1;gap:4.5dp;height:22.5dp;border-radius:11.25dp;overflow:hidden;background-color:var(--p-div);} +.mv-stat .bar div {height:100%;} +.mv-stat .bar .a {flex:1;} +.mv-res {display:flex;align-items:center;gap:13.5dp;height:63dp;padding:0 27dp;border-bottom:2.25dp var(--p-rule);font-size:28.13dp;} +.mv-res .h,.mv-res .a {display:block;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-res .h {text-align:right;} +.mv-res .sc {display:block;flex:none;width:103.5dp;text-align:center;font-family:Display;font-size:33.75dp;} + +/* the controls at the foot */ +.mv-bar {display:flex;flex:none;align-items:center;gap:27dp;height:130.5dp;box-sizing:border-box;padding-top:27dp;border-top:3.38dp var(--p-div);min-width:0;} +.mv-stage .mv-btn,.mv-stage .mv-btn:hover,.mv-stage .mv-btn:disabled {flex:none;height:90dp;padding:0 45dp;border:3.38dp var(--p-n5);border-radius:45dp;background-color:var(--p-row);font-family:Display;font-size:33.75dp;white-space:nowrap;} +.mv-stage .mv-btn:hover {background-color:var(--p-n1);} +.mv-stage .mv-btn.primary,.mv-stage .mv-btn.primary:hover,.mv-stage .mv-btn.primary:disabled {height:99dp;padding:0 63dp;border-color:var(--p-accent);border-radius:49.5dp;background-color:var(--p-accent);font-size:38.25dp;color:var(--p-on-accent);} +.mv-stage .mv-btn.primary:hover {border-color:var(--p-a6);background-color:var(--p-a6);} +.mv-stage .mv-btn.sm,.mv-stage .mv-btn.sm:hover,.mv-stage .mv-btn.sm:disabled {height:76.5dp;padding:0 36dp;border-radius:38.25dp;font-size:31.5dp;} +.mv-stage .mv-btn.play {width:297dp;padding:0;} +.mv-stage button:focus-visible {border-color:var(--p-accent);} +.mv-bar .mv-seg {border-radius:42.75dp;} +.mv-stage .mv-bar .mv-seg button,.mv-stage .mv-bar .mv-seg button:hover {height:76.5dp;padding:0 29.25dp;} +.mv-stage .mv-sw,.mv-stage .mv-sw:hover {flex:none;gap:15.75dp;font-size:28.13dp;white-space:nowrap;} +.mv-sw .tr {display:block;flex:none;width:72dp;height:40.5dp;border-radius:20.25dp;background-color:var(--p-n4);} +.mv-sw .kn {display:block;width:31.5dp;height:31.5dp;margin:4.5dp;border-radius:15.75dp;background-color:var(--p-n1);} +.mv-sw.selected .tr {background-color:var(--p-s6);} +.mv-sw.selected .kn {margin-left:36dp;} +.mv-sw .lb {display:block;} +.mv-status {display:block;flex:1;min-width:0;padding-right:9dp;text-align:right;font-size:28.13dp;color:var(--p-n7);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} + +/* notes laid on the sheet */ +.mv-veil {position:absolute;left:0;top:0;width:3516.75dp;height:1973.25dp;display:flex;align-items:center;justify-content:center;border-radius:31.5dp;background-color:#1d161180;z-index:20;} +.mv-note {position:relative;display:flex;flex-direction:column;gap:27dp;box-sizing:border-box;max-height:1800dp;padding:58.5dp 63dp 45dp;border-radius:13.5dp;background-color:var(--p-n1);box-shadow:0dp 18dp 49.5dp #00000073;} +.mv-tape {position:absolute;left:50%;top:-24.75dp;width:247.5dp;height:54dp;margin-left:-123.75dp;background-color:#d9a4418c;transform:rotate(-1.5deg);} +.mv-note h2 {display:block;font-family:Display;font-size:58.5dp;line-height:67.5dp;} +.mv-note p {display:block;color:var(--p-n7);} +.mv-cols {display:flex;gap:36dp;} +.mv-cols .col {display:block;flex:1;min-width:0;} +.mv-cols .mv-k {margin-bottom:11.25dp;} +.mv-list {display:block;box-sizing:border-box;border:3.38dp var(--p-div);border-radius:22.5dp;padding:11.25dp;overflow-y:auto;overflow-x:hidden;background-color:var(--p-bg);} +.mv-list.rows {padding:0;} +.mv-stage .mv-pick,.mv-stage .mv-pick:hover {justify-content:flex-start;gap:13.5dp;width:100%;box-sizing:border-box;height:67.5dp;padding:0 22.5dp;border-radius:15.75dp;font-size:29.25dp;} +.mv-stage .mv-pick:hover {background-color:#d9a44129;} +.mv-stage .mv-pick.selected,.mv-stage .mv-pick.selected:hover {background-color:var(--p-n9);color:var(--p-bg);} +.mv-pick .nr {display:block;flex:none;width:49.5dp;text-align:right;} +.mv-pick .ps {display:block;flex:none;width:76.5dp;font-size:24.75dp;text-align:left;} +.mv-pick .nm {display:block;flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-pick .vl {display:block;flex:none;} +.mv-acts {display:flex;align-items:center;justify-content:flex-end;gap:22.5dp;} +.mv-acts .hint {display:block;flex:1;min-width:0;color:var(--p-n7);} +.mv-stage .mv-acts .mv-btn.primary,.mv-stage .mv-acts .mv-btn.primary:hover,.mv-stage .mv-acts .mv-btn.primary:disabled {height:90dp;border-radius:45dp;font-size:33.75dp;} diff --git a/src/modern/ui/engine_screens.inc b/src/modern/ui/engine_screens.inc index c78cf7f..02738e2 100644 --- a/src/modern/ui/engine_screens.inc +++ b/src/modern/ui/engine_screens.inc @@ -242,8 +242,10 @@ void App::engine_render() { for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); } } const auto size = context_->GetDimensions(); - element("background")->SetInnerRML(img("background", size.x / scale_, size.y / scale_, false, true, 2048)); - element("background")->SetProperty("filter", theme_ == "silver" ? "saturate(0.2) brightness(0.9)" : theme_ == "matchday" ? "saturate(0.13) brightness(0.56)" : "saturate(0.34) brightness(0.70)"); + // behind the match sheet lies a stadium that suits the crowd and the weather + const std::string ground = live_backdrop(); + element("background")->SetInnerRML(img(ground.empty() ? "background" : ground, size.x / scale_, size.y / scale_, false, true, ground.empty() ? 2048 : 2400)); + element("background")->SetProperty("filter", !ground.empty() ? "brightness(0.78)" : theme_ == "silver" ? "saturate(0.2) brightness(0.9)" : theme_ == "matchday" ? "saturate(0.13) brightness(0.56)" : "saturate(0.34) brightness(0.70)"); if (!contracts_dialog_.empty()) { Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#contracts-underlay button,.contracts-actions button,#window-close"); for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); } diff --git a/src/modern/ui/live_controls.inc b/src/modern/ui/live_controls.inc index de09278..0f0a037 100644 --- a/src/modern/ui/live_controls.inc +++ b/src/modern/ui/live_controls.inc @@ -274,19 +274,16 @@ void App::live_set_speed(int value) { if (!live_.speed(value)) return; live_feedback_.clear(); live_last_tick_ = SDL_GetTicks64(); - if (auto *node = dynamic_cast(element("live-speed"))) { - node->SetValue(std::to_string(value)); node->SetAttribute("aria-valuenow", value); - node->SetAttribute("aria-valuetext", value ? "Wiedergabe Stufe " + std::to_string(value) : "Pause"); - } - if (auto *node = element("live-speed-value")) node->SetInnerRML(esc(value ? std::to_string(value) + "×" : "Pause")); - if (auto *node = element("live-pause")) node->SetInnerRML(live_text(value ? "Pause" : "Abspielen", "control-label")); - const auto &frame = live_.fixture().at("frames")[live_.sequence()]; - const bool recorded = live_.fixture().at("source") == "engine-recording"; - if (recorded) { if (auto *node = element("live-playback-status")) node->SetInnerRML(""); return; } - const std::string phase = live_.finished() ? "Beendet" : frame.at("phase") == "interval" ? "Halbzeit" : value ? (recorded ? "Spiel läuft" : "Aufzeichnung läuft") : (recorded ? "Pausiert" : "Gemeinsam pausiert"); - if (auto *node = element("live-phase-status")) node->SetInnerRML(esc(phase)); - if (auto *node = element("live-playback-status")) node->SetInnerRML(esc(phase + " · " + std::to_string(frame.at("minute").get()) + (recorded ? "′" : "′ · keine Spielwertänderung"))); - dirty_ = true; + refresh(); +} +void App::live_follow_match() { + for (const auto &owner : live_.fixture().at("owners")) + if (owner.at("match_id") == live_selected_match_) { + // the manager on the right page already plays in this match: he stays + const auto shown = live_owner(); + if (!shown.is_object() || shown.at("match_id") != live_selected_match_) { live_.owner(owner.at("id").get()); live_reset_detail_ = true; } + return; + } } void App::live_tick() { if (engine_live_busy_) engine_live_poll(); @@ -350,11 +347,13 @@ bool App::live_action(const std::string &action, Rml::Element *target) { if (scene_ != "live" || !live_.available()) return true; const auto id = target ? target->GetAttribute("data-id", "") : ""; bool detail_only = false, ticker_only = false; - if (!live_dialog_.empty() && action != "live-dialog-cancel" && action != "live-dialog-apply" && action != "live-tactic-cycle") return true; + if (!live_dialog_.empty() && action != "live-dialog-cancel" && action != "live-dialog-apply" && action != "live-tactic-cycle" && action != "live-pick-out" && action != "live-pick-in") return true; if (action == "live-back") { live_close(); return true; } if (action == "live-owner-prev" || action == "live-owner-next") { if (!live_.cycle_owner(action == "live-owner-prev" ? -1 : 1)) return true; - live_reset_detail_ = detail_only = true; + const auto owner = live_owner(); + if (owner.is_object()) live_selected_match_ = owner.at("match_id").get(); + live_reset_detail_ = live_reset_ticker_ = true; } else if (action == "live-tab") { if (id != "team" && id != "tactics" && id != "opponent" && id != "table" && id != "stats") return true; if (live_tab_ == id) return true; @@ -368,7 +367,7 @@ bool App::live_action(const std::string &action, Rml::Element *target) { live_coverage_ = id; live_reset_ticker_ = true; } else if (action == "live-match") { for (const auto &match : live_.fixture().at("matches")) if (match.at("id") == id) { - live_selected_match_ = id; live_reset_ticker_ = true; break; + live_selected_match_ = id; live_reset_ticker_ = true; live_follow_match(); break; } } else if (action == "live-match-prev" || action == "live-match-next") { const auto &matches = live_.fixture().at("matches"); @@ -383,7 +382,15 @@ bool App::live_action(const std::string &action, Rml::Element *target) { (id == "interval" ? live_halt_interval_ : live_halt_behind_) ^= true; focus_after_render_ = target->GetId(); } else if (action == "live-pause") { - live_set_speed(live_.speed() ? 0 : 1); return true; + focus_after_render_ = "live-pause"; + live_set_speed(live_.speed() ? 0 : live_resume_speed_ ? live_resume_speed_ : 2); return true; + } else if (action == "live-speed-set") { + try { const int step = std::stoi(id); if (step) live_resume_speed_ = 0; focus_after_render_ = "live-speed-" + std::to_string(std::clamp(step, 0, 4)); live_set_speed(step); } catch (const std::exception &) {} + return true; + } else if (action == "live-pick-out" || action == "live-pick-in") { + if (live_dialog_ != "lineup") return true; + auto &chosen = action == "live-pick-out" ? live_out_ : live_in_; + chosen = chosen == id ? std::string() : std::string(id); } else if (action == "live-review" && live_.finished()) { postmatch_open();return true; } else if (action == "live-review-back") { @@ -400,9 +407,6 @@ bool App::live_action(const std::string &action, Rml::Element *target) { live_dialog_ = action == "live-intervene-lineup" ? "lineup" : "tactics"; live_resume_speed_ = live_.speed(); live_.speed(0); live_last_tick_ = SDL_GetTicks64(); live_out_.clear(); live_in_.clear(); - const auto rows = live_owner_rows(owner); const size_t count = live_.fixture().at("field_count"); - if (!rows.empty()) live_out_ = rows[0].at("id"); - if (rows.size() > count) live_in_ = rows[count].at("id"); focus_after_render_ = "live-dialog-cancel"; } else if (action == "live-dialog-cancel" || action == "live-dialog-apply") { live_dialog_close(action == "live-dialog-apply"); return true; @@ -478,8 +482,11 @@ bool App::live_event(Rml::Event &event) { } event.StopImmediatePropagation(); return true; } - if (live_dialog_.empty() && key == Rml::Input::KI_P && !live_.finished()) { - live_set_speed(live_.speed() ? 0 : 1); event.StopImmediatePropagation(); return true; + if (live_dialog_.empty() && (key == Rml::Input::KI_P || key == Rml::Input::KI_SPACE) && !live_.finished()) { + live_set_speed(live_.speed() ? 0 : 2); event.StopImmediatePropagation(); return true; + } + if (live_dialog_.empty() && key == Rml::Input::KI_RIGHT && !live_.finished()) { + live_action("live-next", nullptr); event.StopImmediatePropagation(); return true; } if (speed_control && (key == Rml::Input::KI_HOME || key == Rml::Input::KI_END || key == Rml::Input::KI_UP || key == Rml::Input::KI_DOWN)) { live_set_speed(key == Rml::Input::KI_HOME ? 0 : key == Rml::Input::KI_END ? 4 : std::clamp(live_.speed() + (key == Rml::Input::KI_UP ? 1 : -1), 0, 4)); @@ -488,6 +495,7 @@ bool App::live_event(Rml::Event &event) { } if (type == "click" && live_dialog_.empty()) for (auto *node = target; node && node != doc_; node = node->GetParentNode()) if (node->HasAttribute("data-live-match")) { live_selected_match_ = node->GetAttribute("data-live-match", ""); + live_follow_match(); if (live_coverage_ == "single") live_reset_ticker_ = true; refresh(); return true; } diff --git a/src/modern/ui/live_screens.inc b/src/modern/ui/live_screens.inc index 6a413da..bd3c153 100644 --- a/src/modern/ui/live_screens.inc +++ b/src/modern/ui/live_screens.inc @@ -14,6 +14,32 @@ const Json &live_match_by_id(const Json &rows, const Json &id) { for (const auto &row : rows) if (row.at("id") == id) return row; throw editor::Error("live_match_unavailable"); } +// Relative luminance and contrast of "#rrggbb" colours, for type on a club's colour. +double mv_lum(const std::string &colour) { + if (colour.size() < 7) return 0; + double v[3]; + for (size_t i = 0; i < 3; ++i) { + const double x = std::stoi(colour.substr(1 + i * 2, 2), nullptr, 16) / 255.0; + v[i] = x <= .03928 ? x / 12.92 : std::pow((x + .055) / 1.055, 2.4); + } + return .2126 * v[0] + .7152 * v[1] + .0722 * v[2]; +} +double mv_contrast(const std::string &a, const std::string &b) { + const double x = mv_lum(a), y = mv_lum(b); + return (std::max(x, y) + .05) / (std::min(x, y) + .05); +} +std::string mv_ink(const std::string &colour) { return mv_lum(colour) > .4 ? "#1d1611" : "#fffdf6"; } +// A player's position as the three letters of the squad lists. +std::string live_position_text(const Json &value) { + if (!value.is_string()) return {}; + std::string code = value.get(); + for (auto &c : code) c = char(std::toupper(static_cast(c))); + if (code == "TW" || code == "T" || code == "GK") return "TW"; + if (code == "ABW" || code == "A" || code == "AB" || code == "DEF") return "ABW"; + if (code == "MIT" || code == "M" || code == "MF" || code == "MID") return "MIT"; + if (code == "STU" || code == "S" || code == "ST" || code == "FWD") return "STU"; + return code; +} const Json &live_score_by_id(const Json &frame, const Json &id) { for (const auto &row : frame.at("matches")) if (row.at("match_id") == id) return row; throw editor::Error("live_score_unavailable"); @@ -57,26 +83,145 @@ std::string App::live_badge(const Json &team, double size) { if (art.empty()) art = glyph(team.value("role", "club") == "national" ? "world" : "shirt", size); return "
" + art + "
"; } +// The small signs of the ticker and the squad list, drawn in the paper's ink. +std::string App::live_icon(const std::string &kind, double size) { + const bool dark = theme_ != "silver" && theme_ != "matchday"; + const std::string ink = dark ? "#f0ece2" : "#2a211a", paper = dark ? "#2a2d34" : "#fffdf6"; + std::string g; + if (kind == "goal") + g = ""; + else if (kind == "chance" || kind == "save") + g = ""; + else if (kind == "miss") + g = ""; + else if (kind == "yellow") + g = ""; + else if (kind == "second_yellow") + g = ""; + else if (kind == "red") + g = ""; + else if (kind == "injury") + g = ""; + else if (kind == "up") + g = ""; + else if (kind == "down") + g = ""; + else if (kind == "same") + g = ""; + else if (kind == "substitution") + g = ""; + else + g = ""; + return picture(renderer_.diagram("mv-icon-" + kind + (dark ? "-d" : "-l"), "" + g + "", 96), size, size); +} +// The weather of a match as a picture; the code is the engine's weather picture 0-7. +std::string App::live_weather_icon(int code, double size) { + const std::string sun = ""; + const auto cloud = [](const char *colour) { return std::string(""; }; + std::string g; + if (code <= 0) g = "" + sun + ""; + else if (code == 1) g = "" + sun + "" + cloud("#cfc7b8"); + else if (code <= 3) g = cloud("#b9b1a3"); + else if (code <= 5) g = cloud("#9aa3a8") + ""; + else g = cloud("#aeb6ba") + ""; + return picture(renderer_.diagram("mv-weather-" + std::to_string(std::clamp(code, 0, 7)), "" + g + "", 160), size, size); +} +// The picture behind the match sheet: a ground of about the crowd's size in about this +// weather. Empty when the match is played in a hall or the pictures are not installed. +std::string App::live_backdrop() const { + if (scene_ != "live" || !live_.available()) return {}; + try { + const auto &fixture = live_.fixture(); + if (live_indoor()) return {}; + const auto owner = live_owner(); + const Json *match = &fixture.at("matches").front(); + if (owner.is_object()) + for (const auto &row : fixture.at("matches")) if (row.at("id") == owner.at("match_id")) match = &row; + const int64_t crowd = match->contains("attendance") && match->at("attendance").is_number_integer() ? match->at("attendance").get() : 20000; + const int size = crowd < 8000 ? 0 : crowd < 20000 ? 1 : crowd < 40000 ? 2 : 3; + int code = 2; + if (match->contains("weather") && match->at("weather").is_object() && match->at("weather").value("rain", Json()).is_number_integer()) + code = match->at("weather").at("rain").get(); + // the eight weather pictures as five kinds of sky: sun, fair, cloud, rain, snow + static constexpr std::array kSky{0, 1, 2, 2, 3, 3, 4, 4}; + const int sky = kSky[size_t(std::clamp(code, 0, 7))]; + struct Ground { int size, sky; const char *key; }; + static constexpr std::array grounds{{ + {0, 0, "match.0-sun-a"}, {0, 2, "match.0-cloud-a"}, {0, 3, "match.0-rain-a"}, + {1, 0, "match.1-sun-a"}, {1, 0, "match.1-sun-b"}, {1, 0, "match.1-sun-c"}, {1, 1, "match.1-fair-a"}, {1, 1, "match.1-fair-b"}, + {1, 2, "match.1-cloud-a"}, {1, 2, "match.1-cloud-b"}, {1, 3, "match.1-rain-a"}, {1, 4, "match.1-snow-a"}, {1, 4, "match.1-snow-b"}, + {2, 0, "match.2-sun-a"}, {2, 0, "match.2-sun-b"}, {2, 0, "match.2-sun-c"}, {2, 1, "match.2-fair-a"}, + {3, 1, "match.3-fair-a"}, {3, 1, "match.3-fair-b"}, {3, 1, "match.3-fair-c"}, {3, 2, "match.3-cloud-a"}, + {3, 3, "match.3-rain-a"}, {3, 3, "match.3-rain-b"}, {3, 4, "match.3-snow-a"}}}; + // the nearest in size and sky; among equals the home club keeps its ground + int best = 99; + std::vector nearest; + for (const auto &ground : grounds) { + if (!gui_.contains(ground.key)) continue; + const int cost = std::abs(ground.size - size) + std::abs(ground.sky - sky); + if (cost < best) { best = cost; nearest.clear(); } + if (cost == best) nearest.push_back(ground.key); + } + if (nearest.empty()) return {}; + size_t hash = 2166136261u; + for (const unsigned char c : match->at("home").at("id").get()) hash = (hash ^ c) * 16777619u; + return nearest[hash % nearest.size()]; + } catch (const std::exception &) { return {}; } +} +// Played in a hall: the fixture says so, or the engine named the competition a hall tournament. +bool App::live_indoor() const { + if (!live_.available()) return false; + const auto &fixture = live_.fixture(); + if (fixture.at("surface") == "indoor") return true; + for (const auto &match : fixture.at("matches")) + if (match.value("competition", std::string()).find("Halle") != std::string::npos) return true; + return false; +} std::string App::live_roster(const Json &owner) { const bool national = live_.fixture().at("role") == "national"; const int field_count = live_.fixture().at("field_count"); - std::string out = "
" + - live_text("Nr.", "live-roster-number") + live_text(owner.at("team").at("name"), "live-roster-name") + - live_text(national ? "Caps" : "Stä.", "live-roster-stat") + live_text(national ? "Tore" : "Ko.", "live-roster-stat") + "
"; const auto rows = live_owner_rows(owner); const bool recorded = live_.fixture().at("source") == "engine-recording"; - if (national && !recorded) out += "

" + live_text("Demokader auf Vereinsbasis · keine Nationalkaderberufung") + "

"; - for (size_t i = 0; i < rows.size(); ++i) { - if (int(i) == field_count) out += "

" + live_text(field_count == 6 ? "Rotationspartner · erster 11er-Plan" : recorded ? "Ersatzbank und Reserve" : "Reserven · Demovorschau") + "

"; - if (field_count == 6 && i == 11) out += "

" + live_text("Weitere Kaderreserven") + "

"; - const auto &row = rows[i]; - out += "
()) + "\">" + - live_text(std::to_string(i + 1), "live-roster-number") + live_text(row.at("name"), "live-roster-name") + - live_text(lineup_value(row.at(national ? "caps" : "strength")), "live-roster-stat") + - live_text(lineup_value(row.at(national ? "international_goals" : "condition")), "live-roster-stat") + "
"; + // what the match has brought each player so far: goals, a yellow card, a knock + std::map> marks; + const auto frame = live_.frame(); + for (const auto &event : frame.at("events")) { + if (!event.contains("player") || !event.at("player").is_object()) continue; + const std::string id = event.at("player").value("id", std::string()), kind = event.value("kind", std::string()); + if (id.empty()) continue; + if (kind == "goal") ++marks[id][0]; + if (kind == "yellow") ++marks[id][1]; + if (kind == "injury") ++marks[id][2]; } - if (rows.empty()) out += "

" + live_text(recorded ? "Für diese Mannschaft liegt keine Kaderansicht vor." : "Für diese Demomannschaft sind keine Kaderspieler verfügbar.") + "

"; - return out + "
"; + const auto cell = [](const std::string &text, const char *css) { return "" + esc(text) + ""; }; + const auto section = [](const std::string &text) { return "
" + esc(pg_upper(text)) + "
"; }; + std::string out = "
" + cell("NR.", "w1") + cell("POS.", "w2 l") + cell("SPIELER", "g") + + cell(national ? "CAPS" : "STÄRKE", "w3") + cell(national ? "TORE" : "KONDITION", "w4") + "
"; + if (national && !recorded) out += section("Demokader auf Vereinsbasis · keine Nationalkaderberufung"); + for (size_t i = 0; i < rows.size(); ++i) { + if (int(i) == field_count) out += section(field_count == 6 ? "Rotationspartner · erster 11er-Plan" : recorded ? "Ersatzbank und Reserve" : "Reserven · Demovorschau"); + if (field_count == 6 && i == 11) out += section("Weitere Kaderreserven"); + const auto &row = rows[i]; + const std::string id = row.at("id").get(); + std::string badges; + if (const auto at = marks.find(id); at != marks.end()) { + if (at->second[0]) badges += live_icon("goal", 31) + (at->second[0] > 1 ? "×" + std::to_string(at->second[0]) + "" : std::string()); + if (at->second[1]) badges += ""; + if (at->second[2]) badges += live_icon("injury", 27); + } + std::string last = cell(lineup_value(row.at(national ? "international_goals" : "condition")), "w4"); + if (!national && row.at("condition").is_number()) { + const int value = std::clamp(int(row.at("condition").get()), 0, 100); + last = "
70 ? "#56874a" : value > 50 ? "#d9a441" : "#c8372d") + ";\">
" + std::to_string(value) + "
"; + } + out += "
" + cell(std::to_string(i + 1), "w1") + + cell(live_position_text(row.value("position", Json())), "w2 l pos") + + "" + esc(row.at("name").get()) + "" + badges + "" + + cell(lineup_value(row.at(national ? "caps" : "strength")), "w3") + last + "
"; + } + if (rows.empty()) out += "

" + esc(recorded ? "Für diese Mannschaft liegt keine Kaderansicht vor." : "Für diese Demomannschaft sind keine Kaderspieler verfügbar.") + "

"; + return out; } std::string App::live_detail(const Json &owner, const Json &frame) { const auto &fixture = live_.fixture(); @@ -84,47 +229,61 @@ std::string App::live_detail(const Json &owner, const Json &frame) { const auto &score = live_score_by_id(frame, match.at("id")); if (live_tab_ == "team") return live_roster(owner); const bool recorded = fixture.at("source") == "engine-recording"; + const auto note = [](const std::string &text) { return "

" + esc(text) + "

"; }; + const auto cell = [](const std::string &text, const char *css) { return "" + esc(text) + ""; }; if (live_tab_ == "table") { - if (recorded && score.at("standings").empty()) return "

" + live_text("Diese Partie gehört zu keiner Ligatabelle.") + "

"; - if (fixture.at("role") == "national") return "

" + live_text("Dieses Demo-Länderspiel gehört zu keiner Liga. Der Spielstand steht links; eine Vereins-Live-Tabelle wird nicht eingeblendet.") + "

"; - std::string out = "

" + live_text(recorded ? "Tabelle zum Stand dieser Spielminute" : "Vorgegebene Demo-Tabelle · keine echte Saisonwertung") + "

" + - live_text("Pl.", "live-table-pos") + "
" + live_text("Verein") + "
" + live_text("Sp.", "live-table-number") + - live_text("Tore", "live-table-number live-table-goals") + live_text("Diff.", "live-table-number") + live_text("Pkt.", "live-table-number") + "
"; + if (recorded && score.at("standings").empty()) return note("Diese Partie gehört zu keiner Ligatabelle."); + if (fixture.at("role") == "national") return note("Dieses Länderspiel gehört zu keiner Liga."); + // where every club stood at the kickoff, for the arrows + std::map before; + try { + for (const auto &row : live_score_by_id(fixture.at("frames").front(), match.at("id")).at("standings")) + before[row.at("team").at("id").get()] = row.at("position").get(); + } catch (const std::exception &) {} + bool results = false; + for (const auto &row : score.at("standings")) results = results || (row.contains("won") && row.at("won").is_number_integer()); + std::string out = "
" + cell("PL.", "w1") + cell("", "w0") + cell("VEREIN", "g") + cell("SP.", "w1") + + (results ? cell("S", "w1") + cell("U", "w1") + cell("N", "w1") : std::string()) + cell("TORE", "w3") + cell("DIFF.", "w2") + cell("PKT.", "w2") + "
"; + const auto colours = live_colours(match); for (const auto &row : score.at("standings")) { + const std::string id = row.at("team").at("id").get(); const bool own = row.at("team").at("id") == owner.at("team").at("id"); - const int difference = row.at("gf").get() - row.at("ga").get(); - out += "
()) + "\"" + (own ? " aria-current=\"true\"" : "") + ">" + - live_text(std::to_string(row.at("position").get()), "live-table-pos") + - "
" + live_badge(row.at("team"), 48) + live_text(row.at("team").at("name")) + "
" + - live_text(std::to_string(row.at("played").get()), "live-table-number") + - live_text(std::to_string(row.at("gf").get()) + ":" + std::to_string(row.at("ga").get()), "live-table-number live-table-goals") + - live_text((difference > 0 ? "+" : "") + std::to_string(difference), "live-table-number") + - live_text(std::to_string(row.at("points").get()), "live-table-number") + "
"; + const int position = row.at("position").get(), difference = row.at("gf").get() - row.at("ga").get(); + const int was = before.contains(id) ? before.at(id) : position; + const std::string colour = colours[match.at("home").at("id") == owner.at("team").at("id") ? 0 : 1]; + const auto count = [&](const char *key) { return cell(row.contains(key) && row.at(key).is_number_integer() ? std::to_string(row.at(key).get()) : "–", "w1"); }; + out += "
" + + cell(std::to_string(position), "w1") + + "" + (own ? std::string() : live_icon(position < was ? "up" : position > was ? "down" : "same", 22)) + "" + + "" + live_badge(row.at("team"), 40) + "" + esc(row.at("team").at("name").get()) + "" + + cell(std::to_string(row.at("played").get()), "w1") + (results ? count("won") + count("drawn") + count("lost") : std::string()) + + cell(std::to_string(row.at("gf").get()) + ":" + std::to_string(row.at("ga").get()), "w3") + + cell((difference > 0 ? "+" : "") + std::to_string(difference), "w2") + cell(std::to_string(row.at("points").get()), "w2") + "
"; } - return out + "
"; + return out; } if (live_tab_ == "tactics" && live_.running() && engine_live_tactics_.size() == 8) { - std::string out = "

" + live_text("Taktik in diesem Spiel") + "

"; + std::string out; for (size_t i = 0; i < engine_live_tactics_.size(); ++i) - out += "
" + live_text(engine_live_tactics_[i].at("label").get()) + - live_text(i == 0 && engine_live_assistant_ ? std::string("Assistent passt an") : live_tactic_value(i, engine_live_tactics_[i].at("value").get(), engine_live_tactics_[i].at("max").get())) + "
"; - return out + btn("live-intervene-tactics", "Taktik ändern", "", "id=\"live-tactics-edit\"") + "
"; + out += "
" + esc(engine_live_tactics_[i].at("label").get()) + "" + + esc(i == 0 && engine_live_assistant_ ? std::string("Assistent passt an") : live_tactic_value(i, engine_live_tactics_[i].at("value").get(), engine_live_tactics_[i].at("max").get())) + "
"; + return out + "
" + btn("live-intervene-tactics", "Taktik ändern", "mv-btn sm", "id=\"live-tactics-edit\"") + "
"; } if (live_tab_ == "tactics" && recorded) - return "

" + live_text("Taktik") + "

" + live_text("Dieser Spieltag wurde mit der Aufstellung und Taktik vom Schreibtisch gespielt. Eingriffe während des Spiels folgen mit dem Live-Modus.") + "

"; + return note("Dieser Spieltag wurde mit der Aufstellung und Taktik vom Schreibtisch gespielt."); if (live_tab_ == "tactics") { const auto state = live_owner_state(owner), board = demo_lineup_visible(state); Json points = Json::array(); const int count = fixture.at("field_count"); for (int i = 0; i < count; ++i) points.push_back(board.at("points")[size_t(i)]); - return "

" + live_text("Aktuelle Demoaufstellung") + "

" + live_text(std::to_string(count) + " Spieler auf dem Feld · unabhängige Manageransicht") + "

" + - picture(renderer_.diagram("live-formation", lineup_mini(points, theme_), 1200), 1140, 684) + "
" + - btn("live-intervene-tactics", "Taktik als Demo bearbeiten", "", "id=\"live-tactics-edit\" " + std::string(live_.finished() ? "disabled" : "")) + - "

" + live_text("Die Vorschau verändert weder diese feste Ereignisfolge noch Spiel- oder Saisonwerte.") + "

"; + return "

" + esc(std::to_string(count) + " Spieler auf dem Feld · unabhängige Manageransicht") + "

" + + picture(renderer_.diagram("live-formation", lineup_mini(points, theme_), 1200), 1140, 684) + + btn("live-intervene-tactics", "Taktik als Demo bearbeiten", "mv-btn sm", "id=\"live-tactics-edit\" " + std::string(live_.finished() ? "disabled" : "")) + "
"; } if (live_tab_ == "opponent" && recorded) { // the other matches of the day, own competition first; known once the day is played if (!live_.finished() || !fixture.contains("conference") || !fixture.at("conference").is_array() || fixture.at("conference").empty()) - return "

" + live_text(live_.finished() ? "An diesem Tag gab es keine weiteren Spiele." : "Die Ergebnisse der anderen Spiele stehen nach dem Abpfiff hier.") + "

"; + return note(live_.finished() ? "An diesem Tag gab es keine weiteren Spiele." : "Die Ergebnisse der anderen Spiele stehen nach dem Abpfiff hier."); const std::string own = match.value("competition", std::string()); std::vector order; std::map groups; @@ -132,56 +291,87 @@ std::string App::live_detail(const Json &owner, const Json &frame) { const std::string name = other.at("competition").value("name", std::string("Weitere Spiele")); if (!groups.contains(name)) order.push_back(name); const auto &result = other.at("result").at("final"); - groups[name] += "
" + - live_text(other.at("home").value("name", std::string()) + " – " + other.at("away").value("name", std::string()), "live-roster-name") + - live_text(std::to_string(result[0].get()) + ":" + std::to_string(result[1].get()), "live-roster-stat") + "
"; + Json home = other.at("home"), away = other.at("away"); + if (!home.contains("role")) home["role"] = "club"; + if (!away.contains("role")) away["role"] = "club"; + groups[name] += "
" + esc(home.value("name", std::string())) + "" + live_badge(home, 40) + + "" + std::to_string(result[0].get()) + " : " + std::to_string(result[1].get()) + "" + + live_badge(away, 40) + "" + esc(away.value("name", std::string())) + "
"; } std::stable_sort(order.begin(), order.end(), [&](const std::string &a, const std::string &b) { return (a == own) > (b == own); }); - std::string list = "
"; - for (const auto &name : order) - list += "
" + live_text(name, "live-roster-name") + live_text("", "live-roster-stat") + "
" + groups.at(name); - return list + "
"; + std::string list; + for (const auto &name : order) list += "
" + esc(pg_upper(name)) + "
" + groups.at(name); + return list; } std::string out; if (live_tab_ == "opponent") { const auto &opponent = match.at(owner.at("team").at("id") == match.at("home").at("id") ? "away" : "home"); - out = "

" + live_text(opponent.at("name")) + "

" + live_text(recorded ? "Gegner dieser Partie." : "Gegner dieser vorgegebenen Demopartie. Es werden keine unbekannten Gegneranweisungen behauptet.") + "

"; + return "

" + esc(pg_upper("Gegner")) + "

" + esc(opponent.at("name").get()) + "

"; } + const auto colours = live_colours(match); + out = "
" + live_badge(match.at("home"), 58) + "" + esc(match.at("home").at("name").get()) + + "
VERGLEICH
" + esc(match.at("away").at("name").get()) + "" + live_badge(match.at("away"), 58) + "
"; const std::array, 5> fields{{{"Tore", "score"}, {"Chancen", "chances"}, {"Gelbe Karten", "yellow"}, {"Rote Karten", "red"}, {"Spieler auf dem Feld", "players"}}}; for (const auto &[label, key] : fields) { const auto &pair = score.at(key); const int a = pair[0], b = pair[1]; const double percent = a + b ? 100.0 * a / (a + b) : 50; - out += "
" + live_text(std::to_string(a)) + live_text(label, "stat-title") + live_text(std::to_string(b)) + - "
"; + out += "
" + esc(pg_upper(label)) + "
" + std::to_string(a) + + "
" + (a + b ? "
" : std::string()) + + "
" + std::to_string(b) + "
"; } - return out + "

" + live_text(match.at("home").at("name").get() + " · " + match.at("away").at("name").get() + (recorded ? "" : " · vorgegebene Demowerte")) + "

"; + return out; } std::string App::live_dialog_markup(const Json &owner) { if (live_dialog_.empty()) return ""; const auto rows = live_owner_rows(owner); - std::string body = "

" + live_text(live_.running() ? (live_dialog_ == "lineup" ? "Aufstellung & Wechsel" : "Taktik") : live_dialog_ == "lineup" ? "Aufstellung & Wechsel · Demo" : "Taktik · Demo") + "

" + live_text(live_.running() ? owner.at("team").at("name").get() + " · Das Spiel steht, bis du entschieden hast." : "Nur lokale Vorschau für " + owner.at("name").get() + " · " + owner.at("team").at("name").get() + ". Keine Änderung an der Partie; der feste Spielverlauf bleibt unverändert.") + "

"; - if (live_dialog_ == "lineup") { - std::vector> active, bench; - for (size_t i = 0; i < rows.size(); ++i) (i < size_t(live_.fixture().at("field_count").get()) ? active : bench).emplace_back(rows[i].at("id"), rows[i].at("name")); - body += ""; - if (active.empty() || bench.empty()) body += "

" + live_text(live_.running() ? "Kein Wechselpaar verfügbar." : "Für diese Demokaderbasis ist kein Wechselpaar verfügbar.") + "

"; + const bool lineup = live_dialog_ == "lineup"; + const std::string team = owner.at("team").at("name").get(); + std::string body = "
" + esc(pg_upper(live_.running() ? team : team + " · Demo")) + "

" + + esc(lineup ? "Aufstellung & Wechsel" : "Taktik") + "

"; + std::string hint; + if (lineup) { + const size_t count = size_t(live_.fixture().at("field_count").get()); + std::string lists[2], names[2]; + for (size_t i = 0; i < rows.size(); ++i) { + const bool bench = i >= count; + const std::string id = rows[i].at("id").get(); + const bool chosen = id == (bench ? live_in_ : live_out_); + if (chosen) names[bench] = rows[i].at("name").get(); + const std::string strength = lineup_value(rows[i].value("strength", Json())), condition = lineup_value(rows[i].value("condition", Json())); + lists[bench] += btn(bench ? "live-pick-in" : "live-pick-out", + "" + std::to_string(i + 1) + "" + esc(live_position_text(rows[i].value("position", Json()))) + "" + + esc(rows[i].at("name").get()) + "" + esc(strength + " · " + condition) + "", + std::string("mv-pick") + (chosen ? " selected" : ""), + "id=\"live-pick-" + std::to_string(i) + "\" data-id=\"" + esc(id) + "\" aria-pressed=\"" + (chosen ? "true" : "false") + "\""); + } + for (auto &list : lists) if (list.empty()) list = "

" + esc("Niemand verfügbar.") + "

"; + body += "
VOM FELD
" + lists[0] + + "
VON DER ERSATZBANK
" + lists[1] + "
"; + hint = !names[0].empty() && !names[1].empty() ? names[1] + " kommt für " + names[0] + "." + : live_.running() ? "Wähle einen Spieler vom Feld und einen von der Bank. Das Spiel steht so lange." : "Nur lokale Vorschau; der feste Spielverlauf bleibt unverändert."; } else { const std::array names{"Defensiv / offensiv", "Pass-/Schussbild unten", "Pass-/Schussbild Mitte", "Pass-/Schussbild links", "Flache / hohe Bälle", "Flügelbild links", "Flügelbild rechts", "Einsatz"}; const bool engine_board = live_.running() && engine_live_tactics_.size() == 8; const auto &values = engine_board ? live_dialog_draft_.at("values") : live_dialog_draft_.at("tactics").at("values"); + body += "
"; for (size_t i = 0; i < names.size(); ++i) - body += "
" + live_text(engine_board ? engine_live_tactics_[i].at("label").get() : std::string(names[i])) + btn("live-tactic-cycle", engine_board ? live_tactic_value(i, values[i].get(), engine_live_tactics_[i].at("max").get()) : "Wert " + std::to_string(values[i].get()), "", "id=\"live-tactic-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"") + "
"; + body += btn("live-tactic-cycle", + "" + esc(engine_board ? engine_live_tactics_[i].at("label").get() : std::string(names[i])) + "" + + esc(engine_board ? live_tactic_value(i, values[i].get(), engine_live_tactics_[i].at("max").get()) : "Wert " + std::to_string(values[i].get())) + "›", + "mv-trow", "id=\"live-tactic-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\""); + body += "

" + esc((engine_board ? tactic_effect_text(size_t(std::clamp(last_tactic_, 0, 7))) + " " : std::string()) + "Ein Klick auf eine Zeile schaltet den Wert weiter.") + "

"; } - if (live_dialog_ == "tactics" && live_.running() && engine_live_tactics_.size() == 8) - body += "

" + live_text(tactic_effect_text(size_t(std::clamp(last_tactic_, 0, 7)))) + "

"; - body += "
" + btn("live-dialog-cancel", "Abbrechen", "", "id=\"live-dialog-cancel\"") + - btn("live-dialog-apply", live_.running() ? (live_dialog_ == "lineup" ? "Wechsel ausführen" : "Taktik übernehmen") : "Demovorschau anzeigen", "", "id=\"live-dialog-apply\" " + std::string(live_dialog_ == "lineup" && (live_out_.empty() || live_in_.empty()) ? "disabled" : "")) + "
"; - return "
" + body + "
"; + body += "
" + (hint.empty() ? std::string() : "" + esc(hint) + "") + btn("live-dialog-cancel", "Abbrechen", "mv-btn", "id=\"live-dialog-cancel\"") + + btn("live-dialog-apply", live_.running() ? (lineup ? "Wechsel ausführen" : "Taktik übernehmen") : "Demovorschau anzeigen", "mv-btn primary", + "id=\"live-dialog-apply\" " + std::string(lineup && (live_out_.empty() || live_in_.empty()) ? "disabled" : "")) + "
"; + return "
" + body + "
"; } std::string App::live_ticker_events(const Json &frame, size_t &shown) { const auto &fixture = live_.fixture(); const bool recorded = fixture.at("source") == "engine-recording"; const bool several = fixture.at("matches").size() > 1; + const bool dark = theme_ != "silver" && theme_ != "matchday"; + const std::string paper = dark ? "#2a2d34" : "#fffdf6"; shown = 0; std::string out; for (auto i = frame.at("events").rbegin(); i != frame.at("events").rend(); ++i) { @@ -191,20 +381,20 @@ std::string App::live_ticker_events(const Json &frame, size_t &shown) { if (live_filter_ == "yellow" && kind != "yellow" && kind != "red" && kind != "second_yellow") continue; if (live_filter_ == "highlights" && kind != "goal" && kind != "chance" && kind != "miss" && kind != "red" && kind != "second_yellow") continue; const auto &match = live_match_by_id(fixture.at("matches"), event.at("match_id")); - const bool whistle = kind == "kickoff" || kind == "interval" || kind == "fulltime"; + const bool whistle = kind == "kickoff" || kind == "interval" || kind == "fulltime" || kind == "restart"; const auto side = event.at("side").get(); - // one line per report: minute, what happened (a mark by kind), the club, the wording, the score - std::string row = "
()) + "\""; - if (kind == "goal") row += " style=\"border-left-color:" + live_colours(match)[side == "away" ? 1 : 0] + ";\""; - row += ">" + live_text(std::to_string(event.at("minute").get()) + "′", "live-event-time") + - "
" + - (whistle ? "
" : live_badge(match.at(side), 54)) + - "
" + - (several || !recorded ? live_text(match.at("home").at("name").get() + " – " + match.at("away").at("name").get(), "live-event-owners") : std::string()) + - "

" + live_text(event.at("headline")) + "

" + live_text(event.at("body")) + "

" + - live_text(live_score_text(event.at("score")), "live-event-score") + "
"; - out += row; + // one line per report: minute, what happened, the club, the wording, the score + std::string head_style; + if (kind == "goal") { + const std::string colour = live_colours(match)[side == "away" ? 1 : 0]; + if (mv_contrast(colour, paper) >= (dark ? 4.5 : 3)) head_style = " style=\"color:" + colour + ";\""; + } + out += "
()) + "\">" + + "" + std::to_string(event.at("minute").get()) + "′" + live_icon(whistle ? "time" : kind, 40) + "" + + (whistle ? std::string() : live_badge(match.at(side), 50)) + "
" + + (several || !recorded ? "" + esc(match.at("home").at("name").get() + " – " + match.at("away").at("name").get()) + "" : std::string()) + + "

" + esc(event.at("headline").get()) + "

" + esc(event.at("body").get()) + "

" + + std::to_string(event.at("score")[0].get()) + ":" + std::to_string(event.at("score")[1].get()) + "
"; ++shown; } if (!shown && recorded && live_filter_ == "all" && frame.at("events").empty()) { @@ -215,18 +405,18 @@ std::string App::live_ticker_events(const Json &frame, size_t &shown) { std::string columns; for (const auto *side : {"home", "away"}) { const auto names = match.at("lineups").value(side, Json()); - columns += "

" + live_text(match.at(side).at("name")) + "

"; + columns += "

" + esc(match.at(side).at("name").get()) + "

"; if (names.is_array() && !names.empty()) { size_t number = 0; - for (const auto &name : names) columns += "
" + live_text(std::to_string(++number), "live-roster-number") + live_text(name.get(), "live-roster-name") + "
"; - } else columns += "

" + live_text("Aufstellung nicht bekannt.") + "

"; + for (const auto &name : names) columns += "
" + std::to_string(++number) + "" + esc(name.get()) + "
"; + } else columns += "

" + esc("Aufstellung nicht bekannt.") + "

"; columns += "
"; } - out += "
" + columns + "
"; + out += "
" + columns + "
"; } if (!out.empty()) return out; } - if (!shown) out += "

" + live_text(recorded ? "Noch keine Meldungen." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "

"; + if (!shown) out += "

" + esc(frame.at("events").empty() ? "Noch ist nichts passiert." : "Keine Meldungen in dieser Auswahl.") + "

"; return out; } std::array App::live_colours(const Json &match) { @@ -248,7 +438,7 @@ std::array App::live_colours(const Json &match) { if (distance < 110) out[1] = "#3a4148"; return out; } -// One match on the stage: crests, the score plate in the clubs' colours, the clock, who is +// One match on the sheet: crests, the score tiles in the clubs' colours, the clock, who is // pressing, and the time line with every goal, card and injury so far. `layout` is solo // (one match), duo (two) or quad (three or four). std::string App::live_card(const Json &match, const Json &frame, const std::string &layout, size_t index) { @@ -257,46 +447,49 @@ std::string App::live_card(const Json &match, const Json &frame, const std::stri const auto &value = live_score_by_id(frame, match.at("id")); const int minute = frame.at("minute"), duration = std::max(1, fixture.value("duration", 90)); const auto colours = live_colours(match); - const bool quad = layout == "quad"; - const double crest = layout == "solo" ? 250 : layout == "duo" ? 190 : 110; + const bool quad = layout == "quad", solo = layout == "solo"; + const bool dark = theme_ != "silver" && theme_ != "matchday"; + const std::string ink = dark ? "#f0ece2" : "#2a211a", paper = dark ? "#2a2d34" : "#fffdf6"; const auto id = match.at("id").get(); - const double tw = layout == "solo" ? 2480 : 1180, th = quad ? 84 : 112, W = tw / th * 100; // the clock: a ring that fills with the minutes - const double turn = std::clamp(double(minute) / duration, 0.0, 1.0) * 289.03; - const auto ink = "#eef2f5"; - const std::string ring = ""; + const double round = 2 * 3.14159265 * 13, turn = std::clamp(double(minute) / duration, 0.0, 1.0) * round; + const std::string ring = ""; - // who is pressing: goals and chances of the last ten minutes - int press[2] = {0, 0}; // the time line: grass in bands of fifteen minutes, the home side's marks above, the guests' below + const double W = solo ? 868 : 421, H = quad ? 34 : 76, y0 = quad ? 10 : 22, sh = quad ? 14 : 32, away_y = y0 + sh + (quad ? 5 : 12), home_y = y0 - (quad ? 5 : 12); + const auto X = [&](double at) { return 10 + at / duration * (W - 20); }; + int press[2] = {0, 0}; std::string marks, bands; for (int from = 0; from < duration; from += 15) - bands += ""; + bands += ""; for (const auto &event : frame.at("events")) { if (event.at("match_id") != match.at("id")) continue; const auto kind = event.value("kind", std::string()); const size_t side = event.value("side", std::string("home")) == "away" ? 1 : 0; const int at = event.at("minute").get(); - if ((kind == "goal" || kind == "chance" || kind == "miss") && at > minute - 10) ++press[side]; - const double x = std::clamp(at * W / duration, 12.0, W - 12), y = side ? 86 : 14; + if ((kind == "goal" || kind == "chance" || kind == "miss") && at > minute - 10) press[side] += kind == "goal" ? 3 : 1; + const double x = X(std::clamp(at, 0, duration)), y = side ? away_y : home_y; if (kind == "goal") - marks += "" - ""; + marks += ""; else if (kind == "yellow" || kind == "red" || kind == "second_yellow") - marks += ""; - else if (kind == "injury") - marks += ""; + marks += ""; + else if (kind == "injury") { + const double arm = quad ? 3.5 : 5.5; + marks += ""; + } } - const double now = std::clamp(minute * W / duration, 0.0, W); - const std::string timeline = "" + bands + - "" - "" - "" + marks + - (live_.finished() ? std::string() : "") + ""; + const double now = X(std::clamp(minute, 0, duration)); + const std::string timeline = "" + bands + + "" + + "" + + (live_.finished() || minute < 1 ? std::string() : "") + marks + ""; const int total = press[0] + press[1]; const double share = total ? 100.0 * press[0] / total : 50; @@ -304,27 +497,33 @@ std::string App::live_card(const Json &match, const Json &frame, const std::stri const std::string status = live_.finished() ? "Abpfiff" : phase == "interval" ? "Halbzeit" : minute < 1 ? "Anpfiff" : std::to_string(minute) + "′"; std::string names; for (const auto &owner_id : match.at("owners")) for (const auto &person : fixture.at("owners")) if (person.at("id") == owner_id) { if (!names.empty()) names += " · "; names += person.at("name").get(); } + const bool several = fixture.at("owners").size() > 1; + const std::string competition = recorded ? match.value("competition", std::string("Spieltag")) : std::string("Demospiel"); + const double crest = solo ? 86 : quad ? 34 : 50; + const auto team = [&](size_t side) { + const auto &club = match.at(side ? "away" : "home"); + const int players = value.at("players")[side].get(); + return "
" + live_badge(club, crest * 2.25) + "
" + esc(club.at("name").get()) + + "" + + esc(std::string(side ? "Gast" : "Heim") + (players < int(fixture.value("field_count", 11)) ? " · " + std::to_string(players) + " Spieler" : std::string())) + "
"; + }; + const auto tile = [&](size_t side) { + return "
" + std::to_string(value.at("score")[side].get()) + "
"; + }; - std::string out = "
" + team(1) + "
" + picture(renderer_.diagram("live-line-" + std::to_string(index), timeline, 2048), W * 2.25, H * 2.25); + if (!quad) + for (int at = 15; at < duration; at += 15) + if (at * 2 != duration) out += "" + std::to_string(at) + "′"; + out += "
"; // a goal that has just fallen: a banner across this card, once if (minute == 0) live_moment_.clear(); // a new match day: its banners are new again @@ -345,10 +544,12 @@ std::string App::live_card(const Json &match, const Json &frame, const std::stri const bool fresh = live_moment_.find(mark) == std::string::npos; if (fresh) live_moment_ += mark; const size_t side = goal->value("side", std::string("home")) == "away" ? 1 : 0; - out += "
" + - live_badge(match.at(side ? "away" : "home"), layout == "solo" ? 200 : quad ? 96 : 150) + - "
TOR!" + live_text(goal->value("headline", std::string()), "live-moment-text") + "
" + - live_text(live_score_text(goal->at("score")), "live-moment-score") + "
"; + const std::string scorer = goal->contains("player") && goal->at("player").is_object() ? goal->at("player").value("name", std::string()) : std::string(); + const std::string club = match.at(side ? "away" : "home").at("name").get(); + out += "
" + + live_badge(match.at(side ? "away" : "home"), (solo ? 92 : quad ? 44 : 58) * 2.25) + + "
TOR!" + esc(scorer.empty() ? goal->value("headline", std::string()) : scorer + " trifft für " + club) + "
" + + esc(live_score_text(goal->at("score"))) + "
"; } } return out + ""; @@ -366,38 +567,79 @@ std::string App::render_live() { const size_t count = fixture.at("matches").size(); const std::string layout = count == 1 ? "solo" : count == 2 ? "duo" : "quad"; const auto phase_text = live_.finished() ? "Beendet" : phase == "interval" ? "Halbzeit" : live_.speed() ? (recorded ? (phase == "extra_time" ? "Verlängerung" : phase == "shootout" ? "Elfmeterschießen" : "Spiel läuft") : "Aufzeichnung läuft") : (recorded ? "Pausiert" : "Gemeinsam pausiert"); - const auto arrow = [&](bool right) { const auto color = theme_ == "silver" ? "#376b84" : theme_ == "matchday" ? "#efb2aa" : "#b5dbd2"; return picture(renderer_.diagram(right ? "live-arrow-right" : "live-arrow-left", "", 72), 36, 36); }; + const bool indoor = live_indoor(); + const std::string title = fixture.at("role") == "national" ? "Länderspiel" : indoor ? "Hallenturnier" : recorded && count == 1 ? fixture.at("matches").front().value("competition", std::string("Spieltag")) : std::string("Spieltag"); + const auto tab = [](const char *action, const std::string &id, const std::string &text, bool selected, const std::string &prefix) { + return btn(action, text, std::string("mv-tab") + (selected ? " selected" : ""), "id=\"" + prefix + id + "\" data-id=\"" + id + "\" aria-pressed=\"" + (selected ? "true" : "false") + "\""); + }; - // a sheet in the menus' 4:3 format on the darkened stadium: the stage with one card per - // match of a human manager on top, the ticker and the manager's squad below, the controls at the foot - std::string out = "
()) + "\">"; - out += "

" + live_text(fixture.at("role") == "national" ? "Länderspiel" : fixture.at("surface") == "indoor" ? "Hallenturnier" : recorded && count == 1 ? fixture.at("matches").front().value("competition", std::string("Spieltag")) : std::string("Spieltag")) + "

" + - live_text(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "
"; - out += "
"; + // an open match sheet in front of the stadium: on the left page the cards of the human + // managers' matches and the ticker, on the right the ground, the weather and the manager's + // team; the controls run along the foot + std::string out = "
()) + "\">"; + out += "
" + esc(pg_upper("Spieltag · Textmodus")) + "

" + esc(title) + "

" + + esc(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("Demo · vorgegebene Ergebnisse")) + "
"; + out += "
"; size_t index = 0; for (const auto &match : fixture.at("matches")) out += live_card(match, frame, layout, index++); - out += "

" + live_text("Ticker") + "

"; + out += btn("live-coverage", text, live_coverage_ == id ? "selected" : "", "id=\"live-coverage-" + std::string(id) + "\" data-id=\"" + id + "\" aria-pressed=\"" + (live_coverage_ == id ? "true" : "false") + "\""); + out += "
"; + } + out += "
"; size_t shown = 0; out += live_ticker_events(frame, shown); - out += "
" + esc(recorded && !shown ? std::string() : std::to_string(shown) + (recorded ? (shown == 1 ? " Meldung" : " Meldungen") : " Meldungen · feste Aufzeichnung")) + "" + esc(phase_text) + "
"; - out += "
" + esc(std::to_string(shown) + (shown == 1 ? " Meldung" : " Meldungen")) + "" + esc(phase_text) + "
"; + + // the right page: the ground and the weather, then the manager's team + out += ""; - out += "
" + btn("live-back", live_.running() ? "Zu Ende spielen" : recorded ? "Zum Schreibtisch" : "Zum Desktop", "", "id=\"live-back\"") + btn("live-pause", live_.speed() ? "Pause" : "Abspielen", "", "id=\"live-pause\" " + std::string(live_.finished() ? "disabled" : "")) + "
"; - out += "
" + live_text("Tempo") + "" + esc(live_.finished() ? "Ende" : live_.speed() ? std::to_string(live_.speed()) + "×" : "Pause") + "
"; - if (live_.running()) - out += "
" + btn("live-halt", "Zur Halbzeit anhalten", live_halt_interval_ ? "selected" : "", "id=\"live-halt-interval\" data-id=\"interval\" aria-pressed=\"" + std::string(live_halt_interval_ ? "true" : "false") + "\"") + - btn("live-halt", "Bei Rückstand anhalten", live_halt_behind_ ? "selected" : "", "id=\"live-halt-behind\" data-id=\"behind\" aria-pressed=\"" + std::string(live_halt_behind_ ? "true" : "false") + "\"") + "
"; - out += "" + esc(live_feedback_.empty() ? (recorded ? std::string() : std::string(phase_text) + " · " + std::to_string(minute) + "′ · keine Spielwertänderung") : live_feedback_) + "" + - btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? "Zur Auswertung" : live_.running() ? "Nächste Minute" : "Nächste Meldung", "primary", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "
"; + out += btn("live-owner-prev", "‹", "mv-ic", "id=\"live-owner-prev\" aria-label=\"Vorheriger Manager\"") + btn("live-owner-next", "›", "mv-ic", "id=\"live-owner-next\" aria-label=\"Nächster Manager\""); + out += "
" + live_detail(owner, frame) + "
" + + esc(live_.running() ? "Das Spiel steht, solange du eingreifst." : "") + "" + + btn("live-intervene-lineup", "Aufstellung & Wechsel", "mv-btn sm", "id=\"live-lineup-edit\" " + std::string(live_.finished() || (recorded && !live_.running()) ? "disabled" : "")) + "
"; + + out += "
" + btn("live-back", live_.running() ? "Zu Ende spielen" : recorded ? "Zum Schreibtisch" : "Zum Desktop", "mv-btn", "id=\"live-back\"") + + btn("live-pause", live_.speed() ? "Pause" : "Abspielen", "mv-btn play", "id=\"live-pause\" " + std::string(live_.finished() ? "disabled" : "")); + out += "
"; + for (int step = 0; step <= 4; ++step) + out += btn("live-speed-set", step ? std::to_string(step) + "×" : std::string("II"), live_.speed() == step ? "selected" : "", + "id=\"live-speed-" + std::to_string(step) + "\" data-id=\"" + std::to_string(step) + "\" aria-pressed=\"" + (live_.speed() == step ? "true" : "false") + "\" aria-label=\"" + + (step ? "Tempo " + std::to_string(step) : std::string("Pause")) + "\" " + (live_.finished() ? "disabled" : "")); + out += "
"; + if (live_.running()) { + const auto halt = [](const char *id, const char *label, bool on) { + return btn("live-halt", "" + std::string(label) + "", std::string("mv-sw") + (on ? " selected" : ""), + "id=\"live-halt-" + std::string(id) + "\" data-id=\"" + id + "\" aria-pressed=\"" + (on ? "true" : "false") + "\""); + }; + out += halt("interval", "Zur Halbzeit anhalten", live_halt_interval_) + halt("behind", "Bei Rückstand anhalten", live_halt_behind_); + } + out += "" + esc(live_feedback_.empty() ? (recorded ? std::string() : std::string(phase_text) + " · " + std::to_string(minute) + "′ · keine Spielwertänderung") : live_feedback_) + "" + + btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? "Zur Auswertung" : live_.running() ? "Nächste Minute" : "Nächste Meldung", "mv-btn primary", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "
"; return out + live_dialog_markup(owner) + ""; } void App::live_after_render() { @@ -407,7 +649,7 @@ void App::live_after_render() { if (auto *node = element("live-ticker")) node->SetScrollTop(live_ticker_scroll_); if (auto *node = element("live-detail-body")) node->SetScrollTop(live_detail_scroll_); if (!live_dialog_.empty()) { - Rml::ElementList controls; doc_->QuerySelectorAll(controls, "#live-underlay button,#live-speed,.live-bottom button"); + Rml::ElementList controls; doc_->QuerySelectorAll(controls, "#live-underlay button,#live-stage .mv-bar button"); for (auto *node : controls) { node->SetProperty("pointer-events", "none"); node->SetAttribute("tabindex", "-1"); } } } @@ -432,7 +674,7 @@ void App::live_update_parts() { name->SetInnerRML(esc(owner.at("name").get())); body->SetInnerRML(live_detail(owner, frame)); body->SetScrollTop(0); live_detail_scroll_ = 0; live_reset_detail_ = false; - Rml::ElementList tabs; doc_->QuerySelectorAll(tabs, "#live-detail .live-tabs button"); + Rml::ElementList tabs; doc_->QuerySelectorAll(tabs, "#live-detail .mv-tab"); for (auto *tab : tabs) { const bool selected = tab->GetAttribute("data-id", "") == live_tab_; tab->SetClass("selected", selected); tab->SetAttribute("aria-pressed", selected ? "true" : "false"); @@ -443,11 +685,14 @@ void App::live_update_parts() { auto *list = element("live-ticker"); auto *count = element("live-event-count"); if (!list || !count) { refresh(); return; } size_t shown = 0; list->SetInnerRML(live_ticker_events(frame, shown)); - count->SetInnerRML(esc(std::to_string(shown) + (live_.fixture().at("source") == "engine-recording" ? (shown == 1 ? " Meldung" : " Meldungen") : " Meldungen · feste Aufzeichnung"))); + count->SetInnerRML(esc(std::to_string(shown) + (shown == 1 ? " Meldung" : " Meldungen"))); list->SetScrollTop(0); live_ticker_scroll_ = 0; live_reset_ticker_ = false; - Rml::ElementList filters; doc_->QuerySelectorAll(filters, ".live-filters button"); + Rml::ElementList filters; doc_->QuerySelectorAll(filters, "#live-filters .mv-tab"); for (auto *filter : filters) - filter->SetClass("selected", filter->GetAttribute("data-id", "") == live_filter_); +{ + const bool selected = filter->GetAttribute("data-id", "") == live_filter_; + filter->SetClass("selected", selected); filter->SetAttribute("aria-pressed", selected ? "true" : "false"); + } ++live_ticker_updates_; } live_detail_pending_ = live_ticker_pending_ = false; diff --git a/src/modern/ui/live_state.inc b/src/modern/ui/live_state.inc index 8ab7ac4..058455e 100644 --- a/src/modern/ui/live_state.inc +++ b/src/modern/ui/live_state.inc @@ -20,6 +20,13 @@ std::string live_detail(const Json &owner, const Json &frame); std::string live_dialog_markup(const Json &owner); std::string live_badge(const Json &, double); + std::string live_icon(const std::string &kind, double size); + std::string live_weather_icon(int code, double size); + // the stadium picture behind the match sheet, by the crowd and the weather ("" = none) + std::string live_backdrop() const; + bool live_indoor() const; + // the manager whose team the right page shows follows the chosen match, and the other way round + void live_follow_match(); // the two club colours of a match (home, away), far enough apart to tell the sides std::array live_colours(const Json &match); std::string live_card(const Json &match, const Json &frame, const std::string &layout, size_t index); diff --git a/src/modern/ui/view.cpp b/src/modern/ui/view.cpp index aa5a044..d7ef423 100644 --- a/src/modern/ui/view.cpp +++ b/src/modern/ui/view.cpp @@ -432,6 +432,7 @@ class App final : public Rml::EventListener { // A menu window (2720 x 2040 at the middle of the stage) is shown as large as the screen // allows; the desk behind it is cropped. Without a window the whole stage is fitted. bool window_zoom_ = false; + bool match_stage_ = false; // the stage shows the match sheet: it may reach a little past the window's edge bool entry_stage_ = false; // the stage shows the table of the entry: it fills the window std::string scene_ = "main", menu_, theme_ = "silver", active_mod_, selected_mod_, notice_, country_ = "nation:de", league_, @@ -1082,14 +1083,16 @@ class App final : public Rml::EventListener { // Called after the stage was rebuilt: zoom in when it now shows a menu window. void sync_window_zoom() { // a page of the notebook is no window: the book keeps the whole stage - const bool wanted = (doc_->QuerySelector(".window") != nullptr && doc_->QuerySelector(".nb-sheet") == nullptr) || doc_->QuerySelector(".live-stage") != nullptr; + const bool wanted = doc_->QuerySelector(".window") != nullptr && doc_->QuerySelector(".nb-sheet") == nullptr; + const bool match = doc_->QuerySelector(".mv-stage") != nullptr; if (!wanted) window_shown_ = "\x01"; // the career's desk hangs from the top edge of a taller screen, so its bar is the // screen's bar and the spare height shows the stadium below const bool entry = doc_->QuerySelector(".es-stage") != nullptr; const bool desk = !wanted && !entry && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub"); - if (wanted == window_zoom_ && desk == desk_top_ && entry == entry_stage_) return; + if (wanted == window_zoom_ && desk == desk_top_ && entry == entry_stage_ && match == match_stage_) return; entry_stage_ = entry; + match_stage_ = match; window_zoom_ = wanted; desk_top_ = desk; resize(); @@ -1102,6 +1105,8 @@ class App final : public Rml::EventListener { return; scale_ = std::min(double(pw) / 3840, double(ph) / 2160); if (window_zoom_) scale_ = std::max(scale_, std::min(double(pw) / 2760, double(ph) / 2080)); + // the match sheet with a margin (1640 x 928 units of 2.25dp about the middle) fills the window + if (match_stage_) scale_ = std::min(double(pw) / 3690, double(ph) / 2088); // the table of the entry fills the window; its pad (930 x 690 units about the middle) stays whole if (entry_stage_) scale_ = std::min({std::max(double(pw) / 3840, double(ph) / 2160), double(pw) / (930 * kEntryUnit), double(ph) / (690 * kEntryUnit)}); canvas_left_ = (pw - 3840 * scale_) / 2; @@ -1271,11 +1276,13 @@ class App final : public Rml::EventListener { } } const auto size = context_->GetDimensions(); + // behind the match sheet lies a stadium that suits the crowd and the weather + const std::string ground = live_backdrop(); const auto background = - img("background", size.x / scale_, size.y / scale_, false, true, 2048); + img(ground.empty() ? "background" : ground, size.x / scale_, size.y / scale_, false, true, ground.empty() ? 2048 : 2400); element("background")->SetInnerRML(background); element("background") - ->SetProperty("filter", scene_ == "main" ? "none" + ->SetProperty("filter", !ground.empty() ? "brightness(0.78)" : scene_ == "main" ? "none" : theme_ == "silver" ? "saturate(0.2) brightness(0.9)" : theme_ == "matchday"