%深渊增加耗时显示 close #85

This commit is contained in:
UCPr 2025-04-26 00:57:15 +08:00
parent 5a0ecd278a
commit a134543639
5 changed files with 23 additions and 11 deletions

View file

@ -13,7 +13,7 @@ export class Card extends ZZZPlugin {
priority: _.get(settings.getConfig('priority'), 'card', 70),
rule: [
{
reg: `${rulePrefix}(card|卡片|个人信息)$`,
reg: `${rulePrefix}(card|卡片|个人信息|角色)$`,
fnc: 'card',
},
],

View file

@ -176,6 +176,8 @@ export class ChallengeNode {
/** @type {MonsterInfo} */
this.monster_info =
data?.monster_info && new MonsterInfo(data.monster_info);
/** @type {number} */
this.battle_time = data.battle_time;
}
async get_assets() {
@ -192,6 +194,12 @@ export class ChallengeNode {
return element.IDToElement(type);
});
}
get formattedTime() {
const seconds = this.battle_time % 60;
const minutes = Math.floor(this.battle_time / 60);
return `${minutes ? minutes + '分' : ''}${seconds + '秒'}`;
}
}
/**

View file

@ -119,14 +119,15 @@
margin-bottom: 0.5em;
}
.card .item-card .team .info .label {
margin-right: auto;
padding: 0 0.5em;
}
.card .item-card .team .info .time {
background-color: rgba(23, 135, 255, 0.2);
.card .item-card .team .info .spent, .card .item-card .team .info .time {
color: #ddd;
font-size: 0.8em;
padding: 0 0.2em;
font-size: 0.7em;
color: rgba(255, 255, 255, 0.8);
}
.card .item-card .team .info .spent {
margin-right: auto;
}
.card .item-card .team .info .advantage {
display: flex;

View file

@ -49,6 +49,7 @@
<div class="team">
<div class="info">
<div class="label">队伍1</div>
<div class="spent">耗时:{{floor.node_1.formattedTime}}</div>
<div class="time">{{floor.formattedTime}}</div>
<div class="advantage">
<span>有利</span>
@ -93,6 +94,7 @@
<div class="team">
<div class="info">
<div class="label">队伍2</div>
<div class="spent">耗时:{{floor.node_2.formattedTime}}</div>
<div class="time">{{floor.formattedTime}}</div>
<div class="advantage">
<span>有利</span>

View file

@ -118,14 +118,15 @@
align-items: center;
margin-bottom: 0.5em;
.label {
margin-right: auto;
padding: 0 0.5em;
}
.time {
background-color: rgba(23, 135, 255, 0.2);
.spent, .time {
color: #ddd;
font-size: 0.8em;
padding: 0 0.2em;
font-size: 0.7em;
color: rgba(255, 255, 255, 0.8);
}
.spent {
margin-right: auto;
}
.advantage {
display: flex;