From ef48fd54b0794f9d5da1cb2932ac9ef386aa18eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Tue, 20 Dec 2022 19:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E5=8A=A0type=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E5=A2=9E=E5=8A=A0=E5=8A=A0=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 7 +++++-- service-worker.js | 4 ++-- style.css | 10 +++++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/script.js b/script.js index a698154d..f3b10db2 100644 --- a/script.js +++ b/script.js @@ -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); } } diff --git a/service-worker.js b/service-worker.js index a59a80d1..ae839292 100644 --- a/service-worker.js +++ b/service-worker.js @@ -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", diff --git a/style.css b/style.css index c479ed15..79011895 100644 --- a/style.css +++ b/style.css @@ -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; }