modified: __pycache__/app.cpython-310.pyc
modified: app.py modified: static/css/style.css modified: templates/weather.html
This commit is contained in:
Binary file not shown.
11
app.py
11
app.py
@@ -202,13 +202,17 @@ def wetter():
|
|||||||
|
|
||||||
# "Aktuell" = erste Stunde >= jetzt (UTC), sonst erste verfügbare
|
# "Aktuell" = erste Stunde >= jetzt (UTC), sonst erste verfügbare
|
||||||
now_utc = _dt.datetime.now(_dt.timezone.utc).replace(tzinfo=None)
|
now_utc = _dt.datetime.now(_dt.timezone.utc).replace(tzinfo=None)
|
||||||
current = forecast[0]
|
now_local = _dt.datetime.now() # lokale Serverzeit für Anzeige
|
||||||
for h in forecast:
|
current_idx = 0
|
||||||
|
for i, h in enumerate(forecast):
|
||||||
dt = h["datetime"]
|
dt = h["datetime"]
|
||||||
dt_naive = dt.replace(tzinfo=None) if hasattr(dt, "tzinfo") and dt.tzinfo is not None else dt
|
dt_naive = dt.replace(tzinfo=None) if hasattr(dt, "tzinfo") and dt.tzinfo is not None else dt
|
||||||
if dt_naive >= now_utc:
|
if dt_naive >= now_utc:
|
||||||
current = h
|
current_idx = i
|
||||||
break
|
break
|
||||||
|
current = forecast[current_idx]
|
||||||
|
# Stundenliste ab jetzt kürzen
|
||||||
|
forecast = forecast[current_idx:]
|
||||||
|
|
||||||
# Tageszusammenfassung
|
# Tageszusammenfassung
|
||||||
daily = {}
|
daily = {}
|
||||||
@@ -262,6 +266,7 @@ def wetter():
|
|||||||
station_id=station_id,
|
station_id=station_id,
|
||||||
station_dist=station_dist,
|
station_dist=station_dist,
|
||||||
current=current,
|
current=current,
|
||||||
|
now_local=now_local.strftime("%H:%M"),
|
||||||
forecast=forecast[:48],
|
forecast=forecast[:48],
|
||||||
daily=daily_summary,
|
daily=daily_summary,
|
||||||
chart_labels=chart_labels,
|
chart_labels=chart_labels,
|
||||||
|
|||||||
@@ -278,6 +278,10 @@ main { flex: 1; }
|
|||||||
}
|
}
|
||||||
.hero-meta svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--orange); }
|
.hero-meta svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--orange); }
|
||||||
.hero-meta-sub { color: var(--muted); font-weight: 400; }
|
.hero-meta-sub { color: var(--muted); font-weight: 400; }
|
||||||
|
.hero-meta-time {
|
||||||
|
margin-left: auto; font-variant-numeric: tabular-nums;
|
||||||
|
color: var(--orange); font-weight: 600; letter-spacing: 0.04em;
|
||||||
|
}
|
||||||
|
|
||||||
.hero-main {
|
.hero-main {
|
||||||
display: flex; align-items: flex-start; gap: 2rem;
|
display: flex; align-items: flex-start; gap: 2rem;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
||||||
{{ display_name.split(',')[0] }}
|
{{ display_name.split(',')[0] }}
|
||||||
<span class="hero-meta-sub">{{ display_name.split(',')[1:3]|join(',') if ',' in display_name else '' }}</span>
|
<span class="hero-meta-sub">{{ display_name.split(',')[1:3]|join(',') if ',' in display_name else '' }}</span>
|
||||||
|
<span class="hero-meta-time">{{ now_local }} Uhr</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hero-main">
|
<div class="hero-main">
|
||||||
@@ -70,7 +71,8 @@
|
|||||||
{% for h in forecast %}
|
{% for h in forecast %}
|
||||||
<div class="hcard {% if loop.first %}hcard--now{% endif %}">
|
<div class="hcard {% if loop.first %}hcard--now{% endif %}">
|
||||||
<div class="hcard-time">
|
<div class="hcard-time">
|
||||||
{% if h.datetime is string %}{{ h.datetime[11:16] }}
|
{% if loop.first %}Jetzt
|
||||||
|
{% elif h.datetime is string %}{{ h.datetime[11:16] }}
|
||||||
{% else %}{{ h.datetime.strftime('%H:%M') }}{% endif %}
|
{% else %}{{ h.datetime.strftime('%H:%M') }}{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="hcard-date">
|
<div class="hcard-date">
|
||||||
|
|||||||
Reference in New Issue
Block a user