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}}