增加一些潜觉的高亮显示
This commit is contained in:
parent
84e30553a9
commit
87e2c5bb78
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
|
@ -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.</span>
|
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.</span>
|
||||||
<br>
|
<br>
|
||||||
<img src="images/tips-advanced-rich-text.webp" alt="富文本功能">
|
<img src="images/tips-advanced-rich-text.webp" alt="富文本功能">
|
||||||
|
<br>
|
||||||
|
<span lang="zh">电脑上使用鼠标时,支持直接拖拽队伍和搜索结果里的角色头像到介绍里。</span>
|
||||||
|
<span lang="en">When using the mouse on the computer, you can directly drag character avatars from the team and search results and drop into the descriptions.</span>
|
||||||
|
<br>
|
||||||
|
<img src="images/tips-advanced-rich-text-drag-dop.webp" alt="将角色头像拖拽到介绍中">
|
||||||
</p>
|
</p>
|
||||||
<h2 id="others">
|
<h2 id="others">
|
||||||
<span lang="zh">其他</span>
|
<span lang="zh">其他</span>
|
||||||
|
|
28
script.js
28
script.js
|
@ -4141,7 +4141,7 @@ function initialize() {
|
||||||
const t = document.body.querySelector('#template-team-awoken-effect');
|
const t = document.body.querySelector('#template-team-awoken-effect');
|
||||||
const clone = document.importNode(t.content, true);
|
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=>{
|
akIcons.forEach(icon=>{
|
||||||
icon.onmouseenter = highlightAwokenMemberForIcon;
|
icon.onmouseenter = highlightAwokenMemberForIcon;
|
||||||
icon.onmouseleave = removeAllHighlightOnAwokenMenber;
|
icon.onmouseleave = removeAllHighlightOnAwokenMenber;
|
||||||
|
@ -7275,28 +7275,42 @@ function highlightAwokenMember(event, teamIndex) {
|
||||||
throw new TypeError("输入的不是 整数 或者含 data-awoken-icon 的 HTML 元素");
|
throw new TypeError("输入的不是 整数 或者含 data-awoken-icon 的 HTML 元素");
|
||||||
}
|
}
|
||||||
})(icon);
|
})(icon);
|
||||||
if (!akId) return;
|
|
||||||
const eqak = equivalent_awoken.find(obj=>akId === obj.big || akId === obj.small);
|
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")) {
|
if (icon.classList.contains("latent-icon") && icon.hasAttribute("data-latent-icon")) {
|
||||||
|
//如果选中的是潜觉,只显示让这个潜觉生效的觉醒
|
||||||
const latentId = parseInt(icon.getAttribute("data-latent-icon"), 10);
|
const latentId = parseInt(icon.getAttribute("data-latent-icon"), 10);
|
||||||
formation.teams[teamIndex][0]
|
formation.teams[teamIndex][0]
|
||||||
.forEach((member,idx)=>{
|
.forEach((member,idx)=>{
|
||||||
if (member.latent.includes(latentId)) {
|
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 {
|
} 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=>{
|
akIcons.filter(icon=>{
|
||||||
const iconId = parseInt(icon?.dataset?.awokenIcon, 10);
|
const iconId = parseInt(icon?.dataset?.awokenIcon, 10);
|
||||||
return eqak ? (iconId === eqak.big || iconId === eqak.small) : iconId === akId;
|
return eqak ? (iconId === eqak.big || iconId === eqak.small) : iconId === akId;
|
||||||
})
|
})
|
||||||
.forEach(icon=>icon.classList.add("hightlight"));
|
.forEach(icon=>icon.classList.add("hightlight"));
|
||||||
|
|
||||||
|
forceArea.forEach(icon=>icon.classList.add("hightlight"));
|
||||||
}
|
}
|
||||||
function highlightAwokenMemberForIcon(event) {
|
function highlightAwokenMemberForIcon(event) {
|
||||||
const teamBigBoxs = [...formationBox.querySelectorAll(".teams .team-bigbox")];
|
const teamBigBoxs = [...formationBox.querySelectorAll(".teams .team-bigbox")];
|
||||||
|
@ -7306,7 +7320,7 @@ function highlightAwokenMemberForIcon(event) {
|
||||||
function removeAllHighlightOnAwokenMenber() {
|
function removeAllHighlightOnAwokenMenber() {
|
||||||
const teamBigBoxs = [...formationBox.querySelectorAll(".teams .team-bigbox")];
|
const teamBigBoxs = [...formationBox.querySelectorAll(".teams .team-bigbox")];
|
||||||
teamBigBoxs.forEach(teamDom=>{
|
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"));
|
akIcons.forEach(icon=>icon.classList.remove("hightlight"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -48291,7 +48291,7 @@ const cachesMap = new Map([
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"script.js",
|
"script.js",
|
||||||
"ce3ec6865c12a5415c589d8d1bfbfaae"
|
"9687910fc7def4fe936ea2afaf4c4cf4"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"solo.html",
|
"solo.html",
|
||||||
|
@ -48567,7 +48567,7 @@ const cachesMap = new Map([
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"doc/index.html",
|
"doc/index.html",
|
||||||
"6b00206673f027d8dc5e72a9165d2519"
|
"8fa8a304df48bb61cdbe487270ec1ecd"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"doc/images/bluestacks-adb-connect.webp",
|
"doc/images/bluestacks-adb-connect.webp",
|
||||||
|
@ -48873,6 +48873,10 @@ const cachesMap = new Map([
|
||||||
"doc/images/tips-advanced-color.png",
|
"doc/images/tips-advanced-color.png",
|
||||||
"db53e0cb1cdaf22a30f34adba12e4582"
|
"db53e0cb1cdaf22a30f34adba12e4582"
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
"doc/images/tips-advanced-rich-text-drag-dop.webp",
|
||||||
|
"55bebe4674f8469b676813d2136201c2"
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"doc/images/tips-advanced-rich-text.webp",
|
"doc/images/tips-advanced-rich-text.webp",
|
||||||
"cbf879bd83def89ebb62de0bb1d8d764"
|
"cbf879bd83def89ebb62de0bb1d8d764"
|
||||||
|
|
Loading…
Reference in New Issue