From c89db36e90a6ac6b1f6b6528f5e5468a59d91b3e Mon Sep 17 00:00:00 2001 From: "ZM.J" Date: Wed, 3 Jul 2024 15:34:37 +0800 Subject: [PATCH] Implement basic functions of role challenge --- apps/stat.js | 6 + apps/stat/RoleCombatSummary.js | 145 +++++++++ config/system/cfg_system.js | 6 + models/Character.js | 5 + models/MysApi.js | 5 + models/Role.js | 98 ++++++ models/index.js | 2 + resources/common/tpl.css | 7 +- resources/common/tpl/avatar-card.css | 247 ++++++++++++--- resources/common/tpl/avatar-card.html | 2 +- resources/common/tpl/avatar-card.less | 7 + resources/stat/imgs/role/star/nostar.png | Bin 0 -> 1031 bytes resources/stat/imgs/role/star/star.png | Bin 0 -> 1006 bytes resources/stat/role-summary.css | 319 +++++++++++++++++++ resources/stat/role-summary.html | 144 +++++++++ resources/stat/role-summary.less | 375 +++++++++++++++++++++++ 16 files changed, 1321 insertions(+), 47 deletions(-) create mode 100644 apps/stat/RoleCombatSummary.js create mode 100644 models/Role.js create mode 100644 resources/stat/imgs/role/star/nostar.png create mode 100644 resources/stat/imgs/role/star/star.png create mode 100644 resources/stat/role-summary.css create mode 100644 resources/stat/role-summary.html create mode 100644 resources/stat/role-summary.less diff --git a/apps/stat.js b/apps/stat.js index 9a9f6526..9eab80ea 100644 --- a/apps/stat.js +++ b/apps/stat.js @@ -5,6 +5,7 @@ import { ConsStat, AbyssPct } from './stat/AbyssStat.js' import { AbyssTeam } from './stat/AbyssTeam.js' import { AbyssSummary } from './stat/AbyssSummary.js' +import { RoleCombatSummary } from './stat/RoleCombatSummary.js' import { App } from '#miao' let app = App.init({ @@ -32,6 +33,11 @@ app.reg({ rule: /^#*(喵喵|上传|本期)*(深渊|深境|深境螺旋)[ |0-9]*(数据)?$/, fn: AbyssSummary, desc: '上传深渊' + }, + RoleCombatSummary: { + rule: /^#*(喵喵|上传|本期)*(幻想|剧诗|幻想真境剧诗)[ |0-9]*(数据)?$/, + fn: RoleCombatSummary, + desc: '上传幻想真境剧诗' } }) export default app diff --git a/apps/stat/RoleCombatSummary.js b/apps/stat/RoleCombatSummary.js new file mode 100644 index 00000000..ca6c5057 --- /dev/null +++ b/apps/stat/RoleCombatSummary.js @@ -0,0 +1,145 @@ +import lodash from 'lodash' +import HutaoApi from './HutaoApi.js' +import { Cfg, Common, Data } from '#miao' +import { Role, Character, MysApi, Player } from '#miao.models' + +export async function RoleCombatSummary (e) { + let isMatch = /^#(喵喵|上传)*(幻想|剧诗|幻想真境剧诗)(数据)?$/.test(e.original_msg || e.msg || '') + if (!Cfg.get('uploadRoleCombat', false) && !isMatch) { + return false + } + let mys = await MysApi.init(e, 'all') + if (!mys || !mys.uid) { + if (isMatch) { + e.reply(`请绑定ck后再使用${e.original_msg || e.msg}`) + } + return false + } + let ret = {} + let uid = mys.uid + let player = Player.create(e) + let resDetail, resRole + try { + resRole = await mys.getRoleCombat() + let lvs = Data.getVal(resRole, 'data.0') + // 检查是否查询到了幻想真境剧诗信息 + if (!lvs || !lvs.has_data) { + e.reply('暂未获得本期幻想真境剧诗挑战数据...') + return true + } + // TODO: What if CK is not used? + // else if (lvs && lvs.battles && lvs.battles.length === 0) { + // if (!mys.isSelfCookie) { + // if (isMatch) { + // e.reply(`请绑定ck后再使用${e.original_msg || e.msg}`) + // } + // return false + // } + // } + + resDetail = await mys.getCharacter() + if (!resDetail || !resRole || !resDetail.avatars || resDetail.avatars.length <= 3) { + e.reply('角色信息获取失败') + return true + } + delete resDetail._res + delete resRole._res + + // TOOD: upload HuTao API + ret = lvs + // ret = await HutaoApi.uploadData({ + // uid, + // resDetail, + // resRole: resRole + // }) + } catch (err) { + // console.log(err); + } + // 更新player信息 + player.setMysCharData(resDetail) + + // TODO: HuTao API +// if (ret && ret.retcode === 0) { +// let stat = [] +// if (ret.data) { + if (resRole.data.length === 0) { + e.reply('暂未获得本期深渊挑战数据...') + return true + } + let role = new Role(resRole.data[0]) + let roleData = role.getData() + let ownAvatarIds = role.getOwnAvatars() + // let overview = ret.info || (await HutaoApi.getOverview())?.data || {} + // let addMsg = function (title, ds) { + // let tmp = {} + // if (!ds) { + // return false + // } + // if (!ds.avatarId && !ds.id) { + // return false + // } + // let char = Character.get(ds.avatarId || ds.id) + // tmp.title = title + // tmp.id = char.id + // tmp.value = `${(ds.value / 10000).toFixed(1)} W` + // let msg = [] + // tmp.msg = msg + // let pct = (percent, name) => { + // if (percent < 0.2) { + // msg.push({ + // title: '少于', + // value: (Math.max(0.1, 100 - percent * 100)).toFixed(1), + // name + // }) + // } else { + // msg.push({ + // title: '超过', + // value: (Math.min(99.9, percent * 100)).toFixed(1), + // name + // }) + // } + // } + // if (ds.percent) { + // pct(ds.percent, char.abbr) + // pct(ds.percentTotal, '总记录') + // } else { + // msg.push({ + // txt: '暂无统计信息' + // }) + // } + // stat.push(tmp) + // } + // addMsg('最强一击', ret.data?.damage || abyssData?.stat?.dmg || {}) + // addMsg('最高承伤', ret.data?.takeDamage || abyssData?.stat.takeDmg || {}) + // let abyssStat = abyssData?.stat || {} + // lodash.forEach({ defeat: '最多击破', e: '元素战技', q: '元素爆发' }, (title, key) => { + // if (abyssStat[key]) { + // stat.push({ + // title, + // id: abyssStat[key]?.id || 0, + // value: `${abyssStat[key]?.value}次` + // }) + // } else { + // stat.push({}) + // } + // }) + // await player.refreshTalent(avatarIds) + let ownAvatarData = player.getAvatarData(ownAvatarIds) + let otherAvatarData = role.getOtherAvatarsData() + + let avatarData = lodash.merge(ownAvatarData, otherAvatarData) + return await Common.render('stat/role-summary', { + role: roleData, + avatars: avatarData, + save_id: uid, + uid + }, { e, scale: 1.2 }) +// } else { +// e.reply('暂未获得本期深渊挑战数据...') +// return true +// } +// } else { +// e.reply(`${ret.message || '上传失败'},请稍后重试...`) +// } + return true +} diff --git a/config/system/cfg_system.js b/config/system/cfg_system.js index c28769b7..a59036aa 100644 --- a/config/system/cfg_system.js +++ b/config/system/cfg_system.js @@ -20,6 +20,12 @@ export const cfgSchema = { def: false, miao: true }, + uploadRoleCombat: { + title: '#幻想', + key: '幻想真境剧诗', + def: false, + miao: true + }, profileStat: { title: '#练度统计', key: '练度统计', diff --git a/models/Character.js b/models/Character.js index 7d76a4df..0a7c8581 100644 --- a/models/Character.js +++ b/models/Character.js @@ -132,6 +132,11 @@ class Character extends Base { return this.getImgs().face } + // 获取Q版头像 + get qFace () { + return this.getImgs().qFace + } + // 获取侧脸图像 get side () { if (this.isSr) { diff --git a/models/MysApi.js b/models/MysApi.js index 05491759..62e088a0 100644 --- a/models/MysApi.js +++ b/models/MysApi.js @@ -145,6 +145,11 @@ export default class MysApi { return await this.getData('spiralAbyss', { schedule_type: type }) } + // 获取幻想真境剧诗信息 + async getRoleCombat () { + return await this.getData('role_combat') + } + async getDetail (id) { if (this.e.isSr) { return await this.getData('detail', { avatar_id: id, tab_from: 'TabOwned' }) } return await this.getData('detail', { avatar_id: id }) diff --git a/models/Role.js b/models/Role.js new file mode 100644 index 00000000..633c4cb0 --- /dev/null +++ b/models/Role.js @@ -0,0 +1,98 @@ +/* +* Mys幻想真境剧诗数据处理 +* */ + +import lodash from 'lodash' +import moment from 'moment' +import Base from '../models/Base.js' +import Character from '../models/Character.js' +import { Data } from '#miao' + +moment.locale('zh-cn') + +export default class Role extends Base { + constructor (data) { + super() + this.rounds = {} + lodash.forEach(data.detail.rounds_data, (round) => { + // TODO: Analyze Choice cards & buffs + let tmp = { + 'is_get_medal': round.is_get_medal, + 'choice_cards': round.choice_cards, + 'buffs': round.buffs, + } + let time = moment(new Date(round.finish_time * 1000)) + tmp.finish_time = time.format('MM-DD HH:mm:ss') + let avatars = [] + lodash.forEach(round.avatars, (avatar) => { + avatars.push({ + 'avatar_id': avatar.avatar_id.toString(), + 'name': avatar.name, + 'avatar_type': avatar.avatar_type, + 'level': avatar.level, + }) + // avatar_type: + // - 1: self + // - 2: trial + // - 3: friend support + }) + + tmp.avatars = avatars + this.rounds[round.round_id] = tmp + }) + this.stat = data.stat + this.schedule = data.schedule + let st = moment(new Date(data.schedule.start_time * 1000)) + this.start_time = st.format('YYYY.MM.DD') + st = moment(new Date(data.schedule.end_time * 1000)) + this.end_time = st.format('YYYY.MM.DD') + } + + getData () { + return Data.getData(this, 'rounds,stat,schedule,start_time,end_time') + } + + getOwnAvatars () { + let ret = {} + lodash.forEach(this.rounds, (round) => { + lodash.forEach(round.avatars || [], (avatar) => { + if (avatar.avatar_id && avatar.avatar_type == 1) { + ret[avatar.avatar_id] = true + } + }) + }) + return lodash.keys(ret) + } + + getOtherAvatarsData () { + let ret = {} + lodash.forEach(this.rounds, (round) => { + lodash.forEach(round.avatars || [], (avatar) => { + if (avatar.avatar_id && avatar.avatar_type != 1) { + let character = new Character({ + 'id': +avatar.avatar_id, + 'name': avatar.name + }) + let detailInfo = character.getDetail() + ret[avatar.avatar_id] = { + id: +avatar.avatar_id, + name: avatar.name, + level: avatar.level, + star: detailInfo.star, + cons: { + 2: '试用', + 3: '助演' + }[avatar.avatar_type], + elem: detailInfo.elem, + abbr: detailInfo.abbr, + face: character.face, + qFace: character.qFace, + side: character.side, + gacha: character.gacha, + } + } + }) + }) + return ret + } +} diff --git a/models/index.js b/models/index.js index 67237319..4e8c8cf7 100644 --- a/models/index.js +++ b/models/index.js @@ -4,6 +4,7 @@ import Character from './Character.js' import Artifact from './Artifact.js' import ArtifactSet from './ArtifactSet.js' import Abyss from './Abyss.js' +import Role from './Role.js' import Player from './Player.js' import Avatar from './Avatar.js' import ProfileDmg from './ProfileDmg.js' @@ -30,6 +31,7 @@ for (let game of ['gs', 'sr']) { export { Base, Abyss, + Role, Button, Character, Artifact, diff --git a/resources/common/tpl.css b/resources/common/tpl.css index 045df589..a9d0fa5b 100644 --- a/resources/common/tpl.css +++ b/resources/common/tpl.css @@ -189,6 +189,12 @@ .avatar-card .cons.cons-0 { display: none; } +.avatar-card .cons.cons-试用 { + background-color: #d9767c; +} +.avatar-card .cons.cons-助演 { + background-color: #4889bf; +} .avatar-card .avatar-talent { height: 30px; padding: 4.5px 7.5px 3px; @@ -353,4 +359,3 @@ .item-list .item { width: 65px; } -/*# sourceMappingURL=tpl.css.map */ \ No newline at end of file diff --git a/resources/common/tpl/avatar-card.css b/resources/common/tpl/avatar-card.css index 379e768e..818278e3 100644 --- a/resources/common/tpl/avatar-card.css +++ b/resources/common/tpl/avatar-card.css @@ -1,57 +1,214 @@ .avatar-card { - margin: 0 0 10px 10px; - border-radius: 7px; - box-shadow: 0 2px 6px 0 rgba(132, 93, 90, 0.3); - height: 88px; + margin: 4.5px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.8); + font-size: 19.5px; + border-radius: 10.5px; +} +.avatar-card .card { + border-radius: 10.5px; + box-shadow: 0 2px 9px 0 rgba(132, 93, 90, 0.3); position: relative; overflow: hidden; background: #e7e5d9; + width: 105px; } -.avatar-card img { - width: 70px; - height: 70px; - border-radius: 7px 7px 20px 0; -} -.avatar-card.star5 img { - background-image: url(../common/item/bg5.png); - width: 100%; - height: 70px; - /*filter: brightness(1.1);*/ - background-size: 100%; +.avatar-card .avatar-face { + width: 105px; + height: 105px; + border-radius: 10.5px 10.5px 22.5px 0; + background-size: 100% 100%; background-repeat: no-repeat; + position: relative; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5); } -.avatar-card.star4 img { - width: 100%; - height: 70px; - background-image: url(../common/item/bg4.png); - background-size: 100%; - background-repeat: no-repeat; +.avatar-card .avatar-face .img { + background-position: center bottom; } -.avatar-card .num { +.avatar-card .avatar-face .avatar-level { position: absolute; - top: 0; - right: 0; - z-index: 9; - font-size: 18px; - text-align: center; - color: #fff; - padding: 1px 5px; - border-radius: 4px; - background: rgba(0, 0, 0, 0.5); -} -.avatar-card .name, -.avatar-card .num_name { - position: absolute; - top: 70px; + bottom: 0; + background: rgba(0, 0, 0, 0.6); left: 0; - z-index: 9; - font-size: 12px; - text-align: center; - width: 100%; - height: 16px; - line-height: 18px; -} -.avatar-card .num_name { + padding: 3px 7.5px 3px 4.5px; + border-radius: 0 6px 0 0; + color: #fff; font-size: 16px; + text-shadow: 0 0 1px #000; +} +.avatar-card .avatar-face .avatar-level span { + font-size: 12px; +} +.avatar-card .cons { + border-radius: 0 0 0 7.5px; + padding: 3px 7.5px; + position: absolute; + right: 0; + top: 0; + font-size: 16px; + text-shadow: 0 0 1px #000, 1px 1px 3px rgba(0, 0, 0, 0.8); +} +.avatar-card .cons.cons-0 { + display: none; +} +.avatar-card .cons.cons-试用 { + background-color: #d9767c; +} +.avatar-card .cons.cons-助演 { + background-color: #4889bf; +} +.avatar-card .avatar-talent { + height: 30px; + padding: 4.5px 7.5px 3px; + font-size: 18px; + width: 100%; + color: #222; + text-align: center; + display: flex; +} +.avatar-card .avatar-talent .talent-item { + width: 30px; + height: 24px; + line-height: 25.5px; + margin: 0 3px; + text-align: center; + display: block; + background-size: contain; + opacity: 0.8; + position: relative; + border-radius: 4.5px; + box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); +} +.avatar-card .avatar-talent .talent-item.talent-plus { + font-weight: bold; + color: #0284b9; +} +.avatar-card .avatar-talent .talent-item.talent-crown { + background: #d3bc8e; + color: #3a2702; + box-shadow: 0 0 3px 0 #000; +} +.avatar-card .avatar-talent.no-talent { + font-size: 18px; + color: rgba(100, 100, 100, 0.5); + text-align: center; + padding: 4.5px 0 3px; +} +.avatar-card .avatar-talent.no-talent span { + transform: scale(0.75); + white-space: nowrap; + margin-left: -1px; +} +.avatar-card.card-mini .wide, +.avatar-card.card-mini .line { + display: none; +} +.avatar-card .avatar-name { + padding: 12px 0 0 7.5px; + color: #333; +} +.avatar-card .avatar-name strong { + font-size: 30px; + display: block; + height: 34.5px; + line-height: 30px; +} +.avatar-card .avatar-name .cons { + position: initial; + border-radius: 4px; + padding: 1.5px 4.5px; + vertical-align: baseline; +} +.avatar-card.card-wide .mini { + display: none; +} +.avatar-card.card-wide .card { + width: 219px; + display: flex; +} +.avatar-card.card-wide .avatar-face { + height: 189px; + width: 114px; + border-radius: 10.5px 0 0 10.5px; +} +.avatar-card.card-wide .avatar-face .img { + background-size: 100% auto; + background-position: 0 10%; + height: 202.5px; + margin-top: -13.5px; +} +.avatar-card.card-wide .avatar-info { + width: 105px; +} +.avatar-card.card-wide .avatar-info strong { + display: block; + height: 45px; + line-height: 45px; +} +.avatar-card.card-wide .avatar-info .lv-info { + height: 30px; +} +.avatar-card.card-wide .line { + display: block; + height: 1px; + width: 100%; + margin: 5px 0; + background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(100, 100, 100, 0.5) 20%, rgba(100, 100, 100, 0.5) 80%, rgba(0, 0, 0, 0)); + transform: scale(0.8); +} +.avatar-card.wide2 .card { + width: 447px; +} +.avatar-card.wide2 .avatar-face { + width: 219px; +} +.avatar-card.wide2 .avatar-face .img { + margin-top: -75px; + height: 264px; +} +.avatar-card.wide2 .avatar-info { + width: 219px; + padding-left: 7.5px; +} +.avatar-card .avatar-detail { + display: flex; + padding: 0 1.5px 3px 3px; +} +.avatar-card .avatar-detail .item { + width: 46.5px; + height: 46.5px; + border-radius: 4.5px; + margin: 1.5px; + overflow: hidden; +} +.avatar-card .avatar-weapon .icon { + border-radius: 4px; +} +.avatar-card .avatar-weapon .cons { + top: initial; + bottom: 0; + padding: 1.5px 4.5px; + border-radius: 4.5px 0 0 0; +} +.avatar-card .avatar-artis { + position: relative; +} +.avatar-card .avatar-artis.artis0 .item-icon { + background: url('./item/artifact-icon.webp') rgba(0, 0, 0, 0.3) center no-repeat; + background-size: auto 80%; +} +.avatar-card .avatar-artis .artis { + background: rgba(0, 0, 0, 0.4); +} +.avatar-card .avatar-artis.artis2 .img { + position: absolute; + transform: scale(0.7); + width: 92%; + height: 92%; + margin: 4%; +} +.avatar-card .avatar-artis.artis2 .img:first-child { + transform-origin: left top; +} +.avatar-card .avatar-artis.artis2 .img:last-child { + transform-origin: right bottom; } -/*# sourceMappingURL=avatar-card.css.map */ \ No newline at end of file diff --git a/resources/common/tpl/avatar-card.html b/resources/common/tpl/avatar-card.html index a411e965..22c0ae9e 100644 --- a/resources/common/tpl/avatar-card.html +++ b/resources/common/tpl/avatar-card.html @@ -50,7 +50,7 @@
- {{/if}} + {{/if}} \ No newline at end of file diff --git a/resources/common/tpl/avatar-card.less b/resources/common/tpl/avatar-card.less index ae5bea3d..773324bc 100644 --- a/resources/common/tpl/avatar-card.less +++ b/resources/common/tpl/avatar-card.less @@ -59,6 +59,13 @@ &.cons-0 { display: none; } + + &.cons-试用 { + background-color: rgb(217, 118, 124); + } + &.cons-助演 { + background-color: rgb(72, 137, 191); + } } .avatar-talent { diff --git a/resources/stat/imgs/role/star/nostar.png b/resources/stat/imgs/role/star/nostar.png new file mode 100644 index 0000000000000000000000000000000000000000..adbfac82d2f554c8136f8beaeaacd5c83e891dfe GIT binary patch literal 1031 zcmV+i1o-=jP)MrjaAof1k6;X^vT*FPZ+B+b^GegkndiB^-Mh8C zrIJJdgO2h^QZ zn=o-YOVxX7KOlmx$N+>P9T||^FjqR$;9-fuh9R~|B} zda90=gFv|j(ZfK33UUspPnQi=CduKAq=5R# zDYN_XmDyf?W^n4L7f5<;rdcB|puPv+Z2V}J4+;9>dDHm#*)%?VF?w!xbVooZeB(hv z8-Dw3>=w}2Ypi@G_*B)+Lf&=)$3BWxGc4GFrfnJ$3zb?-^`P;z>z{pAj zfCwPJ3QsT%g=2Y$980Ca-F()B!{0YkQ`ysjy*YIH0Ok5&HHU!w@d{|4e zW^bulva222Gc|XKL?V$$Boc{4B9TZW5=kkj`~kdvQMXQyApZaW002ovPDHLkV1kpq B!|eb7 literal 0 HcmV?d00001 diff --git a/resources/stat/imgs/role/star/star.png b/resources/stat/imgs/role/star/star.png new file mode 100644 index 0000000000000000000000000000000000000000..cfac33699d439d6a46346281f64be8fecbb77ef1 GIT binary patch literal 1006 zcmVv8$d6-1ri9VvIBuw zu}Qx&>KD03zRwlqmM(9DU%u9qDkBS&r3LNB&sdyeh@m(I4)eBYVzaVkw52SE@7 zK@bE%5ClOG1VJLCWm?x8M$amy4aKyn4DAzZFUzG2?GM(%v_Xbun!V;Vam~^A(YQ*i zUy;$jZ3Cm^h5S)QFR8w|;YbJ>8Y83kY=fb+%jjLzQ=?YlE2AFy9bp{?Tip$F);hn) z@aedOw08n+(?}tY9X_Ls-u?9b)0OlDuzqWO(JZa#b!ww#5vCmqTRxL*8cAG$|Io3% zSQc7+noe8*8Tw#-p)9nFUQb>C>#p^Mvdr?|n3ETP>Bl=~2ka#;KtQLF;DP{#0P9^y z*a7xI5RM@GFvvpT8NkBlDy~Xx&>42)t%1HvzjP;u>!)pjgGrzZ)tNm zVCPT8`ZsecAZ`h+Q23$+M3Jy~3OLE|#S0i#LT#%q8h$1OM3qp>0Q}4d@T<}Z{*{40 z!GxN2+R0BlnHLathA$2A+<<@!B~0Z4e&%)n#Uw!r{LBiVAtXqGpJ@RUa?F$nKl1`8 zganE3b0L5NNRSFYHv;G!36kOGN&uZAK|1{037`WB<+c0XZFf>U{9Fp4gAsM9y<#11 zVFgfz3IZ4ctal+{2iONexjlk#VUu?jd}Z`b;sO*?+jf_c*rIQV3&5p)+VZ7+hGy({ znig4#^@GF(`1j}I;#PfH_y0=e;#NP3^&8vWM#4%N{nAPG2OEsuwY_K(H2t)Gwk|tq zMsf2djv_s{zP{0G-bxkzkp!dXiu@Y_%7<_CtQGi25_)R1h{usKdPnzl$&rwc{Phws zy%3%=rT`GRt7oB#j-07*qoM6N<$f`ZM(o&W#< literal 0 HcmV?d00001 diff --git a/resources/stat/role-summary.css b/resources/stat/role-summary.css new file mode 100644 index 00000000..c2f0e702 --- /dev/null +++ b/resources/stat/role-summary.css @@ -0,0 +1,319 @@ +.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, +.container { + width: 970px; +} +.container { + padding: 5px 0 10px 5px; +} +.head-box { + display: flex; + width: 100%; +} +.head-box .title { + font-size: 45px; + padding-bottom: 10px; + width: 70%; +} +.head-box .title span { + font-size: 30px; + margin-left: 10px; + color: #d3bc8e; +} +.head-box .uid { + text-align: right; + width: 30%; + padding-top: 25px; + padding-right: 10px; + font-size: 25px; +} +.abyss-stat-cont { + display: flex; + padding: 5px; +} +.abyss-stat { + display: flex; +} +.abyss-stat .cont { + margin: 5px 10px 5px 5px; + width: 175px; + height: 90px; +} +.abyss-stat .cont.best-record { + width: 120px; +} +.abyss-stat .cont.star-display { + width: 230px; +} +.abyss-stat strong { + text-shadow: 0 0 3px #000; +} +.abyss-stat .stat-title { + position: absolute; + top: 0; + background: rgba(0, 0, 0, 0.5); + padding: 5px 10px; + width: 100%; + text-shadow: 0 0 1px #000; +} +.abyss-stat .stat-title span { + display: block; + font-weight: normal; + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; + font-size: 24px; +} +.abyss-stat .stat-title strong { + display: block; + font-size: 30px; +} +.abyss-stat .stat-msg { + position: absolute; + bottom: 0; + background: rgba(0, 0, 0, 0.55); + backdrop-filter: blur(2px); + padding: 5px 10px; + width: 100%; + text-shadow: 0 0 1px #000; + font-size: 30px; + height: 45px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} +.abyss-stat .stat-msg .stat-star-container { + flex: 0 0 11%; + /* 23% 是为了在有间隙的情况下,四个元素一行 */ + margin-bottom: 10px; +} +.abyss-stat .stat-msg .stat-star-container .stat-star { + width: 25px; + height: 25px; + background-size: cover; +} +.avatar-banner { + height: 100px; + width: 175px; + background-repeat: no-repeat; + background-size: 100% auto; + background-position: 0 10%; +} +.abyss-data { + display: flex; + padding: 0 6px; +} +.abyss-data .abyss-item { + color: #fff; + margin: 5px; +} +.abyss-data .abyss-item .info { + text-align: center; + text-shadow: 0 0 1px #000, 1px 1px 3px #000; +} +.abyss-data .abyss-item .info strong { + display: block; + font-weight: normal; + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} +.abyss-data .abyss-item .info span { + font-size: 24px; + display: block; +} +.abyss-data .abyss-item .info span:after { + content: "次"; + font-size: 15px; + margin-left: 2px; +} +.abyss-title { + margin: -3px 0 8px; + display: flex; + align-items: flex-end; +} +.abyss-title strong { + color: #d3bc8e; + font-size: 18px; + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; + font-weight: normal; + margin-right: 10px; +} +.abyss-title .abyss-star { + width: 25px; + height: 25px; + background-size: cover; +} +.abyss-floor-team { + display: flex; +} +.abyss-floor-team .line { + width: 1px; + background: rgba(255, 255, 255, 0.5); + height: 80px; + vertical-align: middle; + margin: 15px 8px 0; +} +.abyss-team { + display: flex; + margin-right: -5px; + margin-left: -5px; +} +.role-buff { + display: flex; + margin-right: -5px; + margin-left: -5px; + flex-direction: column; + width: 50%; +} +.role-buff .role-choice-cards-container { + width: 100%; + height: 46%; + background-color: #e7e5d9; + display: flex; + border-radius: 10px; + overflow: hidden; + flex-direction: column; +} +.role-buff .role-choice-cards-container .role-choice-cards-header { + width: 100%; + height: 30px; + background-color: #8b8b83; + padding: 5px; + font-size: 18px; +} +.role-buff .role-choice-cards-container .role-choice-cards-content { + width: 100%; + padding: 5px; +} +.role-buff .role-choice-cards-container + .role-choice-cards-container { + margin-top: 4%; + /* 两个子元素之间的间距4% */ +} +.abyss-detail { + display: flex; + width: calc(100% + 40px); + margin: 10px -15px -10px; +} +.abyss-level { + padding: 5px 10px 7px; + width: 33%; + box-shadow: 0 0 1px 0 #fff; +} +.abyss-level:nth-child(even) { + background: rgba(255, 255, 255, 0.1); +} +.abyss-level .info { + margin-bottom: 5px; + display: flex; + padding-left: 8px; +} +.abyss-level .title { + font-size: 16px; + white-space: nowrap; + font-weight: bold; +} +.abyss-level .star { + height: 18px; + display: inline-block; + background: url(./imgs/star.png); + background-size: 18px 18px; + margin-left: 5px; +} +.abyss-level .star.star1 { + width: 18px; + margin-right: 36px; +} +.abyss-level .star.star2 { + width: 36px; + margin-right: 18px; +} +.abyss-level .star.star3 { + width: 54px; + margin-right: 0; +} +.abyss-level .time { + text-align: right; + width: 60%; + color: #aaa; + font-size: 14px; +} +.abyss-level .avatars { + display: flex; + width: 100%; +} +.abyss-level .avatars .avatar-list { + display: flex; + position: relative; +} +.abyss-level .avatars .avatar-list.up { + padding-right: 15px; +} +.abyss-level .avatars .avatar-list.up:after { + content: ""; + display: block; + position: absolute; + width: 1px; + height: 16px; + background: rgba(255, 255, 255, 0.3); + right: 8px; + top: 50%; + margin-top: -8px; +} +.abyss-level .avatars .avatar-icon { + width: 33px; + height: 33px; + border-radius: 50%; + margin-right: 2px; +} +.abyss-level .avatars .avatar-icon .img { + background-size: auto 100%; + background-position: center; + width: 29px; + height: 29px; + margin: 2px; +} +.abyss-notice .cont-body { + font-size: 16px; +} +.avatar-banner.avatar-枫原万叶, +.img.wide.avatar-枫原万叶 { + background-position: 0 -13%; +} +.avatar-banner.avatar-九条裟罗, +.img.wide.avatar-九条裟罗 { + background-position: 0 0; +} +.avatar-banner.avatar-香菱, +.img.wide.avatar-香菱 { + background-position: 0 -16%; +} +.avatar-banner.avatar-行秋, +.img.wide.avatar-行秋 { + background-position: 0 -16%; +} +.avatar-banner.avatar-甘雨, +.img.wide.avatar-甘雨 { + background-position: 0 -8%; +} +.avatar-banner.avatar-刻晴, +.img.wide.avatar-刻晴 { + background-position: 0 -5%; +} +.avatar-banner.avatar-神里绫华, +.img.wide.avatar-神里绫华 { + background-position: 0 13%; +} +.avatar-banner.avatar-班尼特, +.img.wide.avatar-班尼特 { + background-position: 0 15%; +} +.avatar-banner.avatar-五郎, +.img.wide.avatar-五郎 { + background-position: 0 15%; +} +.avatar-banner.avatar-托马, +.img.wide.avatar-托马 { + background-position: 0 -5%; +} diff --git a/resources/stat/role-summary.html b/resources/stat/role-summary.html new file mode 100644 index 00000000..390733f0 --- /dev/null +++ b/resources/stat/role-summary.html @@ -0,0 +1,144 @@ +{{extend defaultLayout}} + +{{block 'css'}} + + + +{{/block}} + +{{block 'main'}} +{{ set upDown = {up:'上半', down:'下半'} }} +
+
#上传幻想{{role.start_time}}-{{role.end_time}}
+
UID:{{uid}}
+
+
+ +
+ +
+
+
+ 最佳纪录 +
+
+ 第 {{role.stat.max_round_id}} 幕 +
+
+
+
+ 明星挑战星章 +
+
+ {{each role.stat.get_medal_round_list star}} +
+ {{if star == 1}} +
+ {{else}} +
+ {{/if}} +
+ {{/each}} +
+
+
+
+ 消耗幻剧之花 +
+
+ {{role.stat.coin_num}} +
+
+
+
+ 场外观众声援 +
+
+ {{role.stat.avatar_bonus_num}} 次 +
+
+
+
+ 支援其他玩家 +
+
+ {{role.stat.rent_cnt}} 次 +
+
+
+ +
+ {{set cardTypes={1:['wide wide2'],2:['wide','wide'],3:['wide','mini','mini'],4:['mini','mini','mini','mini']} }} + {{each role?.rounds round round_index}} +
+
+
+ {{if round.is_get_medal}} +
+ {{else}} +
+ {{/if}} + 第 {{round_index}} 幕 + {{round?.finish_time}} +
+
+
+ {{set current_avatars=round?.avatars||[] }} + {{each current_avatars avatar idx}} + <% include(_tpl_path+'/avatar-card.html', [avatars[avatar.avatar_id],{_res_path, cardType:cardTypes[current_avatars.length][idx]}]) %> + {{/each}} +
+
+
+ {{set buffs=round?.buff }} +
+
奇妙助益
+
等待实现
+
+ {{set choice_cards=round?.choice_cards }} +
+
神秘收获
+
等待实现
+
+
+
+ +
+
+ {{/each}} + +
+
+
    +
  • #上传幻想不会上传你的角色列表及当期幻想真境剧诗挑战数据,喵~
  • +
  • 角色装备与圣遗物为当前最新状态;排名会随时间而更新,数据排名仅供娱乐~
  • +
+
+
+
+{{/block}} \ No newline at end of file diff --git a/resources/stat/role-summary.less b/resources/stat/role-summary.less new file mode 100644 index 00000000..8e74d8a6 --- /dev/null +++ b/resources/stat/role-summary.less @@ -0,0 +1,375 @@ +@import "../common/base.less"; + +@scale: 1.4; +body, .container { + width: 970px; +} + +.container { + padding: 5px 0 10px 5px; +} + +.head-box { + display: flex; + width: 100%; + + .title { + font-size: 45px; + padding-bottom: 10px; + width: 70%; + + span { + font-size: 30px; + margin-left: 10px; + color: #d3bc8e; + } + } + + .uid { + text-align: right; + width: 30%; + padding-top: 25px; + padding-right: 10px; + font-size: 25px; + } +} + +.abyss-stat-cont { + display: flex; + padding: 5px; +} + +.abyss-stat { + display: flex; + + .cont { + // position: relative; + margin: 5px 10px 5px 5px; + width: 175px; + height: 90px; + } + + .cont.best-record { + width: 120px; + } + + .cont.star-display { + width: 230px; + } + + strong { + text-shadow: 0 0 3px #000; + } + + .stat-title { + position: absolute; + top: 0; + background: rgba(0, 0, 0, 0.5); + padding: 5px 10px; + width: 100%; + text-shadow: 0 0 1px #000; + + span { + display: block; + font-weight: normal; + .font-NZBZ; + font-size: 24px; + } + + strong { + display: block; + font-size: 30px; + } + } + + .stat-msg { + position: absolute; + bottom: 0; + background: rgba(0, 0, 0, 0.55); + backdrop-filter: blur(2px); + padding: 5px 10px; + width: 100%; + text-shadow: 0 0 1px #000; + font-size: 30px; + height: 45px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + + .stat-star-container { + flex: 0 0 11%; /* 23% 是为了在有间隙的情况下,四个元素一行 */ + margin-bottom: 10px; + + .stat-star { + width: 25px; + height: 25px; + background-size: cover; + } + } + } +} + + +.avatar-banner { + height: 100px; + width: 175px; + background-repeat: no-repeat; + background-size: 100% auto; + background-position: 0 10%; +} + +.abyss-data { + display: flex; + padding: 0 6px; + + .abyss-item { + color: #fff; + margin: 5px; + + .info { + text-align: center; + text-shadow: 0 0 1px #000, 1px 1px 3px #000; + + strong { + display: block; + font-weight: normal; + .font-NZBZ; + } + + span { + font-size: 24px; + display: block; + + &:after { + content: "次"; + font-size: 15px; + margin-left: 2px; + } + } + } + } +} + +.abyss-title { + margin: -3px 0 8px; + display: flex; + align-items: flex-end; + + strong { + color: #d3bc8e; + font-size: 18px; + .font-NZBZ; + font-weight: normal; + margin-right: 10px; + } + + .abyss-star { + width: 25px; + height: 25px; + background-size: cover; + } +} + +.abyss-floor-team { + display: flex; + + .line { + width: 1px; + background: rgba(255, 255, 255, .5); + height: 80px; + vertical-align: middle; + margin: 15px 8px 0; + } +} + +.abyss-team { + display: flex; + margin-right: -5px; + margin-left: -5px; +} + +.role-buff { + display: flex; + margin-right: -5px; + margin-left: -5px; + flex-direction: column; + width: 50%; + + .role-choice-cards-container { + width: 100%; + height: 46%; + background-color: rgb(231, 229, 217); + display: flex; + border-radius: 10px; + overflow: hidden; + flex-direction: column; + + .role-choice-cards-header { + width: 100%; + height: 30px; + background-color: rgb(139, 139, 131); + padding: 5px; + font-size: 18px; + } + + .role-choice-cards-content { + width: 100%; + padding: 5px; + } + } + + .role-choice-cards-container + .role-choice-cards-container { + margin-top: 4%; /* 两个子元素之间的间距4% */ + } +} + +.abyss-detail { + display: flex; + width: calc(100% + 40px); + margin: 10px -15px -10px; +} + + +.abyss-level { + padding: 5px 10px 7px; + width: 33%; + box-shadow: 0 0 1px 0 #fff; + + &:nth-child(even) { + background: rgba(255, 255, 255, .1) + } + + + .info { + margin-bottom: 5px; + display: flex; + padding-left: 8px; + } + + .title { + font-size: 16px; + white-space: nowrap; + font-weight: bold; + } + + .star { + @size: 18px; + + height: @size; + display: inline-block; + background: url(./imgs/star.png); + background-size: @size @size; + margin-left: 5px; + + &.star1 { + width: @size; + margin-right: @size * 2; + } + + &.star2 { + width: @size * 2; + margin-right: @size; + } + + &.star3 { + width: @size * 3; + margin-right: 0; + } + } + + .time { + text-align: right; + width: 60%; + color: #aaa; + font-size: 14px; + } + + .avatars { + display: flex; + width: 100%; + + .avatar-list { + display: flex; + position: relative; + + &.up { + padding-right: 15px; + } + + &.up:after { + content: ""; + display: block; + position: absolute; + width: 1px; + height: 16px; + background: rgba(255, 255, 255, .3); + right: 8px; + top: 50%; + margin-top: -8px; + } + } + + .avatar-icon { + width: 33px; + height: 33px; + border-radius: 50%; + margin-right: 2px; + + .img { + background-size: auto 100%; + background-position: center; + width: 29px; + height: 29px; + margin: 2px; + } + } + } +} + +.abyss-notice { + .cont-body { + font-size: 16px; + } +} + +.avatar-banner, .img.wide { + &.avatar-枫原万叶 { + background-position: 0 -13%; + } + + &.avatar-九条裟罗 { + background-position: 0 0; + } + + &.avatar-香菱 { + background-position: 0 -16%; + } + + &.avatar-行秋 { + background-position: 0 -16%; + } + + &.avatar-甘雨 { + background-position: 0 -8%; + } + + &.avatar-刻晴 { + background-position: 0 -5%; + } + + &.avatar-神里绫华 { + background-position: 0 13%; + } + + &.avatar-班尼特 { + background-position: 0 15%; + } + + &.avatar-五郎 { + background-position: 0 15%; + } + + &.avatar-托马 { + background-position: 0 -5%; + } +} \ No newline at end of file