From 2f6052f4c74aeb0826960450381f2ebc8e94b698 Mon Sep 17 00:00:00 2001 From: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Date: Thu, 16 Apr 2026 03:18:39 +0200 Subject: [PATCH 1/5] feat(pets): add pets to the stats page --- src/components/items/profile-pets.svelte | 221 ++++++++++++++++++ .../(main)/@[id=id]/[[profile]]/+page.svelte | 2 + 2 files changed, 223 insertions(+) create mode 100644 src/components/items/profile-pets.svelte diff --git a/src/components/items/profile-pets.svelte b/src/components/items/profile-pets.svelte new file mode 100644 index 00000000..cfeb170b --- /dev/null +++ b/src/components/items/profile-pets.svelte @@ -0,0 +1,221 @@ + + +
+
+
+

Pets

+ + {#if groupedPets.length === 0} +
+

No pets found

+

+ This profile does not currently expose any pets in the API response. +

+
+ {:else} + +
+ {#each groupedPets as [rarity, pets] (rarity)} +
+

+ {rarity} +

+
+ {#each pets as pet (pet.key)} + + {#snippet child({ props })} + + + + + {pet.name} + {#if pet.active} + Active + {/if} + + + Level {pet.level} + {#if pet.heldItem} + • {getHeldItemName(pet.heldItem)} + {/if} + + + + {/snippet} + +
+
+ +
+
+

{pet.name}

+ {#if pet.active} + Active Pet + {/if} +
+

+ {pet.tier} • Level {pet.level} +

+
+
+
+

+ Held Item: {getHeldItemName(pet.heldItem)} +

+ {#if pet.candyUsed > 0} +

+ Candy Used: {pet.candyUsed} +

+ {/if} +

+ Experience: {pet.exp.toLocaleString(undefined, { + maximumFractionDigits: 0, + })} +

+ {#if pet.skin} +

+ Skin: {pet.skin} +

+ {/if} +
+
+
+ {/each} +
+
+ {/each} +
+
+ {/if} +
+
+
diff --git a/src/routes/(main)/@[id=id]/[[profile]]/+page.svelte b/src/routes/(main)/@[id=id]/[[profile]]/+page.svelte index 01e6f8bb..0c5f7e7e 100644 --- a/src/routes/(main)/@[id=id]/[[profile]]/+page.svelte +++ b/src/routes/(main)/@[id=id]/[[profile]]/+page.svelte @@ -3,6 +3,7 @@ import ProfileEventMember from '$comp/events/profile-event-member.svelte'; import Head from '$comp/head.svelte'; import InventorySelect from '$comp/items/inventories/inventory-select.svelte'; + import ProfilePets from '$comp/items/profile-pets.svelte'; import SackContents from '$comp/items/sack-contents.svelte'; import Farmingtools from '$comp/items/tools/farmingtools.svelte'; import Breakdown from '$comp/stats/breakdown.svelte'; @@ -119,6 +120,7 @@ + From c82bcbdcd9f18084371c654a4db4fe96c45a1229 Mon Sep 17 00:00:00 2001 From: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Date: Thu, 16 Apr 2026 03:38:21 +0200 Subject: [PATCH 2/5] refactor(pets): extract pet card component --- src/components/items/profile-pet-card.svelte | 77 +++++++++++ src/components/items/profile-pets.svelte | 132 +++---------------- 2 files changed, 97 insertions(+), 112 deletions(-) create mode 100644 src/components/items/profile-pet-card.svelte diff --git a/src/components/items/profile-pet-card.svelte b/src/components/items/profile-pet-card.svelte new file mode 100644 index 00000000..67eae7ef --- /dev/null +++ b/src/components/items/profile-pet-card.svelte @@ -0,0 +1,77 @@ + + + + {#snippet child({ props })} + + + + + {petName} + {#if pet.active} + Active + {/if} + + + Level {pet.level} + {#if pet.heldItem} + • {heldItemName} + {/if} + + + + {/snippet} + +
+
+ +
+
+

{petName}

+ {#if pet.active} + Active Pet + {/if} +
+

{tier} • Level {pet.level}

+
+
+
+

Held Item: {heldItemName}

+ {#if (pet.candyUsed ?? 0) > 0} +

Candy Used: {pet.candyUsed}

+ {/if} +

+ Experience: + + {(pet.exp ?? 0).toLocaleString(undefined, { maximumFractionDigits: 0 })} + +

+ {#if pet.skin} +

Skin: {pet.skin}

+ {/if} +
+
+
diff --git a/src/components/items/profile-pets.svelte b/src/components/items/profile-pets.svelte index cfeb170b..8c0a2f55 100644 --- a/src/components/items/profile-pets.svelte +++ b/src/components/items/profile-pets.svelte @@ -1,42 +1,21 @@