modified: app.py

modified:   static/css/style.css
	modified:   templates/weather.html
This commit is contained in:
simon
2026-04-22 14:33:00 +02:00
parent 7b3b66c6fc
commit 3294ccf45a
3 changed files with 85 additions and 4 deletions

View File

@@ -43,11 +43,18 @@
</div>
<div class="hero-metrics">
{% if current.uv_index is not none %}
{% set _uv_l, _uv_lv = uv_risk_info(current.uv_index) %}
{% set uv_curr_str = current.uv_index|string + " " + _uv_l %}
{% else %}
{% set uv_curr_str = "" %}
{% endif %}
{% set items = [
("Gefühlt wie", (current.feels_like|string + " °C") if current.feels_like is not none else ""),
("Böen", (current.gust_kmh|string + " km/h") if current.gust_kmh is not none else ""),
("Niederschlag", (current.precip_mm|string + " mm") if (current.precip_mm is not none and current.precip_mm > 0) else ((current.rain_prob|string + " %") if (current.rain_prob is not none and current.rain_prob > 0) else "0 mm")),
("Sonne", (current.sun_min|string + " min/h") if (current.sun_min is not none and current.sun_min > 0) else ""),
("UV-Index", uv_curr_str),
] %}
{% for label, val in items %}
<div class="hero-metric">
@@ -138,6 +145,16 @@
<!-- STÜNDLICH -->
<section class="section">
<h2 class="section-title">Stundenweise</h2>
<div class="hourly-legend">
<span class="hl-label">Legende:</span>
<span class="hl-badge hl-conf hl-conf--hoch">Konfidenz hoch</span>
<span class="hl-badge hl-conf hl-conf--mittel">mittel</span>
<span class="hl-badge hl-conf hl-conf--niedrig">niedrig</span>
<span class="hl-sep">·</span>
<span class="hl-badge hl-act">Aktivität 0100</span>
<span class="hl-sep">·</span>
<span class="hl-badge hl-uv">UV-Index</span>
</div>
<div class="hourly-strip-wrap">
<div class="hourly-strip">
{% for h in forecast %}
@@ -190,6 +207,11 @@
<!-- TAGESÜBERSICHT -->
<section class="section">
<h2 class="section-title">Tagesübersicht</h2>
<div class="daily-header">
<span>Tag</span>
<span>Temperaturbereich</span>
<span>Min &nbsp;·&nbsp; Max &nbsp;·&nbsp; Nieder. &nbsp;·&nbsp; UV</span>
</div>
<div class="daily-list">
{# calc global min/max for bar scaling do it in a loop to stay Jinja2-safe #}
{% set ns = namespace(g_min=99, g_max=-99) %}