modified: app.py

modified:   static/css/style.css
	modified:   templates/weather.html
This commit is contained in:
simon
2026-04-22 13:48:21 +02:00
parent 1f0849d9a1
commit 778c024335
3 changed files with 316 additions and 21 deletions

View File

@@ -64,7 +64,8 @@
 ·  🌅 {{ sunrise }}  ·  🌇 {{ sunset }}
{% endif %}
{% if current.uv_index is not none %}
 ·  UV {{ current.uv_index }}
{% set uv_label, uv_level = uv_risk_info(current.uv_index) %}
 ·  UV {{ current.uv_index }} ({{ uv_label }})
{% endif %}
</div>
</header>
@@ -76,14 +77,64 @@
<span class="warn-icon">{{ '⚠️' if w.level == 1 else ('🟠' if w.level == 2 else ('🔴' if w.level >= 3 else '⚠️')) }}</span>
<div>
<strong>{{ w.headline }}</strong>
{% if w.onset %}<p class="warn-time">{% if w.onset is string %}{{ w.onset[8:10] }}.{{ w.onset[5:7] }}. {{ w.onset[11:16] }}{% else %}{{ w.onset }}{% endif %}{% if w.expires %} {% if w.expires is string %}{{ w.expires[8:10] }}.{{ w.expires[5:7] }}. {{ w.expires[11:16] }}{% else %}{{ w.expires }}{% endif %}{% endif %}</p>{% endif %}
{% if w.description %}<p class="warn-desc">{{ w.description[:250] }}{% if w.description|length > 250 %}…{% endif %}</p>{% endif %}
{% if w.onset_dt or w.expires_dt %}
<p class="warn-time">
{% if w.onset_dt %}{{ w.onset_dt.strftime('%d.%m. %H:%M') }}{% endif %}
{% if w.expires_dt %} {{ w.expires_dt.strftime('%d.%m. %H:%M') }}{% endif %}
</p>
{% endif %}
{% if w.description %}
{% set short_desc = w.description.split('. ')[0] %}
<p class="warn-desc">{{ short_desc }}{% if short_desc|length < w.description|length %}.{% endif %}</p>
{% if short_desc|length < w.description|length %}
<details class="warn-more">
<summary>Details</summary>
<p>{{ w.description }}</p>
</details>
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
<section class="section insights">
<h2 class="section-title">Kurzfazit</h2>
<div class="insight-grid">
<div class="insight-card">
<span class="insight-label">Temperaturtrend (6h)</span>
<strong class="insight-value">
{% if temp_delta_6h is not none %}
{% if temp_delta_6h > 0 %}+{% endif %}{{ temp_delta_6h }}° · {{ temp_trend_6h }}
{% else %}
{% endif %}
</strong>
</div>
<div class="insight-card">
<span class="insight-label">Drucktrend (6h)</span>
<strong class="insight-value">
{% if pressure_delta is not none %}
{% if pressure_delta > 0 %}+{% endif %}{{ pressure_delta }} hPa · {{ pressure_trend }}
{% else %}
{% endif %}
</strong>
</div>
<div class="insight-card">
<span class="insight-label">Bestes Aktivitätsfenster</span>
<strong class="insight-value">
{% if best_window %}
{{ best_window.start.strftime('%H:%M') }}{{ best_window.end.strftime('%H:%M') }} · Score {{ best_window.score }}
{% else %}
{% endif %}
</strong>
</div>
</div>
</section>
<!-- STÜNDLICH -->
<section class="section">
<h2 class="section-title">Stundenweise</h2>
@@ -114,8 +165,10 @@
{% if h.wind_kmh is not none %}
<div class="hcard-wind">{{ h.wind_kmh }}<small>km/h</small></div>
{% endif %}
<div class="hcard-confidence hcard-confidence--{{ h.confidence_label }}">{{ h.confidence }}%</div>
<div class="hcard-activity">Aktiv {{ h.activity_score }}</div>
{% if h.uv_index is not none and h.uv_index > 0 %}
<div class="hcard-uv">UV {{ h.uv_index }}</div>
<div class="hcard-uv hcard-uv--{{ h.uv_level }}">UV {{ h.uv_index }} {{ h.uv_label }}</div>
{% endif %}
</div>
{% endfor %}
@@ -126,7 +179,7 @@
<!-- CHART -->
<section class="section">
<div class="chart-head">
<h2 class="section-title">Temperatur &amp; Niederschlag</h2>
<h2 class="section-title">Temperatur, Gefühlt &amp; Niederschlag</h2>
<span class="chart-range">48 Stunden</span>
</div>
<div class="chart-box">
@@ -212,6 +265,7 @@
(function() {
const labels = {{ chart_labels | tojson }};
const temps = {{ chart_temps | tojson }};
const feels = {{ chart_feels | tojson }};
const precip = {{ chart_precip | tojson }};
const rainProb = {{ chart_rain_prob | tojson }};
@@ -249,6 +303,19 @@
pointHoverRadius: 5,
pointHoverBackgroundColor: "#ff8c32",
},
{
type: "line",
label: "Gefühlt (°C)",
data: feels,
borderColor: "#ffd4a8",
borderDash: [5, 4],
borderWidth: 1.8,
tension: 0.45,
fill: false,
yAxisID: "yT",
pointRadius: 0,
pointHoverRadius: 4,
},
{
type: "bar",
label: barLabel,