From ef24680baffe3b7b3aec67f71c00d3ed24da715c Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:38:09 +0000 Subject: [PATCH 1/3] Fix overlap issues in weather and dns-stats widgets --- internal/assets/static/main.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index d5ab9bb7..5aa90e5c 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -514,6 +514,7 @@ kbd:active { list-style: none; position: relative; display: flex; + z-index: 1; } .details[open] .summary { @@ -535,6 +536,10 @@ kbd:active { opacity: 1; } +.details:not([open]) .list-with-transition { + display: none; +} + .summary::after { content: "◀"; font-size: 1.2em; @@ -707,6 +712,7 @@ details[open] .summary::after { justify-content: space-between; position: relative; margin-bottom: 1.8rem; + z-index: 1; } .widget-error-header::before { @@ -1095,7 +1101,6 @@ details[open] .summary::after { .dns-stats-graph-gridlines-container { position: absolute; - z-index: -1; inset: 0; } @@ -1122,7 +1127,6 @@ details[open] .summary::after { content: ''; position: absolute; inset: 1px 0; - z-index: -1; opacity: 0; background: var(--color-text-base); transition: opacity .2s; @@ -1264,7 +1268,6 @@ details[open] .summary::after { overflow: hidden; mask-image: linear-gradient(0deg, transparent 40%, #000); -webkit-mask-image: linear-gradient(0deg, transparent 40%, #000); - z-index: -1; } .weather-column-rain::before { From 804cf9916b1c01210234a63d74a0391a686f3666 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:47:30 +0000 Subject: [PATCH 2/3] Change simple icons provider and always use latest version --- internal/widget/fields.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/widget/fields.go b/internal/widget/fields.go index 9ae1eda6..72ade158 100644 --- a/internal/widget/fields.go +++ b/internal/widget/fields.go @@ -162,7 +162,7 @@ func toSimpleIconIfPrefixed(icon string) (string, bool) { } icon = strings.TrimPrefix(icon, "si:") - icon = "https://cdnjs.cloudflare.com/ajax/libs/simple-icons/11.14.0/" + icon + ".svg" + icon = "https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/" + icon + ".svg" return icon, true } From 949fde151708f18834679d4fd0652be3b4d63f5c Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:50:34 +0000 Subject: [PATCH 3/3] Fix edge case in weather widget graph --- internal/feed/openmeteo.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/feed/openmeteo.go b/internal/feed/openmeteo.go index 2a8dfa62..2bfa8f22 100644 --- a/internal/feed/openmeteo.go +++ b/internal/feed/openmeteo.go @@ -189,12 +189,19 @@ func FetchWeatherForPlace(place *PlaceJson, units string) (*Weather, error) { minT := slices.Min(temperatures) maxT := slices.Max(temperatures) + temperaturesRange := float64(maxT - minT) + for i := 0; i < 12; i++ { bars = append(bars, weatherColumn{ Temperature: temperatures[i], - Scale: float64(temperatures[i]-minT) / float64(maxT-minT), HasPrecipitation: precipitations[i], }) + + if temperaturesRange > 0 { + bars[i].Scale = float64(temperatures[i]-minT) / temperaturesRange + } else { + bars[i].Scale = 1 + } } }