This commit is contained in:
2026-01-14 15:51:33 +01:00
parent 2b7726b709
commit 2dc9761809
+31 -29
View File
@@ -374,7 +374,6 @@ data:
<style> <style>
.idokep-wrap { display:grid; gap:12px; } .idokep-wrap { display:grid; gap:12px; }
/* TOP */
.idokep-top { display:flex; align-items:center; justify-content:space-between; gap:12px; } .idokep-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.idokep-now { display:flex; align-items:center; gap:12px; } .idokep-now { display:flex; align-items:center; gap:12px; }
.idokep-now img { width:44px; height:44px; } .idokep-now img { width:44px; height:44px; }
@@ -382,7 +381,6 @@ data:
.idokep-cond { opacity:.85; font-size:13px; margin-top:2px; } .idokep-cond { opacity:.85; font-size:13px; margin-top:2px; }
.idokep-place { opacity:.75; font-size:12px; text-align:right; } .idokep-place { opacity:.75; font-size:12px; text-align:right; }
/* HOURLY STRIP */
.idokep-hourly { .idokep-hourly {
display:grid; display:grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
@@ -403,7 +401,6 @@ data:
.idokep-h .v { font-weight:600; } .idokep-h .v { font-weight:600; }
.idokep-h .p { font-size:11px; opacity:.70; } .idokep-h .p { font-size:11px; opacity:.70; }
/* DAILY BARS */
.idokep-daily { display:grid; gap:10px; margin-top:2px; } .idokep-daily { display:grid; gap:10px; margin-top:2px; }
.idokep-d { .idokep-d {
display:grid; display:grid;
@@ -432,6 +429,7 @@ data:
.idokep-foot { font-size:11px; opacity:.65; margin-top:2px; } .idokep-foot { font-size:11px; opacity:.65; margin-top:2px; }
.idokep-foot a { opacity:.8; } .idokep-foot a { opacity:.8; }
.idokep-err { opacity:.85; font-size:13px; } .idokep-err { opacity:.85; font-size:13px; }
.idokep-muted { opacity:.7; font-size:12px; padding: 4px 0; }
</style> </style>
{{ if .JSON.Exists "error" }} {{ if .JSON.Exists "error" }}
@@ -440,40 +438,44 @@ data:
Place: <b>{{ .JSON.String "place" }}</b> Place: <b>{{ .JSON.String "place" }}</b>
</div> </div>
{{ else }} {{ else }}
{{ $c := .JSON "current" }}
{{ $hourly := .JSON.Array "hourly" }}
{{ $daily := .JSON.Array "daily" }}
{{ $src := .JSON "source" }}
<div class="idokep-wrap"> <div class="idokep-wrap">
<div class="idokep-top"> <div class="idokep-top">
<div class="idokep-now"> <div class="idokep-now">
{{ if $c.Exists "icon_url" }}<img src="{{ $c.String "icon_url" }}" alt="">{{ end }} {{ if .JSON.Exists "current.icon_url" }}<img src="{{ .JSON.String "current.icon_url" }}" alt="">{{ end }}
<div> <div>
<div class="idokep-temp">{{ $c.Float "temp_c" | toInt }}°C</div> {{ if .JSON.Exists "current.temp_c" }}
<div class="idokep-cond">{{ $c.String "condition_hu" }}</div> <div class="idokep-temp">{{ .JSON.Float "current.temp_c" | toInt }}°C</div>
{{ else }}
<div class="idokep-temp">—</div>
{{ end }}
<div class="idokep-cond">{{ .JSON.String "current.condition_hu" }}</div>
</div> </div>
</div> </div>
<div class="idokep-place">{{ .JSON.String "place" }}</div> <div class="idokep-place">{{ .JSON.String "place" }}</div>
</div> </div>
<div class="idokep-hourly"> {{ $hourly := .JSON.Array "hourly" }}
{{ range $hourly }} {{ if gt (len $hourly) 0 }}
<div class="idokep-h"> <div class="idokep-hourly">
<div class="t">{{ .String "hour" }}</div> {{ range $hourly }}
{{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }} <div class="idokep-h">
<div class="v">{{ .Float "temp_c" | toInt }}°</div> <div class="t">{{ .String "hour" }}</div>
{{ if .Exists "precip_pct" }} {{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }}
<div class="p">{{ .Float "precip_pct" | toInt }}%</div> {{ if .Exists "temp_c" }}<div class="v">{{ .Float "temp_c" | toInt }}°</div>{{ else }}<div class="v">—</div>{{ end }}
{{ else }} {{ if .Exists "precip_pct" }}
<div class="p">&nbsp;</div> <div class="p">{{ .Float "precip_pct" | toInt }}%</div>
{{ end }} {{ else }}
</div> <div class="p">&nbsp;</div>
{{ end }} {{ end }}
</div> </div>
{{ end }}
</div>
{{ else }}
<div class="idokep-muted">No hourly data returned by scraper yet.</div>
{{ end }}
<div class="idokep-daily"> <div class="idokep-daily">
{{ range $daily }} {{ range .JSON.Array "daily" }}
<div class="idokep-d"> <div class="idokep-d">
<div class="dow">{{ .String "dow" }}</div> <div class="dow">{{ .String "dow" }}</div>
{{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }} {{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }}
@@ -485,8 +487,8 @@ data:
{{ end }} {{ end }}
</div> </div>
<div style="display:flex; align-items:center; gap:8px;"> <div style="display:flex; align-items:center; gap:8px;">
<div style="font-weight:600;">{{ .Float "tmin_c" | toInt }}°</div> {{ if .Exists "tmin_c" }}<div style="font-weight:600;">{{ .Float "tmin_c" | toInt }}°</div>{{ else }}<div style="font-weight:600;">—</div>{{ end }}
<div style="opacity:.85;">{{ .Float "tmax_c" | toInt }}°</div> {{ if .Exists "tmax_c" }}<div style="opacity:.85;">{{ .Float "tmax_c" | toInt }}°</div>{{ else }}<div style="opacity:.85;">—</div>{{ end }}
{{ if .Exists "prec_mm" }}<div class="idokep-mm">{{ .Float "prec_mm" }}mm</div>{{ end }} {{ if .Exists "prec_mm" }}<div class="idokep-mm">{{ .Float "prec_mm" }}mm</div>{{ end }}
</div> </div>
</div> </div>
@@ -494,7 +496,7 @@ data:
</div> </div>
<div class="idokep-foot"> <div class="idokep-foot">
Forrás: <a href="{{ $src.String "url" }}" target="_blank">{{ $src.String "name" }}</a> Forrás: <a href="{{ .JSON.String "source.url" }}" target="_blank">{{ .JSON.String "source.name" }}</a>
</div> </div>
</div> </div>
{{ end }} {{ end }}