diff options
| author | Wolfboy248 <121288977+Wolfboy248@users.noreply.github.com> | 2024-07-11 19:22:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-11 20:22:00 +0300 |
| commit | 4bdb77287866c47f5b61d6472b3ff9cc4020f35e (patch) | |
| tree | a8aac6098d991e5ae607dd7264f7bf2631d84e99 /frontend/src/components/pages | |
| parent | docs: add wolfboy248 onto project team (#179) (diff) | |
| download | lphub-4bdb77287866c47f5b61d6472b3ff9cc4020f35e.tar.gz lphub-4bdb77287866c47f5b61d6472b3ff9cc4020f35e.tar.bz2 lphub-4bdb77287866c47f5b61d6472b3ff9cc4020f35e.zip | |
fix: about page crash, update packages (#181)
Diffstat (limited to 'frontend/src/components/pages')
| -rw-r--r-- | frontend/src/components/pages/games.js | 4 | ||||
| -rw-r--r-- | frontend/src/components/pages/maplist.js | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/frontend/src/components/pages/games.js b/frontend/src/components/pages/games.js index 8c27151..75b5e44 100644 --- a/frontend/src/components/pages/games.js +++ b/frontend/src/components/pages/games.js | |||
| @@ -10,6 +10,10 @@ export default function Games(prop) { | |||
| 10 | const location = useLocation(); | 10 | const location = useLocation(); |
| 11 | 11 | ||
| 12 | useEffect(() => { | 12 | useEffect(() => { |
| 13 | document.querySelectorAll(".games-page-item-body").forEach((game, index) => { | ||
| 14 | game.innerHTML = ""; | ||
| 15 | }) | ||
| 16 | |||
| 13 | const fetchGames = async () => { | 17 | const fetchGames = async () => { |
| 14 | try { | 18 | try { |
| 15 | const response = await fetch("https://lp.ardapektezol.com/api/v1/games", { | 19 | const response = await fetch("https://lp.ardapektezol.com/api/v1/games", { |
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"; |