From 669b598b381cdf4fbd0840313a42b117361d6801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Thu, 15 Oct 2020 19:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=98=BE=E7=A4=BA=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- multi.html | 2 +- script.js | 73 +++++++++++++++++++++++++---------------------------- solo.html | 2 +- style.css | 16 +++++++++--- triple.html | 2 +- 5 files changed, 50 insertions(+), 45 deletions(-) diff --git a/multi.html b/multi.html index 19251bba..87fa1794 100644 --- a/multi.html +++ b/multi.html @@ -662,10 +662,10 @@ var formation = new Formation(teamsCount,5);
- +
diff --git a/script.js b/script.js index 4d0157aa..7d6344c0 100644 --- a/script.js +++ b/script.js @@ -935,18 +935,6 @@ function initialize() { monstersID.onchange(); return false; //取消链接的默认操作 } - //产生一个觉醒列表 - function creatAwokenList(awokens) { - const ul = document.createElement("ul"); - ul.className = "awoken-ul"; - awokens.forEach(ak=>{ - const li = ul.appendChild(document.createElement("li")); - const icon = li.appendChild(document.createElement("icon")); - icon.className = "awoken-icon"; - icon.setAttribute("data-awoken-icon",ak); - }); - return ul; - } const cli = document.createElement("li"); const cdom = cli.head = createCardA(id); cli.appendChild(cdom); @@ -976,40 +964,46 @@ function initialize() { CD_MaxDom.textContent = CD_Max; } } + //产生一个能力值列表 + function creatAbilitiesList(abilities) { + const abilitiesPreview = document.createElement("ul"); + abilitiesPreview.className = "abilities-preview"; + const hpDom = abilitiesPreview.appendChild(document.createElement("li")); + hpDom.className = "hp-preview"; + hpDom.textContent = abilities.hp; + const atkDom = abilitiesPreview.appendChild(document.createElement("li")); + atkDom.className = "atk-preview"; + atkDom.textContent = abilities.atk; + const rcvDom = abilitiesPreview.appendChild(document.createElement("li")); + rcvDom.className = "rcv-preview"; + rcvDom.textContent = abilities.rcv; + return abilitiesPreview; + } if (options.showAbilities || options.showAbilitiesWithAwoken) { const abilities_2status = calculateAbility_max(id, solo, teamsCount); if (options.showAbilities && abilities_2status) { - const abilitiesPreview = cli.appendChild(document.createElement("ul")); - abilitiesPreview.className = "abilities-preview"; - const abilities = abilities_2status.noAwoken; - const hpDom = abilitiesPreview.appendChild(document.createElement("li")); - hpDom.className = "hp-preview"; - hpDom.textContent = abilities.hp; - const atkDom = abilitiesPreview.appendChild(document.createElement("li")); - atkDom.className = "atk-preview"; - atkDom.textContent = abilities.atk; - const rcvDom = abilitiesPreview.appendChild(document.createElement("li")); - rcvDom.className = "rcv-preview"; - rcvDom.textContent = abilities.rcv; + const abilitiesPreview = cli.appendChild(creatAbilitiesList(abilities_2status.noAwoken)); } if (options.showAbilitiesWithAwoken && abilities_2status) { - const abilitiesPreview = cli.appendChild(document.createElement("ul")); - abilitiesPreview.className = "abilities-with-awoken-preview"; - const abilities = abilities_2status.withAwoken; - const hpDom = abilitiesPreview.appendChild(document.createElement("li")); - hpDom.className = "hp-preview"; - hpDom.textContent = abilities.hp; - const atkDom = abilitiesPreview.appendChild(document.createElement("li")); - atkDom.className = "atk-preview"; - atkDom.textContent = abilities.atk; - const rcvDom = abilitiesPreview.appendChild(document.createElement("li")); - rcvDom.className = "rcv-preview"; - rcvDom.textContent = abilities.rcv; + const abilitiesPreview = cli.appendChild(creatAbilitiesList(abilities_2status.withAwoken)); + abilitiesPreview.classList.add("abilities-with-awoken-preview"); } } + //产生一个觉醒列表 + function creatAwokenList(awokens) { + const ul = document.createElement("ul"); + ul.className = "awoken-ul"; + awokens.forEach(ak=>{ + const li = ul.appendChild(document.createElement("li")); + const icon = li.appendChild(document.createElement("icon")); + icon.className = "awoken-icon"; + icon.setAttribute("data-awoken-icon",ak); + }); + return ul; + } if (options.showAwoken) { const awokenPreview = cli.appendChild(document.createElement("div")); @@ -1195,8 +1189,11 @@ function initialize() { //对已经搜索到的Cards重新附加显示 function reShowSearch() { - const oldArr = searchMonList.originalHeads.map(head=>head.card); - showSearch(oldArr); + if (Array.isArray(searchMonList.originalHeads)) + { + const oldArr = searchMonList.originalHeads.map(head=>head.card); + showSearch(oldArr); + } } s_add_show_awoken.onchange = reShowSearch; s_add_show_CD.onchange = reShowSearch; diff --git a/solo.html b/solo.html index d4377ab1..8974c6da 100644 --- a/solo.html +++ b/solo.html @@ -612,10 +612,10 @@ var formation = new Formation(teamsCount,6);
- +
diff --git a/style.css b/style.css index 2f5f45d1..fbf12380 100644 --- a/style.css +++ b/style.css @@ -883,19 +883,27 @@ ul{ { content: "-"; } -.abilities-preview>li, -.abilities-with-awoken-preview>li +.cd-preview, +.add-show-CD-label +{ + color: lightblue; +} +.abilities-preview>li { font-size: 14px; } .cd-preview::before, -.abilities-preview>li::before, -.abilities-with-awoken-preview>li::before +.abilities-preview>li::before { font-size: 10px; display: inline-block; width: 25px; } +.add-show-abilities-with-awoken-label, +.abilities-with-awoken-preview>li +{ + color: #dfd; +} /*.setting-box .row-mon-id .open-search::before{ diff --git a/triple.html b/triple.html index 8799b29a..96ce83d9 100644 --- a/triple.html +++ b/triple.html @@ -1307,10 +1307,10 @@ var formation = new Formation(teamsCount,6);
- +