The match day is an open match sheet in front of a stadium that suits the crowd and the weather

The live view follows the new design: match cards with score tiles in the clubs'
colours, the ticker and the manager's team on two pages, speed as five buttons,
substitutions picked from two lists. The colours are the notebook's, so the skins
apply. Twenty-four stadium pictures are chosen by attendance and weather picture.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-16 21:23:27 +01:00
1 parent abbd4afe70
commit 79b0a75c14
31 files changed
+921 -447

No files matched your search

+240
View File
@@ -341,6 +341,246 @@
1, 1,
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
]
} }
} }
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

+226 -261
View File
@@ -1,264 +1,229 @@
/* SPDX-License-Identifier: GPL-3.0-only */ /* SPDX-License-Identifier: GPL-3.0-only */
/* Selected text-only Gold layout in the existing 3840x2160 logical canvas. */ /* (No shadow under the sheet: where it reaches past the window's edge it is drawn as paper.) */
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;} /* The match day in text mode: an open match sheet (two pages) in front of the stadium.
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;} Written in design units (1 unit = 2.25dp); the colours are the notebook's, so the skins apply. */
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;}
.live-badge {display:flex;align-items:center;justify-content:center;flex-shrink:0;} .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;} .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);}
.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;} .mv-stage h1,.mv-stage h2,.mv-stage h3,.mv-stage p {margin:0;font-weight:normal;}
.live-panel-heading h2 {display:block;min-width:0;flex:1;font-size:42dp;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);}
.live-small {display:block;font-size:28dp;color:var(--live-muted);} .mv-stage button:disabled,.mv-stage button[disabled] {opacity:0.45;}
.live-filters {display:flex;align-items:center;gap:14dp;padding:18dp 32dp;border-bottom:2dp var(--live-line);flex-shrink:0;} .mv-stage button .control-label {display:block;white-space:nowrap;}
.live-filters button {height:64dp;padding:0 24dp;font-size:30dp;} .mv-k {display:block;font-size:23.63dp;line-height:31.5dp;letter-spacing:3.15dp;font-weight:bold;color:var(--p-a7);}
.live-event-list {display:block;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;} .mv-mut {color:var(--p-n7);}
.live-event {display:flex;align-items:flex-start;gap:24dp;padding:30dp 40dp;border-bottom:2dp var(--live-line);} .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);}
.live-event.is-goal {background-color:var(--live-selected);} .mv-head .ttl {display:block;min-width:0;}
.live-event-time {display:block;width:116dp;flex-shrink:0;color:var(--live-muted);font-size:31dp;line-height:1.5;} .mv-head h1 {display:block;font-family:Display;font-size:60.75dp;line-height:67.5dp;white-space:nowrap;}
.live-event-copy {display:block;flex:1;min-width:0;} .mv-date {display:block;flex:none;font-family:Display;font-size:40.5dp;line-height:54dp;white-space:nowrap;}
.live-event-copy h3 {display:block;width:100%;font-size:38dp;font-weight:normal;line-height:1.25;} .mv-body {display:flex;flex:1;min-height:0;gap:112.5dp;}
.live-event-copy p {display:block;width:100%;font-size:32dp;line-height:1.4;color:var(--live-muted);margin-top:12dp;} .mv-left {display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:27dp;}
.live-event-owners {display:block;color:var(--live-accent);font-size:28dp;margin-bottom:10dp;} .mv-right {display:flex;flex-direction:column;flex:none;width:1251dp;min-height:0;gap:22.5dp;}
.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;}
/* the goal banner lies above everything on its card and keeps its three parts in one row */ /* match cards */
.live-moment {z-index:6;padding:0 48dp;gap:40dp;overflow:hidden;top:112dp;height:230dp;} .mv-cards {display:flex;flex:none;flex-wrap:wrap;gap:22.5dp;height:589.5dp;}
.live-moment>.live-badge {flex-shrink:0;} 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;}
.live-moment>.live-moment-copy {flex:1;min-width:0;text-align:left;} .mv-stage button.mv-card.duo {width:1001.25dp;padding:22.5dp 27dp 18dp;}
.live-moment strong {font-size:72dp;line-height:84dp;} .mv-stage button.mv-card.quad {width:1001.25dp;height:283.5dp;padding:15.75dp 27dp 13.5dp;}
.live-moment-text {font-size:32dp;line-height:40dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .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);}
.live-moment-score {flex-shrink:0;white-space:nowrap;font-family:Display;font-size:96dp;} .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);}
.live-game.solo .live-moment {top:120dp;height:260dp;padding:0 120dp;} .mv-chead {display:flex;flex:none;justify-content:space-between;align-items:center;gap:22.5dp;height:36dp;white-space:nowrap;}
.live-game.solo .live-moment strong {font-size:96dp;line-height:108dp;} .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;}
.live-game.solo .live-moment-text {font-size:38dp;line-height:48dp;} .mv-chead .r {display:block;flex:none;font-size:24.75dp;color:var(--p-n7);}
.live-game.solo .live-moment-score {font-size:132dp;} .mv-chead .r.now {font-size:27dp;font-weight:bold;color:var(--p-text);}
.live-game.quad .live-moment {top:44dp;height:150dp;gap:24dp;padding:0 28dp;} .mv-score {display:flex;flex:1;min-height:0;align-items:center;gap:40.5dp;}
.live-game.quad .live-moment strong {font-size:48dp;line-height:56dp;} .mv-team {display:flex;flex:1;min-width:0;align-items:center;gap:31.5dp;}
.live-game.quad .live-moment-text {font-size:26dp;line-height:32dp;} .mv-team.a {flex-direction:row-reverse;}
.live-game.quad .live-moment-score {font-size:64dp;} .mv-team-nm {display:block;flex:1;min-width:0;}
.live-moment {height:284dp;} .mv-team.a .mv-team-nm {text-align:right;}
.live-game.solo .live-moment {height:340dp;} .mv-team-nm .n {display:block;font-family:Display;font-size:56.25dp;line-height:63dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.live-game.quad .live-moment {height:150dp;} .mv-team-nm .bar {display:block;height:11.25dp;border-radius:6.75dp;margin:15.75dp 0 13.5dp;}
.live-game.solo .live-moment {top:92dp;height:372dp;} .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;}
+4 -2
View File
@@ -242,8 +242,10 @@ void App::engine_render() {
for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); } for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); }
} }
const auto size = context_->GetDimensions(); const auto size = context_->GetDimensions();
element("background")->SetInnerRML(img("background", size.x / scale_, size.y / scale_, false, true, 2048)); // behind the match sheet lies a stadium that suits the crowd and the weather
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)"); 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()) { if (!contracts_dialog_.empty()) {
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#contracts-underlay button,.contracts-actions button,#window-close"); 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"); } for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); }
+30 -22
View File
@@ -274,19 +274,16 @@ void App::live_set_speed(int value) {
if (!live_.speed(value)) return; if (!live_.speed(value)) return;
live_feedback_.clear(); live_feedback_.clear();
live_last_tick_ = SDL_GetTicks64(); live_last_tick_ = SDL_GetTicks64();
if (auto *node = dynamic_cast<Rml::ElementFormControl *>(element("live-speed"))) { refresh();
node->SetValue(std::to_string(value)); node->SetAttribute("aria-valuenow", value); }
node->SetAttribute("aria-valuetext", value ? "Wiedergabe Stufe " + std::to_string(value) : "Pause"); void App::live_follow_match() {
} for (const auto &owner : live_.fixture().at("owners"))
if (auto *node = element("live-speed-value")) node->SetInnerRML(esc(value ? std::to_string(value) + "×" : "Pause")); if (owner.at("match_id") == live_selected_match_) {
if (auto *node = element("live-pause")) node->SetInnerRML(live_text(value ? "Pause" : "Abspielen", "control-label")); // the manager on the right page already plays in this match: he stays
const auto &frame = live_.fixture().at("frames")[live_.sequence()]; const auto shown = live_owner();
const bool recorded = live_.fixture().at("source") == "engine-recording"; if (!shown.is_object() || shown.at("match_id") != live_selected_match_) { live_.owner(owner.at("id").get<std::string>()); live_reset_detail_ = true; }
if (recorded) { if (auto *node = element("live-playback-status")) node->SetInnerRML(""); return; } 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<int>()) + (recorded ? "′" : "′ · keine Spielwertänderung")));
dirty_ = true;
} }
void App::live_tick() { void App::live_tick() {
if (engine_live_busy_) engine_live_poll(); 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; if (scene_ != "live" || !live_.available()) return true;
const auto id = target ? target->GetAttribute<Rml::String>("data-id", "") : ""; const auto id = target ? target->GetAttribute<Rml::String>("data-id", "") : "";
bool detail_only = false, ticker_only = false; 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-back") { live_close(); return true; }
if (action == "live-owner-prev" || action == "live-owner-next") { if (action == "live-owner-prev" || action == "live-owner-next") {
if (!live_.cycle_owner(action == "live-owner-prev" ? -1 : 1)) return true; 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<std::string>();
live_reset_detail_ = live_reset_ticker_ = true;
} else if (action == "live-tab") { } else if (action == "live-tab") {
if (id != "team" && id != "tactics" && id != "opponent" && id != "table" && id != "stats") return true; if (id != "team" && id != "tactics" && id != "opponent" && id != "table" && id != "stats") return true;
if (live_tab_ == id) 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; live_coverage_ = id; live_reset_ticker_ = true;
} else if (action == "live-match") { } else if (action == "live-match") {
for (const auto &match : live_.fixture().at("matches")) if (match.at("id") == id) { 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") { } else if (action == "live-match-prev" || action == "live-match-next") {
const auto &matches = live_.fixture().at("matches"); 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; (id == "interval" ? live_halt_interval_ : live_halt_behind_) ^= true;
focus_after_render_ = target->GetId(); focus_after_render_ = target->GetId();
} else if (action == "live-pause") { } 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()) { } else if (action == "live-review" && live_.finished()) {
postmatch_open();return true; postmatch_open();return true;
} else if (action == "live-review-back") { } 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_dialog_ = action == "live-intervene-lineup" ? "lineup" : "tactics";
live_resume_speed_ = live_.speed(); live_.speed(0); live_last_tick_ = SDL_GetTicks64(); live_resume_speed_ = live_.speed(); live_.speed(0); live_last_tick_ = SDL_GetTicks64();
live_out_.clear(); live_in_.clear(); 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"; focus_after_render_ = "live-dialog-cancel";
} else if (action == "live-dialog-cancel" || action == "live-dialog-apply") { } else if (action == "live-dialog-cancel" || action == "live-dialog-apply") {
live_dialog_close(action == "live-dialog-apply"); return true; live_dialog_close(action == "live-dialog-apply"); return true;
@@ -478,8 +482,11 @@ bool App::live_event(Rml::Event &event) {
} }
event.StopImmediatePropagation(); return true; event.StopImmediatePropagation(); return true;
} }
if (live_dialog_.empty() && key == Rml::Input::KI_P && !live_.finished()) { if (live_dialog_.empty() && (key == Rml::Input::KI_P || key == Rml::Input::KI_SPACE) && !live_.finished()) {
live_set_speed(live_.speed() ? 0 : 1); event.StopImmediatePropagation(); return true; 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)) { 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)); 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")) { 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<Rml::String>("data-live-match", ""); live_selected_match_ = node->GetAttribute<Rml::String>("data-live-match", "");
live_follow_match();
if (live_coverage_ == "single") live_reset_ticker_ = true; if (live_coverage_ == "single") live_reset_ticker_ = true;
refresh(); return true; refresh(); return true;
} }
+403 -158
View File
@@ -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; for (const auto &row : rows) if (row.at("id") == id) return row;
throw editor::Error("live_match_unavailable"); 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<std::string>();
for (auto &c : code) c = char(std::toupper(static_cast<unsigned char>(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) { 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; for (const auto &row : frame.at("matches")) if (row.at("match_id") == id) return row;
throw editor::Error("live_score_unavailable"); 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); if (art.empty()) art = glyph(team.value("role", "club") == "national" ? "world" : "shirt", size);
return "<div class=\"live-badge\" style=\"width:" + scalar(size) + "dp;height:" + scalar(size) + "dp;\">" + art + "</div>"; return "<div class=\"live-badge\" style=\"width:" + scalar(size) + "dp;height:" + scalar(size) + "dp;\">" + art + "</div>";
} }
// 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 = "<circle cx='10' cy='10' r='8.4' fill='" + paper + "' stroke='" + ink + "' stroke-width='1.6'/><path d='M10 5.7l4 2.9-1.5 4.7h-5L6 8.6z' fill='" + ink + "'/>";
else if (kind == "chance" || kind == "save")
g = "<path d='M3 16V5h14v11' fill='none' stroke='" + ink + "' stroke-width='2'/><circle cx='10' cy='12' r='2.6' fill='#c67139'/>";
else if (kind == "miss")
g = "<path d='M3 17V8h10v9' fill='none' stroke='#8a8072' stroke-width='2'/><circle cx='16.5' cy='4.5' r='2.4' fill='#8a8072'/>";
else if (kind == "yellow")
g = "<rect x='5.5' y='2.5' width='9' height='14' rx='1.5' fill='#e9c53a' stroke='#2a211a' stroke-width='1.2'/>";
else if (kind == "second_yellow")
g = "<rect x='3' y='2.5' width='8.5' height='13' rx='1.5' fill='#e9c53a' stroke='#2a211a' stroke-width='1.2'/><rect x='8.5' y='5' width='8.5' height='13' rx='1.5' fill='#c8372d' stroke='#2a211a' stroke-width='1.2'/>";
else if (kind == "red")
g = "<rect x='5.5' y='2.5' width='9' height='14' rx='1.5' fill='#c8372d' stroke='#2a211a' stroke-width='1.2'/>";
else if (kind == "injury")
g = "<path d='M7.5 2.5h5v5h5v5h-5v5h-5v-5h-5v-5h5z' fill='#c8372d'/>";
else if (kind == "up")
g = "<path d='M10 4l7 12H3z' fill='#3f7a35'/>";
else if (kind == "down")
g = "<path d='M10 16L3 4h14z' fill='#b8402f'/>";
else if (kind == "same")
g = "<circle cx='10' cy='10' r='4' fill='#b9ae9a'/>";
else if (kind == "substitution")
g = "<path d='M6 17V6M2.5 9.5L6 6l3.5 3.5' fill='none' stroke='#56874a' stroke-width='2.2'/><path d='M14 3v11M10.5 10.5L14 14l3.5-3.5' fill='none' stroke='#c8372d' stroke-width='2.2'/>";
else
g = "<circle cx='10' cy='10' r='7.5' fill='none' stroke='" + ink + "' stroke-width='1.8'/><path d='M10 5.5V10l3 2' fill='none' stroke='" + ink + "' stroke-width='1.8'/>";
return picture(renderer_.diagram("mv-icon-" + kind + (dark ? "-d" : "-l"), "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>" + g + "</svg>", 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 = "<circle cx='14' cy='14' r='6' fill='#e9b53a'/><g stroke='#e9b53a' stroke-width='2' stroke-linecap='round'><path d='M14 2.5v3M14 22.5v3M2.5 14h3M22.5 14h3M5.9 5.9l2.1 2.1M20 20l2.1 2.1M5.9 22.1L8 20M20 8l2.1-2.1'/></g>";
const auto cloud = [](const char *colour) { return std::string("<path d='M12 31a7 7 0 0 1 .6-14 9 9 0 0 1 17.3 2A6 6 0 0 1 29 31z' fill='") + colour + "'/>"; };
std::string g;
if (code <= 0) g = "<g transform='translate(6 6)'>" + sun + "</g>";
else if (code == 1) g = "<g transform='translate(0 -1) scale(.85)'>" + sun + "</g>" + cloud("#cfc7b8");
else if (code <= 3) g = cloud("#b9b1a3");
else if (code <= 5) g = cloud("#9aa3a8") + "<g stroke='#5b86a8' stroke-width='2' stroke-linecap='round'><path d='M14 33l-1.5 4M21 33l-1.5 4M28 33l-1.5 4'/></g>";
else g = cloud("#aeb6ba") + "<g fill='#8fb0c8'><circle cx='14' cy='35' r='1.7'/><circle cx='21' cy='36.5' r='1.7'/><circle cx='28' cy='35' r='1.7'/></g>";
return picture(renderer_.diagram("mv-weather-" + std::to_string(std::clamp(code, 0, 7)), "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'>" + g + "</svg>", 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<int64_t>() : 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<int>();
// the eight weather pictures as five kinds of sky: sun, fair, cloud, rain, snow
static constexpr std::array<int, 8> 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<Ground, 24> 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<const char *> 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<std::string>()) 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) { std::string App::live_roster(const Json &owner) {
const bool national = live_.fixture().at("role") == "national"; const bool national = live_.fixture().at("role") == "national";
const int field_count = live_.fixture().at("field_count"); const int field_count = live_.fixture().at("field_count");
std::string out = "<div class=\"live-roster\"><div class=\"live-roster-row heading\">" +
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") + "</div>";
const auto rows = live_owner_rows(owner); const auto rows = live_owner_rows(owner);
const bool recorded = live_.fixture().at("source") == "engine-recording"; const bool recorded = live_.fixture().at("source") == "engine-recording";
if (national && !recorded) out += "<p class=\"live-roster-note\">" + live_text("Demokader auf Vereinsbasis · keine Nationalkaderberufung") + "</p>"; // what the match has brought each player so far: goals, a yellow card, a knock
for (size_t i = 0; i < rows.size(); ++i) { std::map<std::string, std::array<int, 3>> marks;
if (int(i) == field_count) out += "<p class=\"live-roster-note\">" + live_text(field_count == 6 ? "Rotationspartner · erster 11er-Plan" : recorded ? "Ersatzbank und Reserve" : "Reserven · Demovorschau") + "</p>"; const auto frame = live_.frame();
if (field_count == 6 && i == 11) out += "<p class=\"live-roster-note\">" + live_text("Weitere Kaderreserven") + "</p>"; for (const auto &event : frame.at("events")) {
const auto &row = rows[i]; if (!event.contains("player") || !event.at("player").is_object()) continue;
out += "<div class=\"live-roster-row\" data-live-player=\"" + esc(row.at("id").get<std::string>()) + "\">" + const std::string id = event.at("player").value("id", std::string()), kind = event.value("kind", std::string());
live_text(std::to_string(i + 1), "live-roster-number") + live_text(row.at("name"), "live-roster-name") + if (id.empty()) continue;
live_text(lineup_value(row.at(national ? "caps" : "strength")), "live-roster-stat") + if (kind == "goal") ++marks[id][0];
live_text(lineup_value(row.at(national ? "international_goals" : "condition")), "live-roster-stat") + "</div>"; if (kind == "yellow") ++marks[id][1];
if (kind == "injury") ++marks[id][2];
} }
if (rows.empty()) out += "<p class=\"live-note\">" + live_text(recorded ? "Für diese Mannschaft liegt keine Kaderansicht vor." : "Für diese Demomannschaft sind keine Kaderspieler verfügbar.") + "</p>"; const auto cell = [](const std::string &text, const char *css) { return "<span class=\"" + std::string(css) + "\">" + esc(text) + "</span>"; };
return out + "</div>"; const auto section = [](const std::string &text) { return "<div class=\"mv-tr sec\"><span class=\"l\">" + esc(pg_upper(text)) + "</span></div>"; };
std::string out = "<div class=\"mv-tr hd\">" + cell("NR.", "w1") + cell("POS.", "w2 l") + cell("SPIELER", "g") +
cell(national ? "CAPS" : "STÄRKE", "w3") + cell(national ? "TORE" : "KONDITION", "w4") + "</div>";
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>();
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 ? "<span>×" + std::to_string(at->second[0]) + "</span>" : std::string());
if (at->second[1]) badges += "<span class=\"mv-card-mark\"></span>";
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<double>()), 0, 100);
last = "<div class=\"mv-ko\"><span class=\"bar\"><div style=\"width:" + std::to_string(value) + "%;background-color:" +
(value > 70 ? "#56874a" : value > 50 ? "#d9a441" : "#c8372d") + ";\"></div></span><span>" + std::to_string(value) + "</span></div>";
}
out += "<div class=\"mv-tr\" data-live-player=\"" + esc(id) + "\">" + cell(std::to_string(i + 1), "w1") +
cell(live_position_text(row.value("position", Json())), "w2 l pos") +
"<span class=\"nm\"><span class=\"t\">" + esc(row.at("name").get<std::string>()) + "</span>" + badges + "</span>" +
cell(lineup_value(row.at(national ? "caps" : "strength")), "w3") + last + "</div>";
}
if (rows.empty()) out += "<p class=\"mv-empty\">" + esc(recorded ? "Für diese Mannschaft liegt keine Kaderansicht vor." : "Für diese Demomannschaft sind keine Kaderspieler verfügbar.") + "</p>";
return out;
} }
std::string App::live_detail(const Json &owner, const Json &frame) { std::string App::live_detail(const Json &owner, const Json &frame) {
const auto &fixture = live_.fixture(); 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")); const auto &score = live_score_by_id(frame, match.at("id"));
if (live_tab_ == "team") return live_roster(owner); if (live_tab_ == "team") return live_roster(owner);
const bool recorded = fixture.at("source") == "engine-recording"; const bool recorded = fixture.at("source") == "engine-recording";
const auto note = [](const std::string &text) { return "<p class=\"mv-empty\">" + esc(text) + "</p>"; };
const auto cell = [](const std::string &text, const char *css) { return "<span class=\"" + std::string(css) + "\">" + esc(text) + "</span>"; };
if (live_tab_ == "table") { if (live_tab_ == "table") {
if (recorded && score.at("standings").empty()) return "<p class=\"live-note\">" + live_text("Diese Partie gehört zu keiner Ligatabelle.") + "</p>"; if (recorded && score.at("standings").empty()) return note("Diese Partie gehört zu keiner Ligatabelle.");
if (fixture.at("role") == "national") return "<p class=\"live-note\">" + live_text("Dieses Demo-Länderspiel gehört zu keiner Liga. Der Spielstand steht links; eine Vereins-Live-Tabelle wird nicht eingeblendet.") + "</p>"; if (fixture.at("role") == "national") return note("Dieses Länderspiel gehört zu keiner Liga.");
std::string out = "<p class=\"live-note\">" + live_text(recorded ? "Tabelle zum Stand dieser Spielminute" : "Vorgegebene Demo-Tabelle · keine echte Saisonwertung") + "</p><div class=\"live-table\" role=\"table\" aria-label=\"Live-Tabelle\"><div class=\"live-table-row heading\">" + // where every club stood at the kickoff, for the arrows
live_text("Pl.", "live-table-pos") + "<div class=\"live-table-team\">" + live_text("Verein") + "</div>" + live_text("Sp.", "live-table-number") + std::map<std::string, int> before;
live_text("Tore", "live-table-number live-table-goals") + live_text("Diff.", "live-table-number") + live_text("Pkt.", "live-table-number") + "</div>"; 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<std::string>()] = row.at("position").get<int>();
} 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 = "<div class=\"mv-tr hd\">" + 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") + "</div>";
const auto colours = live_colours(match);
for (const auto &row : score.at("standings")) { for (const auto &row : score.at("standings")) {
const std::string id = row.at("team").at("id").get<std::string>();
const bool own = row.at("team").at("id") == owner.at("team").at("id"); const bool own = row.at("team").at("id") == owner.at("team").at("id");
const int difference = row.at("gf").get<int>() - row.at("ga").get<int>(); const int position = row.at("position").get<int>(), difference = row.at("gf").get<int>() - row.at("ga").get<int>();
out += "<div class=\"live-table-row " + std::string(own ? "own" : "") + "\" data-live-table-team=\"" + esc(row.at("team").at("id").get<std::string>()) + "\"" + (own ? " aria-current=\"true\"" : "") + ">" + const int was = before.contains(id) ? before.at(id) : position;
live_text(std::to_string(row.at("position").get<int>()), "live-table-pos") + const std::string colour = colours[match.at("home").at("id") == owner.at("team").at("id") ? 0 : 1];
"<div class=\"live-table-team\">" + live_badge(row.at("team"), 48) + live_text(row.at("team").at("name")) + "</div>" + const auto count = [&](const char *key) { return cell(row.contains(key) && row.at(key).is_number_integer() ? std::to_string(row.at(key).get<int>()) : "–", "w1"); };
live_text(std::to_string(row.at("played").get<int>()), "live-table-number") + out += "<div class=\"mv-tr" + std::string(own ? " own" : "") + "\" data-live-table-team=\"" + esc(id) + "\"" +
live_text(std::to_string(row.at("gf").get<int>()) + ":" + std::to_string(row.at("ga").get<int>()), "live-table-number live-table-goals") + (own ? " aria-current=\"true\" style=\"background-color:" + colour + ";color:" + mv_ink(colour) + ";\"" : "") + ">" +
live_text((difference > 0 ? "+" : "") + std::to_string(difference), "live-table-number") + cell(std::to_string(position), "w1") +
live_text(std::to_string(row.at("points").get<int>()), "live-table-number") + "</div>"; "<span class=\"w0\">" + (own ? std::string() : live_icon(position < was ? "up" : position > was ? "down" : "same", 22)) + "</span>" +
"<span class=\"nm\">" + live_badge(row.at("team"), 40) + "<span class=\"t\">" + esc(row.at("team").at("name").get<std::string>()) + "</span></span>" +
cell(std::to_string(row.at("played").get<int>()), "w1") + (results ? count("won") + count("drawn") + count("lost") : std::string()) +
cell(std::to_string(row.at("gf").get<int>()) + ":" + std::to_string(row.at("ga").get<int>()), "w3") +
cell((difference > 0 ? "+" : "") + std::to_string(difference), "w2") + cell(std::to_string(row.at("points").get<int>()), "w2") + "</div>";
} }
return out + "</div>"; return out;
} }
if (live_tab_ == "tactics" && live_.running() && engine_live_tactics_.size() == 8) { if (live_tab_ == "tactics" && live_.running() && engine_live_tactics_.size() == 8) {
std::string out = "<div class=\"live-context\"><h3>" + live_text("Taktik in diesem Spiel") + "</h3>"; std::string out;
for (size_t i = 0; i < engine_live_tactics_.size(); ++i) for (size_t i = 0; i < engine_live_tactics_.size(); ++i)
out += "<div class=\"live-tactic-row\">" + live_text(engine_live_tactics_[i].at("label").get<std::string>()) + out += "<div class=\"mv-trow\"><span class=\"k\">" + esc(engine_live_tactics_[i].at("label").get<std::string>()) + "</span><span class=\"v\">" +
live_text(i == 0 && engine_live_assistant_ ? std::string("Assistent passt an") : live_tactic_value(i, engine_live_tactics_[i].at("value").get<int>(), engine_live_tactics_[i].at("max").get<int>())) + "</div>"; esc(i == 0 && engine_live_assistant_ ? std::string("Assistent passt an") : live_tactic_value(i, engine_live_tactics_[i].at("value").get<int>(), engine_live_tactics_[i].at("max").get<int>())) + "</span></div>";
return out + btn("live-intervene-tactics", "Taktik ändern", "", "id=\"live-tactics-edit\"") + "</div>"; return out + "<div class=\"mv-pad\">" + btn("live-intervene-tactics", "Taktik ändern", "mv-btn sm", "id=\"live-tactics-edit\"") + "</div>";
} }
if (live_tab_ == "tactics" && recorded) if (live_tab_ == "tactics" && recorded)
return "<div class=\"live-context\"><h3>" + live_text("Taktik") + "</h3><p>" + live_text("Dieser Spieltag wurde mit der Aufstellung und Taktik vom Schreibtisch gespielt. Eingriffe während des Spiels folgen mit dem Live-Modus.") + "</p></div>"; return note("Dieser Spieltag wurde mit der Aufstellung und Taktik vom Schreibtisch gespielt.");
if (live_tab_ == "tactics") { if (live_tab_ == "tactics") {
const auto state = live_owner_state(owner), board = demo_lineup_visible(state); const auto state = live_owner_state(owner), board = demo_lineup_visible(state);
Json points = Json::array(); const int count = fixture.at("field_count"); 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)]); for (int i = 0; i < count; ++i) points.push_back(board.at("points")[size_t(i)]);
return "<div class=\"live-context\"><h3>" + live_text("Aktuelle Demoaufstellung") + "</h3><p>" + live_text(std::to_string(count) + " Spieler auf dem Feld · unabhängige Manageransicht") + "</p><div class=\"live-pitch\">" + return "<div class=\"mv-pad\"><p>" + esc(std::to_string(count) + " Spieler auf dem Feld · unabhängige Manageransicht") + "</p>" +
picture(renderer_.diagram("live-formation", lineup_mini(points, theme_), 1200), 1140, 684) + "</div>" + 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" : "")) + btn("live-intervene-tactics", "Taktik als Demo bearbeiten", "mv-btn sm", "id=\"live-tactics-edit\" " + std::string(live_.finished() ? "disabled" : "")) + "</div>";
"<p>" + live_text("Die Vorschau verändert weder diese feste Ereignisfolge noch Spiel- oder Saisonwerte.") + "</p></div>";
} }
if (live_tab_ == "opponent" && recorded) { if (live_tab_ == "opponent" && recorded) {
// the other matches of the day, own competition first; known once the day is played // 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()) if (!live_.finished() || !fixture.contains("conference") || !fixture.at("conference").is_array() || fixture.at("conference").empty())
return "<p class=\"live-note\">" + live_text(live_.finished() ? "An diesem Tag gab es keine weiteren Spiele." : "Die Ergebnisse der anderen Spiele stehen nach dem Abpfiff hier.") + "</p>"; 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()); const std::string own = match.value("competition", std::string());
std::vector<std::string> order; std::vector<std::string> order;
std::map<std::string, std::string> groups; std::map<std::string, std::string> 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")); const std::string name = other.at("competition").value("name", std::string("Weitere Spiele"));
if (!groups.contains(name)) order.push_back(name); if (!groups.contains(name)) order.push_back(name);
const auto &result = other.at("result").at("final"); const auto &result = other.at("result").at("final");
groups[name] += "<div class=\"live-roster-row\">" + Json home = other.at("home"), away = other.at("away");
live_text(other.at("home").value("name", std::string()) + " – " + other.at("away").value("name", std::string()), "live-roster-name") + if (!home.contains("role")) home["role"] = "club";
live_text(std::to_string(result[0].get<int>()) + ":" + std::to_string(result[1].get<int>()), "live-roster-stat") + "</div>"; if (!away.contains("role")) away["role"] = "club";
groups[name] += "<div class=\"mv-res\"><span class=\"h\">" + esc(home.value("name", std::string())) + "</span>" + live_badge(home, 40) +
"<span class=\"sc\">" + std::to_string(result[0].get<int>()) + " : " + std::to_string(result[1].get<int>()) + "</span>" +
live_badge(away, 40) + "<span class=\"a\">" + esc(away.value("name", std::string())) + "</span></div>";
} }
std::stable_sort(order.begin(), order.end(), [&](const std::string &a, const std::string &b) { return (a == own) > (b == own); }); std::stable_sort(order.begin(), order.end(), [&](const std::string &a, const std::string &b) { return (a == own) > (b == own); });
std::string list = "<div class=\"live-roster\">"; std::string list;
for (const auto &name : order) for (const auto &name : order) list += "<div class=\"mv-tr sec\"><span class=\"l\">" + esc(pg_upper(name)) + "</span></div>" + groups.at(name);
list += "<div class=\"live-roster-row heading\">" + live_text(name, "live-roster-name") + live_text("", "live-roster-stat") + "</div>" + groups.at(name); return list;
return list + "</div>";
} }
std::string out; std::string out;
if (live_tab_ == "opponent") { if (live_tab_ == "opponent") {
const auto &opponent = match.at(owner.at("team").at("id") == match.at("home").at("id") ? "away" : "home"); const auto &opponent = match.at(owner.at("team").at("id") == match.at("home").at("id") ? "away" : "home");
out = "<div class=\"live-context\"><h3>" + live_text(opponent.at("name")) + "</h3><p>" + live_text(recorded ? "Gegner dieser Partie." : "Gegner dieser vorgegebenen Demopartie. Es werden keine unbekannten Gegneranweisungen behauptet.") + "</p></div>"; return "<div class=\"mv-pad\"><h3 class=\"mv-k\">" + esc(pg_upper("Gegner")) + "</h3><p>" + esc(opponent.at("name").get<std::string>()) + "</p></div>";
} }
const auto colours = live_colours(match);
out = "<div class=\"mv-cmp\"><div class=\"t\">" + live_badge(match.at("home"), 58) + "<span>" + esc(match.at("home").at("name").get<std::string>()) +
"</span></div><span class=\"mv-k\">VERGLEICH</span><div class=\"t a\"><span>" + esc(match.at("away").at("name").get<std::string>()) + "</span>" + live_badge(match.at("away"), 58) + "</div></div>";
const std::array<std::pair<const char *, const char *>, 5> fields{{{"Tore", "score"}, {"Chancen", "chances"}, {"Gelbe Karten", "yellow"}, {"Rote Karten", "red"}, {"Spieler auf dem Feld", "players"}}}; const std::array<std::pair<const char *, const char *>, 5> fields{{{"Tore", "score"}, {"Chancen", "chances"}, {"Gelbe Karten", "yellow"}, {"Rote Karten", "red"}, {"Spieler auf dem Feld", "players"}}};
for (const auto &[label, key] : fields) { for (const auto &[label, key] : fields) {
const auto &pair = score.at(key); const int a = pair[0], b = pair[1]; 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; const double percent = a + b ? 100.0 * a / (a + b) : 50;
out += "<div class=\"live-stat\"><div class=\"live-stat-label\">" + live_text(std::to_string(a)) + live_text(label, "stat-title") + live_text(std::to_string(b)) + out += "<div class=\"mv-stat\"><span class=\"lb\">" + esc(pg_upper(label)) + "</span><div class=\"ln\"><span class=\"n h\">" + std::to_string(a) +
"</div><div class=\"live-stat-bar\"><div class=\"home\" style=\"width:" + scalar(percent) + "%;\"></div><div class=\"away\"></div></div></div>"; "</span><div class=\"bar\">" + (a + b ? "<div style=\"width:" + scalar(percent) + "%;background-color:" + colours[0] + ";\"></div><div class=\"a\" style=\"background-color:" + colours[1] + ";\"></div>" : std::string()) +
"</div><span class=\"n\">" + std::to_string(b) + "</span></div></div>";
} }
return out + "<p class=\"live-note\">" + live_text(match.at("home").at("name").get<std::string>() + " · " + match.at("away").at("name").get<std::string>() + (recorded ? "" : " · vorgegebene Demowerte")) + "</p>"; return out;
} }
std::string App::live_dialog_markup(const Json &owner) { std::string App::live_dialog_markup(const Json &owner) {
if (live_dialog_.empty()) return ""; if (live_dialog_.empty()) return "";
const auto rows = live_owner_rows(owner); const auto rows = live_owner_rows(owner);
std::string body = "<h2 id=\"live-dialog-heading\">" + live_text(live_.running() ? (live_dialog_ == "lineup" ? "Aufstellung & Wechsel" : "Taktik") : live_dialog_ == "lineup" ? "Aufstellung & Wechsel · Demo" : "Taktik · Demo") + "</h2><p>" + live_text(live_.running() ? owner.at("team").at("name").get<std::string>() + " · Das Spiel steht, bis du entschieden hast." : "Nur lokale Vorschau für " + owner.at("name").get<std::string>() + " · " + owner.at("team").at("name").get<std::string>() + ". Keine Änderung an der Partie; der feste Spielverlauf bleibt unverändert.") + "</p>"; const bool lineup = live_dialog_ == "lineup";
if (live_dialog_ == "lineup") { const std::string team = owner.at("team").at("name").get<std::string>();
std::vector<std::pair<std::string, std::string>> active, bench; std::string body = "<div class=\"mv-tape\"></div><div><span class=\"mv-k\">" + esc(pg_upper(live_.running() ? team : team + " · Demo")) + "</span><h2 id=\"live-dialog-heading\">" +
for (size_t i = 0; i < rows.size(); ++i) (i < size_t(live_.fixture().at("field_count").get<int>()) ? active : bench).emplace_back(rows[i].at("id"), rows[i].at("name")); esc(lineup ? "Aufstellung & Wechsel" : "Taktik") + "</h2></div>";
body += "<label for=\"live-player-out\">" + live_text("Vom Feld") + select("live-player-out", active, live_out_) + "</label><label for=\"live-player-in\">" + live_text("Von der Ersatzbank") + select("live-player-in", bench, live_in_) + "</label>"; std::string hint;
if (active.empty() || bench.empty()) body += "<p>" + live_text(live_.running() ? "Kein Wechselpaar verfügbar." : "Für diese Demokaderbasis ist kein Wechselpaar verfügbar.") + "</p>"; if (lineup) {
const size_t count = size_t(live_.fixture().at("field_count").get<int>());
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<std::string>();
const bool chosen = id == (bench ? live_in_ : live_out_);
if (chosen) names[bench] = rows[i].at("name").get<std::string>();
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",
"<span class=\"nr\">" + std::to_string(i + 1) + "</span><span class=\"ps\">" + esc(live_position_text(rows[i].value("position", Json()))) + "</span><span class=\"nm\">" +
esc(rows[i].at("name").get<std::string>()) + "</span><span class=\"vl\">" + esc(strength + " · " + condition) + "</span>",
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 = "<p class=\"mv-empty\">" + esc("Niemand verfügbar.") + "</p>";
body += "<div class=\"mv-cols\"><div class=\"col\"><span class=\"mv-k\">VOM FELD</span><div id=\"live-player-out\" class=\"mv-list\" style=\"height:" + pg(344) + ";\">" + lists[0] +
"</div></div><div class=\"col\"><span class=\"mv-k\">VON DER ERSATZBANK</span><div id=\"live-player-in\" class=\"mv-list\" style=\"height:" + pg(344) + ";\">" + lists[1] + "</div></div></div>";
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 { } else {
const std::array<const char *, 8> names{"Defensiv / offensiv", "Pass-/Schussbild unten", "Pass-/Schussbild Mitte", "Pass-/Schussbild links", "Flache / hohe Bälle", "Flügelbild links", "Flügelbild rechts", "Einsatz"}; const std::array<const char *, 8> 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 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"); const auto &values = engine_board ? live_dialog_draft_.at("values") : live_dialog_draft_.at("tactics").at("values");
body += "<div class=\"mv-list rows\">";
for (size_t i = 0; i < names.size(); ++i) for (size_t i = 0; i < names.size(); ++i)
body += "<div class=\"live-tactic-row\">" + live_text(engine_board ? engine_live_tactics_[i].at("label").get<std::string>() : std::string(names[i])) + btn("live-tactic-cycle", engine_board ? live_tactic_value(i, values[i].get<int>(), engine_live_tactics_[i].at("max").get<int>()) : "Wert " + std::to_string(values[i].get<int>()), "", "id=\"live-tactic-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"") + "</div>"; body += btn("live-tactic-cycle",
"<span class=\"k\">" + esc(engine_board ? engine_live_tactics_[i].at("label").get<std::string>() : std::string(names[i])) + "</span><span class=\"v\">" +
esc(engine_board ? live_tactic_value(i, values[i].get<int>(), engine_live_tactics_[i].at("max").get<int>()) : "Wert " + std::to_string(values[i].get<int>())) + "</span><span class=\"go\">›</span>",
"mv-trow", "id=\"live-tactic-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"");
body += "</div><p id=\"live-tactic-effect\">" + 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.") + "</p>";
} }
if (live_dialog_ == "tactics" && live_.running() && engine_live_tactics_.size() == 8) body += "<div class=\"mv-acts\">" + (hint.empty() ? std::string() : "<span class=\"hint\">" + esc(hint) + "</span>") + btn("live-dialog-cancel", "Abbrechen", "mv-btn", "id=\"live-dialog-cancel\"") +
body += "<p id=\"live-tactic-effect\">" + live_text(tactic_effect_text(size_t(std::clamp(last_tactic_, 0, 7)))) + "</p>"; btn("live-dialog-apply", live_.running() ? (lineup ? "Wechsel ausführen" : "Taktik übernehmen") : "Demovorschau anzeigen", "mv-btn primary",
body += "<div class=\"live-dialog-actions\">" + btn("live-dialog-cancel", "Abbrechen", "", "id=\"live-dialog-cancel\"") + "id=\"live-dialog-apply\" " + std::string(lineup && (live_out_.empty() || live_in_.empty()) ? "disabled" : "")) + "</div>";
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" : "")) + "</div>"; return "<div class=\"mv-veil\"><div id=\"live-dialog\" class=\"mv-note\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"live-dialog-heading\" style=\"width:" + pg(lineup ? 820 : 560) + ";\">" + body + "</div></div>";
return "<div class=\"live-dialog-layer\"><div id=\"live-dialog\" class=\"live-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"live-dialog-heading\">" + body + "</div></div>";
} }
std::string App::live_ticker_events(const Json &frame, size_t &shown) { std::string App::live_ticker_events(const Json &frame, size_t &shown) {
const auto &fixture = live_.fixture(); const auto &fixture = live_.fixture();
const bool recorded = fixture.at("source") == "engine-recording"; const bool recorded = fixture.at("source") == "engine-recording";
const bool several = fixture.at("matches").size() > 1; const bool several = fixture.at("matches").size() > 1;
const bool dark = theme_ != "silver" && theme_ != "matchday";
const std::string paper = dark ? "#2a2d34" : "#fffdf6";
shown = 0; shown = 0;
std::string out; std::string out;
for (auto i = frame.at("events").rbegin(); i != frame.at("events").rend(); ++i) { 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_ == "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; 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 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<std::string>(); const auto side = event.at("side").get<std::string>();
// one line per report: minute, what happened (a mark by kind), the club, the wording, the score // one line per report: minute, what happened, the club, the wording, the score
std::string row = "<article class=\"live-event kind-" + esc(kind) + (kind == "goal" ? " is-goal" : "") + (whistle ? " is-whistle" : "") + std::string head_style;
"\" data-live-event=\"" + esc(event.at("id").get<std::string>()) + "\""; if (kind == "goal") {
if (kind == "goal") row += " style=\"border-left-color:" + live_colours(match)[side == "away" ? 1 : 0] + ";\""; const std::string colour = live_colours(match)[side == "away" ? 1 : 0];
row += ">" + live_text(std::to_string(event.at("minute").get<int>()) + "′", "live-event-time") + if (mv_contrast(colour, paper) >= (dark ? 4.5 : 3)) head_style = " style=\"color:" + colour + ";\"";
"<div class=\"live-event-mark\"><div class=\"mark\"></div></div>" + }
(whistle ? "<div class=\"live-badge\" style=\"width:54dp;height:54dp;\"></div>" : live_badge(match.at(side), 54)) + out += "<article class=\"mv-ev kind-" + esc(kind) + (kind == "goal" ? " goal" : "") + "\" data-live-event=\"" + esc(event.at("id").get<std::string>()) + "\">" +
"<div class=\"live-event-copy\">" + "<span class=\"m\">" + std::to_string(event.at("minute").get<int>()) + "′</span><span class=\"i\">" + live_icon(whistle ? "time" : kind, 40) + "</span><span class=\"c\">" +
(several || !recorded ? live_text(match.at("home").at("name").get<std::string>() + " – " + match.at("away").at("name").get<std::string>(), "live-event-owners") : std::string()) + (whistle ? std::string() : live_badge(match.at(side), 50)) + "</span><div class=\"tx\">" +
"<h3>" + live_text(event.at("headline")) + "</h3><p>" + live_text(event.at("body")) + "</p></div>" + (several || !recorded ? "<span class=\"who\">" + esc(match.at("home").at("name").get<std::string>() + " – " + match.at("away").at("name").get<std::string>()) + "</span>" : std::string()) +
live_text(live_score_text(event.at("score")), "live-event-score") + "</article>"; "<h3 class=\"hd\"" + head_style + ">" + esc(event.at("headline").get<std::string>()) + "</h3><p>" + esc(event.at("body").get<std::string>()) + "</p></div><span class=\"sc\">" +
out += row; std::to_string(event.at("score")[0].get<int>()) + ":" + std::to_string(event.at("score")[1].get<int>()) + "</span></article>";
++shown; ++shown;
} }
if (!shown && recorded && live_filter_ == "all" && frame.at("events").empty()) { 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; std::string columns;
for (const auto *side : {"home", "away"}) { for (const auto *side : {"home", "away"}) {
const auto names = match.at("lineups").value(side, Json()); const auto names = match.at("lineups").value(side, Json());
columns += "<div class=\"live-lineup-side\"><h3>" + live_text(match.at(side).at("name")) + "</h3>"; columns += "<div class=\"side\"><h3>" + esc(match.at(side).at("name").get<std::string>()) + "</h3>";
if (names.is_array() && !names.empty()) { if (names.is_array() && !names.empty()) {
size_t number = 0; size_t number = 0;
for (const auto &name : names) columns += "<div class=\"live-lineup-row\">" + live_text(std::to_string(++number), "live-roster-number") + live_text(name.get<std::string>(), "live-roster-name") + "</div>"; for (const auto &name : names) columns += "<div class=\"row\"><span class=\"nr\">" + std::to_string(++number) + "</span><span class=\"nm\">" + esc(name.get<std::string>()) + "</span></div>";
} else columns += "<p>" + live_text("Aufstellung nicht bekannt.") + "</p>"; } else columns += "<p class=\"mv-mut\">" + esc("Aufstellung nicht bekannt.") + "</p>";
columns += "</div>"; columns += "</div>";
} }
out += "<div class=\"live-lineups\">" + columns + "</div>"; out += "<div class=\"mv-lineups\">" + columns + "</div>";
} }
if (!out.empty()) return out; if (!out.empty()) return out;
} }
if (!shown) out += "<p class=\"live-note\">" + live_text(recorded ? "Noch keine Meldungen." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "</p>"; if (!shown) out += "<p class=\"mv-empty\">" + esc(frame.at("events").empty() ? "Noch ist nichts passiert." : "Keine Meldungen in dieser Auswahl.") + "</p>";
return out; return out;
} }
std::array<std::string, 2> App::live_colours(const Json &match) { std::array<std::string, 2> App::live_colours(const Json &match) {
@@ -248,7 +438,7 @@ std::array<std::string, 2> App::live_colours(const Json &match) {
if (distance < 110) out[1] = "#3a4148"; if (distance < 110) out[1] = "#3a4148";
return out; 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 // 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). // (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) { 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 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 int minute = frame.at("minute"), duration = std::max(1, fixture.value("duration", 90));
const auto colours = live_colours(match); const auto colours = live_colours(match);
const bool quad = layout == "quad"; const bool quad = layout == "quad", solo = layout == "solo";
const double crest = layout == "solo" ? 250 : layout == "duo" ? 190 : 110; 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<std::string>(); const auto id = match.at("id").get<std::string>();
const double tw = layout == "solo" ? 2480 : 1180, th = quad ? 84 : 112, W = tw / th * 100;
// the clock: a ring that fills with the minutes // the clock: a ring that fills with the minutes
const double turn = std::clamp(double(minute) / duration, 0.0, 1.0) * 289.03; const double round = 2 * 3.14159265 * 13, turn = std::clamp(double(minute) / duration, 0.0, 1.0) * round;
const auto ink = "#eef2f5"; const std::string ring = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='13' fill='none' stroke='" + ink +
const std::string ring = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='46' fill='none' stroke='" + std::string(ink) + "' stroke-opacity='.14' stroke-width='4'/><circle cx='16' cy='16' r='13' fill='none' stroke='#c67139' stroke-width='4' stroke-linecap='round' stroke-dasharray='" +
"' stroke-opacity='.16' stroke-width='7'/><circle cx='50' cy='50' r='46' fill='none' stroke='" + (live_.finished() ? std::string(ink) : colours[0]) + scalar(turn) + " " + scalar(round) + "' transform='rotate(-90 16 16)'/></svg>";
"' stroke-width='7' stroke-linecap='round' stroke-dasharray='" + scalar(turn) + " 400' transform='rotate(-90 50 50)'/></svg>";
// 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 // 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; std::string marks, bands;
for (int from = 0; from < duration; from += 15) for (int from = 0; from < duration; from += 15)
bands += "<rect x='" + scalar(from * W / duration) + "' y='30' width='" + scalar(std::min(15, duration - from) * W / duration) + bands += "<rect x='" + scalar(X(from)) + "' y='" + scalar(y0) + "' width='" + scalar(X(std::min(duration, from + 15)) - X(from)) + "' height='" + scalar(sh) +
"' height='40' fill='" + ((from / 15) % 2 ? "#3f7d4e" : "#4a8a58") + "'/>"; "' fill='" + ((from / 15) % 2 ? "#3f7336" : "#4a8040") + "'/>";
for (const auto &event : frame.at("events")) { for (const auto &event : frame.at("events")) {
if (event.at("match_id") != match.at("id")) continue; if (event.at("match_id") != match.at("id")) continue;
const auto kind = event.value("kind", std::string()); const auto kind = event.value("kind", std::string());
const size_t side = event.value("side", std::string("home")) == "away" ? 1 : 0; const size_t side = event.value("side", std::string("home")) == "away" ? 1 : 0;
const int at = event.at("minute").get<int>(); const int at = event.at("minute").get<int>();
if ((kind == "goal" || kind == "chance" || kind == "miss") && at > minute - 10) ++press[side]; if ((kind == "goal" || kind == "chance" || kind == "miss") && at > minute - 10) press[side] += kind == "goal" ? 3 : 1;
const double x = std::clamp(at * W / duration, 12.0, W - 12), y = side ? 86 : 14; const double x = X(std::clamp(at, 0, duration)), y = side ? away_y : home_y;
if (kind == "goal") if (kind == "goal")
marks += "<line x1='" + scalar(x) + "' y1='" + scalar(side ? 70 : 30) + "' x2='" + scalar(x) + "' y2='" + scalar(y) + "' stroke='" + colours[side] + "' stroke-width='3'/>" marks += "<circle cx='" + scalar(x) + "' cy='" + scalar(y) + "' r='" + (quad ? "4" : "6.5") + "' fill='" + colours[side] + "' stroke='" + ink + "' stroke-width='1.5'/>";
"<circle cx='" + scalar(x) + "' cy='" + scalar(y) + "' r='11' fill='" + colours[side] + "' stroke='#ffffff' stroke-width='3'/>";
else if (kind == "yellow" || kind == "red" || kind == "second_yellow") else if (kind == "yellow" || kind == "red" || kind == "second_yellow")
marks += "<rect x='" + scalar(x - 6) + "' y='" + scalar(y - 9) + "' width='12' height='18' rx='2' fill='" + (kind == "yellow" ? "#f2c230" : "#d6453d") + "' stroke='#00000040' stroke-width='1'/>"; marks += "<rect x='" + scalar(x - (quad ? 2.5 : 4)) + "' y='" + scalar(y - (quad ? 4 : 6.5)) + "' width='" + (quad ? "5" : "8") + "' height='" + (quad ? "8" : "13") +
else if (kind == "injury") "' rx='1.2' fill='" + (kind == "yellow" ? "#e9c53a" : "#d8452f") + "' stroke='#2a211a' stroke-width='.8'/>";
marks += "<path d='M" + scalar(x - 8) + " " + scalar(y) + "h16M" + scalar(x) + " " + scalar(y - 8) + "v16' stroke='#d6453d' stroke-width='5' stroke-linecap='round'/>"; else if (kind == "injury") {
const double arm = quad ? 3.5 : 5.5;
marks += "<path d='M" + scalar(x - arm) + " " + scalar(y) + "h" + scalar(arm * 2) + "M" + scalar(x) + " " + scalar(y - arm) + "v" + scalar(arm * 2) + "' stroke='#e0564a' stroke-width='" + (quad ? "2.4" : "3.6") + "'/>";
}
} }
const double now = std::clamp(minute * W / duration, 0.0, W); const double now = X(std::clamp(minute, 0, duration));
const std::string timeline = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 " + scalar(W) + " 100'><rect x='0' y='30' width='" + scalar(W) + "' height='40' rx='6' fill='#4a8a58'/>" + bands + const std::string timeline = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 " + scalar(W) + " " + scalar(H) + "'><rect x='8' y='" + scalar(y0 - 2) + "' width='" + scalar(W - 16) +
"<rect x='" + scalar(now) + "' y='30' width='" + scalar(W - now) + "' height='40' fill='#10161c' fill-opacity='.5'/>" "' height='" + scalar(sh + 4) + "' rx='5' fill='#2f5a29'/>" + bands +
"<path d='M" + scalar(W / 2) + " 30v40' stroke='#ffffff' stroke-opacity='.75' stroke-width='3'/><circle cx='" + scalar(W / 2) + "' cy='50' r='12' fill='none' stroke='#ffffff' stroke-opacity='.6' stroke-width='2.5'/>" "<path d='M" + scalar(X(duration / 2.0)) + " " + scalar(y0) + "v" + scalar(sh) + "' stroke='#ffffff' stroke-opacity='.75' stroke-width='2'/><circle cx='" + scalar(X(duration / 2.0)) + "' cy='" +
"<rect x='1.5' y='31.5' width='" + scalar(W - 3) + "' height='37' rx='6' fill='none' stroke='#ffffff' stroke-opacity='.55' stroke-width='3'/>" + marks + scalar(y0 + sh / 2) + "' r='" + scalar(sh * .3) + "' fill='none' stroke='#ffffff' stroke-opacity='.75' stroke-width='2'/>" +
(live_.finished() ? std::string() : "<path d='M" + scalar(now) + " 24v52' stroke='#ffffff' stroke-width='4' stroke-linecap='round'/>") + "</svg>"; "<rect x='" + scalar(now) + "' y='" + scalar(y0) + "' width='" + scalar(X(duration) - now) + "' height='" + scalar(sh) + "' fill='" + paper + "' fill-opacity='.62'/>" +
(live_.finished() || minute < 1 ? std::string() : "<path d='M" + scalar(now) + " " + scalar(y0 - 3) + "v" + scalar(sh + 6) + "' stroke='" + ink + "' stroke-width='2.5'/>") + marks + "</svg>";
const int total = press[0] + press[1]; const int total = press[0] + press[1];
const double share = total ? 100.0 * press[0] / total : 50; 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) + "′"; const std::string status = live_.finished() ? "Abpfiff" : phase == "interval" ? "Halbzeit" : minute < 1 ? "Anpfiff" : std::to_string(minute) + "′";
std::string names; 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<std::string>(); } 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<std::string>(); }
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<int>();
return "<div class=\"mv-team " + std::string(side ? "a" : "h") + "\">" + live_badge(club, crest * 2.25) + "<div class=\"mv-team-nm\"><span class=\"n live-team-name\">" + esc(club.at("name").get<std::string>()) +
"</span><span class=\"bar\" style=\"decorator:linear-gradient(" + (side ? "270deg" : "90deg") + "," + colours[side] + " 0%," + colours[side] + " 60%," + colours[side] + "00 100%);\"></span><span class=\"s\">" +
esc(std::string(side ? "Gast" : "Heim") + (players < int(fixture.value("field_count", 11)) ? " · " + std::to_string(players) + " Spieler" : std::string())) + "</span></div></div>";
};
const auto tile = [&](size_t side) {
return "<div class=\"mv-tile\" style=\"background-color:" + colours[side] + ";color:" + mv_ink(colours[side]) + ";\"><span>" + std::to_string(value.at("score")[side].get<int>()) + "</span></div>";
};
std::string out = "<button data-action=\"live-match\" class=\"live-game " + layout + (match.at("id") == live_selected_match_ ? " active" : "") + "\" data-live-match=\"" + esc(id) + "\" data-id=\"" + esc(id) + "\">"; std::string out = "<button data-action=\"live-match\" class=\"mv-card live-game " + layout + (!solo && match.at("id") == live_selected_match_ ? " sel" : "") + "\" data-live-match=\"" + esc(id) + "\" data-id=\"" + esc(id) + "\">";
out += "<div class=\"live-card-top\">" + live_text(recorded ? match.value("competition", std::string("Spieltag")) : std::string("Demospiel"), "live-card-competition") + out += "<div class=\"mv-chead\"><span class=\"l\">" + esc(pg_upper(quad && several ? names : competition)) + "</span><span class=\"r" + std::string(quad ? " now" : "") + "\">" +
live_text(fixture.at("owners").size() > 1 ? names : live_match_info_text(match, fixture.at("surface") == "indoor"), "live-match-info") + "</div>"; esc(quad ? status : several ? names : live_match_info_text(match, live_indoor())) + "</span></div>";
out += "<div class=\"live-card-main\"><div class=\"live-side home\">" + live_badge(match.at("home"), crest) + live_text(match.at("home").at("name"), "live-team-name") + "</div>" out += "<div class=\"mv-score\">" + team(0) + "<div class=\"mv-mid\">";
"<div class=\"live-centre\">"; if (!quad) out += "<div class=\"mv-clock\">" + picture(renderer_.diagram("live-clock-" + std::to_string(index), ring, 160), solo ? 67.5 : 54, solo ? 67.5 : 54) + "<span>" + esc(status) + "</span></div>";
out += "<div class=\"mv-tiles\">" + tile(0) + "<span class=\"c\">:</span>" + tile(1) + "</div>";
if (!quad) if (!quad)
out += "<div class=\"live-clock\">" + picture(renderer_.diagram("live-clock-" + std::to_string(index), ring, 256), 84, 84) + live_text(status, "live-clock-text") + "</div>"; out += "<div class=\"mv-press\" aria-label=\"Druck der letzten zehn Minuten\"><div style=\"width:" + scalar(share) + "%;background-color:" + colours[0] + ";\"></div><div class=\"a\" style=\"background-color:" + colours[1] + ";\"></div></div>";
out += "<div class=\"live-plate\"><div class=\"live-plate-half\" style=\"background-color:" + colours[0] + ";\"><span>" + std::to_string(value.at("score")[0].get<int>()) + out += "</div>" + team(1) + "</div><div class=\"mv-tl\">" + picture(renderer_.diagram("live-line-" + std::to_string(index), timeline, 2048), W * 2.25, H * 2.25);
"</span></div><div class=\"live-plate-half\" style=\"background-color:" + colours[1] + ";\"><span>" + std::to_string(value.at("score")[1].get<int>()) + "</span></div></div>"; if (!quad)
if (quad) out += live_text(status, "live-clock-inline"); for (int at = 15; at < duration; at += 15)
else if (at * 2 != duration) out += "<span class=\"t\" style=\"left:" + pg(X(at) + 5) + ";\">" + std::to_string(at) + "′</span>";
out += "<div class=\"live-press\" aria-label=\"Druck der letzten zehn Minuten\"><div class=\"live-press-home\" style=\"width:" + scalar(share) + "%;background-color:" + colours[0] + out += "</div>";
";\"></div><div class=\"live-press-away\" style=\"background-color:" + colours[1] + ";\"></div></div>";
out += "</div><div class=\"live-side away\">" + live_badge(match.at("away"), crest) + live_text(match.at("away").at("name"), "live-team-name") + "</div></div>";
out += "<div class=\"live-timeline\">" + picture(renderer_.diagram("live-line-" + std::to_string(index), timeline, 2048), tw, th) + "</div>";
if (!quad) {
out += "<div class=\"live-timeline-ticks\" style=\"width:" + scalar(tw) + "dp;\">";
for (int at = 15; at < duration; at += 15) out += "<span style=\"left:" + scalar(at * 100.0 / duration) + "%;\">" + std::to_string(at) + "′</span>";
out += "</div>";
}
// a goal that has just fallen: a banner across this card, once // 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 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; const bool fresh = live_moment_.find(mark) == std::string::npos;
if (fresh) live_moment_ += mark; if (fresh) live_moment_ += mark;
const size_t side = goal->value("side", std::string("home")) == "away" ? 1 : 0; const size_t side = goal->value("side", std::string("home")) == "away" ? 1 : 0;
out += "<div class=\"live-moment" + std::string(fresh ? " fresh" : "") + "\" style=\"background-color:" + colours[side] + ";\">" + const std::string scorer = goal->contains("player") && goal->at("player").is_object() ? goal->at("player").value("name", std::string()) : std::string();
live_badge(match.at(side ? "away" : "home"), layout == "solo" ? 200 : quad ? 96 : 150) + const std::string club = match.at(side ? "away" : "home").at("name").get<std::string>();
"<div class=\"live-moment-copy\"><strong>TOR!</strong>" + live_text(goal->value("headline", std::string()), "live-moment-text") + "</div>" + out += "<div class=\"mv-goal live-moment" + std::string(fresh ? " fresh" : "") + "\" style=\"background-color:" + colours[side] + ";color:" + mv_ink(colours[side]) + ";\">" +
live_text(live_score_text(goal->at("score")), "live-moment-score") + "</div>"; live_badge(match.at(side ? "away" : "home"), (solo ? 92 : quad ? 44 : 58) * 2.25) +
"<div class=\"tx\"><span class=\"t\">TOR!</span><span class=\"s\">" + esc(scorer.empty() ? goal->value("headline", std::string()) : scorer + " trifft für " + club) + "</span></div><span class=\"r\">" +
esc(live_score_text(goal->at("score"))) + "</span></div>";
} }
} }
return out + "</button>"; return out + "</button>";
@@ -366,38 +567,79 @@ std::string App::render_live() {
const size_t count = fixture.at("matches").size(); const size_t count = fixture.at("matches").size();
const std::string layout = count == 1 ? "solo" : count == 2 ? "duo" : "quad"; 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 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", "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"" + std::string(right ? "M7 4l6 6-6 6" : "M13 4l-6 6 6 6") + "\" fill=\"none\" stroke=\"" + color + "\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>", 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 // an open match sheet in front of the stadium: on the left page the cards of the human
// match of a human manager on top, the ticker and the manager's squad below, the controls at the foot // managers' matches and the ticker, on the right the ground, the weather and the manager's
std::string out = "<div class=\"live-backdrop\"></div><section id=\"live-stage\" class=\"live-stage " + layout + "\" data-source=\"" + std::string(recorded ? "engine-recording" : "ui-demo-fixture") + "\" data-fixture-id=\"" + esc(fixture.at("fixture_id").get<std::string>()) + "\">"; // team; the controls run along the foot
out += "<header class=\"live-header\"><h1>" + 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")) + "</h1>" + std::string out = "<section id=\"live-stage\" class=\"mv-stage " + layout + "\" data-source=\"" + std::string(recorded ? "engine-recording" : "ui-demo-fixture") + "\" data-fixture-id=\"" + esc(fixture.at("fixture_id").get<std::string>()) + "\">";
live_text(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "</header>"; out += "<header class=\"mv-head\"><div class=\"ttl\"><span class=\"mv-k\">" + esc(pg_upper("Spieltag · Textmodus")) + "</span><h1>" + esc(title) + "</h1></div><span class=\"mv-date\">" +
out += "<div id=\"live-underlay\" class=\"live-body\"><div class=\"live-cards " + layout + "\">"; esc(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("Demo · vorgegebene Ergebnisse")) + "</span></header>";
out += "<div id=\"live-underlay\" class=\"mv-body\"><section class=\"mv-left\"><div class=\"mv-cards " + layout + "\">";
size_t index = 0; size_t index = 0;
for (const auto &match : fixture.at("matches")) out += live_card(match, frame, layout, index++); for (const auto &match : fixture.at("matches")) out += live_card(match, frame, layout, index++);
out += "</div><div class=\"live-columns\"><section class=\"live-panel live-ticker\"><header class=\"live-panel-heading\"><h2>" + live_text("Ticker") + "</h2><nav class=\"live-filters\">"; out += "</div><div class=\"mv-box\"><nav id=\"live-filters\" class=\"mv-tabs\"><span class=\"ttl\">Ticker</span>";
if (count > 1) for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 4>{{{"all", "Alles"}, {"highlights", "Highlights"}, {"goal", "Tore"}, {"yellow", "Karten"}}}) out += tab("live-filter", id, label, live_filter_ == id, "live-filter-");
out += "<span class=\"sp\"></span>";
if (count > 1) {
out += "<div class=\"mv-seg\">";
for (const auto &[id, text] : std::array<std::pair<const char *, const char *>, 2>{{{"all", "Alle Spiele"}, {"single", "Gewähltes Spiel"}}}) for (const auto &[id, text] : std::array<std::pair<const char *, const char *>, 2>{{{"all", "Alle Spiele"}, {"single", "Gewähltes Spiel"}}})
out += btn("live-coverage", text, live_coverage_ == id ? "selected" : "", "id=\"live-coverage-" + std::string(id) + "\" data-id=\"" + id + "\""); 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") + "\"");
for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 4>{{{"all", "Alles"}, {"highlights", "Highlights"}, {"goal", "Tore"}, {"yellow", "Karten"}}}) out += btn("live-filter", label, live_filter_ == id ? "selected" : "", "id=\"live-filter-" + std::string(id) + "\" data-id=\"" + id + "\""); out += "</div>";
out += "</nav></header><div id=\"live-ticker\" class=\"live-event-list\" tabindex=\"0\" aria-label=\"Ereignisverlauf\">"; }
out += "</nav><div class=\"mv-in\"><div id=\"live-ticker\" class=\"mv-scroll\" tabindex=\"0\" aria-label=\"Ereignisverlauf\">";
size_t shown = 0; size_t shown = 0;
out += live_ticker_events(frame, shown); out += live_ticker_events(frame, shown);
out += "</div><footer class=\"live-ticker-footer\"><span id=\"live-event-count\" class=\"live-small\">" + esc(recorded && !shown ? std::string() : std::to_string(shown) + (recorded ? (shown == 1 ? " Meldung" : " Meldungen") : " Meldungen · feste Aufzeichnung")) + "</span><span id=\"live-phase-status\" class=\"live-small\">" + esc(phase_text) + "</span></footer></section>"; out += "</div><footer class=\"mv-foot\"><span id=\"live-event-count\">" + esc(std::to_string(shown) + (shown == 1 ? " Meldung" : " Meldungen")) + "</span><span id=\"live-phase-status\" class=\"b\">" + esc(phase_text) + "</span></footer></div></div></section>";
out += "<aside id=\"live-detail\" class=\"live-detail live-panel\"><header class=\"live-panel-heading\"><div class=\"live-detail-heading\"><h2><span id=\"live-owner-team\">" + esc(owner.at("team").at("name").get<std::string>()) + "</span></h2><p><span id=\"live-owner-name\">" + esc(owner.at("name").get<std::string>()) + "</span></p></div>";
// the right page: the ground and the weather, then the manager's team
out += "<aside id=\"live-detail\" class=\"mv-right\">";
{
const Json *match = &fixture.at("matches").front();
for (const auto &row : fixture.at("matches")) if (row.at("id") == owner.at("match_id")) match = &row;
std::string crowd = live_attendance_text(*match);
out += "<div class=\"mv-info\"><div class=\"main\"><span class=\"mv-k\">" + esc(pg_upper(indoor ? "Halle" : "Stadion")) + "</span><span class=\"big\">" + esc(crowd) +
"</span><span class=\"sub\">" + esc("Heimspiel von " + match->at("home").at("name").get<std::string>()) + "</span></div>";
const auto weather = match->value("weather", Json());
if (!indoor && weather.is_object()) {
const Json rain = weather.value("rain", Json()), temperature = weather.value("temperature", Json());
out += "<div class=\"mv-wx\">" + (rain.is_number_integer() ? live_weather_icon(rain.get<int>(), 104) : std::string()) + "<div class=\"v\"><span class=\"t\">" +
esc(temperature.is_number_integer() ? std::to_string(temperature.get<int>()) + " °C" : std::string("—")) + "</span><span class=\"l\">" +
esc(rain.is_number_integer() ? live_weather_label(rain.get<int>()) : std::string("Wetter —")) + "</span></div></div>";
}
out += "</div>";
}
out += "<header class=\"mv-phead\">" + live_badge(owner.at("team"), 99) + "<div class=\"nm\"><h2><span id=\"live-owner-team\">" + esc(owner.at("team").at("name").get<std::string>()) +
"</span></h2><p>Manager: <span id=\"live-owner-name\">" + esc(owner.at("name").get<std::string>()) + "</span></p></div>";
if (fixture.at("owners").size() > 1) if (fixture.at("owners").size() > 1)
out += "<nav class=\"live-team-switch\" aria-label=\"Manager wechseln\">" + btn("live-owner-prev", arrow(false), "", "id=\"live-owner-prev\" aria-label=\"Vorheriger Manager\"") + btn("live-owner-next", arrow(true), "", "id=\"live-owner-next\" aria-label=\"Nächster Manager\"") + "</nav>"; 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 += "</header><nav class=\"live-tabs\">"; out += "</header><div class=\"mv-box\"><nav class=\"mv-tabs\">";
for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 5>{{{"team", "Team"}, {"tactics", "Taktik"}, {"opponent", recorded ? "Ergebnisse" : "Gegner"}, {"table", "Tabelle"}, {"stats", "Statistik"}}}) out += btn("live-tab", label, live_tab_ == id ? "selected" : "", "id=\"live-tab-" + std::string(id) + "\" data-id=\"" + id + "\" aria-pressed=\"" + (live_tab_ == id ? "true" : "false") + "\""); for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 5>{{{"team", "Team"}, {"tactics", "Taktik"}, {"opponent", recorded ? "Ergebnisse" : "Gegner"}, {"table", "Tabelle"}, {"stats", "Statistik"}}}) out += tab("live-tab", id, label, live_tab_ == id, "live-tab-");
out += "</nav><div id=\"live-detail-body\" class=\"live-detail-body\" tabindex=\"0\">" + live_detail(owner, frame) + "</div><footer class=\"live-detail-footer\">" + btn("live-intervene-lineup", "Aufstellung & Wechsel", "", "id=\"live-lineup-edit\" " + std::string(live_.finished() || (recorded && !live_.running()) ? "disabled" : "")) + "</footer></aside></div></div>"; out += "</nav><div class=\"mv-in\"><div id=\"live-detail-body\" class=\"mv-scroll\" tabindex=\"0\">" + live_detail(owner, frame) + "</div><footer class=\"mv-foot\"><span>" +
out += "<footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + 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" : "")) + "</div>"; esc(live_.running() ? "Das Spiel steht, solange du eingreifst." : "") + "</span>" +
out += "<div class=\"live-speed\">" + live_text("Tempo") + "<input id=\"live-speed\" type=\"range\" min=\"0\" max=\"4\" step=\"1\" value=\"" + std::to_string(live_.speed()) + "\" aria-label=\"Wiedergabegeschwindigkeit; links Pause\" aria-valuenow=\"" + std::to_string(live_.speed()) + "\" " + (live_.finished() ? "disabled" : "") + "/><span id=\"live-speed-value\" class=\"live-speed-value\">" + esc(live_.finished() ? "Ende" : live_.speed() ? std::to_string(live_.speed()) + "×" : "Pause") + "</span></div>"; btn("live-intervene-lineup", "Aufstellung &amp; Wechsel", "mv-btn sm", "id=\"live-lineup-edit\" " + std::string(live_.finished() || (recorded && !live_.running()) ? "disabled" : "")) + "</footer></div></div></aside></div>";
if (live_.running())
out += "<div class=\"live-halts\">" + 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") + "\"") + out += "<footer class=\"mv-bar\">" + btn("live-back", live_.running() ? "Zu Ende spielen" : recorded ? "Zum Schreibtisch" : "Zum Desktop", "mv-btn", "id=\"live-back\"") +
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") + "\"") + "</div>"; btn("live-pause", live_.speed() ? "Pause" : "Abspielen", "mv-btn play", "id=\"live-pause\" " + std::string(live_.finished() ? "disabled" : ""));
out += "<span id=\"live-playback-status\" class=\"live-bottom-note\">" + esc(live_feedback_.empty() ? (recorded ? std::string() : std::string(phase_text) + " · " + std::to_string(minute) + "′ · keine Spielwertänderung") : live_feedback_) + "</span>" + out += "<div id=\"live-speed\" class=\"mv-seg\" role=\"group\" aria-label=\"Tempo\">";
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") + "\"") + "</footer>"; 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 += "</div>";
if (live_.running()) {
const auto halt = [](const char *id, const char *label, bool on) {
return btn("live-halt", "<span class=\"tr\"><span class=\"kn\"></span></span><span class=\"lb\">" + std::string(label) + "</span>", 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 += "<span id=\"live-playback-status\" class=\"mv-status\">" + esc(live_feedback_.empty() ? (recorded ? std::string() : std::string(phase_text) + " · " + std::to_string(minute) + "′ · keine Spielwertänderung") : live_feedback_) + "</span>" +
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") + "\"") + "</footer>";
return out + live_dialog_markup(owner) + "</section>"; return out + live_dialog_markup(owner) + "</section>";
} }
void App::live_after_render() { 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-ticker")) node->SetScrollTop(live_ticker_scroll_);
if (auto *node = element("live-detail-body")) node->SetScrollTop(live_detail_scroll_); if (auto *node = element("live-detail-body")) node->SetScrollTop(live_detail_scroll_);
if (!live_dialog_.empty()) { 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"); } 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<std::string>())); name->SetInnerRML(esc(owner.at("name").get<std::string>()));
body->SetInnerRML(live_detail(owner, frame)); body->SetInnerRML(live_detail(owner, frame));
body->SetScrollTop(0); live_detail_scroll_ = 0; live_reset_detail_ = false; 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) { for (auto *tab : tabs) {
const bool selected = tab->GetAttribute<Rml::String>("data-id", "") == live_tab_; const bool selected = tab->GetAttribute<Rml::String>("data-id", "") == live_tab_;
tab->SetClass("selected", selected); tab->SetAttribute("aria-pressed", selected ? "true" : "false"); 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"); auto *list = element("live-ticker"); auto *count = element("live-event-count");
if (!list || !count) { refresh(); return; } if (!list || !count) { refresh(); return; }
size_t shown = 0; list->SetInnerRML(live_ticker_events(frame, shown)); 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; 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) for (auto *filter : filters)
filter->SetClass("selected", filter->GetAttribute<Rml::String>("data-id", "") == live_filter_); {
const bool selected = filter->GetAttribute<Rml::String>("data-id", "") == live_filter_;
filter->SetClass("selected", selected); filter->SetAttribute("aria-pressed", selected ? "true" : "false");
}
++live_ticker_updates_; ++live_ticker_updates_;
} }
live_detail_pending_ = live_ticker_pending_ = false; live_detail_pending_ = live_ticker_pending_ = false;
+7
View File
@@ -20,6 +20,13 @@
std::string live_detail(const Json &owner, const Json &frame); std::string live_detail(const Json &owner, const Json &frame);
std::string live_dialog_markup(const Json &owner); std::string live_dialog_markup(const Json &owner);
std::string live_badge(const Json &, double); 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 // the two club colours of a match (home, away), far enough apart to tell the sides
std::array<std::string, 2> live_colours(const Json &match); std::array<std::string, 2> live_colours(const Json &match);
std::string live_card(const Json &match, const Json &frame, const std::string &layout, size_t index); std::string live_card(const Json &match, const Json &frame, const std::string &layout, size_t index);
+11 -4
View File
@@ -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 // 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. // allows; the desk behind it is cropped. Without a window the whole stage is fitted.
bool window_zoom_ = false; 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 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_, std::string scene_ = "main", menu_, theme_ = "silver", active_mod_,
selected_mod_, notice_, country_ = "nation:de", league_, 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. // Called after the stage was rebuilt: zoom in when it now shows a menu window.
void sync_window_zoom() { void sync_window_zoom() {
// a page of the notebook is no window: the book keeps the whole stage // 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"; if (!wanted) window_shown_ = "\x01";
// the career's desk hangs from the top edge of a taller screen, so its bar is the // 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 // screen's bar and the spare height shows the stadium below
const bool entry = doc_->QuerySelector(".es-stage") != nullptr; const bool entry = doc_->QuerySelector(".es-stage") != nullptr;
const bool desk = !wanted && !entry && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub"); 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; entry_stage_ = entry;
match_stage_ = match;
window_zoom_ = wanted; window_zoom_ = wanted;
desk_top_ = desk; desk_top_ = desk;
resize(); resize();
@@ -1102,6 +1105,8 @@ class App final : public Rml::EventListener {
return; return;
scale_ = std::min(double(pw) / 3840, double(ph) / 2160); scale_ = std::min(double(pw) / 3840, double(ph) / 2160);
if (window_zoom_) scale_ = std::max(scale_, std::min(double(pw) / 2760, double(ph) / 2080)); 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 // 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)}); 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; canvas_left_ = (pw - 3840 * scale_) / 2;
@@ -1271,11 +1276,13 @@ class App final : public Rml::EventListener {
} }
} }
const auto size = context_->GetDimensions(); 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 = 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")->SetInnerRML(background);
element("background") element("background")
->SetProperty("filter", scene_ == "main" ? "none" ->SetProperty("filter", !ground.empty() ? "brightness(0.78)" : scene_ == "main" ? "none"
: theme_ == "silver" : theme_ == "silver"
? "saturate(0.2) brightness(0.9)" ? "saturate(0.2) brightness(0.9)"
: theme_ == "matchday" : theme_ == "matchday"