A sheet may carry a faint picture of its subject
A data set's art.paper-<motif>.png (ball, seats, stand, kickoff, training, locker, fans) is drawn under a menu window's content in the light skin; without such pictures the sheet stays plain. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f607a9d89
commit
a87535018f
2 files changed
+22
-1
No files matched your search
@@ -199,3 +199,5 @@ button {transition:background-color border-color 0.12s cubic-out;}
|
|||||||
body.calm .desktop-app:hover .app-tile,body.calm .desktop-card[data-action]:hover {transform:none;}
|
body.calm .desktop-app:hover .app-tile,body.calm .desktop-card[data-action]:hover {transform:none;}
|
||||||
.identity strong {font-family:Display;font-size:44dp;}
|
.identity strong {font-family:Display;font-size:44dp;}
|
||||||
.titlebar-club {margin-left:auto;width:68dp;height:68dp;flex-shrink:0;}
|
.titlebar-club {margin-left:auto;width:68dp;height:68dp;flex-shrink:0;}
|
||||||
|
/* a faint picture of the sheet's subject, under the content and under a veil of the paper's own tone */
|
||||||
|
.window-art {position:absolute;left:0;top:108dp;width:2720dp;height:1932dp;overflow:hidden;opacity:.55;pointer-events:none;}
|
||||||
+20
-1
@@ -614,6 +614,25 @@ class App final : public Rml::EventListener {
|
|||||||
esc(world_->name(*c)) + "</span></span>"
|
esc(world_->name(*c)) + "</span></span>"
|
||||||
: "";
|
: "";
|
||||||
}
|
}
|
||||||
|
// A sheet may carry a faint picture of its subject under its content: the data set's
|
||||||
|
// "art.paper-<motif>.png" for the menu, else its general one. The paper's own tone and
|
||||||
|
// gradient stay on top of the picture's; without such pictures the sheet is plain.
|
||||||
|
std::string window_art() {
|
||||||
|
static const std::map<std::string, std::string> motifs{
|
||||||
|
{"stadium", "seats"}, {"advertising", "stand"}, {"environment", "fans"}, {"training", "training"}, {"camps", "training"},
|
||||||
|
{"lineup", "kickoff"}, {"tactics", "kickoff"}, {"squad", "locker"}, {"contracts", "locker"}, {"transfer", "locker"},
|
||||||
|
{"tables", "stand"}, {"league", "stand"}, {"other", "stand"}, {"strengths", "stand"}, {"statistics", "kickoff"},
|
||||||
|
{"scorers", "kickoff"}, {"fairplay", "kickoff"}};
|
||||||
|
if (theme_ != "silver") return {};
|
||||||
|
const auto found = motifs.find(menu_);
|
||||||
|
for (const std::string motif : {found == motifs.end() ? std::string("ball") : found->second, std::string("ball")}) {
|
||||||
|
const auto key = "art.paper-" + motif + ".png";
|
||||||
|
const auto art = renderer_.image(key, false, 2048);
|
||||||
|
if (art.token.empty() || art.width <= 0 || art.height <= 0) continue;
|
||||||
|
return "<div class=\"window-art\">" + picture(art, 2720, 1932, true) + "</div>";
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
std::string window(const std::string &heading, const std::string &content,
|
std::string window(const std::string &heading, const std::string &content,
|
||||||
bool close = true) {
|
bool close = true) {
|
||||||
// a sheet of paper on two more; it slides in once when its menu opens, not on every redraw
|
// a sheet of paper on two more; it slides in once when its menu opens, not on every redraw
|
||||||
@@ -635,7 +654,7 @@ class App final : public Rml::EventListener {
|
|||||||
return "<div class=\"sheet-under first" + arriving + "\"></div><div class=\"sheet-under second" + arriving + "\"></div><div class=\"window" + arriving + "\"><div class=\"titlebar\"" + club_rule + ">" +
|
return "<div class=\"sheet-under first" + arriving + "\"></div><div class=\"sheet-under second" + arriving + "\"></div><div class=\"window" + arriving + "\"><div class=\"titlebar\"" + club_rule + ">" +
|
||||||
(close ? btn("close", "<span>×</span>", "close", "id=\"window-close\" aria-label=\"" + std::string(menu_ == "bank" && bank_view_ != "entrance" ? "Zurück zur Bankhalle" : "Fenster schließen") + "\"")
|
(close ? btn("close", "<span>×</span>", "close", "id=\"window-close\" aria-label=\"" + std::string(menu_ == "bank" && bank_view_ != "entrance" ? "Zurück zur Bankhalle" : "Fenster schließen") + "\"")
|
||||||
: "<span style=\"width:76dp;\"></span>") +
|
: "<span style=\"width:76dp;\"></span>") +
|
||||||
"<h1>" + esc(heading) + "</h1>" + club_mark + "</div><div class=\"content\">" +
|
"<h1>" + esc(heading) + "</h1>" + club_mark + "</div>" + window_art() + "<div class=\"content\">" +
|
||||||
content + "</div>" + (amount_ ? render_amount() : "") + "</div>";
|
content + "</div>" + (amount_ ? render_amount() : "") + "</div>";
|
||||||
}
|
}
|
||||||
std::string
|
std::string
|
||||||
|
|||||||
Reference in new issue
Block a user