From 7bb9853bd4593db70220b4e51f918418ae725e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Mon, 28 Sep 2020 17:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0type=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=97=B6=E9=A2=84=E5=85=88=E6=98=BE=E7=A4=BA=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=89=93=E4=BB=80=E4=B9=88=E6=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- multi.html | 26 +++++++++++++------------- script.js | 22 ++++++++++++++++++++-- solo.html | 26 +++++++++++++------------- style.css | 37 +++++++++++++++++++++++++++++++++++++ triple.html | 26 +++++++++++++------------- 5 files changed, 96 insertions(+), 41 deletions(-) diff --git a/multi.html b/multi.html index 26d5cdfa..b8180c5a 100644 --- a/multi.html +++ b/multi.html @@ -472,21 +472,21 @@ var formation = new Formation(teamsCount,5);
- +
diff --git a/script.js b/script.js index 7821afd7..4d55dd60 100644 --- a/script.js +++ b/script.js @@ -828,8 +828,26 @@ function initialize() { const s_attr1s = Array.from(searchBox.querySelectorAll(".attrs .attr-list-1 .attr-radio")); const s_attr2s = Array.from(searchBox.querySelectorAll(".attrs .attr-list-2 .attr-radio")); const s_fixMainColor = searchBox.querySelector("#fix-main-color"); - const s_types = Array.from(searchBox.querySelectorAll(".types-div .type-check")); - const s_typeAndOr = searchBox.querySelector("#type-and-or"); + const s_typesDiv = searchBox.querySelector(".types-div"); + const s_types = Array.from(s_typesDiv.querySelectorAll(".type-check")); + const s_typeAndOr = s_typesDiv.querySelector("#type-and-or"); + const s_typesUl = s_typesDiv.querySelector(".type-list"); + const s_typesLi = Array.from(s_typesUl.querySelectorAll("li")); + const s_typesCheckBox = s_typesLi.map(li=>li.querySelector(".type-check")); + s_typesCheckBox.forEach(checkBox=> + checkBox.onchange = function(){ + const newClassName = `type-killer-${this.value}`; + if (this.checked && s_typeAndOr.checked) + s_typesUl.classList.add(newClassName); + else + s_typesUl.classList.remove(newClassName); + } + ); + s_typeAndOr.onchange = function(){ + s_typesCheckBox.forEach(checkBox=>checkBox.onchange()); + }; + s_typeAndOr.onchange(); + const s_awokensItems = Array.from(searchBox.querySelectorAll(".awoken-div .awoken-count")); const s_awokensIcons = s_awokensItems.map(it => it.querySelector(".awoken-icon")); const s_awokensCounts = s_awokensItems.map(it => it.querySelector(".count")); diff --git a/solo.html b/solo.html index c7ab49b3..296a6ea4 100644 --- a/solo.html +++ b/solo.html @@ -422,21 +422,21 @@ var formation = new Formation(teamsCount,6);
- +
diff --git a/style.css b/style.css index a7c6554a..5f3849cc 100644 --- a/style.css +++ b/style.css @@ -952,6 +952,43 @@ ul{ margin-left: 10px; margin-right: 0; } +.types-div .type-list li +{ + position: relative; +} +.types-div .type-list li:after +{ + content: "⚔️"; + font-size: 10px; + position: absolute; + right: 0; + bottom: 0; + display: none; + pointer-events:none; +} +.types-div .type-list.type-killer-5 li[data-type-icon="7"]:after, +.types-div .type-list.type-killer-4 li[data-type-icon="8"]:after, +.types-div .type-list.type-killer-4 li[data-type-icon="3"]:after, +.types-div .type-list.type-killer-7 li[data-type-icon="5"]:after, +.types-div .type-list.type-killer-8 li[data-type-icon="5"]:after, +.types-div .type-list.type-killer-8 li[data-type-icon="1"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="5"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="4"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="7"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="8"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="1"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="6"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="2"]:after, +.types-div .type-list.type-killer-1 li[data-type-icon="3"]:after, +.types-div .type-list.type-killer-6 li[data-type-icon="7"]:after, +.types-div .type-list.type-killer-6 li[data-type-icon="2"]:after, +.types-div .type-list.type-killer-2 li[data-type-icon="8"]:after, +.types-div .type-list.type-killer-2 li[data-type-icon="3"]:after, +.types-div .type-list.type-killer-3 li[data-type-icon="4"]:after, +.types-div .type-list.type-killer-3 li[data-type-icon="6"]:after +{ + display: block; +} /*.search-box .awoken-div::before{ content: "觉醒"; }*/ diff --git a/triple.html b/triple.html index 61adc022..25879ed6 100644 --- a/triple.html +++ b/triple.html @@ -1117,21 +1117,21 @@ var formation = new Formation(teamsCount,6);
- +