From 79851781aae194d732f432513ad55f66184b015e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Tue, 26 May 2026 04:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E:=2024h=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E9=A2=84=E6=8A=A5=E9=99=8D=E6=B0=B4=E6=A6=82=E7=8E=87+?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=97=B4=E8=B7=9D=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 24h预报卡片显示降水概率(非0%时显示) - MULTI布局组件间距统一为20px,边距统一40px - 时间卡片和星座卡片垂直间距调整 --- weather.go | 4 +++- web/overlay.html | 37 +++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/weather.go b/weather.go index e47c154..662d84a 100644 --- a/weather.go +++ b/weather.go @@ -167,6 +167,7 @@ type hourlyItem struct { Time string `json:"time"` Temp string `json:"temp"` Icon string `json:"icon"` + Pop string `json:"pop,omitempty"` } type dailyItem struct { @@ -267,6 +268,7 @@ func fetchHourlyForecast(cityID string) []hourlyItem { Hourly []struct { FxTime string `json:"fxTime"` Temp string `json:"temp"` + Pop string `json:"pop"` Text string `json:"text"` } `json:"hourly"` } @@ -285,7 +287,7 @@ func fetchHourlyForecast(cityID string) []hourlyItem { t = t[:5] } } - result = append(result, hourlyItem{t, h.Temp + "°", getWeatherIcon(h.Text)}) + result = append(result, hourlyItem{t, h.Temp + "°", getWeatherIcon(h.Text), h.Pop}) } return result } diff --git a/web/overlay.html b/web/overlay.html index 29e3f97..2ceadbe 100644 --- a/web/overlay.html +++ b/web/overlay.html @@ -89,6 +89,7 @@ html, body { .forecast-icon { font-size: 20px; margin: 4px 0; } .forecast-time { opacity: 0.6; font-size: 10px; } .forecast-temp { font-weight: 600; margin-top: 2px; font-size: 13px; } +.forecast-pop { font-size: 10px; opacity: 0.6; margin-top: 1px; } .daily-forecast { display: flex; gap: 6px; @@ -309,20 +310,34 @@ body.layout-multi #card-time { min-width: 280px; z-index: 10; } +body.layout-multi #card-zodiac { + position: fixed; + top: 160px; + right: 40px; + width: 280px; + z-index: 10; +} +body.layout-multi #card-ainews { + position: fixed; + bottom: 40px; + left: 40px; + width: calc(50vw - 80px); + z-index: 10; +} body.layout-multi #card-bottom { position: fixed; - bottom: 80px; + bottom: 40px; right: 40px; width: calc(50vw - 60px); display: flex; - gap: 16px; + gap: 20px; align-items: flex-end; z-index: 10; } body.layout-multi #card-right-col { display: flex; flex-direction: column; - gap: 16px; + gap: 20px; flex: 1; min-width: 0; } @@ -335,20 +350,6 @@ body.layout-multi #card-right-col #card-ainews { body.layout-multi #card-bottom #card-weather { text-align: right; } -body.layout-multi #card-ainews { - position: fixed; - bottom: 80px; - left: 40px; - width: calc(50vw - 80px); - z-index: 10; -} -body.layout-multi #card-zodiac { - position: fixed; - top: 200px; - right: 40px; - width: 280px; - z-index: 10; -} /* ===== 卡片隐藏 ===== */ body.hide-time #card-time, @@ -701,7 +702,7 @@ window.updateWeatherFromGo=function(data){ if(fel){ if(data.hourly&&data.hourly.length>0){ fel.innerHTML=data.hourly.map(function(item){ - return '
'+item.time+'
'+item.icon+'
'+item.temp+'
'; + return '
'+item.time+'
'+item.icon+'
'+item.temp+'
'+(item.pop&&item.pop!=='0'?'
'+item.pop+'%
':'')+'
'; }).join(''); } else { fel.innerHTML='
暂无数据
'; } }