From d0d347e4e3741eb1414defe5775dd71936475c3c Mon Sep 17 00:00:00 2001 From: EillesWan Date: Fri, 19 Jul 2024 02:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=A1=E5=B0=8F=E4=B8=91=EF=BC=81?= =?UTF-8?q?=E6=B5=AA=E8=B4=B9=E7=94=9F=E5=91=BD=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- docs/.vuepress/public/js/style.js | 2 +- .../vanilla_language/lang/zh-WY.lang | 2 +- .../vanilla_resource/templates/css/card.css | 10 ++-- .../vanilla_resource/templates/css/fonts.css | 6 +-- .../vanilla_resource/templates/css/status.css | 53 ++++++++++++------- .../vanilla_resource/templates/css/style.css | 14 ++--- .../vanilla_resource/templates/js/status.js | 32 +++++------ .../vanilla_resource/templates/js/style.js | 20 +++---- .../vanilla_resource/templates/status.html | 13 +++-- src/utils/__init__.py | 42 ++++++++------- 11 files changed, 109 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 7d6681c..f9a0475 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![][banner]][lightyuki-link] -

>尹灵温< 轻雪 6

-

✨ 轻量,高效,易于扩展✨

+

>尹灵温< 轻雪 6

+

✨ 轻量,高效,易于扩展✨

[![][OneBot]][onebot-link] [![][NoneBot2]][nonebot-link] diff --git a/docs/.vuepress/public/js/style.js b/docs/.vuepress/public/js/style.js index e73b0dd..416a1fb 100644 --- a/docs/.vuepress/public/js/style.js +++ b/docs/.vuepress/public/js/style.js @@ -4,7 +4,7 @@ function applyStyle() { // 插入现成的html文本 let title = item.getAttribute('data-title') let tabStr = - "
" + + "
" + "
" + "
" + "
" + diff --git a/src/resources/vanilla_language/lang/zh-WY.lang b/src/resources/vanilla_language/lang/zh-WY.lang index f445090..71d5662 100644 --- a/src/resources/vanilla_language/lang/zh-WY.lang +++ b/src/resources/vanilla_language/lang/zh-WY.lang @@ -135,7 +135,7 @@ weather.no_key=无天监司遥讯之玥,请于设增 status.friends=友 status.groups=羣 -status.plugins=件 +status.plugins=附件 status.resources=件资 status.bots=工造灵机 status.message_sent=方传 diff --git a/src/resources/vanilla_resource/templates/css/card.css b/src/resources/vanilla_resource/templates/css/card.css index 8cacba8..f283c9b 100644 --- a/src/resources/vanilla_resource/templates/css/card.css +++ b/src/resources/vanilla_resource/templates/css/card.css @@ -1,7 +1,7 @@ :root { - --main-text-color: #fff; - --sub-text-color: #ccc; - --tip-text-color: #999; + --main-text-color: #000; + --sub-text-color: #333; + --tip-text-color: #777; --device-info-width: 240px; } @@ -14,7 +14,7 @@ body { background-repeat: repeat-y; background-size: cover; background-position: center; - text-shadow: 1px 1px 2px black; + text-shadow: 1px 1px 2px white; margin: 20px; } @@ -22,7 +22,7 @@ body { /* border-radius: 60px; */ padding: 40px; backdrop-filter: blur(10px); - background-color: rgba(0, 0, 0, 0.5); + background-color: rgba(255, 255, 255, 0.5); margin-bottom: 20px; } diff --git a/src/resources/vanilla_resource/templates/css/fonts.css b/src/resources/vanilla_resource/templates/css/fonts.css index fa6d8bc..ceee044 100644 --- a/src/resources/vanilla_resource/templates/css/fonts.css +++ b/src/resources/vanilla_resource/templates/css/fonts.css @@ -31,7 +31,7 @@ } /*MapleMono*/ -@font-face { +/* @font-face { font-family: 'MapleMono'; src: url('../fonts/MapleMono/MapleMono-Light.woff2') format('woff2'); font-weight: 200; @@ -69,8 +69,8 @@ src: url('../fonts/MapleMono/MapleMono-BoldItalic.woff2') format('woff2'); font-weight: 700; font-style: italic; -} +} */ * { - font-family: 'MapleMono', 'MiSans', sans-serif; + font-family: 'MiSans', sans-serif; } \ No newline at end of file diff --git a/src/resources/vanilla_resource/templates/css/status.css b/src/resources/vanilla_resource/templates/css/status.css index d1d5b6c..04a22fa 100644 --- a/src/resources/vanilla_resource/templates/css/status.css +++ b/src/resources/vanilla_resource/templates/css/status.css @@ -1,7 +1,7 @@ :root { - --main-text-color: #fff; - --sub-text-color: #ccc; - --tip-text-color: #999; + --main-text-color: #000; + --sub-text-color: #333; + --tip-text-color: #777; --device-info-width: 240px; } @@ -9,17 +9,26 @@ display: flex; } +.bot-icon-tags { + display: flex; + flex-direction:row; + justify-content: space-between; + /* margin-left: auto; */ +} + .bot-icon { display: flex; width: 220px; align-items: center; justify-content: center; - margin-right: 20px; + margin-right: 15px; + /* margin-left: 20px; */ } .bot-icon-img { - height: 220px; - width: 220px; + display: flex; + height: 210px; + width: 210px; /* border-radius: 50%; */ } @@ -36,16 +45,19 @@ color: var(--sub-text-color); font-size: 30px; font-weight: 700; - line-height: 1.6; + line-height: 1.4; + text-align: end; + /* width: 700px; */ } -.bot-tag[suffix="1"]::after { - content: "|"; +.bot-tag[suffix="1"]::before { + content: " | "; display: inline-block; - margin: 0 5px; - height: 30%; - line-height: 50%; + /* margin: 0 5px; */ + height: 20%; + line-height: 30%; color: var(--tip-text-color); + /* text-align: end; */ } /*修改bot-info 下hr样式*/ @@ -55,6 +67,7 @@ background: var(--tip-text-color); margin: 10px 0; width: 100%; + /* text-align: end; */ } #hardware-info { @@ -87,13 +100,13 @@ position: relative; width: 100%; height: 60px; - background-color: #ffffff44; + background-color: #00000044; /* border-radius: 30px; */ align-items: center; } .disk-usage { - background-color: #a2d8f4; + background-color: #007ebd; height: 100%; /* border-radius: 30px; */ position: absolute; @@ -103,15 +116,15 @@ .disk-title { position: absolute; color: var(--main-text-color); - font-size: 24px; - margin-bottom: 10px; + font-size: 25px; + margin-bottom: 7px; margin-left: 20px; text-align: left; z-index: 2; } #motto-text { - font-size: 36px; + font-size: 42px; word-wrap: break-word; color: var(--main-text-color); text-align: center; @@ -119,16 +132,16 @@ } #motto-from { - font-size: 30px; + font-size: 32px; font-style: italic; color: var(--sub-text-color); text-align: right; } #addition-info { - font-size: 36px; + font-size: 32px; word-wrap: break-word; color: var(--main-text-color); text-align: center; - margin: 30px 0 10px 0; + /* margin: 30px 0 10px 0; */ } \ No newline at end of file diff --git a/src/resources/vanilla_resource/templates/css/style.css b/src/resources/vanilla_resource/templates/css/style.css index bb1c6f9..dbc2547 100644 --- a/src/resources/vanilla_resource/templates/css/style.css +++ b/src/resources/vanilla_resource/templates/css/style.css @@ -2,7 +2,7 @@ body { background-repeat: repeat-y; background-size: cover; background-position: center; - color: white; + color: black; /* // 上10px,左右10px,下0px // margin: 24 px; */ margin: 20px; } @@ -11,7 +11,7 @@ body { border-radius: 30px; padding: 30px; backdrop-filter: blur(10px); - background-color: rgba(0, 0, 0, 0.3); + background-color: rgba(255, 255, 255, 0.3); margin-bottom: 20px; } @@ -52,7 +52,7 @@ body { .bot-icon { /* border-radius: 50%; */ height: 200px; - background-color: white; + background-color: black; } .bot-name, @@ -87,21 +87,21 @@ body { margin: 0 5px; height: 50%; line-height: 50%; - color: #ccc; + color: #333; } .motto-text { font-size: 36px; - color: #fff; + color: #000; } .motto-author { font-size: 30px; font-style: italic; - color: #ccc; + color: #333; } .addition-info { font-size: 32px; - color: #fff; + color: #000; } \ No newline at end of file diff --git a/src/resources/vanilla_resource/templates/js/status.js b/src/resources/vanilla_resource/templates/js/status.js index 7e4c1b9..1384b92 100644 --- a/src/resources/vanilla_resource/templates/js/status.js +++ b/src/resources/vanilla_resource/templates/js/status.js @@ -19,7 +19,7 @@ function createPieChartOption(title, data) { left: 'center', top: 'center', textStyle: { - color: '#fff', + color: '#000', fontSize: 30, lineHeight: 36 } @@ -27,9 +27,9 @@ function createPieChartOption(title, data) { tooltip: { show: true, trigger: 'item', - backgroundColor: '#fff', + backgroundColor: '#000', }, - color: data.length === 3 ? ['#00a6ff', '#a2d8f4', "#ffffff44"] : ['#a2d8f4', '#ffffff44'], + color: data.length === 3 ? ['#053349', '#007ebd', "#00000044"] : ['#007ebd', '#00000044'], series: [ { name: 'info', @@ -128,11 +128,11 @@ function main() { botInfoDiv.querySelector('.bot-name').innerText = bot['name'] let tagArray = [ bot['protocol_name'], - bot['app_name'], - `${localData['groups']} ${bot['groups']}`, - `${localData['friends']} ${bot['friends']}`, - `${localData['message_sent']} ${bot['message_sent']}`, - `${localData['message_received']} ${bot['message_received']}`, + `${bot['app_name']}`, + `${localData['groups']}${bot['groups']}`, + `${localData['friends']}${bot['friends']}`, + `${localData['message_sent']}${bot['message_sent']}`, + `${localData['message_received']}${bot['message_received']}`, ] // 添加一些标签 tagArray.forEach( @@ -141,7 +141,7 @@ function main() { tagSpan.className = 'bot-tag' tagSpan.innerText = tag // 给最后一个标签不添加后缀 - tagSpan.setAttribute('suffix', index === tagArray.length - 1 ? '0' : '1') + tagSpan.setAttribute('suffix', (index === 0)||(tag[0] == '\n') ? '0' : '1') botInfoDiv.querySelector('.bot-tags').appendChild(tagSpan) } ) @@ -154,16 +154,16 @@ function main() { let liteyukiInfoDiv = document.importNode(document.getElementById('bot-template').content, true) // 复制模板 liteyukiInfoDiv.className = 'info-box bot-info' liteyukiInfoDiv.querySelector('.bot-icon-img').setAttribute('src', './img/liteyuki.png') - liteyukiInfoDiv.querySelector('.bot-name').innerText = liteyukiData['name'] + liteyukiInfoDiv.querySelector('.bot-name').innerText = `${liteyukiData['name']} - 睿乐` let tagArray = [ - `Liteyuki ${liteyukiData['version']}`, + `灵温 ${liteyukiData['version']}`, `Nonebot ${liteyukiData['nonebot']}`, - liteyukiData['python'], + `${liteyukiData['python']}`, liteyukiData['system'], - `${localData['plugins']} ${liteyukiData['plugins']}`, - `${localData['resources']} ${liteyukiData['resources']}`, - `${localData['bots']} ${liteyukiData['bots']}`, + `${localData['plugins']}${liteyukiData['plugins']}`, + `${localData['resources']}${liteyukiData['resources']}`, + `${localData['bots']}${liteyukiData['bots']}`, `${localData['runtime']} ${secondsToTextTime(liteyukiData['runtime'])}`, ] tagArray.forEach( @@ -172,7 +172,7 @@ function main() { tagSpan.className = 'bot-tag' tagSpan.innerText = tag // 给最后一个标签不添加后缀 - tagSpan.setAttribute('suffix', index === tagArray.length - 1 ? '0' : '1') + tagSpan.setAttribute('suffix', (index === 0)||(tag[0] == '\n') ? '0' : '1') liteyukiInfoDiv.querySelector('.bot-tags').appendChild(tagSpan) } ) diff --git a/src/resources/vanilla_resource/templates/js/style.js b/src/resources/vanilla_resource/templates/js/style.js index ec738ef..42d0463 100644 --- a/src/resources/vanilla_resource/templates/js/style.js +++ b/src/resources/vanilla_resource/templates/js/style.js @@ -70,7 +70,7 @@ botName.innerText = bot.name; if (bot.self) { // 添加颜色 - botName.style.color = '#d0e9ff'; + botName.style.color = '#32383D'; } botDetail.appendChild(botName); @@ -88,7 +88,7 @@ tagSpan.className = 'tag'; if (bot.self) { // 添加颜色 - tagSpan.style.color = '#a2d8f4'; + tagSpan.style.color = '#007ebd'; } botTags.appendChild(tagSpan); if (index === bot.tags.length - 1) { @@ -147,17 +147,17 @@ //文字颜色 lineHeight: 36, - color: '#fff', + color: '#000', fontSize: 30 } }, tooltip: { show: true, trigger: "item", - backgroundColor: "#ffffff00", + backgroundColor: "#00000000", // {a}(系列名称),{b}(数据项名称),{c}(数值), {d}(百分比) }, - color: ['#a2d8f4', "#ffffff44", '#00a6ff'], + color: ['#007ebd', "#00000044", '#053349'], series: [ { name: 'info', @@ -196,20 +196,20 @@ } // data为百分比,最大值为100 return { - background: '#d0e9ff', + background: '#32383D', title: { text: title, left: '5%', top: 'center', textStyle: { - color: '#fff', + color: '#000', fontSize: 30 } }, tooltip: { show: true, trigger: "item", - backgroundColor: "#ffffff", + backgroundColor: "#000000", }, grid: { left: '0', @@ -234,7 +234,7 @@ data: [percent], itemStyle: { normal: { - color: '#a2d8f4', + color: '#007ebd', barBorderRadius: [50, 0, 0, 50] } }, @@ -246,7 +246,7 @@ data: [100 - percent], itemStyle: { normal: { - color: '#d0e9ff', + color: '#32383D', barBorderRadius: [fillet, 50, 50, fillet] } }, diff --git a/src/resources/vanilla_resource/templates/status.html b/src/resources/vanilla_resource/templates/status.html index 7b4e384..65ded14 100644 --- a/src/resources/vanilla_resource/templates/status.html +++ b/src/resources/vanilla_resource/templates/status.html @@ -12,17 +12,20 @@