diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..13566b81b --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/SkyCrypt.iml b/.idea/SkyCrypt.iml new file mode 100644 index 000000000..24643cc37 --- /dev/null +++ b/.idea/SkyCrypt.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..87e8badc2 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..79ee123c2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..03d9549ea --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..095647a26 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 000000000..b0c1c68fb --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/app.css b/src/app.css index a521c9362..b07b2c1dc 100644 --- a/src/app.css +++ b/src/app.css @@ -366,3 +366,8 @@ @apply relative animate-chroma bg-size-[8.875rem_8.875rem] bg-clip-text bg-origin-padding text-transparent!; background-image: repeating-linear-gradient(-45deg, oklch(62.8% 0.258 29.2), oklch(77.2% 0.174 64.6), oklch(93.1% 0.229 123), oklch(87% 0.29 142), oklch(87.2% 0.255 148), oklch(90.5% 0.155 195), oklch(56.3% 0.241 261), oklch(46.6% 0.304 271), oklch(62.7% 0.307 316), oklch(65.3% 0.268 355), oklch(62.8% 0.258 29.2) 100px); } + +.pixelated { + image-rendering: crisp-edges; + image-rendering: -webkit-optimize-contrast; +} diff --git a/src/lib/components/Chip.svelte b/src/lib/components/Chip.svelte index 5fd079e81..e941d9917 100644 --- a/src/lib/components/Chip.svelte +++ b/src/lib/components/Chip.svelte @@ -58,7 +58,7 @@
{#if hasBeenInViewport} - + diff --git a/src/lib/components/ContainedItem.svelte b/src/lib/components/ContainedItem.svelte index e1b74a335..516c122eb 100644 --- a/src/lib/components/ContainedItem.svelte +++ b/src/lib/components/ContainedItem.svelte @@ -11,7 +11,7 @@
- + diff --git a/src/lib/components/EmptyEquipment.svelte b/src/lib/components/EmptyEquipment.svelte index 6a5b89acc..f50fd851e 100644 --- a/src/lib/components/EmptyEquipment.svelte +++ b/src/lib/components/EmptyEquipment.svelte @@ -18,7 +18,7 @@ {#if selectedPiece}
-
+
{:else}
diff --git a/src/lib/components/Item.svelte b/src/lib/components/Item.svelte index 4a3bc3061..c105e7f71 100644 --- a/src/lib/components/Item.svelte +++ b/src/lib/components/Item.svelte @@ -57,7 +57,7 @@
{#if hasBeenInViewport} - + {#if loadingStatus === "loading"} {@render loadingState()} {:else} diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 321ec7af5..c54f8e559 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -10,7 +10,7 @@ import ChevronLeft from "@lucide/svelte/icons/chevron-left"; import ChevronRight from "@lucide/svelte/icons/chevron-right"; import { Button, ScrollArea } from "bits-ui"; - import { onDestroy, tick, type Snippet } from "svelte"; + import { tick, type Snippet } from "svelte"; const { children }: { children?: Snippet } = $props(); const profile = $derived(getProfileContext().current); @@ -41,7 +41,6 @@ let pinned = $state(false); let navbarElement = $state(null); - let observer: IntersectionObserver; function handleSectionClick(sectionName: SectionName) { tabValue.set(sectionName); @@ -73,46 +72,6 @@ link.scrollIntoView(scrollOptions); } - function observerInit() { - if (!navbarElement) { - console.warn("Navbar element is not defined"); - return; - } - - const topValue = parseInt(window.getComputedStyle(navbarElement).getPropertyValue("top")); - - observer = new IntersectionObserver( - ([e]) => { - // Check if the element has reached its sticky position by comparing - // its actual top position to the CSS top value - const hasReachedStickyPosition = e.boundingClientRect.top <= topValue; - pinned = hasReachedStickyPosition && e.intersectionRatio < 1; - }, - { - threshold: [1], - rootMargin: `-${topValue + 1}px 0px` // shrink the viewport to element top value +1px to trigger observer when element has reach it's sticky position - } - ); - - observer.observe(navbarElement); - } - - function observerCleanup() { - if (observer) observer.disconnect(); - } - - $effect(() => { - if (!navbarElement) return; - observerInit(); - return () => { - observerCleanup(); - }; - }); - - onDestroy(() => { - observerCleanup(); - }); - // Effect to handle tab value changes and update URL $effect(() => { if (navbarElement && $tabValue) { @@ -125,7 +84,7 @@ }); - + {#snippet viewportChildren()}
diff --git a/src/lib/components/Skillbar.svelte b/src/lib/components/Skillbar.svelte index 4688a70cf..ffd7681f7 100644 --- a/src/lib/components/Skillbar.svelte +++ b/src/lib/components/Skillbar.svelte @@ -24,7 +24,7 @@
- + diff --git a/src/lib/components/header/settings/Packs.svelte b/src/lib/components/header/settings/Packs.svelte index c178636b9..d5b186297 100644 --- a/src/lib/components/header/settings/Packs.svelte +++ b/src/lib/components/header/settings/Packs.svelte @@ -31,7 +31,7 @@
- + {pack.name?.slice(0, 2)}
diff --git a/src/lib/components/item/item-content.svelte b/src/lib/components/item/item-content.svelte index fb11d7f0a..d4af6da7a 100644 --- a/src/lib/components/item/item-content.svelte +++ b/src/lib/components/item/item-content.svelte @@ -58,7 +58,7 @@
- + @@ -98,7 +98,7 @@
- + {piece.sourceTab.name?.slice(0, 2)} @@ -124,7 +124,7 @@
- + {packData.name?.slice(0, 2)} diff --git a/src/lib/layouts/stats/Main.svelte b/src/lib/layouts/stats/Main.svelte index 8da622733..45fbfe426 100644 --- a/src/lib/layouts/stats/Main.svelte +++ b/src/lib/layouts/stats/Main.svelte @@ -45,8 +45,14 @@ // Initialize the profile context const profileClass = new ProfileContext(); + profileClass.current = profile; setProfileContext(profileClass); + // Update the profile context when the data changes + $effect.pre(() => { + profileClass.current = profile; + }); + function rewriteURL() { if (!(ctx as ModelsStatsOutput)) return; @@ -97,11 +103,6 @@ return searches; }); - // Update the profile context when the data changes - $effect.pre(() => { - profileClass.current = profile; - }); - $effect(() => { rewriteURL(); }); @@ -216,16 +217,11 @@ {/if}
+ +
{#if getProfileContext().current} -
- - - - -
- diff --git a/src/lib/layouts/stats/PlayerProfile.svelte b/src/lib/layouts/stats/PlayerProfile.svelte index 7fa9723d0..e538b2cd6 100644 --- a/src/lib/layouts/stats/PlayerProfile.svelte +++ b/src/lib/layouts/stats/PlayerProfile.svelte @@ -93,9 +93,9 @@
- + - Steve + Steve diff --git a/src/lib/sections/Sections.svelte b/src/lib/sections/Sections.svelte index cb9ff7a2f..5fcc8a1f2 100644 --- a/src/lib/sections/Sections.svelte +++ b/src/lib/sections/Sections.svelte @@ -9,6 +9,7 @@ import { Tabs } from "bits-ui"; const COMPONENTS = { + Overview: () => import("$lib/sections/stats/Overview.svelte"), Gear: () => import("$lib/sections/stats/Gear.svelte"), Accessories: () => import("$lib/sections/stats/Accessories.svelte"), Pets: () => import("$lib/sections/stats/Pets.svelte"), diff --git a/src/lib/sections/constants.ts b/src/lib/sections/constants.ts index db0b0b436..fdc5c7a6d 100644 --- a/src/lib/sections/constants.ts +++ b/src/lib/sections/constants.ts @@ -1,17 +1,18 @@ import type { SectionID } from "$lib/sections/types"; export const sections: SectionID[] = [ - { id: 0, name: "Gear" }, - { id: 1, name: "Accessories" }, - { id: 2, name: "Pets" }, - { id: 3, name: "Inventory" }, - { id: 4, name: "Skills" }, - { id: 5, name: "Dungeons" }, - { id: 6, name: "Slayer" }, - { id: 7, name: "Minions" }, - { id: 8, name: "Bestiary" }, - { id: 9, name: "Collections" }, - { id: 10, name: "Crimson_Isle" }, - { id: 11, name: "Rift" }, - { id: 12, name: "Misc" } + { id: 0, name: "Overview" }, + { id: 1, name: "Gear" }, + { id: 2, name: "Accessories" }, + { id: 3, name: "Pets" }, + { id: 4, name: "Inventory" }, + { id: 5, name: "Skills" }, + { id: 6, name: "Dungeons" }, + { id: 7, name: "Slayer" }, + { id: 8, name: "Minions" }, + { id: 9, name: "Bestiary" }, + { id: 10, name: "Collections" }, + { id: 11, name: "Crimson_Isle" }, + { id: 12, name: "Rift" }, + { id: 13, name: "Misc" } ]; diff --git a/src/lib/sections/stats/Dungeons.svelte b/src/lib/sections/stats/Dungeons.svelte index fa781277d..a1a89a55f 100644 --- a/src/lib/sections/stats/Dungeons.svelte +++ b/src/lib/sections/stats/Dungeons.svelte @@ -128,7 +128,7 @@
- + diff --git a/src/lib/sections/stats/Overview.svelte b/src/lib/sections/stats/Overview.svelte new file mode 100644 index 000000000..2c12a9db9 --- /dev/null +++ b/src/lib/sections/stats/Overview.svelte @@ -0,0 +1,16 @@ + + +
+
+ + + +
+
\ No newline at end of file diff --git a/src/lib/sections/stats/Slayer.svelte b/src/lib/sections/stats/Slayer.svelte index f0d1fc0ae..c0eef19e0 100644 --- a/src/lib/sections/stats/Slayer.svelte +++ b/src/lib/sections/stats/Slayer.svelte @@ -36,7 +36,7 @@
- + diff --git a/src/lib/sections/stats/farming/garden.svelte b/src/lib/sections/stats/farming/garden.svelte index 615e2ffc8..346d150d0 100644 --- a/src/lib/sections/stats/farming/garden.svelte +++ b/src/lib/sections/stats/farming/garden.svelte @@ -140,7 +140,7 @@ content.set(tooltipContent)}> - + diff --git a/src/lib/sections/types.ts b/src/lib/sections/types.ts index a6bd43277..3b4b7be89 100644 --- a/src/lib/sections/types.ts +++ b/src/lib/sections/types.ts @@ -1,6 +1,6 @@ import type { Component } from "svelte"; -export type SectionName = "Gear" | "Accessories" | "Pets" | "Inventory" | "Skills" | "Dungeons" | "Slayer" | "Minions" | "Bestiary" | "Collections" | "Crimson_Isle" | "Rift" | "Misc"; +export type SectionName = "Overview" | "Gear" | "Accessories" | "Pets" | "Inventory" | "Skills" | "Dungeons" | "Slayer" | "Minions" | "Bestiary" | "Collections" | "Crimson_Isle" | "Rift" | "Misc"; export type SectionComponents = Record | null>; export type SectionComponentsEager = Record; diff --git a/src/lib/stores/preferences.ts b/src/lib/stores/preferences.ts index 5ccf6fd39..5c96a9a0e 100644 --- a/src/lib/stores/preferences.ts +++ b/src/lib/stores/preferences.ts @@ -4,9 +4,9 @@ import type { SectionID } from "$lib/sections/types"; import { persisted } from "svelte-persisted-store"; export const sectionOrderPreferences = persisted("sectionOrderPreferences", sections); -export const performanceMode = persisted("performanceMode", false); +export const performanceMode = persisted("performanceMode", true); export const keybind = persisted("keybind", "/"); -export const showGlint = persisted("showGlint", true); +export const showGlint = persisted("showGlint", false); export const rainbowEnchantments = persisted("rainbowEnchantments", false); // Check for invalid section order and reset if found diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 11649ca03..45f8aaedf 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -206,9 +206,11 @@ {/if} -
+ -
+ {@render children()} @@ -315,7 +317,7 @@ {#if !ign || recentSearch.ign !== ign} - + {recentSearch.ign.slice(0, 2)} @@ -336,7 +338,7 @@ {#if !ign || favorite.ign !== ign} - + {favorite.ign.slice(0, 2)} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index cfaf7a1e8..22c9bf231 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -159,7 +159,7 @@
- + {user.username?.slice(0, 2)}