fixed?
This commit is contained in:
@@ -374,7 +374,6 @@ data:
|
||||
<style>
|
||||
.idokep-wrap { display:grid; gap:12px; }
|
||||
|
||||
/* TOP */
|
||||
.idokep-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
|
||||
.idokep-now { display:flex; align-items:center; gap:12px; }
|
||||
.idokep-now img { width:44px; height:44px; }
|
||||
@@ -382,7 +381,6 @@ data:
|
||||
.idokep-cond { opacity:.85; font-size:13px; margin-top:2px; }
|
||||
.idokep-place { opacity:.75; font-size:12px; text-align:right; }
|
||||
|
||||
/* HOURLY STRIP */
|
||||
.idokep-hourly {
|
||||
display:grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
@@ -403,7 +401,6 @@ data:
|
||||
.idokep-h .v { font-weight:600; }
|
||||
.idokep-h .p { font-size:11px; opacity:.70; }
|
||||
|
||||
/* DAILY BARS */
|
||||
.idokep-daily { display:grid; gap:10px; margin-top:2px; }
|
||||
.idokep-d {
|
||||
display:grid;
|
||||
@@ -432,6 +429,7 @@ data:
|
||||
.idokep-foot { font-size:11px; opacity:.65; margin-top:2px; }
|
||||
.idokep-foot a { opacity:.8; }
|
||||
.idokep-err { opacity:.85; font-size:13px; }
|
||||
.idokep-muted { opacity:.7; font-size:12px; padding: 4px 0; }
|
||||
</style>
|
||||
|
||||
{{ if .JSON.Exists "error" }}
|
||||
@@ -440,40 +438,44 @@ data:
|
||||
Place: <b>{{ .JSON.String "place" }}</b>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ $c := .JSON "current" }}
|
||||
{{ $hourly := .JSON.Array "hourly" }}
|
||||
{{ $daily := .JSON.Array "daily" }}
|
||||
{{ $src := .JSON "source" }}
|
||||
|
||||
<div class="idokep-wrap">
|
||||
<div class="idokep-top">
|
||||
<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 class="idokep-temp">{{ $c.Float "temp_c" | toInt }}°C</div>
|
||||
<div class="idokep-cond">{{ $c.String "condition_hu" }}</div>
|
||||
{{ if .JSON.Exists "current.temp_c" }}
|
||||
<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 class="idokep-place">{{ .JSON.String "place" }}</div>
|
||||
</div>
|
||||
|
||||
<div class="idokep-hourly">
|
||||
{{ range $hourly }}
|
||||
<div class="idokep-h">
|
||||
<div class="t">{{ .String "hour" }}</div>
|
||||
{{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }}
|
||||
<div class="v">{{ .Float "temp_c" | toInt }}°</div>
|
||||
{{ if .Exists "precip_pct" }}
|
||||
<div class="p">{{ .Float "precip_pct" | toInt }}%</div>
|
||||
{{ else }}
|
||||
<div class="p"> </div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ $hourly := .JSON.Array "hourly" }}
|
||||
{{ if gt (len $hourly) 0 }}
|
||||
<div class="idokep-hourly">
|
||||
{{ range $hourly }}
|
||||
<div class="idokep-h">
|
||||
<div class="t">{{ .String "hour" }}</div>
|
||||
{{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }}
|
||||
{{ if .Exists "temp_c" }}<div class="v">{{ .Float "temp_c" | toInt }}°</div>{{ else }}<div class="v">—</div>{{ end }}
|
||||
{{ if .Exists "precip_pct" }}
|
||||
<div class="p">{{ .Float "precip_pct" | toInt }}%</div>
|
||||
{{ else }}
|
||||
<div class="p"> </div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="idokep-muted">No hourly data returned by scraper yet.</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="idokep-daily">
|
||||
{{ range $daily }}
|
||||
{{ range .JSON.Array "daily" }}
|
||||
<div class="idokep-d">
|
||||
<div class="dow">{{ .String "dow" }}</div>
|
||||
{{ if .Exists "icon_url" }}<img src="{{ .String "icon_url" }}" alt="">{{ end }}
|
||||
@@ -485,8 +487,8 @@ data:
|
||||
{{ end }}
|
||||
</div>
|
||||
<div style="display:flex; align-items:center; gap:8px;">
|
||||
<div style="font-weight:600;">{{ .Float "tmin_c" | toInt }}°</div>
|
||||
<div style="opacity:.85;">{{ .Float "tmax_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 }}
|
||||
{{ 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 }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -494,7 +496,7 @@ data:
|
||||
</div>
|
||||
|
||||
<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>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user