diff --git a/doc/images/tips-advanced-rich-text-drag-dop.webp b/doc/images/tips-advanced-rich-text-drag-dop.webp new file mode 100644 index 00000000..b39483b1 Binary files /dev/null and b/doc/images/tips-advanced-rich-text-drag-dop.webp differ diff --git a/doc/index.html b/doc/index.html index adfc98d0..b9b4c9fc 100644 --- a/doc/index.html +++ b/doc/index.html @@ -498,6 +498,11 @@ Since I'm just an amateur developer, there will be a lot of bugs, and you can always switch to code mode for more detailed editing.
富文本功能 +
+ 电脑上使用鼠标时,支持直接拖拽队伍和搜索结果里的角色头像到介绍里。 + When using the mouse on the computer, you can directly drag character avatars from the team and search results and drop into the descriptions. +
+ 将角色头像拖拽到介绍中

其他 diff --git a/script.js b/script.js index 8e55609e..2eeed9d5 100644 --- a/script.js +++ b/script.js @@ -4141,7 +4141,7 @@ function initialize() { const t = document.body.querySelector('#template-team-awoken-effect'); const clone = document.importNode(t.content, true); - const akIcons = clone.querySelectorAll(":where(.awoken-icon,.latent-icon.show-enabling-awokwn)"); + const akIcons = clone.querySelectorAll(":where(.awoken-icon,.latent-icon)"); akIcons.forEach(icon=>{ icon.onmouseenter = highlightAwokenMemberForIcon; icon.onmouseleave = removeAllHighlightOnAwokenMenber; @@ -7275,28 +7275,42 @@ function highlightAwokenMember(event, teamIndex) { throw new TypeError("输入的不是 整数 或者含 data-awoken-icon 的 HTML 元素"); } })(icon); - if (!akId) return; const eqak = equivalent_awoken.find(obj=>akId === obj.big || akId === obj.small); - let findArea = []; + const awokenFindArea = [], //搜索觉醒ID的区域 + forceArea = []; //强制高亮的区域 if (icon.classList.contains("latent-icon") && icon.hasAttribute("data-latent-icon")) { + //如果选中的是潜觉,只显示让这个潜觉生效的觉醒 const latentId = parseInt(icon.getAttribute("data-latent-icon"), 10); formation.teams[teamIndex][0] .forEach((member,idx)=>{ if (member.latent.includes(latentId)) { - findArea.push(...teamBox.querySelectorAll(`:where(.team-member-awoken,${latentId === 48 ? "" : ".team-assist-awoken"}) .member-awoken[data-index="${idx}"]`)); + awokenFindArea.push(...teamBox.querySelectorAll(`:where(.team-member-awoken,${latentId === 48 ? "" : ".team-assist-awoken"}) .member-awoken[data-index="${idx}"]`)); } }); + const latents = teamBox.querySelectorAll(`.team-latents .latent-icon[data-latent-icon="${latentId}"]`); + forceArea.push(...latents); } else { - findArea.push(...teamBox.querySelectorAll(":where(.team-member-awoken,.team-assist-awoken)")); + awokenFindArea.push(...teamBox.querySelectorAll(":where(.team-member-awoken,.team-assist-awoken)")); + if (icon.closest(".team-awoken-effect")) { + //处理盾,高亮潜觉的盾 + const awokenId = parseInt(icon.getAttribute("data-awoken-icon"), 10); + if (awokenId >= 4 && awokenId <= 8) { + const latentId_1 = awokenId + 2, latentId_2 = awokenId + 28; + const latents = teamBox.querySelectorAll(`.team-latents .latent-icon:where([data-latent-icon="${latentId_1}"],[data-latent-icon="${latentId_2}"])`); + forceArea.push(...latents); + } + } } - const akIcons = findArea.flatMap(node=>Array.from(node.querySelectorAll(".awoken-icon"))); + const akIcons = awokenFindArea.flatMap(node=>Array.from(node.querySelectorAll(".awoken-icon"))); akIcons.filter(icon=>{ const iconId = parseInt(icon?.dataset?.awokenIcon, 10); return eqak ? (iconId === eqak.big || iconId === eqak.small) : iconId === akId; }) .forEach(icon=>icon.classList.add("hightlight")); + + forceArea.forEach(icon=>icon.classList.add("hightlight")); } function highlightAwokenMemberForIcon(event) { const teamBigBoxs = [...formationBox.querySelectorAll(".teams .team-bigbox")]; @@ -7306,7 +7320,7 @@ function highlightAwokenMemberForIcon(event) { function removeAllHighlightOnAwokenMenber() { const teamBigBoxs = [...formationBox.querySelectorAll(".teams .team-bigbox")]; teamBigBoxs.forEach(teamDom=>{ - const akIcons = [...teamDom.querySelectorAll(":where(.team-member-awoken,.team-assist-awoken) .awoken-icon.hightlight")]; + const akIcons = [...teamDom.querySelectorAll(":where(.team-member-awoken,.team-assist-awoken,.team-latents) .hightlight")]; akIcons.forEach(icon=>icon.classList.remove("hightlight")); }); } diff --git a/service-worker.js b/service-worker.js index d25d3b3b..071d9b84 100644 --- a/service-worker.js +++ b/service-worker.js @@ -48291,7 +48291,7 @@ const cachesMap = new Map([ ], [ "script.js", - "ce3ec6865c12a5415c589d8d1bfbfaae" + "9687910fc7def4fe936ea2afaf4c4cf4" ], [ "solo.html", @@ -48567,7 +48567,7 @@ const cachesMap = new Map([ ], [ "doc/index.html", - "6b00206673f027d8dc5e72a9165d2519" + "8fa8a304df48bb61cdbe487270ec1ecd" ], [ "doc/images/bluestacks-adb-connect.webp", @@ -48873,6 +48873,10 @@ const cachesMap = new Map([ "doc/images/tips-advanced-color.png", "db53e0cb1cdaf22a30f34adba12e4582" ], + [ + "doc/images/tips-advanced-rich-text-drag-dop.webp", + "55bebe4674f8469b676813d2136201c2" + ], [ "doc/images/tips-advanced-rich-text.webp", "cbf879bd83def89ebb62de0bb1d8d764"