调整帮助界面的展示样式

This commit is contained in:
yoimiya-kokomi 2022-04-13 03:28:01 +08:00
parent 962c9ce16f
commit 889a5bb317
7 changed files with 33 additions and 24 deletions

View File

@ -16,8 +16,14 @@ export async function help(e, { render }) {
helpFile = await import(`file://${helpFilePath}?version=${new Date().getTime()}`); helpFile = await import(`file://${helpFilePath}?version=${new Date().getTime()}`);
const { helpCfg } = helpFile; const { helpCfg } = helpFile;
let helpGroup = [];
lodash.forEach(helpCfg, (group) => { lodash.forEach(helpCfg, (group) => {
if (group.auth && group.auth === "master" && !e.isMaster) {
return;
}
lodash.forEach(group.list, (help) => { lodash.forEach(group.list, (help) => {
let icon = help.icon * 1; let icon = help.icon * 1;
if (!icon) { if (!icon) {
@ -27,12 +33,14 @@ export async function help(e, { render }) {
help.css = `background-position:-${x * 50}px -${y * 50}px`; help.css = `background-position:-${x * 50}px -${y * 50}px`;
} }
}) });
helpGroup.push(group);
}); });
let base64 = await render("help", "index", { let base64 = await render("help", "index", {
helpCfg, helpCfg: helpGroup,
cfgScale: Cfg.scale(1) cfgScale: Cfg.scale(1.05)
}, "png"); }, "png");
if (base64) { if (base64) {
e.reply(segment.image(`base64://${base64}`)); e.reply(segment.image(`base64://${base64}`));

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 743 KiB

After

Width:  |  Height:  |  Size: 743 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

View File

@ -32,10 +32,6 @@ export const helpCfg = [{
icon: 15, icon: 15,
title: "#体力 #体力帮助", title: "#体力 #体力帮助",
desc: "查询体力绑定Cookie帮助" desc: "查询体力绑定Cookie帮助"
}, {
icon: 86,
title: "#签到",
desc: "米游社原神签到"
}, { }, {
icon: 5, icon: 5,
title: "#原石 #原石统计", title: "#原石 #原石统计",
@ -48,12 +44,16 @@ export const helpCfg = [{
icon: 22, icon: 22,
title: "#我的ck #删除ck", title: "#我的ck #删除ck",
desc: "查看绑定的cookie 删除cookie" desc: "查看绑定的cookie 删除cookie"
}, {
icon: 86,
title: "#签到",
desc: "米游社原神签到"
}] }]
}, { }, {
group: "喵喵扩展 Miao-Plugin", group: "喵喵扩展 Miao-Plugin",
list: [{ list: [{
icon: 60, icon: 60,
title: "#老婆 #老婆设置心海雷神", title: "#老婆 #老婆设置心海,雷神",
desc: "设置老婆,查看老婆信息卡片" desc: "设置老婆,查看老婆信息卡片"
}, { }, {
icon: 88, icon: 88,
@ -67,14 +67,6 @@ export const helpCfg = [{
icon: 56, icon: 56,
title: "#角色持有率 #深渊出场率", title: "#角色持有率 #深渊出场率",
desc: "查看角色的持有率及深渊出场率信息" desc: "查看角色的持有率及深渊出场率信息"
}, {
icon: 32,
title: "#喵喵设置",
desc: "管理员可用:配置喵喵功能"
}, {
icon: 35,
title: "#喵喵更新素材",
desc: "管理员可用:更新增量图像素材包"
}] }]
}, { }, {
group: "其他查询指令", group: "其他查询指令",
@ -108,10 +100,19 @@ export const helpCfg = [{
desc: "其他命令" desc: "其他命令"
}] }]
}, { }, {
group: "管理命令", group: "管理命令,仅管理员可用",
auth: "master",
list: [{ list: [{
icon: 85, icon: 85,
title: "#用户统计", title: "#用户统计",
desc: "查看用户CK-UID列表" desc: "查看用户CK-UID列表"
}, {
icon: 32,
title: "#喵喵设置",
desc: "配置喵喵功能"
}, {
icon: 35,
title: "#喵喵更新图像",
desc: "更新喵喵的增量角色图像素材"
}] }]
}]; }];

View File

@ -1,13 +1,13 @@
body { body {
transform: scale(1); transform: scale(1);
width: 600px; width: 800px;
background: url("bg.jpg"); background: url("../common/theme/bg-01.jpg");
} }
.container { .container {
background: url(header.png) top left no-repeat; background: url(../common/theme/main-01.png) top left no-repeat;
background-size: 100% auto; background-size: 100% auto;
width: 600px; width: 800px;
} }
.label { .label {
@ -65,7 +65,7 @@ body {
padding: 12px 0 12px 50px; padding: 12px 0 12px 50px;
line-height: 24px; line-height: 24px;
position: relative; position: relative;
width: 50%; width: 33.33%;
text-align: left; text-align: left;
} }

View File

@ -20,7 +20,7 @@
<div class="help-group">{{helpGroup.group}}</div> <div class="help-group">{{helpGroup.group}}</div>
<div class="help-table"> <div class="help-table">
{{each helpGroup.list help idx}} {{each helpGroup.list help idx}}
{{if idx%2 == 0}} {{if idx%3 == 0}}
<div class="tr"> <div class="tr">
{{/if}} {{/if}}
<div class="td"> <div class="td">
@ -28,7 +28,7 @@
<strong class="help-title">{{help.title}}</strong> <strong class="help-title">{{help.title}}</strong>
<span class="help-desc">{{help.desc}}</span> <span class="help-desc">{{help.desc}}</span>
</div> </div>
{{if idx%2 ==1 || idx == helpGroup.list.length -1}} {{if idx%3 ==2 || idx == helpGroup.list.length -1}}
</div> </div>
{{/if}} {{/if}}
{{/each}} {{/each}}