Paper windows, a display serif and chalk hand, a symmetric tactics board, the match day as a stage
- Material: menu windows are sheets of paper (warm surface, edge, two sheets beneath, serif headings) that slide in once when their menu opens; the desk stays glass. Source Serif 4 and Cabin Sketch ship in assets/modern/fonts (SIL OFL, see THIRD_PARTY_NOTICES.md); system fonts remain the fallback. - Tactics board: 320 x 200 units mirrored about its middle - the pitch of the attitude on the left, six equal tiles for the play settings on the right with their names in chalk, the commitment with a scale across the foot. - Live match: a 4:3 sheet like the menus (same window zoom) on the darkened stadium. One score board per match of a human manager - a full-width card for one match, two side by side, a 2 x 2 grid for three or four - with crests, a score plate in the clubs' colours (read from the crests), a clock ring, a pressure bar, and a time line of goals, cards and injuries. Compact ticker rows with a mark per kind, a goal banner on the card, a horizontal speed control, and optional halts at half time and when falling behind. - QA: script command demo-start begins a demo career with 1-4 managers. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
54fef90a5b
commit
9b5d448fb6
21 files changed
+887
-125
No files matched your search
+155
-32
@@ -180,6 +180,8 @@ std::string App::live_dialog_markup(const Json &owner) {
|
||||
}
|
||||
std::string App::live_ticker_events(const Json &frame, size_t &shown) {
|
||||
const auto &fixture = live_.fixture();
|
||||
const bool recorded = fixture.at("source") == "engine-recording";
|
||||
const bool several = fixture.at("matches").size() > 1;
|
||||
shown = 0;
|
||||
std::string out;
|
||||
for (auto i = frame.at("events").rbegin(); i != frame.at("events").rend(); ++i) {
|
||||
@@ -189,11 +191,23 @@ std::string App::live_ticker_events(const Json &frame, size_t &shown) {
|
||||
if (live_filter_ == "yellow" && kind != "yellow" && kind != "red" && kind != "second_yellow") continue;
|
||||
if (live_filter_ == "highlights" && kind != "goal" && kind != "chance" && kind != "miss" && kind != "red" && kind != "second_yellow") continue;
|
||||
const auto &match = live_match_by_id(fixture.at("matches"), event.at("match_id"));
|
||||
out += "<article class=\"live-event " + std::string(kind == "goal" ? "is-goal" : "") + "\" data-live-event=\"" + esc(event.at("id").get<std::string>()) + "\">" + live_text(std::to_string(event.at("minute").get<int>()) + "′", "live-event-time") + (kind == "kickoff" || kind == "interval" || kind == "fulltime" ? "<div class=\"live-badge\" style=\"width:54dp;height:54dp;\"></div>" : live_badge(match.at(event.at("side").get<std::string>()), 54)) +
|
||||
"<div class=\"live-event-copy\">" + (fixture.at("source") == "engine-recording" && fixture.at("matches").size() == 1 ? std::string() : live_text(match.at("home").at("name").get<std::string>() + " · " + match.at("away").at("name").get<std::string>(), "live-event-owners")) + "<h3>" + live_text(event.at("headline")) + "</h3><p>" + live_text(event.at("body")) + "</p></div>" + live_text(live_score_text(event.at("score")), "live-event-score") + "</article>";
|
||||
const bool whistle = kind == "kickoff" || kind == "interval" || kind == "fulltime";
|
||||
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
|
||||
std::string row = "<article class=\"live-event kind-" + esc(kind) + (kind == "goal" ? " is-goal" : "") + (whistle ? " is-whistle" : "") +
|
||||
"\" data-live-event=\"" + esc(event.at("id").get<std::string>()) + "\"";
|
||||
if (kind == "goal") row += " style=\"border-left-color:" + live_colours(match)[side == "away" ? 1 : 0] + ";\"";
|
||||
row += ">" + live_text(std::to_string(event.at("minute").get<int>()) + "′", "live-event-time") +
|
||||
"<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)) +
|
||||
"<div class=\"live-event-copy\">" +
|
||||
(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()) +
|
||||
"<h3>" + live_text(event.at("headline")) + "</h3><p>" + live_text(event.at("body")) + "</p></div>" +
|
||||
live_text(live_score_text(event.at("score")), "live-event-score") + "</article>";
|
||||
out += row;
|
||||
++shown;
|
||||
}
|
||||
if (!shown && fixture.at("source") == "engine-recording" && live_filter_ == "all" && frame.at("events").empty()) {
|
||||
if (!shown && recorded && live_filter_ == "all" && frame.at("events").empty()) {
|
||||
// before the first report: who starts
|
||||
for (const auto &match : fixture.at("matches")) {
|
||||
if (live_coverage_ == "single" && match.at("id") != live_selected_match_) continue;
|
||||
@@ -212,9 +226,116 @@ std::string App::live_ticker_events(const Json &frame, size_t &shown) {
|
||||
}
|
||||
if (!out.empty()) return out;
|
||||
}
|
||||
if (!shown) out += "<p class=\"live-note\">" + live_text(fixture.at("source") == "engine-recording" ? "Noch keine Meldungen." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "</p>";
|
||||
if (!shown) out += "<p class=\"live-note\">" + live_text(recorded ? "Noch keine Meldungen." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "</p>";
|
||||
return out;
|
||||
}
|
||||
std::array<std::string, 2> App::live_colours(const Json &match) {
|
||||
// from the crests; a club without one, or a national side, plays in slate. Two sides in
|
||||
// nearly the same colour: the guests change into a dark neutral.
|
||||
const auto colour = [&](const Json &team) {
|
||||
std::string value;
|
||||
if (team.value("role", "club") != "national" && live_world_)
|
||||
if (const auto *club = live_world_->find("clubs", team.value("id", "")); club && !club->value("crest", "").empty())
|
||||
value = renderer_.crest_colour(club->value("crest", ""));
|
||||
return value;
|
||||
};
|
||||
std::array<std::string, 2> out{colour(match.at("home")), colour(match.at("away"))};
|
||||
const auto channel = [](const std::string &c, size_t at) { return std::stoi(c.substr(at, 2), nullptr, 16); };
|
||||
if (out[0].empty()) out[0] = "#3d5a73";
|
||||
if (out[1].empty()) out[1] = "#7a4a3a";
|
||||
int distance = 0;
|
||||
for (size_t at : {1u, 3u, 5u}) distance += std::abs(channel(out[0], at) - channel(out[1], at));
|
||||
if (distance < 110) out[1] = "#3a4148";
|
||||
return out;
|
||||
}
|
||||
// One match on the stage: crests, the score plate in the clubs' colours, the clock, who is
|
||||
// pressing, and the time line with every goal, card and injury so far. `layout` is solo
|
||||
// (one match), duo (two) or quad (three or four).
|
||||
std::string App::live_card(const Json &match, const Json &frame, const std::string &layout, size_t index) {
|
||||
const auto &fixture = live_.fixture();
|
||||
const bool recorded = fixture.at("source") == "engine-recording";
|
||||
const auto &value = live_score_by_id(frame, match.at("id"));
|
||||
const int minute = frame.at("minute"), duration = std::max(1, fixture.value("duration", 90));
|
||||
const auto colours = live_colours(match);
|
||||
const bool quad = layout == "quad";
|
||||
const double crest = layout == "solo" ? 250 : layout == "duo" ? 190 : 110;
|
||||
const auto id = match.at("id").get<std::string>();
|
||||
const double tw = layout == "solo" ? 2480 : 1180, th = quad ? 84 : 124, W = tw / th * 100;
|
||||
|
||||
// the clock: a ring that fills with the minutes
|
||||
const double turn = std::clamp(double(minute) / duration, 0.0, 1.0) * 289.03;
|
||||
const auto ink = "#eef2f5";
|
||||
const std::string ring = "<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='.16' stroke-width='7'/><circle cx='50' cy='50' r='46' fill='none' stroke='" + (live_.finished() ? std::string(ink) : colours[0]) +
|
||||
"' 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
|
||||
std::string marks, bands;
|
||||
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) +
|
||||
"' height='40' fill='" + ((from / 15) % 2 ? "#3f7d4e" : "#4a8a58") + "'/>";
|
||||
for (const auto &event : frame.at("events")) {
|
||||
if (event.at("match_id") != match.at("id")) continue;
|
||||
const auto kind = event.value("kind", std::string());
|
||||
const size_t side = event.value("side", std::string("home")) == "away" ? 1 : 0;
|
||||
const int at = event.at("minute").get<int>();
|
||||
if ((kind == "goal" || kind == "chance" || kind == "miss") && at > minute - 10) ++press[side];
|
||||
const double x = std::clamp(at * W / duration, 12.0, W - 12), y = side ? 86 : 14;
|
||||
if (kind == "goal")
|
||||
marks += "<line x1='" + scalar(x) + "' y1='" + scalar(side ? 70 : 30) + "' x2='" + scalar(x) + "' y2='" + scalar(y) + "' stroke='" + colours[side] + "' stroke-width='3'/>"
|
||||
"<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")
|
||||
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'/>";
|
||||
else if (kind == "injury")
|
||||
marks += "<path d='M" + scalar(x - 8) + " " + scalar(y) + "h16M" + scalar(x) + " " + scalar(y - 8) + "v16' stroke='#d6453d' stroke-width='5' stroke-linecap='round'/>";
|
||||
}
|
||||
const double now = std::clamp(minute * W / duration, 0.0, W);
|
||||
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 +
|
||||
"<rect x='" + scalar(now) + "' y='30' width='" + scalar(W - now) + "' height='40' fill='#10161c' fill-opacity='.5'/>"
|
||||
"<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'/>"
|
||||
"<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 +
|
||||
(live_.finished() ? std::string() : "<path d='M" + scalar(now) + " 24v52' stroke='#ffffff' stroke-width='4' stroke-linecap='round'/>") + "</svg>";
|
||||
|
||||
const int total = press[0] + press[1];
|
||||
const double share = total ? 100.0 * press[0] / total : 50;
|
||||
const auto phase = frame.at("phase").get<std::string>();
|
||||
const std::string status = live_.finished() ? "Abpfiff" : phase == "interval" ? "Halbzeit" : minute < 1 ? "Anpfiff" : std::to_string(minute) + "′";
|
||||
std::string names;
|
||||
for (const auto &owner_id : match.at("owners")) for (const auto &person : fixture.at("owners")) if (person.at("id") == owner_id) { if (!names.empty()) names += " · "; names += person.at("name").get<std::string>(); }
|
||||
|
||||
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) + "\">";
|
||||
out += "<div class=\"live-card-top\">" + live_text(recorded ? match.value("competition", std::string("Spieltag")) : std::string("Demospiel"), "live-card-competition") +
|
||||
live_text(fixture.at("owners").size() > 1 ? names : live_match_info_text(match, fixture.at("surface") == "indoor"), "live-match-info") + "</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>"
|
||||
"<div class=\"live-centre\">";
|
||||
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=\"live-plate\"><div class=\"live-plate-half\" style=\"background-color:" + colours[0] + ";\"><span>" + std::to_string(value.at("score")[0].get<int>()) +
|
||||
"</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) out += live_text(status, "live-clock-inline");
|
||||
else
|
||||
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] +
|
||||
";\"></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>";
|
||||
|
||||
// a goal that has just fallen: a banner across this card, once
|
||||
if (!frame.at("events").empty()) {
|
||||
const auto &last = frame.at("events").back();
|
||||
if (last.at("match_id") == match.at("id") && last.value("kind", std::string()) == "goal" && !live_.finished() &&
|
||||
last.at("minute").get<int>() >= minute - 1) {
|
||||
// it stays while the minute lasts and slides in only the first time it is drawn
|
||||
const bool fresh = live_moment_ != last.at("id").get<std::string>();
|
||||
live_moment_ = last.at("id").get<std::string>();
|
||||
const size_t side = last.value("side", std::string("home")) == "away" ? 1 : 0;
|
||||
out += "<div class=\"live-moment" + std::string(fresh ? " fresh" : "") + "\" style=\"background-color:" + colours[side] + ";\">" + live_badge(match.at(side ? "away" : "home"), quad ? 120 : 200) +
|
||||
"<div><strong>TOR!</strong>" + live_text(last.value("body", std::string()), "live-moment-text") + "</div>" + live_text(live_score_text(last.at("score")), "live-moment-score") + "</div>";
|
||||
}
|
||||
}
|
||||
return out + "</button>";
|
||||
}
|
||||
std::string App::render_live() {
|
||||
if(live_review_) return render_postmatch();
|
||||
if (!live_.available()) return "";
|
||||
@@ -225,39 +346,41 @@ std::string App::render_live() {
|
||||
const auto &fixture = live_.fixture(); const auto frame = live_.frame(); const auto owner = live_owner();
|
||||
const int minute = frame.at("minute"); const auto phase = frame.at("phase").get<std::string>();
|
||||
const bool recorded = fixture.at("source") == "engine-recording";
|
||||
const size_t count = fixture.at("matches").size();
|
||||
const std::string layout = count == 1 ? "solo" : count == 2 ? "duo" : "quad";
|
||||
const auto phase_text = live_.finished() ? "Beendet" : phase == "interval" ? "Halbzeit" : live_.speed() ? (recorded ? (phase == "extra_time" ? "Verlängerung" : phase == "shootout" ? "Elfmeterschießen" : "Spiel läuft") : "Aufzeichnung läuft") : (recorded ? "Pausiert" : "Gemeinsam pausiert");
|
||||
const auto arrow = [&](bool right) { const auto color = theme_ == "silver" ? "#376b84" : theme_ == "matchday" ? "#efb2aa" : "#b5dbd2"; return picture(renderer_.diagram(right ? "live-arrow-right" : "live-arrow-left", "<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); };
|
||||
std::string out = "<section id=\"live-stage\" class=\"live-stage\" data-source=\"" + std::string(recorded ? "engine-recording" : "ui-demo-fixture") + "\" data-fixture-id=\"" + esc(fixture.at("fixture_id").get<std::string>()) + "\"><header class=\"live-header\"><div>" + (recorded ? std::string() : live_text("SPIELTAG · LIVE-TICKER", "live-eyebrow")) +
|
||||
"<h1>" + live_text(live_review_ ? "Ergebnisse & Bericht" : fixture.at("role") == "national" ? "Deutschland · Demo-Länderspiel" : fixture.at("surface") == "indoor" ? "Hallenpartien · 40 Minuten" : recorded ? fixture.at("matches").front().value("competition", std::string("Spieltag")) : std::string("Gemeinsamer Spieltag")) + "</h1></div>" + live_text(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("UI-Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "</header>";
|
||||
const auto scoreline = [&](const Json &match) {
|
||||
const auto &value = live_score_by_id(frame, match.at("id"));
|
||||
return "<div class=\"live-scoreline\">" + live_text(match.at("home").at("name"), "live-team-name home") + live_badge(match.at("home"), 58) + live_text(live_score_text(value.at("score")), "live-score") + live_badge(match.at("away"), 58) + live_text(match.at("away").at("name"), "live-team-name away") + "</div>";
|
||||
};
|
||||
out += "<div id=\"live-underlay\" class=\"live-body\"><div class=\"live-left\"><section class=\"live-panel live-overview\"><nav class=\"live-coverage" + std::string(recorded && fixture.at("matches").size() == 1 ? " solo" : "") + "\">";
|
||||
if (!(recorded && fixture.at("matches").size() == 1))
|
||||
for (const auto &[id, text] : std::array<std::pair<const char *, const char *>, 3>{{{"all", "Alle Spiele"}, {"single", "Einzelspiel"}, {"conference", "Konferenz"}}})
|
||||
out += btn("live-coverage", text, live_coverage_ == id ? "selected" : "", "id=\"live-coverage-" + std::string(id) + "\" data-id=\"" + id + "\"");
|
||||
if (live_coverage_ == "single" && fixture.at("matches").size() > 1) out += btn("live-match-prev", arrow(false), "live-match-arrow", "id=\"live-match-prev\" aria-label=\"Vorherige Tickerpartie\"") + btn("live-match-next", arrow(true), "live-match-arrow", "id=\"live-match-next\" aria-label=\"Nächste Tickerpartie\"");
|
||||
if (!(recorded && fixture.at("matches").size() == 1)) out += live_text(std::to_string(minute) + ":00", "live-clock");
|
||||
out += "</nav><div class=\"live-cards " + std::string(fixture.at("matches").size() == 1 || live_coverage_ == "single" ? "single" : "") + "\">";
|
||||
for (const auto &match : fixture.at("matches")) {
|
||||
if (live_coverage_ == "single" && match.at("id") != live_selected_match_) continue;
|
||||
std::string names;
|
||||
for (const auto &id : match.at("owners")) for (const auto &person : fixture.at("owners")) if (person.at("id") == id) { if (!names.empty()) names += " · "; names += person.at("name").get<std::string>(); }
|
||||
out += "<button data-action=\"live-match\" class=\"live-game " + std::string(match.at("id") == live_selected_match_ ? "active" : "") + "\" data-live-match=\"" + esc(match.at("id").get<std::string>()) + "\" data-id=\"" + esc(match.at("id").get<std::string>()) + "\">" + (recorded && fixture.at("owners").size() == 1 ? std::string() : live_text(names, "live-owners")) + scoreline(match) + live_text(recorded && fixture.at("matches").size() == 1 ? std::string(phase_text) + (live_.finished() || minute < 1 ? "" : " · " + std::to_string(minute) + ". Minute") : std::to_string(minute) + "′ · " + (match.at("owners").size() > 1 ? std::string("Zwei menschliche Manager") : recorded ? match.value("competition", std::string("Eine menschliche Mannschaft")) : std::string("Eine menschliche Mannschaft")), "live-card-caption") + live_text(live_match_info_text(match, fixture.at("surface") == "indoor"), "live-match-info") + "</button>";
|
||||
}
|
||||
out += "</div></section><section class=\"live-panel live-ticker\"><header class=\"live-panel-heading\"><h2>" + live_text(recorded ? "Ticker" : "Gemeinsamer Live-Ticker") + "</h2>" + (recorded && fixture.at("owners").size() == 1 ? std::string() : live_text(live_coverage_ == "single" ? "Gewählte Partie" : "Alle Manager", "live-small")) + "</header><nav class=\"live-filters\">";
|
||||
|
||||
// a sheet in the menus' 4:3 format on the darkened stadium: the stage with one card per
|
||||
// match of a human manager on top, the ticker and the manager's squad below, the controls at the foot
|
||||
std::string out = "<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>()) + "\">";
|
||||
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>" +
|
||||
live_text(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "</header>";
|
||||
out += "<div id=\"live-underlay\" class=\"live-body\"><div class=\"live-cards " + layout + "\">";
|
||||
size_t index = 0;
|
||||
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\">";
|
||||
if (count > 1)
|
||||
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 + "\"");
|
||||
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 += "</nav><div id=\"live-ticker\" class=\"live-event-list\" tabindex=\"0\" aria-label=\"Gemeinsamer Ereignisverlauf\">";
|
||||
out += "</nav></header><div id=\"live-ticker\" class=\"live-event-list\" tabindex=\"0\" aria-label=\"Ereignisverlauf\">";
|
||||
size_t shown = 0;
|
||||
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) + (live_.fixture().at("source") == "engine-recording" ? (shown == 1 ? " Meldung" : " Meldungen") : " Meldungen · feste Aufzeichnung")) + "</span>" + "<span id=\"live-phase-status\" class=\"live-small\">" + esc(recorded ? std::string() : std::string(phase_text)) + "</span></footer></section></div><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><nav class=\"live-team-switch\" aria-label=\"Managerdetails wechseln\">" +
|
||||
btn("live-owner-prev", arrow(false), "", "id=\"live-owner-prev\" aria-label=\"Vorheriger Manager\" " + std::string(fixture.at("owners").size() == 1 ? "disabled" : "")) + btn("live-owner-next", arrow(true), "", "id=\"live-owner-next\" aria-label=\"Nächster Manager\" " + std::string(fixture.at("owners").size() == 1 ? "disabled" : "")) + "</nav></header><nav class=\"live-tabs\">";
|
||||
for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 5>{{{"team", "Team"}, {"tactics", "Taktik"}, {"opponent", recorded ? "Ergebnisse" : "Gegner"}, {"table", "Live-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") + "\"");
|
||||
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>";
|
||||
out += "<div class=\"live-speed\">" + live_text("+") + "<input id=\"live-speed\" type=\"range\" orientation=\"vertical\" min=\"0\" max=\"4\" step=\"1\" value=\"" + std::to_string(4 - live_.speed()) + "\" aria-label=\"Wiedergabegeschwindigkeit; unten 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>";
|
||||
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><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>" +
|
||||
btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? "Zur Auswertung" : live_.running() ? "Nächste Minute" : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "</footer>";
|
||||
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 += "<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>";
|
||||
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 += "</header><nav class=\"live-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") + "\"");
|
||||
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 += "<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>";
|
||||
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>";
|
||||
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") + "\"") +
|
||||
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>";
|
||||
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>" +
|
||||
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>";
|
||||
return out + live_dialog_markup(owner) + "</section>";
|
||||
}
|
||||
void App::live_after_render() {
|
||||
|
||||
Reference in new issue
Block a user