From 8173003144c26cc1234573f693726efc43899521 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Thu, 16 May 2024 11:25:22 +0800 Subject: [PATCH] [F] Fix rating composition null elements, generalize #35 --- AquaNet/src/components/MapDetails.svelte | 161 ------------------ AquaNet/src/components/RatingCompSong.svelte | 159 +++++++++++++++++ .../src/components/RatingComposition.svelte | 41 +++++ AquaNet/src/pages/UserHome.svelte | 70 +------- 4 files changed, 205 insertions(+), 226 deletions(-) delete mode 100644 AquaNet/src/components/MapDetails.svelte create mode 100644 AquaNet/src/components/RatingCompSong.svelte create mode 100644 AquaNet/src/components/RatingComposition.svelte diff --git a/AquaNet/src/components/MapDetails.svelte b/AquaNet/src/components/MapDetails.svelte deleted file mode 100644 index 3bca1452..00000000 --- a/AquaNet/src/components/MapDetails.svelte +++ /dev/null @@ -1,161 +0,0 @@ - - - - -{#if mapData[0] !== 0} -
-
-
- -
-
-
{meta?.name ?? t("UserHome.UnknownSong")}
- - { mapRank ?? '-' } - -
-
- - - {("" + getMult(mapData[gameIndex], game)[2]).replace("p", "+")} - - {roundFloor(mapData[gameIndex], game, 1)}% - - - {#if game === 'mai2'} - - { mapRank ? (mapRank * Number(mult[1])).toFixed(0) : '-' } - - {/if} -
-
-
-
-
-{/if} - - diff --git a/AquaNet/src/components/RatingCompSong.svelte b/AquaNet/src/components/RatingCompSong.svelte new file mode 100644 index 00000000..b9b0448f --- /dev/null +++ b/AquaNet/src/components/RatingCompSong.svelte @@ -0,0 +1,159 @@ + + + + +
+
+
+ +
+
+
{meta?.name ?? t("UserHome.UnknownSong")}
+ + { mapRank ?? '-' } + +
+
+ + + {("" + getMult(mapData[gameIndex], game)[2]).replace("p", "+")} + + {roundFloor(mapData[gameIndex], game, 1)}% + + + {#if game === 'mai2'} + + { mapRank ? (mapRank * Number(mult[1])).toFixed(0) : '-' } + + {/if} +
+
+
+
+
+ + diff --git a/AquaNet/src/components/RatingComposition.svelte b/AquaNet/src/components/RatingComposition.svelte new file mode 100644 index 00000000..4ed01055 --- /dev/null +++ b/AquaNet/src/components/RatingComposition.svelte @@ -0,0 +1,41 @@ + + + + +{#if comp} +
+

{title}

+
+ {#each comp.split(",").filter(it => it.split(":")[0] !== '0') as map} +
+ +
+ {/each} +
+
+{/if} + + diff --git a/AquaNet/src/pages/UserHome.svelte b/AquaNet/src/pages/UserHome.svelte index b94fe552..6bc62509 100644 --- a/AquaNet/src/pages/UserHome.svelte +++ b/AquaNet/src/pages/UserHome.svelte @@ -21,7 +21,7 @@ import Icon from "@iconify/svelte"; import { GAME_TITLE, t } from "../libs/i18n"; import RankDetails from "../components/RankDetails.svelte"; - import MapDetails from "../components/MapDetails.svelte"; + import RatingComposition from "../components/RatingComposition.svelte"; const TREND_DAYS = 60 @@ -231,57 +231,10 @@ - {#if d.user.ratingComposition.best30} -
-

B30

-
- {#each d.user.ratingComposition.best30.split(",") as map} -
- -
- {/each} -
-
- {/if} - - {#if d.user.ratingComposition.best35} -
-

B35

-
- {#each d.user.ratingComposition.best35.split(",") as map} -
- -
- {/each} -
-
- {/if} - - {#if d.user.ratingComposition.best15} -
-

B15

-
- {#each d.user.ratingComposition.best15.split(",") as map} -
- -
- {/each} -
-
- {/if} - - {#if d.user.ratingComposition.recent10} -
-

R10

-
- {#each d.user.ratingComposition.recent10.split(",") as map} -
- -
- {/each} -
-
- {/if} + + + +

{t('UserHome.RecentScores')}

@@ -569,17 +522,4 @@ &:before content: "+" color: $c-good - -.rating-composition - display: grid - // 3 columns - grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) - gap: $gap - -.rating-composition-2 - display: grid - // 2 columns - grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) - gap: $gap -