design tweaks

This commit is contained in:
2026-01-14 19:03:44 +01:00
parent ea9e24fcde
commit 75f1d1f18a
2 changed files with 30 additions and 11 deletions
+26 -10
View File
@@ -367,7 +367,7 @@ data:
widgets: widgets:
# Weather Widget (Időkép) # Weather Widget (Időkép)
- type: custom-api - type: custom-api
title: "Időkép Budapest VIII." title: "Időkép Budapest VII."
url: "http://idokep-scraper.glance-system.svc.cluster.local:8000/api?v=2" url: "http://idokep-scraper.glance-system.svc.cluster.local:8000/api?v=2"
cache: 30s cache: 30s
template: | template: |
@@ -436,21 +436,20 @@ data:
{{ $tmax := .Float "tmax_c" }} {{ $tmax := .Float "tmax_c" }}
{{ $left := mul (div (sub $tmin $gmin) $span) 100.0 }} {{ $left := mul (div (sub $tmin $gmin) $span) 100.0 }}
{{ $wid := mul (div (sub $tmax $tmin) $span) 100.0 }} {{ $wid := mul (div (sub $tmax $tmin) $span) 100.0 }}
<div class="idokep-row"> <div class="idokep-row">
<div class="idokep-dow">{{ .String "dow" }}</div> <div class="idokep-dow">
<span class="idokep-downame">{{ .String "dow" }}</span>
<span class="idokep-daynum">{{ .String "daynum" }}</span>
</div>
{{ $dicon := .String "icon_url" }} {{ $dicon := .String "icon_url" }}
<div class="idokep-dayicon"> <div class="idokep-dayicon">
{{ if $dicon }}<img src="{{ $dicon }}" alt="" />{{ end }} {{ if $dicon }}<img src="{{ $dicon }}" alt="" />{{ end }}
</div> </div>
<div class="idokep-min">{{ printf "%.0f" $tmin }}°</div>
<div class="idokep-bar"> <div class="idokep-bar">
<div class="idokep-bar-track"></div> <div class="idokep-bar-track"></div>
<div class="idokep-bar-fill" style="left: {{ printf "%.1f" $left }}%; width: {{ printf "%.1f" $wid }}%;"></div> <div class="idokep-bar-fill" style="left: {{ printf "%.1f" $left }}%; width: {{ printf "%.1f" $wid }}%;"></div>
</div> </div>
<div class="idokep-min">{{ printf "%.0f" $tmin }}°</div>
<div class="idokep-max">{{ printf "%.0f" $tmax }}°</div> <div class="idokep-max">{{ printf "%.0f" $tmax }}°</div>
</div> </div>
{{ end }} {{ end }}
@@ -1663,7 +1662,12 @@ data:
.idokep-muted { opacity: 0.6; font-size: 12px; padding: 4px 0; } .idokep-muted { opacity: 0.6; font-size: 12px; padding: 4px 0; }
.idokep-daily { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; } .idokep-daily { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.idokep-row { display: grid; grid-template-columns: 28px 26px 1fr 36px 36px; gap: 10px; align-items: center; } .idokep-row {
display: grid;
grid-template-columns: 44px 26px 36px 1fr 36px; /* day+date, icon, min, bar, max */
gap: 10px;
align-items: center;
}
.idokep-dow { opacity: 0.7; font-weight: 700; } .idokep-dow { opacity: 0.7; font-weight: 700; }
.idokep-dayicon img { width: 22px; height: 22px; opacity: 0.95; } .idokep-dayicon img { width: 22px; height: 22px; opacity: 0.95; }
@@ -1672,12 +1676,24 @@ data:
.idokep-bar-fill { .idokep-bar-fill {
position: absolute; top: 0; bottom: 0; position: absolute; top: 0; bottom: 0;
border-radius: 999px; border-radius: 999px;
background: linear-gradient(90deg, #8BE28B 0%, #FFE17A 50%, #FF9B7A 100%); background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 50%, #fb7185 100%);
box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset; box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset;
} }
.idokep-min, .idokep-max { text-align: right; font-weight: 700; opacity: 0.8; } .idokep-min, .idokep-max { text-align: right; font-weight: 700; opacity: 0.8; }
.idokep-dow {
display: grid;
grid-template-columns: 22px 1fr; /* dow then daynum */
column-gap: 6px;
align-items: center;
opacity: 0.8;
font-weight: 700;
}
.idokep-daynum {
text-align: right;
opacity: 0.75;
font-variant-numeric: tabular-nums;
}
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
+4 -1
View File
@@ -138,11 +138,13 @@ data:
for col in soup.select(".ik.daily-forecast-container .ik.dailyForecastCol")[:15]: for col in soup.select(".ik.daily-forecast-container .ik.dailyForecastCol")[:15]:
dow_el = col.select_one(".ik.dfDay") dow_el = col.select_one(".ik.dfDay")
icon_el = col.select_one("img.ik.forecast-icon") icon_el = col.select_one("img.ik.forecast-icon")
daynum_el = col.select_one(".ik.dfDayNum")
# Normal structure (most days) # Normal structure (most days)
tmax_el = col.select_one("div.ik.max") tmax_el = col.select_one("div.ik.max")
tmin_el = col.select_one("div.ik.min") tmin_el = col.select_one("div.ik.min")
daynum = daynum_el.get_text(strip=True) if daynum_el else ""
dow = dow_el.get_text(strip=True) if dow_el else "" dow = dow_el.get_text(strip=True) if dow_el else ""
icon = _abs_url(icon_el.get("src") if icon_el else None) icon = _abs_url(icon_el.get("src") if icon_el else None)
@@ -167,6 +169,7 @@ data:
if dow and (tmin is not None) and (tmax is not None): if dow and (tmin is not None) and (tmax is not None):
daily.append( daily.append(
{ {
"daynum": daynum,
"dow": dow, # e.g. "Cs", "P", "Sz" "dow": dow, # e.g. "Cs", "P", "Sz"
"tmin_c": tmin, "tmin_c": tmin,
"tmax_c": tmax, "tmax_c": tmax,