From 9eff48f9b19e3582480bc37605ad24ab4239cb11 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Mon, 19 Sep 2022 13:45:42 +0800 Subject: [PATCH] =?UTF-8?q?`#=E5=A6=AE=E9=9C=B2=E5=A4=A9=E8=B5=8B`=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- adapter/mys.js | 2 +- apps/character/avatar-card.js | 10 +-- resources/common/tpl/talent-detail.html | 98 ++++++++++++++----------- resources/wiki/character-talent.css | 26 +++++++ resources/wiki/character-talent.less | 30 ++++++++ tools/char-data-sprider.js | 2 +- tools/sprider/CharData.js | 5 +- tools/sprider/abbr.js | 13 ++++ 9 files changed, 131 insertions(+), 58 deletions(-) create mode 100644 tools/sprider/abbr.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e7710cc5..9666d0e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 2.0 Alpha.3 -* 调整`#角色卡片`的样式,尚未完全稳定 +* 调整`#心海`的角色卡片样式,尚未完全稳定 +* `#妮露天赋` 样式微调 # 2.0 Alpha.2 diff --git a/adapter/mys.js b/adapter/mys.js index 23c85935..cdf7476f 100644 --- a/adapter/mys.js +++ b/adapter/mys.js @@ -40,7 +40,7 @@ class Mys { e.targetUser = this.targetUser e.selfUser = this.selfUser - e.isSelfCookie = uid === ckUid + e.isSelfCookie = uid * 1 === ckUid * 1 } async getData (api, data) { diff --git a/apps/character/avatar-card.js b/apps/character/avatar-card.js index 7916f1d1..f183fa43 100644 --- a/apps/character/avatar-card.js +++ b/apps/character/avatar-card.js @@ -1,12 +1,8 @@ -import { Artifact, Character, AvatarList, Avatar } from '../../models/index.js' -import { Cfg, Data, Common, Profile } from '../../components/index.js' +import { Character, Avatar } from '../../models/index.js' +import { Cfg, Common, Profile } from '../../components/index.js' import lodash from 'lodash' import { segment } from 'oicq' -// 角色昵称 - -let abbr = Character.getAbbr() - export async function renderAvatar (e, avatar, renderType = 'card') { // 如果传递的是名字,则获取 if (typeof (avatar) === 'string') { @@ -73,7 +69,7 @@ async function renderCard (e, ds, renderType = 'card') { actionName: '查询信息' }) data = avatar.getData('id,name,sName,level,fetter,cons,weapon,elem,artis,imgs,dataSourceName,updateTime') - if (MysApi && MysApi.isSelfCookie) { + if (avatar.isProfile || (MysApi && MysApi.isSelfCookie)) { data.talent = await avatar.getTalent(MysApi) data.talentMap = ['a', 'e', 'q'] // 计算皇冠个数 diff --git a/resources/common/tpl/talent-detail.html b/resources/common/tpl/talent-detail.html index 9048b6a6..77d2e75a 100644 --- a/resources/common/tpl/talent-detail.html +++ b/resources/common/tpl/talent-detail.html @@ -2,50 +2,60 @@ {{set {_res_path, icon,lvs,type} = $data[1]}}
-
- -
-
-
{{ds.name}}
-
- {{each ds.desc d}} - {{ if d[0] === "<" }} - {{@d}} - {{else if d!=""}} -

{{d}}

- {{/if}} - {{/each}} +
+
-
- {{if ds.tables && ds.tables.length > 0}} - - - - {{each lvs lv idx}} - {{if (type=="a" && idx>4 && idx<11) || (type!="a" && idx>4 && idx < 13)}} - - {{/if}} - {{/each}} - - {{each ds.tables tr}} - - - {{if tr.isSame}} - - {{else}} - {{each tr.values v idx}} - {{if (type=="a" && idx>4 && idx<11) || (type!="a" && idx>4 && idx < 13)}} - - {{/if}} - {{/each}} - {{/if}} - - {{/each}} -
{{lv}}
- {{tr.name}} - {{if tr.unit}} - ({{tr.unit}}) +
+
{{ds.name}}
+
+ {{each ds.desc d}} + {{ if d[0] === "<" }} + {{@d}} + {{else if d!=""}} +

{{d}}

+ {{/if}} + {{/each}} +
+
+ + {{if ds.tables && ds.tables.length > 0}} +
+ {{each ds.tables tr}} + {{if tr.isSame}} +
+ {{tr.name}}{{if tr.unit}}({{tr.unit}}){{/if}} + {{tr.values[0]}} +
{{/if}} -
{{tr.values[0]}}{{v}}
- {{/if}} + {{/each}} +
+ + + + {{each lvs lv idx}} + {{if (type=="a" && idx>4 && idx<11) || (type!="a" && idx>4 && idx < 13)}} + + {{/if}} + {{/each}} + + {{each ds.tables tr}} + {{if !tr.isSame}} + + + + {{each tr.values v idx}} + {{if (type=="a" && idx>4 && idx<11) || (type!="a" && idx>4 && idx < 13)}} + + {{/if}} + {{/each}} + {{/if}} + + {{/each}} +
{{lv}}
+ {{tr.name}} + {{if tr.unit}} + ({{tr.unit}}) + {{/if}} + {{v}}
+ {{/if}}
diff --git a/resources/wiki/character-talent.css b/resources/wiki/character-talent.css index f719be65..ab7689d1 100644 --- a/resources/wiki/character-talent.css +++ b/resources/wiki/character-talent.css @@ -332,4 +332,30 @@ body { color: #7994a7; margin: 20px 0 10px 0; } +.talent-common-info { + display: flex; + flex-wrap: wrap; + padding-left: 135px; + margin-bottom: -5px; +} +.talent-common-info > div { + display: flex; + margin: 4px; + border-radius: 5px; + white-space: nowrap; + box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, 0.8); +} +.talent-common-info > div strong, +.talent-common-info > div span { + padding: 5px 8px; +} +.talent-common-info > div strong { + background: rgba(0, 0, 0, 0.4); + color: #d3bc8e; + border-radius: 5px 0 0 5px; +} +.talent-common-info > div span { + background: rgba(50, 50, 50, 0.4); + border-radius: 0 5px 5px 0; +} /*# sourceMappingURL=character-talent.css.map */ \ No newline at end of file diff --git a/resources/wiki/character-talent.less b/resources/wiki/character-talent.less index 7682818a..8be971ad 100644 --- a/resources/wiki/character-talent.less +++ b/resources/wiki/character-talent.less @@ -387,4 +387,34 @@ body { text-align: center; color: #7994a7; margin: 20px 0 10px 0; +} + +.talent-common-info { + display: flex; + flex-wrap: wrap; + padding-left: 135px; + margin-bottom: -5px; + + & > div { + display: flex; + margin: 4px; + border-radius: 5px; + white-space: nowrap; + box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .8); + + strong, span { + padding: 5px 8px; + } + + strong { + background: rgba(0, 0, 0, 0.4); + color: #d3bc8e; + border-radius: 5px 0 0 5px; + } + + span { + background: rgba(50, 50, 50, 0.4); + border-radius: 0 5px 5px 0; + } + } } \ No newline at end of file diff --git a/tools/char-data-sprider.js b/tools/char-data-sprider.js index ebe2128b..b8b9dee1 100644 --- a/tools/char-data-sprider.js +++ b/tools/char-data-sprider.js @@ -251,4 +251,4 @@ const charData = { 71: { key: 'cyno', name: '赛诺' }, 72: { key: 'candace', name: '坎蒂丝' } } -await down('4', true) +await down('70,71,72', true) diff --git a/tools/sprider/CharData.js b/tools/sprider/CharData.js index a75ef3a1..ea83c896 100644 --- a/tools/sprider/CharData.js +++ b/tools/sprider/CharData.js @@ -1,4 +1,4 @@ -import { abbr } from '../../../../config/genshin/roleId.js' +import abbr from './abbr.js' import lodash from 'lodash' let costumes = { @@ -8,9 +8,6 @@ let costumes = { 凝光: [202701], // 凝光 迪卢克: [201601], // 迪卢克 菲谢尔: [203101], // 菲谢尔 - 达达利亚: [900001], - 雷电将军: [900002], - 钟离: [900003] } const fixData = { 4: { diff --git a/tools/sprider/abbr.js b/tools/sprider/abbr.js new file mode 100644 index 00000000..e8d9a97f --- /dev/null +++ b/tools/sprider/abbr.js @@ -0,0 +1,13 @@ +export default { + 达达利亚: '公子', + 神里绫华: '绫华', + 神里绫人: '绫人', + 枫原万叶: '万叶', + 雷电将军: '雷神', + 珊瑚宫心海: '心海', + 荒泷一斗: '一斗', + 八重神子: '八重', + 九条裟罗: '九条', + 罗莎莉亚: '罗莎', + 鹿野院平藏: '平藏' +}