Frame.theme (7 presets in app/theme_tokens.py) drives font family, corner radius, drop shadow, and an accent hue for every modern-style widget's header/accent region. Rich accent colors (not just the 6 flat panel inks) are approximated via denser Bayer stippling confined to just that region (html_render.ordered_dither_regions), so icon/text content elsewhere stays exactly as crisp as it is today -- verified directly against real Chromium renders, both in unit tests and via run-server. "classic" is a byte-identical no-visual-change default: weather's header keeps its original fixed blue gradient, tasks/calendar keep their flat THEME_* ink. Themes are purely stylistic -- battery's charge-level color, calendar/ tasks' per-owner event chips, and text's own per-widget font choice are never touched.
52 lines
1.9 KiB
Django/Jinja
52 lines
1.9 KiB
Django/Jinja
<!doctype html>
|
|
<html><head><style>
|
|
@font-face { font-family: "ThemeFont"; src: url("file://{{ font_regular }}"); font-weight: 400; }
|
|
@font-face { font-family: "ThemeFont"; src: url("file://{{ font_bold }}"); font-weight: 700; }
|
|
* { margin: 0; padding: 0; box-sizing: border-box; font-family: "ThemeFont", sans-serif; }
|
|
body { width: {{ w }}px; height: {{ h }}px; background: #ffffff; }
|
|
.card {
|
|
width: {{ w - gutter * 2 }}px;
|
|
height: {{ h - gutter * 2 }}px;
|
|
margin: {{ gutter }}px;
|
|
border-radius: {{ radius }}px;
|
|
overflow: hidden;
|
|
{% if shadow %}box-shadow: 0 4px 14px rgba(0, 20, 60, 0.25);{% endif %}
|
|
background: #ffffff;
|
|
}
|
|
.header {
|
|
height: {{ header_h }}px;
|
|
background: linear-gradient(135deg, {{ accent_start }} 0%, {{ accent_end }} 100%);
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 16px;
|
|
}
|
|
.header .title { color: #ffffff; font-weight: 700; font-size: {{ title_size }}px; }
|
|
.body { display: flex; height: calc(100% - {{ header_h }}px); padding: 12px 8px; }
|
|
.col {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 5px;
|
|
}
|
|
.day { font-weight: 600; font-size: {{ label_size }}px; color: #17233b; }
|
|
.icon { font-size: {{ icon_size }}px; line-height: 1; }
|
|
.temps { font-weight: 700; font-size: {{ label_size }}px; color: #17233b; }
|
|
.temps .low { color: #6b7788; font-weight: 400; }
|
|
</style></head>
|
|
<body>
|
|
<div class="card">
|
|
{% if city_label %}<div class="header"><div class="title">{{ city_label }}</div></div>{% endif %}
|
|
<div class="body">
|
|
{% for d in days %}
|
|
<div class="col">
|
|
<div class="day">{{ d.label }}</div>
|
|
<div class="icon">{{ d.emoji }}</div>
|
|
<div class="temps">{{ d.high }}°<span class="low">/{{ d.low }}°{{ unit_suffix }}</span></div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</body></html>
|