From 81a191f8ba571e8a680cbe1fb2080841a6dbb997 Mon Sep 17 00:00:00 2001 From: Envision <9063072+elapsingdreams@user.noreply.gitee.com> Date: Sun, 11 Aug 2024 01:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Add=20New=20function=20and=20layout=20?= =?UTF-8?q?for=20liteyuki=5Fweather?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../liteyuki_weather/qw_api.py | 17 ++ .../liteyuki_weather/qweather.py | 24 ++- .../templates/css/weather_now.css | 66 +++++- .../templates/img/ad_default/ad_default.png | Bin 0 -> 19893 bytes .../templates/img/svg/cloud.svg | 1 + .../templates/img/svg/feelsLike.svg | 1 + .../templates/img/svg/humidity.svg | 1 + .../templates/img/svg/precip.svg | 1 + .../templates/img/svg/pressure.svg | 1 + .../templates/img/svg/sunrise.svg | 1 + .../templates/img/svg/sunset.svg | 1 + .../templates/img/svg/vis.svg | 1 + .../templates/img/svg/windDirect.svg | 1 + .../templates/img/svg/windVelocity.svg | 1 + .../templates/js/weather_now.js | 41 +++- .../templates/weather_now.html | 193 ++++++++++++------ 17 files changed, 278 insertions(+), 74 deletions(-) create mode 100644 src/resources/liteyuki_weather/templates/img/ad_default/ad_default.png create mode 100644 src/resources/liteyuki_weather/templates/img/svg/cloud.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/feelsLike.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/humidity.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/precip.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/pressure.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/sunrise.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/sunset.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/vis.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/windDirect.svg create mode 100644 src/resources/liteyuki_weather/templates/img/svg/windVelocity.svg diff --git a/.gitignore b/.gitignore index d8bc4873..025ac507 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .venv/ .idea/ +.vscode/ .cache/ node_modules/ data/ diff --git a/src/nonebot_plugins/liteyuki_weather/qw_api.py b/src/nonebot_plugins/liteyuki_weather/qw_api.py index 8f28cd91..ab47fad6 100644 --- a/src/nonebot_plugins/liteyuki_weather/qw_api.py +++ b/src/nonebot_plugins/liteyuki_weather/qw_api.py @@ -169,3 +169,20 @@ async def get_airquality( async with httpx.AsyncClient() as client: resp = await client.get(url, params=params) return resp.json() + +async def get_astronomy( + key: str, + location: str, + date: str, + dev: bool = get_memory_data("is_dev", True), +) -> dict: + url_path = f"v7/astronomy/sun?" + url = dev_url + url_path if dev else com_url + url_path + params = { + "key" : key, + "location" : location, + "date" : date, + } + async with httpx.AsyncClient() as client: + resp = await client.get(url, params=params) + return resp.json() \ No newline at end of file diff --git a/src/nonebot_plugins/liteyuki_weather/qweather.py b/src/nonebot_plugins/liteyuki_weather/qweather.py index 72d3aaee..0afaf931 100644 --- a/src/nonebot_plugins/liteyuki_weather/qweather.py +++ b/src/nonebot_plugins/liteyuki_weather/qweather.py @@ -1,3 +1,5 @@ +import datetime + from nonebot import require, on_endswith from nonebot.adapters import satori from nonebot.adapters.onebot.v11 import MessageSegment @@ -50,6 +52,9 @@ async def get_weather_now_card(matcher: Matcher, event: T_MessageEvent, keyword: qw_lang = get_qw_lang(ulang.lang_code) key = get_config("weather_key") is_dev = get_memory_data("weather.is_dev", True) + extra_info = get_config("weather_extra_info") + attr = get_config("weather_attr") + user: User = user_db.where_one(User(), "user_id = ?", event_utils.get_user_id(event), default=User()) # params unit = user.profile.get("unit", "m") @@ -80,6 +85,7 @@ async def get_weather_now_card(matcher: Matcher, event: T_MessageEvent, keyword: weather_daily = await get_weather_daily(key, location_data.id, lang=qw_lang, unit=unit, dev=is_dev) weather_hourly = await get_weather_hourly(key, location_data.id, lang=qw_lang, unit=unit, dev=is_dev) aqi = await get_airquality(key, location_data.id, lang=qw_lang, dev=is_dev) + weather_astronomy = await get_astronomy(key, location_data.id, date=datetime.datetime.now().strftime('%Y%m%d'), dev=is_dev) image = await template2image( template=get_path("templates/weather_now.html", abs_path=True), @@ -89,13 +95,17 @@ async def get_weather_now_card(matcher: Matcher, event: T_MessageEvent, keyword: "unit": unit, "lang": ulang.lang_code, }, - "weatherNow" : weather_now, - "weatherDaily" : weather_daily, - "weatherHourly": weather_hourly, - "aqi" : aqi, - "location" : location_data.dump(), - "localization" : get_local_data(ulang.lang_code), - "is_dev": 1 if is_dev else 0 + "weatherNow" : weather_now, + "weatherDaily" : weather_daily, + "weatherHourly" : weather_hourly, + "aqi" : aqi, + "location" : location_data.dump(), + "localization" : get_local_data(ulang.lang_code), + "weatherAstronomy" : weather_astronomy, + "is_dev" : 1 if is_dev else 0, + "extra_info" : extra_info, + "attr" : attr + } }, ) diff --git a/src/resources/liteyuki_weather/templates/css/weather_now.css b/src/resources/liteyuki_weather/templates/css/weather_now.css index f25f4ddf..608c93bb 100644 --- a/src/resources/liteyuki_weather/templates/css/weather_now.css +++ b/src/resources/liteyuki_weather/templates/css/weather_now.css @@ -14,7 +14,7 @@ } .icon { -/* icon 类img阴影*/ + /* icon 类img阴影*/ filter: drop-shadow(1px 1px 10px #00000044); } @@ -118,7 +118,7 @@ padding: 20px 10px; } -.hourly-icon{ +.hourly-icon { width: 80%; margin-bottom: 20px; } @@ -167,18 +167,74 @@ height: 80px; } -.daily-weather{ +.daily-weather { position: absolute; left: 30%; } -.daily-temperature{ +.daily-temperature { position: absolute; left: 83%; } -.daily-day, .daily-weather, .daily-temperature { +.daily-day, +.daily-weather, +.daily-temperature { text-align: center; color: var(--main-text-color); font-size: 30px; +} + +.ad-box { + margin-bottom: 20px; + + img { + border-radius: 60px; + } +} + +.sub-info { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; + color: var(--main-text-color); + font-size: 40px; + align-items: center; +} + +.sub-info>div { + display: flex; + align-items: center; + gap: 5px; + overflow: hidden; + padding-left: 20px; + + /*要问就问html调svg为什么那么不友好*/ + img { + transform: translateY(-80px); + /*自定义颜色*/ + filter: drop-shadow(var(--main-text-color) 0 80px); + /*自定义透明度*/ + opacity: 1; + padding-right: 10px; + } +} + +.attribution-box { + margin: 0; + position: relative; + display: flex; + justify-content: center; + + #attribution-info { + backdrop-filter: blur(10px); + padding: 0 5px 0; + background-color: rgba(0, 0, 0, 0.5); + font-size: 25px; + justify-content: space-between; + display: inline-flex; + word-wrap: break-word; + color: var(--sub-text-color); + text-align: center; + } } \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/ad_default/ad_default.png b/src/resources/liteyuki_weather/templates/img/ad_default/ad_default.png new file mode 100644 index 0000000000000000000000000000000000000000..120df813892970a4a358b84d46335b05f29d61be GIT binary patch literal 19893 zcmeFZg|#f;573hbYn_(xB2EGQ=R=^*;0c zz4!hT_nyzkK#ph5dCq?JUVE*ziPP0qCBUV@ML|I!P*+pZLqWm70)Jn?M*hBD_b~$e zf$F8Fs(?~6O1BNZz;Kk;l1D+QPr|#g#spvEc&HhBp`ehyM*c!wa$xjDLDAAsSCZHF zwb;wWY+{}EhV|By4UjbQByc-8)MZ+$4ATg>*a-+FQmMXSaR7(1)j*1T%Z6C$I;*zc z{oHv-$;r1b-fdS;pSRBiR5!YgeETPQ7ajV)gFwYvPU*j+ zxceb~?Ej9(R8gq^J2M6ABR|vs&irNd0PBBeD$%^@3H{%hY7tMVi2v_J`Tzfm{(o{! zU#!aBt;;ruE(Zz)+#L2dsxk&W4%kRhRgk(l=w)W`-zq#LUJX^lMU6xKty*qe$ zfA(^A{$*!w`^8$qEFRytWa;~xW9Gboe_!_3-ij{$ygP`IJ&`KP@@Q{Aoibge>PsZ+ z-%kp;u^rP%cpR~O`_E_gdcSkOnGgC)2N{(n7pJu$xqF|NgJ*3Lcrr%7y)5^AJ08s* z5gLlxLo^KW4&9xU%AQJTT%oJqk4o<6RJX3h&w_uawaK#2pyq?k+P_CE`Yi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&%BzCz4wFEe{&fWWe zjrnfid`t6$3)9at3BOz^XZ&K_`o@my_aB&s1TK&SR+dFqWmhZyl#|MFY<{l3Fx}!V zaKraRk?tz?>%3ysQKlC0r9L*5|IbWH{O$C{R;b2IU`AAQ^NM|+?{CarxBsB2^#sS; z&Z73fLyQbTiRHvYx0j$n@L#i4WON3gogzEPfA6VsDzb z^*GKk{5q_^`^_eWSs!mYJdt>FWXsAs!1ehHQ#-v(-|;2^$7OkoB{|GAC*<(6a@haT zYf;cTyJgmrJIptp1H0G{-)uO{cX}Q$xm`#Ly8c>4{>TnsZ-$+n{U94(Q>Dz7k~5$c z|Dowuqnce@+LS?UbkQ9%mu@k;TUBekC?<(QSd6B4mJyJfyol{ zJQl^2r;A><($38M`*8PuQw#gb4X#ew`#MfM097-wt-zfRm+y#JFYt7k#dE*i!fV6A zdSE4*I9J|@^?v`ExRqJ6dpbI<$O9uB3`UQ80)`qGjGlHiq!0T_KDp^X`>&TDpC@fD SeE>Xajlt8^&t;ucLK6VOBQqKR literal 0 HcmV?d00001 diff --git a/src/resources/liteyuki_weather/templates/img/svg/cloud.svg b/src/resources/liteyuki_weather/templates/img/svg/cloud.svg new file mode 100644 index 00000000..1d48c549 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/cloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/feelsLike.svg b/src/resources/liteyuki_weather/templates/img/svg/feelsLike.svg new file mode 100644 index 00000000..fb18cb13 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/feelsLike.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/humidity.svg b/src/resources/liteyuki_weather/templates/img/svg/humidity.svg new file mode 100644 index 00000000..e0343850 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/humidity.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/precip.svg b/src/resources/liteyuki_weather/templates/img/svg/precip.svg new file mode 100644 index 00000000..f0e1d167 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/precip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/pressure.svg b/src/resources/liteyuki_weather/templates/img/svg/pressure.svg new file mode 100644 index 00000000..d06fe8ef --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/pressure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/sunrise.svg b/src/resources/liteyuki_weather/templates/img/svg/sunrise.svg new file mode 100644 index 00000000..ae6ef2f6 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/sunrise.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/sunset.svg b/src/resources/liteyuki_weather/templates/img/svg/sunset.svg new file mode 100644 index 00000000..b8c096fd --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/sunset.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/vis.svg b/src/resources/liteyuki_weather/templates/img/svg/vis.svg new file mode 100644 index 00000000..c67c0dd6 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/vis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/windDirect.svg b/src/resources/liteyuki_weather/templates/img/svg/windDirect.svg new file mode 100644 index 00000000..f3ab84f5 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/windDirect.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/img/svg/windVelocity.svg b/src/resources/liteyuki_weather/templates/img/svg/windVelocity.svg new file mode 100644 index 00000000..03019797 --- /dev/null +++ b/src/resources/liteyuki_weather/templates/img/svg/windVelocity.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/resources/liteyuki_weather/templates/js/weather_now.js b/src/resources/liteyuki_weather/templates/js/weather_now.js index 78c1c039..b8af944f 100644 --- a/src/resources/liteyuki_weather/templates/js/weather_now.js +++ b/src/resources/liteyuki_weather/templates/js/weather_now.js @@ -23,7 +23,10 @@ let weatherNow = data["weatherNow"] let weatherDaily = data["weatherDaily"] let weatherHourly = data["weatherHourly"] let aqi = data["aqi"] +let weatherAstronomy = data["weatherAstronomy"] let is_dev = data["is_dev"] +let attr = data["attr"] + let locationData = data["location"] @@ -35,10 +38,10 @@ if ("aqi" in aqi) { if (item["defaultLocalAqi"]) { document.getElementById("aqi-data").innerText = "AQI " + item["valueDisplay"] + " " + item["category"] // 将(255,255,255)这种格式的颜色设置给css - if(is_dev == 1){ + if (is_dev) { //开发版 document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"]['red'] + "," + item["color"]['green'] + "," + item["color"]['blue'] + "," + item["color"]['alpha'] + ")" - }else{ + } else { //正式版 document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"] + ")" } @@ -65,6 +68,33 @@ for (let id in templates) { document.getElementById(id).innerText = templates[id] } + +subtemplates = { + "now-windDirect": weatherNow["now"]["windDir"] + " " + weatherNow["now"]["wind360"] + "°", + "now-windVelocity": "风矢 " + weatherNow["now"]["windScale"] + "级 " + weatherNow["now"]["windSpeed"] + "km/h", + "now-humidity": "湿度 " + weatherNow["now"]["humidity"] + "%", + "now-feelsLike": "体感 " + weatherNow["now"]["feelsLike"] + "°C", + "now-precip": "降水 " + weatherNow["now"]["precip"] + "mm", + "now-pressure": "气压 " + weatherNow["now"]["pressure"] + "hPa", + "vis": "能见 " + weatherNow["now"]["vis"] + "km", + "cloud ": "云量 " + (weatherNow["now"]["cloud"] == "" ? "无数据" : (weatherNow["now"]["cloud"] + "%")), + "astronomy-sunrise": "日出 " + get_time_hour(weatherAstronomy["sunrise"]), + "astronomy-sunset": "日落 " + get_time_hour(weatherAstronomy["sunset"]) +} + +let subItemDivTemplate = document.importNode(document.getElementById("sub-info-template").content, true); + +let subItemDiv = subItemDivTemplate.querySelector(".sub-info"); + +for (let id in subtemplates) { + let element = subItemDiv.querySelector(`#${id}`); + if (element) { + element.innerText = subtemplates[id]; + } +} + +document.getElementById('sub-info').appendChild(subItemDiv); + let maxHourlyItem = 8 let percentWidth = 1 / (maxHourlyItem * 1.5) * 100 let hourlyStep = 2 // n小时一个数据 @@ -126,7 +156,12 @@ weatherDaily['daily'].forEach( ) function get_time_hour(fxTime) { -// fxTime 2024-05-03T02:00+/-08:00' + // fxTime 2024-05-03T02:00+/-08:00' fxTime = fxTime.replace("-", "+") return fxTime.split("T")[1].split("+")[0] } + +let attrinfo = document.getElementById('attribution-info'); +if (!is_dev & !attr) attrinfo.parentElement.style.display = "none" + +attrinfo.innerText = is_dev ? "Weather Service Drived by QWeather" : (attr ? attr : "Weather Service Drived by QWeather") diff --git a/src/resources/liteyuki_weather/templates/weather_now.html b/src/resources/liteyuki_weather/templates/weather_now.html index ec360876..8a65bffc 100644 --- a/src/resources/liteyuki_weather/templates/weather_now.html +++ b/src/resources/liteyuki_weather/templates/weather_now.html @@ -1,76 +1,151 @@ + Liteyuki Status + + - + - - - -

{{ data | tojson }}
-
-
-
2045-01-12 22:22:22
-
枫丹 白露 白露区
-
白露区
-
-
-
- WeatherIcon -
-
-
-
- 90° -
-
- 10°~90° -
+ + + + +
{{ data | tojson }}
+
+
+
2045-01-12 22:22:22
+
枫丹 白露 白露区
+
白露区
+
+
+
+ WeatherIcon +
+
+
+
+ 90° +
+
+ 10°~90° +
+
+
+ 示例天气 +
+
+
+
+
+
AQI 114 优
+
+
+
+
+
+ + + + + +
+
+
+ + - - \ No newline at end of file