modified: __pycache__/app.cpython-310.pyc

modified:   app.py
	modified:   requirements.txt
	modified:   static/css/style.css
	modified:   templates/base.html
	modified:   templates/index.html
	modified:   templates/weather.html
This commit is contained in:
SimolZimol
2026-04-21 11:34:19 +02:00
parent 55bda8ea5e
commit 164d0eb6a8
7 changed files with 364 additions and 189 deletions

View File

@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% block title %}{{ display_name.split(',')[0] }} DWD Wetter{% endblock %}
{% block title %}{{ display_name.split(',')[0] }} Skywatcher{% endblock %}
{% block head %}
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.2/dist/chart.umd.min.js"></script>
@@ -44,7 +44,7 @@
<div class="hero-metrics">
{% set items = [
("Gefühlt wie", (current.temp_c|string + " °C") if current.temp_c is not none else ""),
("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 ""),
@@ -59,10 +59,30 @@
</div>
<div class="hero-station">
📡 Station <strong>{{ station_name }}</strong> ({{ station_dist }} km) · ID {{ station_id }}
📡 Station <strong>{{ station_name }}</strong> ({{ station_dist }} km)
{% if sunrise %}
&nbsp;·&nbsp; 🌅 {{ sunrise }} &nbsp;·&nbsp; 🌇 {{ sunset }}
{% endif %}
{% if current.uv_index is not none %}
&nbsp;·&nbsp; UV {{ current.uv_index }}
{% endif %}
</div>
</header>
{% if warnings %}
<div class="warnings">
{% for w in warnings %}
<div class="warn-item warn-lvl-{{ w.level }}">
<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.description %}<p class="warn-desc">{{ w.description[:140] }}{% if w.description|length > 140 %}…{% endif %}</p>{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
<!-- STÜNDLICH -->
<section class="section">
<h2 class="section-title">Stundenweise</h2>
@@ -93,6 +113,9 @@
{% if h.wind_kmh is not none %}
<div class="hcard-wind">{{ h.wind_kmh }}<small>km/h</small></div>
{% endif %}
{% if h.uv_index is not none and h.uv_index > 0 %}
<div class="hcard-uv">UV {{ h.uv_index }}</div>
{% endif %}
</div>
{% endfor %}
</div>
@@ -159,6 +182,9 @@
{% elif d.rain_prob is not none and d.rain_prob > 0 %}
<span class="drow-precip">💧 {{ d.rain_prob }}%</span>
{% endif %}
{% if d.uv_max is not none and d.uv_max > 0 %}
<span class="drow-uv">UV {{ d.uv_max }}</span>
{% endif %}
</div>
</div>
{% endfor %}
@@ -166,12 +192,22 @@
</section>
<p class="data-note">
Alle Daten: <a href="https://opendata.dwd.de" target="_blank">Deutscher Wetterdienst Open Data (MOSMIX)</a>
Wetterdaten: <a href="https://opendata.dwd.de" target="_blank">Deutscher Wetterdienst Open Data (MOSMIX)</a>
</p>
{% endblock %}
{% block scripts %}
<script>
// ── Letzte Suchen speichern ──────────────────────────────────────────────────
(function(){
const key = "sw_recent";
const ort = {{ ort | tojson }};
let recent = JSON.parse(localStorage.getItem(key) || "[]");
recent = [ort, ...recent.filter(x => x !== ort)].slice(0, 6);
localStorage.setItem(key, JSON.stringify(recent));
})();
</script>
<script>
(function() {
const labels = {{ chart_labels | tojson }};
const temps = {{ chart_temps | tojson }};