From 3ec774fa4c376f8f4d9b6530febf61e9d4bfba3a Mon Sep 17 00:00:00 2001 From: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Date: Wed, 8 Jan 2025 21:11:00 +0100 Subject: [PATCH 1/9] chore: add lazy loading to avatar images for improved performance --- src/lib/components/Item.svelte | 4 ++-- src/lib/components/Wardrobe.svelte | 2 +- src/lib/components/header/Header.svelte | 2 +- src/lib/components/header/Settings.svelte | 4 ++-- src/lib/sections/stats/Minions.svelte | 2 +- src/routes/+page.svelte | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/components/Item.svelte b/src/lib/components/Item.svelte index 22a2e444..b7ebd252 100644 --- a/src/lib/components/Item.svelte +++ b/src/lib/components/Item.svelte @@ -123,7 +123,7 @@
- + {packData.name.slice(0, 2)} @@ -192,7 +192,7 @@
- + {packData.name.slice(0, 2)} diff --git a/src/lib/components/Wardrobe.svelte b/src/lib/components/Wardrobe.svelte index f14fa56d..8763acb7 100644 --- a/src/lib/components/Wardrobe.svelte +++ b/src/lib/components/Wardrobe.svelte @@ -14,7 +14,7 @@ {:else} - + {/if} {/each} diff --git a/src/lib/components/header/Header.svelte b/src/lib/components/header/Header.svelte index da46992e..16cb1835 100644 --- a/src/lib/components/header/Header.svelte +++ b/src/lib/components/header/Header.svelte @@ -24,7 +24,7 @@
- + SC SkyCrypt diff --git a/src/lib/components/header/Settings.svelte b/src/lib/components/header/Settings.svelte index 5c054660..79c02503 100644 --- a/src/lib/components/header/Settings.svelte +++ b/src/lib/components/header/Settings.svelte @@ -66,7 +66,7 @@
- + {pack.name.slice(0, 2)}
@@ -99,7 +99,7 @@
- testing + {theme.name.slice(0, 2)}
diff --git a/src/lib/sections/stats/Minions.svelte b/src/lib/sections/stats/Minions.svelte index 12c372dd..8a58ff59 100644 --- a/src/lib/sections/stats/Minions.svelte +++ b/src/lib/sections/stats/Minions.svelte @@ -27,7 +27,7 @@ - + MA
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index b9d050bc..3da7853e 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -61,7 +61,7 @@ - + PA
@@ -101,7 +101,7 @@
- + {user.name.slice(0, 2)} From 20480269861dc1edfd0647124f61f30dc59d016d Mon Sep 17 00:00:00 2001 From: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:36:38 +0100 Subject: [PATCH 2/9] refactor(item): put the item content in a snippet so it's consistent, add image-rendering:pixelated to fix blurry icons --- src/lib/components/Item.svelte | 254 +++++++++++---------------------- 1 file changed, 85 insertions(+), 169 deletions(-) diff --git a/src/lib/components/Item.svelte b/src/lib/components/Item.svelte index b7ebd252..01d5077b 100644 --- a/src/lib/components/Item.svelte +++ b/src/lib/components/Item.svelte @@ -47,12 +47,77 @@ }); -{#snippet item()} +{#snippet itemContents(isDrawer: boolean = false)} +
+ + + + + + + +

+ {@html isMulticolor ? itemNameHtml : removeFormatting(itemNameHtml)} +

+
+
+
+ {#each skyblockItem.lore as lore} + {@html renderLore(lore)} + {/each} + {#if skyblockItem.containsItems && skyblockItem.containsItems.length > 0} +
+
+ {#each skyblockItem.containsItems.slice(0, Math.min(skyblockItem.containsItems.length, 54)) as containedItem} + {#if containedItem.texture_path} +
+ +
+ {:else} +
+ {/if} + {/each} +
+
+ {/if} + + {#if packData} +
+ +
+
+ + + + {packData.name.slice(0, 2)} + + +
+ +
+ by {packData.author} +
+
+
+
+
+
+ {/if} +
+
+{/snippet} + +{#snippet itemIcon()}
- + - + {#if recombobulated} @@ -67,184 +132,25 @@ {/snippet} {#snippet tooltip()} - - showDialog.set(!$showDialog)}> - - - - - - - {#if recombobulated} -
- {/if} - {#if showNumbers} -
- {skyblockItem.Count ?? 1} -
- {/if} + + showDialog.set(!$showDialog)}> + {@render itemIcon()} - -
- - - - - - - -

- {@html isMulticolor ? itemNameHtml : removeFormatting(itemNameHtml)} -

-
-
- {#each skyblockItem.lore as lore} - {@html renderLore(lore)} - {/each} - {#if skyblockItem.containsItems && skyblockItem.containsItems.length > 0} -
-
- {#each skyblockItem.containsItems.slice(0, Math.min(skyblockItem.containsItems.length, 54)) as containedItem} - {#if containedItem.texture_path} -
- -
- {:else} -
- {/if} - {/each} -
-
- {/if} - - {#if packData} -
- -
-
- - - - {packData.name.slice(0, 2)} - - -
- -
- by {packData.author} -
-
-
-
-
-
- {/if} -
+ + {@render itemContents()}
{/snippet} -{#if isHover.current && $showDialog} - - - - -
- - - - - - - -

- {@html isMulticolor ? itemNameHtml : removeFormatting(itemNameHtml)} -

-
-
- {#each skyblockItem.lore as lore} - {@html renderLore(lore)} - {/each} - {#if skyblockItem.containsItems && skyblockItem.containsItems.length > 0} -
-
- {#each skyblockItem.containsItems.slice(0, Math.min(skyblockItem.containsItems.length, 54)) as containedItem} - {#if containedItem.texture_path} -
- -
- {:else} -
- {/if} - {/each} -
-
- {/if} - - {#if packData} -
- -
-
- - - - {packData.name.slice(0, 2)} - - -
- -
- by {packData.author} -
-
-
-
-
-
- {/if} -
-
-
-
-{/if} - {#snippet drawer()} - {@render item()} + {@render itemIcon()} -
- - - - - - - -

- {@html isMulticolor ? itemNameHtml : removeFormatting(itemNameHtml)} -

-
- -
- {#each skyblockItem.lore as lore} - {@html renderLore(lore)} - {/each} -
+ {@render itemContents(true)}
@@ -252,6 +158,16 @@ {#if isHover.current} {@render tooltip()} + {#if $showDialog} + + + + + {@render itemContents()} + + + + {/if} {:else} {@render drawer()} {/if} From 2988bac45c112a78e81baf3cf864237fe1acea97 Mon Sep 17 00:00:00 2001 From: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:36:51 +0100 Subject: [PATCH 3/9] fix(tooltip): fix tooltip styling by removing max-width constraint --- src/app.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.css b/src/app.css index 10e72c10..1fdfce87 100644 --- a/src/app.css +++ b/src/app.css @@ -212,7 +212,7 @@ } [data-tooltip-content] { - @apply max-w-[min(20rem,100vw-2.5rem)] text-pretty text-sm; + @apply text-pretty text-sm; } } From c8bf6cd0853785ee3b57ddfe955a81e24ecd328c Mon Sep 17 00:00:00 2001 From: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:37:23 +0100 Subject: [PATCH 4/9] refactor(wardrobe): replace Avatar component with a div for improved styling --- src/lib/components/Wardrobe.svelte | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/components/Wardrobe.svelte b/src/lib/components/Wardrobe.svelte index 8763acb7..5ac8e4c2 100644 --- a/src/lib/components/Wardrobe.svelte +++ b/src/lib/components/Wardrobe.svelte @@ -1,7 +1,6 @@