From 4a71e15fd5d074543a430d9182e5435001561234 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:35:17 -0500 Subject: [PATCH] [O] Split chuni userbox display Co-Authored-By: Raymond <101374892+raymonable@users.noreply.github.com> --- .../userbox/ChuniUserboxDisplay.svelte | 70 +++++++++++++++++++ AquaNet/src/pages/UserHome.svelte | 68 ++---------------- 2 files changed, 75 insertions(+), 63 deletions(-) create mode 100644 AquaNet/src/components/settings/userbox/ChuniUserboxDisplay.svelte diff --git a/AquaNet/src/components/settings/userbox/ChuniUserboxDisplay.svelte b/AquaNet/src/components/settings/userbox/ChuniUserboxDisplay.svelte new file mode 100644 index 00000000..a55ff5fe --- /dev/null +++ b/AquaNet/src/components/settings/userbox/ChuniUserboxDisplay.svelte @@ -0,0 +1,70 @@ + + +{#if USERBOX_ACTIVE.value && USERBOX_INSTALLED && game == "chu3"} +
+ +
+ +
+
+{/if} + + diff --git a/AquaNet/src/pages/UserHome.svelte b/AquaNet/src/pages/UserHome.svelte index 632ac016..b4913269 100644 --- a/AquaNet/src/pages/UserHome.svelte +++ b/AquaNet/src/pages/UserHome.svelte @@ -23,6 +23,7 @@ import RatingComposition from "../components/RatingComposition.svelte"; import useLocalStorage from "../libs/hooks/useLocalStorage.svelte"; import Line from "../components/chart/Line.svelte"; + import ChuniUserboxDisplay from "../components/settings/userbox/ChuniUserboxDisplay.svelte"; const TREND_DAYS = 60 @@ -105,41 +106,6 @@ d!.user.rival = isAdd }).catch(e => error = e.message).finally(() => isLoading = false) } - - /* Aquabox */ - - import { userboxFileProcess, ddsDB, initializeDb } from "../libs/userbox/userbox" - import ChuniPenguinComponent from "../components/settings/userbox/ChuniPenguin.svelte" - import ChuniUserplateComponent from "../components/settings/userbox/ChuniUserplate.svelte"; - import { - type UserBox, - type UserItem, - } from "../libs/generalTypes"; - import { USERBOX } from "../libs/sdk"; - - let USERBOX_ACTIVE = useLocalStorage("userboxNewProfile", false); - let USERBOX_INSTALLED = false; - - let userbox: UserBox; - let allItems: Record> = {}; - - if (game == "chu3" && USERBOX_ACTIVE.value) { - indexedDB.databases().then(async (dbi) => { - let databaseExists = dbi.some(db => db.name == "userboxChusanDDS"); - if (databaseExists) { - await initializeDb(); - const profile = await USERBOX.getUserProfile(username).catch(_ => null) - if (!profile) return; - userbox = profile; - console.log(userbox); - - allItems = await DATA.allItems('chu3').catch(_ => { - error = t("userbox.error.nodata") - }) as typeof allItems - USERBOX_INSTALLED = databaseExists; - } - }) - }
@@ -167,17 +133,7 @@ - {#if USERBOX_ACTIVE.value && USERBOX_INSTALLED && game == "chu3"} -
- -
- -
-
- {/if} +

{titleText} {t('UserHome.Statistics')}

@@ -339,11 +295,9 @@ }% - {#if game === 'mai2' || game === 'wacca'} - 0} class="dx-change"> - {r.afterRating === r.beforeRating ? '-' : (r.afterRating - r.beforeRating).toFixed(0)} - - {/if} + 0} class="dx-change"> + {r.afterRating === r.beforeRating ? '-' : (r.afterRating - r.beforeRating).toFixed(0)} +
@@ -624,17 +578,5 @@ content: "+" color: vars.$c-good -.chuni-userbox-container - display: flex - align-items: center - justify-content: center - .chuni-penguin-container - height: 256px - aspect-ratio: 1 - position: relative - -@media (max-width: 1000px) - .chuni-userbox-container - flex-wrap: wrap