Browse Source

附加type的时候增加加号

tags/v30.1
枫谷剑仙 3 years ago
parent
commit
ef48fd54b0
3 changed files with 16 additions and 5 deletions
  1. +5
    -2
      script.js
  2. +2
    -2
      service-worker.js
  3. +9
    -1
      style.css

+ 5
- 2
script.js View File

@@ -5162,15 +5162,18 @@ function refreshmemberTypes(memberTypesDom, team, idx) {
if (!memberTypesDom) return; //如果没有dom,直接跳过
const member = team[0][idx];
const assist = team[1][idx];
const {types = [], appendType = false} = member.getAttrsTypesWithWeapon(assist) || {};
let {types = [], appendType = false} = member.getAttrsTypesWithWeapon(assist) || {};
appendType = appendType && (types.length > member.card.types.length); //appendType还需要满足type数量大于角色真实的type
const memberTypesUl = memberTypesDom.querySelector(`.member-types-${idx + 1} .types-ul`);
memberTypesUl.innerHTML = '';
for (let i = 0;i < types.length; i++) {
const iconLi = document.createElement("li");
const icon = iconLi.appendChild(document.createElement("icon"))
icon.className = "type-icon";
if (appendType && i == (types.length - 1)) icon.classList.add('append-type');
icon.setAttribute("data-type-icon", types[i]);
if (appendType && i == (types.length - 1)) {
iconLi.classList.add('append-type');
}
memberTypesUl.appendChild(iconLi);
}
}


+ 2
- 2
service-worker.js View File

@@ -6883,7 +6883,7 @@ const cachesMap = new Map([
],
[
"script.js",
"0cc57043ce3fc24a11597f1e538e8b1d"
"29b443c6701b1f475c0e37141cc40725"
],
[
"solo.html",
@@ -6895,7 +6895,7 @@ const cachesMap = new Map([
],
[
"style.css",
"7adb58362de0f74871443ddd3c424267"
"8c8575c31b4b6282037986a3b6935b89"
],
[
"temp.js",


+ 9
- 1
style.css View File

@@ -514,7 +514,15 @@ ul{
display: block;
position: absolute;
}
.type-icon.append-type {
.member-types .append-type::before {
font-family: var(--game-font-family);
content: "+";
font-size: 15px;
line-height: 10px;
color: yellow;
text-shadow: black 0 0 1px,black 0 0 2px, black 2px 2px 0;
}
.member-types .append-type .type-icon{
background-color: lightgreen;
box-shadow: 1px 1px 3px lightgreen,1px 1px 3px lightgreen,1px 1px 3px lightgreen;
}


Loading…
Cancel
Save