diff --git a/assets/modern/theme.rcss b/assets/modern/theme.rcss index 1dd453b..3bf1698 100644 --- a/assets/modern/theme.rcss +++ b/assets/modern/theme.rcss @@ -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;} .identity strong {font-family:Display;font-size:44dp;} .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;} diff --git a/src/modern/ui/view.cpp b/src/modern/ui/view.cpp index fa4e4f7..fb7cf21 100644 --- a/src/modern/ui/view.cpp +++ b/src/modern/ui/view.cpp @@ -614,6 +614,25 @@ class App final : public Rml::EventListener { esc(world_->name(*c)) + "" : ""; } + // A sheet may carry a faint picture of its subject under its content: the data set's + // "art.paper-.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 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 "
" + picture(art, 2720, 1932, true) + "
"; + } + return {}; + } std::string window(const std::string &heading, const std::string &content, bool close = true) { // 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 "
" + (close ? btn("close", "×", "close", "id=\"window-close\" aria-label=\"" + std::string(menu_ == "bank" && bank_view_ != "entrance" ? "Zurück zur Bankhalle" : "Fenster schließen") + "\"") : "") + - "

" + esc(heading) + "

" + club_mark + "
" + + "

" + esc(heading) + "

" + club_mark + "
" + window_art() + "
" + content + "
" + (amount_ ? render_amount() : "") + "
"; } std::string