Implement basic functions of role challenge

This commit is contained in:
ZM.J 2024-07-03 15:34:37 +08:00
parent d7c732d3aa
commit c89db36e90
16 changed files with 1321 additions and 47 deletions

View File

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

View File

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

View File

@ -20,6 +20,12 @@ export const cfgSchema = {
def: false,
miao: true
},
uploadRoleCombat: {
title: '#幻想',
key: '幻想真境剧诗',
def: false,
miao: true
},
profileStat: {
title: '#练度统计',
key: '练度统计',

View File

@ -132,6 +132,11 @@ class Character extends Base {
return this.getImgs().face
}
// 获取Q版头像
get qFace () {
return this.getImgs().qFace
}
// 获取侧脸图像
get side () {
if (this.isSr) {

View File

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

98
models/Role.js Normal file
View File

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

View File

@ -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,

View File

@ -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 */

View File

@ -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 */

View File

@ -50,7 +50,7 @@
<div class="item-info wide"></div>
</div>
</div>
</div>
{{/if}}
</div>
</div>
</div>

View File

@ -59,6 +59,13 @@
&.cons-0 {
display: none;
}
&.cons-试用 {
background-color: rgb(217, 118, 124);
}
&.cons-助演 {
background-color: rgb(72, 137, 191);
}
}
.avatar-talent {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

View File

@ -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%;
}

View File

@ -0,0 +1,144 @@
<script src="../../../../../Yunzai-Botconfig/miao-diy/app/main.js"></script>{{extend defaultLayout}}
{{block 'css'}}
<link rel="stylesheet" type="text/css" href="{{_res_path}}/stat/common.css?v=1.0"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/common/tpl.css?v=1.0"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/stat/role-summary.css?v=1.0"/>
{{/block}}
{{block 'main'}}
{{ set upDown = {up:'上半', down:'下半'} }}
<div class="head-box type">
<div class="title">#上传幻想<span>{{role.start_time}}-{{role.end_time}}</span></div>
<div class="uid">UID:{{uid}}</div>
</div>
<div class="info_box">
<div class="abyss-stat-cont">
<div class="abyss-stat">
<div class="cont best-record">
<div class="stat-title">
<span>最佳纪录</span>
</div>
<div class="stat-msg">
<strong>第 {{role.stat.max_round_id}} 幕</strong>
</div>
</div>
<div class="cont star-display">
<div class="stat-title">
<span>明星挑战星章</span>
</div>
<div class="stat-msg">
{{each role.stat.get_medal_round_list star}}
<div class="stat-star-container">
{{if star == 1}}
<div class="stat-star" style="background-image:url({{_res_path}}/stat/imgs/role/star/star.png)"></div>
{{else}}
<div class="stat-star" style="background-image:url({{_res_path}}/stat/imgs/role/star/nostar.png)"></div>
{{/if}}
</div>
{{/each}}
</div>
</div>
<div class="cont">
<div class="stat-title">
<span>消耗幻剧之花</span>
</div>
<div class="stat-msg">
<strong>{{role.stat.coin_num}}</strong>
</div>
</div>
<div class="cont">
<div class="stat-title">
<span>场外观众声援</span>
</div>
<div class="stat-msg">
<strong>{{role.stat.avatar_bonus_num}} 次</strong>
</div>
</div>
<div class="cont">
<div class="stat-title">
<span>支援其他玩家</span>
</div>
<div class="stat-msg">
<strong>{{role.stat.rent_cnt}} 次</strong>
</div>
</div>
</div>
</div>
{{set cardTypes={1:['wide wide2'],2:['wide','wide'],3:['wide','mini','mini'],4:['mini','mini','mini','mini']} }}
{{each role?.rounds round round_index}}
<div class="cont">
<div class="cont-body">
<div class="abyss-title">
{{if round.is_get_medal}}
<div class="abyss-star" style="background-image:url({{_res_path}}/stat/imgs/role/star/star.png)"></div>
{{else}}
<div class="abyss-star" style="background-image:url({{_res_path}}/stat/imgs/role/star/nostar.png)"></div>
{{/if}}
<strong>第 {{round_index}} 幕</strong>
<span>{{round?.finish_time}}</span>
</div>
<div class="abyss-floor-team">
<div class="abyss-team">
{{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}}
</div>
<div class="line"></div>
<div class="role-buff">
{{set buffs=round?.buff }}
<div class="role-choice-cards-container">
<div class="role-choice-cards-header">奇妙助益</div>
<div class="role-choice-cards-content">等待实现</div>
</div>
{{set choice_cards=round?.choice_cards }}
<div class="role-choice-cards-container">
<div class="role-choice-cards-header">神秘收获</div>
<div class="role-choice-cards-content">等待实现</div>
</div>
</div>
</div>
<!-- <div class="abyss-detail">
{{each floor?.levels level idx}}
<div class="abyss-level">
<div class="info">
<div class="title">
第{{idx}}间
</div>
<span class="star star{{level.star}}"></span>
<div class="time">{{level?.up?.time}}</div>
</div>
<div class="avatars">
{{each upDown v k}}
<div class="avatar-list {{k}}">
{{each level[k]?.avatars||[] id}}
{{set avatar = avatars[id] || {} }}
<div class="avatar-icon item-icon star{{avatar.star==4?4:5}}">
<span class="img"
style="background-image:url({{_res_path}}{{avatar.face}})"></span>
</div>
{{/each}}
</div>
{{/each}}
</div>
</div>
{{/each}}
</div> -->
</div>
</div>
{{/each}}
<div class="cont abyss-notice">
<div class="cont-body">
<ul class="cont-msg">
<li><strong>#上传幻想</strong>不会上传你的角色列表及当期幻想真境剧诗挑战数据,喵~</li>
<li>角色装备与圣遗物为当前最新状态;排名会随时间而更新,数据排名仅供娱乐~</li>
</ul>
</div>
</div>
</div>
{{/block}}

View File

@ -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%;
}
}