From bf26e880a638844ebf8d88830c52cc922e39d7bd Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Tue, 9 Aug 2022 05:16:37 +0800 Subject: [PATCH] =?UTF-8?q?`#=E9=9D=A2=E6=9D=BF=E7=BB=83=E5=BA=A6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1`=E3=80=81'#=E9=9D=A2=E6=9D=BF=E5=88=97=E8=A1=A8`?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=B8=8E=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E5=86=85=E5=B5=8C=E5=AD=97=E4=BD=93=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4woff=E6=A0=BC=E5=BC=8F=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E4=B8=8E=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=9A=84=E7=BB=93=E6=9E=84=E4=B8=8E=E5=BC=95=E7=94=A8=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 +- apps/character/profile-detail.js | 8 +- apps/character/profile-list.js | 14 +- components/Profile.js | 5 + components/profile-data/enka.js | 5 + components/profile-data/miao.js | 3 + resources/character/artis.css | 1 - resources/character/artis.less | 1 - resources/character/card.css | 14 +- resources/character/card.less | 12 +- resources/character/detail.css | 9 +- resources/character/detail.html | 2 +- resources/character/detail.less | 5 +- resources/character/profile-list.css | 19 ++ resources/character/profile-list.html | 26 +- resources/character/profile-list.less | 23 ++ resources/character/profile-stat.css | 288 +++++++++++++++-------- resources/character/profile-stat.html | 27 +-- resources/character/profile-stat.less | 228 ++++++++++-------- resources/common/base.css | 7 + resources/common/base.less | 7 + resources/common/common.css | 40 ++-- resources/common/common.less | 49 ++-- resources/common/font/HYWH-65W.woff | Bin 0 -> 2111996 bytes resources/common/font/HYWH-85W.ttf | Bin 3283784 -> 0 bytes resources/common/font/NZBZ.ttf | Bin 1502548 -> 1502040 bytes resources/common/font/NZBZ.woff | Bin 0 -> 934748 bytes resources/common/font/tttgbnumber.woff | Bin 0 -> 10348 bytes resources/common/layout/default.html | 7 +- resources/common/layout/elem.html | 7 +- resources/common/tpl.css | 22 +- resources/common/tpl/artis-detail.less | 7 +- resources/common/tpl/avatar-profile.less | 8 +- resources/common/tpl/item-card.less | 2 - resources/help/index.css | 3 - resources/help/index.less | 2 +- resources/stat/abyss-summary.css | 12 +- resources/stat/abyss-summary.less | 8 +- resources/stat/abyss-team.css | 4 - resources/stat/abyss-team.less | 5 +- resources/stat/common.css | 9 +- resources/stat/common.less | 6 +- resources/wiki/calendar.css | 4 - resources/wiki/calendar.less | 13 - resources/wiki/character.css | 3 - resources/wiki/character.less | 3 - 46 files changed, 535 insertions(+), 390 deletions(-) create mode 100644 resources/common/base.css create mode 100644 resources/common/base.less create mode 100644 resources/common/font/HYWH-65W.woff delete mode 100644 resources/common/font/HYWH-85W.ttf create mode 100644 resources/common/font/NZBZ.woff create mode 100644 resources/common/font/tttgbnumber.woff diff --git a/CHANGELOG.md b/CHANGELOG.md index bdddc5bc..bb0c4398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ -# 1.9.6 +# 1.9.7 * 新增`#面板练度统计`功能 * 可展示当前角色天赋及圣遗物练度信息 * 需要用户绑定Cookie,圣遗物评分需要本地获取并查看过对应角色面板 - * 部分样式及功能尚未完全稳定 +* `#面板列表` 等页面样式与功能优化 +* 内嵌字体改为默认woff格式,调整部分页面与资源的结构与引用逻辑 -# 1.9.1 ~ 1.9.5 +# 1.9.1 ~ 1.9.6 * `#面板`、`#更新面板`命令使用图片渲染结果 * Enka面板服务支持配置代理 **@永恒的小黑屋** diff --git a/apps/character/profile-detail.js b/apps/character/profile-detail.js index e65d5cf5..9b82aed0 100644 --- a/apps/character/profile-detail.js +++ b/apps/character/profile-detail.js @@ -89,8 +89,8 @@ export async function renderProfile (e, char, render, mode = 'profile', params = }) } - if (mode === 'dmg') { - let basic = dmgCalc.dmgCfg.basicRet + if (mode === 'dmg' && dmgCalc.dmgRet) { + let basic = dmgCalc?.dmgCfg?.basicRet lodash.forEach(dmgCalc.dmgRet, (row) => { lodash.forEach(row, (ds) => { ds.val = (ds.avg > basic.avg ? '+' : '') + Format.comma(ds.avg - basic.avg) @@ -113,8 +113,8 @@ export async function renderProfile (e, char, render, mode = 'profile', params = talent: char.getAvatarTalent(profile.talent, profile.cons), dmgData, dmgMsg, - dmgRet: dmgCalc.dmgRet, - dmgCfg: dmgCalc.dmgCfg, + dmgRet: dmgCalc.dmgRet || false, + dmgCfg: dmgCalc.dmgCfg || false, artis, enemyLv, enemyName: dmgCalc.enemyName || '小宝', diff --git a/apps/character/profile-list.js b/apps/character/profile-list.js index cf87f986..7dbdce99 100644 --- a/apps/character/profile-list.js +++ b/apps/character/profile-list.js @@ -10,6 +10,9 @@ export async function profileList (e, { render }) { } let profiles = Profile.getAll(uid) || {} + let servName = Profile.getServName(uid) + let hasNew = false + let newCount = 0 let chars = [] let msg = '' @@ -30,7 +33,10 @@ export async function profileList (e, { render }) { } tmp.source = ds.dataSource tmp.level = ds.lv || 1 - tmp.isNew = newChar[char.name] ? 1 : 0 + if (newChar[char.name]) { + tmp.isNew = 1 + newCount++ + } chars.push(tmp) }) @@ -44,6 +50,10 @@ export async function profileList (e, { render }) { return true } + if (newCount > 0) { + hasNew = newCount <= 8 + } + chars = lodash.sortBy(chars, ['isNew', 'star', 'level', 'id']) chars = chars.reverse() @@ -52,6 +62,8 @@ export async function profileList (e, { render }) { save_id: uid, uid, chars, + servName, + hasNew, msg }, { e, render, scale: 1.6 }) } diff --git a/components/Profile.js b/components/Profile.js index 64ccfea3..25a61175 100644 --- a/components/Profile.js +++ b/components/Profile.js @@ -283,6 +283,11 @@ let Profile = { userData.chars[avatar] = originalData fs.writeFileSync(userFile, JSON.stringify(userData), '', ' ') return true + }, + + getServName (uid) { + let Serv = getServ(uid) + return Serv.getName({ uid, diyCfg, sysCfg }) } } export default Profile diff --git a/components/profile-data/enka.js b/components/profile-data/enka.js index b68cc2d3..348cbbe1 100644 --- a/components/profile-data/enka.js +++ b/components/profile-data/enka.js @@ -30,6 +30,11 @@ let Enka = { return false } return EnkaData.getData(uid, data) + }, + getName ({ uid, diyCfg, sysCfg }) { + let url = diyCfg?.enkaApi?.url || sysCfg.enkaApi.url + url = url.replace('https://', '').replace('/', '').trim() + return url } } diff --git a/components/profile-data/miao.js b/components/profile-data/miao.js index a470fc6e..0efa34b9 100644 --- a/components/profile-data/miao.js +++ b/components/profile-data/miao.js @@ -218,6 +218,9 @@ let Miao = { }) return ret }, + getName ({ uid, diyCfg, sysCfg }) { + return 'MiaoApi' + }, dataFix (ret) { if (ret._fix) { return ret diff --git a/resources/character/artis.css b/resources/character/artis.css index 638339ed..9c3d3e59 100644 --- a/resources/character/artis.css +++ b/resources/character/artis.css @@ -2,7 +2,6 @@ width: 790px; } .uid { - font-family: Number; margin: 20px 10px 10px; text-shadow: 0 0 3px #000, 2px 2px 4px rgba(0, 0, 0, 0.7); text-align: right; diff --git a/resources/character/artis.less b/resources/character/artis.less index 7807767d..4001fa0d 100644 --- a/resources/character/artis.less +++ b/resources/character/artis.less @@ -3,7 +3,6 @@ } .uid { - font-family: Number; margin: 20px 10px 10px; text-shadow: 0 0 3px #000, 2px 2px 4px rgba(0, 0, 0, .7); text-align: right; diff --git a/resources/character/card.css b/resources/character/card.css index 81bd12c1..705933a9 100644 --- a/resources/character/card.css +++ b/resources/character/card.css @@ -1,3 +1,9 @@ +.font-YS { + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} +.font-NZBZ { + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} * { margin: 0; padding: 0; @@ -9,7 +15,6 @@ body { color: #fff; transform: scale(1.25); transform-origin: 0 0; - font-family: Number, YS; } .container { position: relative; @@ -31,7 +36,6 @@ body { box-shadow: 0 -5px 10px 0 #000; padding: 5px 10px 10px 150px; text-shadow: 0 0 1px #000, 1px 1px 3px #000; - font-family: Number, YS; } .role_box { padding: 5px 10px; @@ -42,7 +46,7 @@ body { font-size: 36px; } .char_name { - font-family: "NZBZ"; + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; font-size: 60px; letter-spacing: 5px; line-height: 90px; @@ -90,7 +94,6 @@ body { vertical-align: middle; text-align: center; letter-spacing: 0px; - font-family: Number, YS; box-shadow: 0px 0px 3px 0px #000; text-shadow: 0 0 3px #000; margin-right: 15px; @@ -332,7 +335,7 @@ body.bottom_mode { width: calc(100% - 20px); } .bottom_mode .detail { - font-family: NZBZ; + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; margin-top: 0px; } .bottom_mode .for_left { @@ -403,7 +406,6 @@ body.bottom_mode { } .copyright { position: absolute; - font-family: Number, YS; margin-bottom: 0; } .left_mode .copyright { diff --git a/resources/character/card.less b/resources/character/card.less index 007991a9..386681a9 100644 --- a/resources/character/card.less +++ b/resources/character/card.less @@ -1,3 +1,5 @@ +@import "../common/base.less"; + * { margin: 0; padding: 0; @@ -11,7 +13,6 @@ body { color: #fff; transform: scale(1.25); transform-origin: 0 0; - font-family: Number, YS; } .container { @@ -36,8 +37,6 @@ body { box-shadow: 0 -5px 10px 0 #000; padding: 5px 10px 10px 150px; text-shadow: 0 0 1px #000, 1px 1px 3px #000; - font-family: Number, YS; - } .role_box { @@ -52,7 +51,7 @@ body { .char_name { - font-family: "NZBZ"; + .font-NZBZ; font-size: 60px; letter-spacing: 5px; line-height: 90px; @@ -103,7 +102,6 @@ body { vertical-align: middle; text-align: center; letter-spacing: 0px; - font-family: Number, YS; box-shadow: 0px 0px 3px 0px #000; text-shadow: 0 0 3px #000; margin-right: 15px; @@ -403,7 +401,7 @@ body.bottom_mode { } .bottom_mode .detail { - font-family: NZBZ; + .font-NZBZ; margin-top: 0px; } @@ -489,7 +487,7 @@ body.bottom_mode { .copyright { position: absolute; - font-family: Number, YS; + //font-family: Number, YS; margin-bottom: 0; } diff --git a/resources/character/detail.css b/resources/character/detail.css index 7e36c890..d31eabef 100644 --- a/resources/character/detail.css +++ b/resources/character/detail.css @@ -1,3 +1,9 @@ +.font-YS { + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} +.font-NZBZ { + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} body { width: 600px; } @@ -42,7 +48,7 @@ body { } .char-name { font-size: 50px; - font-family: NZBZ; + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; text-shadow: 0 0 3px #000, 2px 2px 4px rgba(0, 0, 0, 0.7); text-align: right; } @@ -416,7 +422,6 @@ body { display: block; white-space: nowrap; overflow: hidden; - font-font: YS; } .artis .head span { font-size: 14px; diff --git a/resources/character/detail.html b/resources/character/detail.html index 23ceb418..1f7cd14f 100644 --- a/resources/character/detail.html +++ b/resources/character/detail.html @@ -175,7 +175,7 @@ {{if mode === "dmg"}} -{{if dmgCfg && dmgCfg.attr && dmgCfg.attr.length>0}} +{{if dmgCfg && dmgCfg.attr && dmgCfg.attr.length>0 && dmgRet}}