diff options
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/components/pages/maplist.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/frontend/src/components/pages/maplist.js b/frontend/src/components/pages/maplist.js index dca76d6..f4041a2 100644 --- a/frontend/src/components/pages/maplist.js +++ b/frontend/src/components/pages/maplist.js | |||
| @@ -98,6 +98,9 @@ export default function Maplist(prop) { | |||
| 98 | const data = await response.json(); | 98 | const data = await response.json(); |
| 99 | let categoriesArr = data.data[gameID - 1].category_portals; | 99 | let categoriesArr = data.data[gameID - 1].category_portals; |
| 100 | 100 | ||
| 101 | if (document.querySelector(".maplist-maps") == null) { | ||
| 102 | return; | ||
| 103 | } | ||
| 101 | const gameNav = document.querySelector(".game-nav"); | 104 | const gameNav = document.querySelector(".game-nav"); |
| 102 | gameNav.innerHTML = ""; | 105 | gameNav.innerHTML = ""; |
| 103 | categoriesArr.forEach((category) => { | 106 | categoriesArr.forEach((category) => { |
| @@ -147,7 +150,6 @@ export default function Maplist(prop) { | |||
| 147 | } | 150 | } |
| 148 | 151 | ||
| 149 | async function changePage(page) { | 152 | async function changePage(page) { |
| 150 | |||
| 151 | const pageNumbers = document.querySelector("#pageNumbers"); | 153 | const pageNumbers = document.querySelector("#pageNumbers"); |
| 152 | 154 | ||
| 153 | pageNumbers.innerText = `${currentPage - minPage + 1}/${maxPage - minPage + 1}`; | 155 | pageNumbers.innerText = `${currentPage - minPage + 1}/${maxPage - minPage + 1}`; |
| @@ -174,6 +176,9 @@ export default function Maplist(prop) { | |||
| 174 | const chapterNumber = chapterNumber1.toString().padStart(2, "0"); | 176 | const chapterNumber = chapterNumber1.toString().padStart(2, "0"); |
| 175 | const chapterTitle = name.split(" - ")[1]; | 177 | const chapterTitle = name.split(" - ")[1]; |
| 176 | 178 | ||
| 179 | if (document.querySelector(".maplist-maps") == null) { | ||
| 180 | return; | ||
| 181 | } | ||
| 177 | const chapterNumberElement = document.querySelector(".chapter-num") | 182 | const chapterNumberElement = document.querySelector(".chapter-num") |
| 178 | const chapterTitleElement = document.querySelector(".chapter-name") | 183 | const chapterTitleElement = document.querySelector(".chapter-name") |
| 179 | chapterNumberElement.innerText = chapterName + " " + chapterNumber; | 184 | chapterNumberElement.innerText = chapterName + " " + chapterNumber; |
| @@ -623,7 +628,7 @@ export default function Maplist(prop) { | |||
| 623 | } | 628 | } |
| 624 | dataPoint.style.animationDelay = delay + "s" | 629 | dataPoint.style.animationDelay = delay + "s" |
| 625 | 630 | ||
| 626 | let isHoveringOverData = false; | 631 | let isHoveringOverData = true; |
| 627 | let isDataActive = false; | 632 | let isDataActive = false; |
| 628 | document.querySelector("#dataPointInfo").style.left = item.x + "px"; | 633 | document.querySelector("#dataPointInfo").style.left = item.x + "px"; |
| 629 | document.querySelector("#dataPointInfo").style.bottom = (point_height * item.record -3) + "px"; | 634 | document.querySelector("#dataPointInfo").style.bottom = (point_height * item.record -3) + "px"; |
| @@ -671,6 +676,8 @@ export default function Maplist(prop) { | |||
| 671 | }) | 676 | }) |
| 672 | document.querySelector(".chart").addEventListener("mouseleave", () => { | 677 | document.querySelector(".chart").addEventListener("mouseleave", () => { |
| 673 | isDataActive = false | 678 | isDataActive = false |
| 679 | // fuck you | ||
| 680 | isHoveringOverData = true; | ||
| 674 | dataPoint.classList.remove("data-point-active") | 681 | dataPoint.classList.remove("data-point-active") |
| 675 | document.querySelector("#dataPointInfo").style.opacity = "0"; | 682 | document.querySelector("#dataPointInfo").style.opacity = "0"; |
| 676 | document.querySelector("#dataPointInfo").style.zIndex = "0"; | 683 | document.querySelector("#dataPointInfo").style.zIndex = "0"; |