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..8e53a3c55 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); } + +body { + -webkit-user-select: none; + user-select: none; +} diff --git a/src/app.html b/src/app.html index 331f22b85..7b131c709 100644 --- a/src/app.html +++ b/src/app.html @@ -1,5 +1,5 @@ - + diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 321ec7af5..d4f363fd3 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); @@ -39,9 +39,8 @@ }) ); - let pinned = $state(false); + let pinned = $state(true); 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,41 +84,47 @@ }); - - {#snippet viewportChildren()} -
-
-
- {#each filteredSectionOrderPreferences as section, index (index)} - handleSectionClick(section.name)}> - {section.name?.replaceAll("_", " ")} +
+ + {#snippet viewportChildren()} +
+
+
+ {#each filteredSectionOrderPreferences as section, index (index)} + handleSectionClick(section.name)}> + {section.name?.replaceAll("_", " ")} + + {/each} +
+ {/snippet} + + + + +
+ +
+
+
+ {@render children?.()} +
+
+ +
+ {#if previousSection} + handleSectionClick(previousSection.name ?? filteredSectionOrderPreferences[0].name)}> + + {previousSection.name.replaceAll("_", " ")} + + {:else} +
+ {/if} + {#if nextSection} + handleSectionClick(nextSection.name ?? filteredSectionOrderPreferences[filteredSectionOrderPreferences.length - 1].name)}> + {nextSection.name.replaceAll("_", " ")} + - {/each} + {/if}
- {/snippet} - - - - - - -
- {@render children?.()} - -
- {#if previousSection} - handleSectionClick(previousSection.name ?? filteredSectionOrderPreferences[0].name)}> - - {previousSection.name.replaceAll("_", " ")} - - {:else} -
- {/if} - {#if nextSection} - handleSectionClick(nextSection.name ?? filteredSectionOrderPreferences[filteredSectionOrderPreferences.length - 1].name)}> - {nextSection.name.replaceAll("_", " ")} - - - {/if}
diff --git a/src/lib/components/header/settings/Order.svelte b/src/lib/components/header/settings/Order.svelte index 235e156d5..2f354d20f 100644 --- a/src/lib/components/header/settings/Order.svelte +++ b/src/lib/components/header/settings/Order.svelte @@ -2,8 +2,8 @@ function changeTheme(themeId: Theme["id"]) { const theme = themes.find((theme) => theme.id === themeId); if (!theme) { - themeStore.set("default"); - document.documentElement.dataset.theme = "default"; + themeStore.set("lunar"); + document.documentElement.dataset.theme = "lunar"; return; } if (theme.light) { diff --git a/src/lib/components/header/settings/Themes.svelte b/src/lib/components/header/settings/Themes.svelte index dfccc5e95..f9cb505a8 100644 --- a/src/lib/components/header/settings/Themes.svelte +++ b/src/lib/components/header/settings/Themes.svelte @@ -2,8 +2,8 @@ function changeTheme(themeId: Theme["id"]) { const theme = themes.find((theme) => theme.id === themeId); if (!theme) { - themeStore.set("default"); - document.documentElement.dataset.theme = "default"; + themeStore.set("lunar"); + document.documentElement.dataset.theme = "lunar"; return; } if (theme.light) { diff --git a/src/lib/hooks/is-hover.svelte.ts b/src/lib/hooks/is-hover.svelte.ts index 120ff5df3..936096b6c 100644 --- a/src/lib/hooks/is-hover.svelte.ts +++ b/src/lib/hooks/is-hover.svelte.ts @@ -1,9 +1,11 @@ -import { MediaQuery } from "svelte/reactivity"; +export class IsHover { + #current = $state(true); -const MEDIA_QUERY = "(hover: hover) and (pointer: fine)"; + constructor() {} -export class IsHover extends MediaQuery { - constructor() { - super(MEDIA_QUERY); + get current() { + return this.#current; } + + destroy() {} } diff --git a/src/lib/layouts/stats/Main.svelte b/src/lib/layouts/stats/Main.svelte index 8da622733..876af427c 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(); }); @@ -199,7 +200,7 @@ --> -
-
+ {#snippet profileIcon(gameMode: string)} {#if gameMode === "bingo"} 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/Overview.svelte b/src/lib/sections/stats/Overview.svelte new file mode 100644 index 000000000..c0ec517fc --- /dev/null +++ b/src/lib/sections/stats/Overview.svelte @@ -0,0 +1,18 @@ + + +
+
+ + + + +
+
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/shared/constants/themes/lunar.json b/src/lib/shared/constants/themes/lunar.json index e8b7f6492..7c5be9684 100644 --- a/src/lib/shared/constants/themes/lunar.json +++ b/src/lib/shared/constants/themes/lunar.json @@ -9,7 +9,7 @@ "backgrounds": { "skillbar": { "type": "color", - "color": "oklch(63.98% 0.1731 150.18)" + "color": "oklch(63.98% 0.028 260)" }, "maxedbar": { "type": "color", @@ -18,10 +18,10 @@ }, "colors": { "logo": "oklch(68.48% 0.2338 351.45)", - "link": "oklch(81.56% 0.2459 146.24)", - "icon": "oklch(73.62% 0.2129 147.69)", - "hover": "oklch(83.81% 0.2303 149.89)", + "link": "oklch(81.56% 0.04 260)", + "icon": "oklch(73.62% 0.03 260)", + "hover": "oklch(83.81% 0.025 260)", "maxed": "oklch(72.84% 0.1506 75.86)", "gold": "oklch(82.84% 0.1548 78.27)" } -} \ No newline at end of file +} 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/lib/stores/themes.ts b/src/lib/stores/themes.ts index 4b30dd8c0..b359d2a1a 100644 --- a/src/lib/stores/themes.ts +++ b/src/lib/stores/themes.ts @@ -2,4 +2,4 @@ import { persisted } from "svelte-persisted-store"; // First param `packs` is the local storage key. // Second param is the initial value. -export const theme = persisted("theme", "default"); +export const theme = persisted("theme", "lunar"); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 11649ca03..608294776 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -30,7 +30,7 @@ import WifiOff from "@lucide/svelte/icons/wifi-off"; import { isHttpError, type RemoteQuery } from "@sveltejs/kit"; import { Avatar, Button, Command, computeCommandScore, Dialog, Tooltip } from "bits-ui"; - import { onMount, type Snippet } from "svelte"; + import { onDestroy, onMount, type Snippet } from "svelte"; import SvelteSeo from "svelte-seo"; import { toast, Toaster, type ToasterProps } from "svelte-sonner"; import { cubicOut } from "svelte/easing"; @@ -122,6 +122,10 @@ } }); + onDestroy(() => { + isHover.destroy(); + }); + beforeNavigate(({ type }) => { if (type === "leave" || type === "link") return; loading = true; @@ -206,9 +210,11 @@ {/if} -
+ -
+ {@render children()} diff --git a/static/img/textures/item/leather_boots.png b/static/img/textures/item/leather_boots.png index 61d71988e..89e8c3a35 100644 Binary files a/static/img/textures/item/leather_boots.png and b/static/img/textures/item/leather_boots.png differ diff --git a/static/img/textures/item/leather_boots_overlay.png b/static/img/textures/item/leather_boots_overlay.png index b6896d872..c983706ba 100644 Binary files a/static/img/textures/item/leather_boots_overlay.png and b/static/img/textures/item/leather_boots_overlay.png differ diff --git a/static/img/textures/item/leather_chestplate.png b/static/img/textures/item/leather_chestplate.png index e534aefc7..b91e03d59 100644 Binary files a/static/img/textures/item/leather_chestplate.png and b/static/img/textures/item/leather_chestplate.png differ diff --git a/static/img/textures/item/leather_chestplate_overlay.png b/static/img/textures/item/leather_chestplate_overlay.png index 125fd3487..751cab573 100644 Binary files a/static/img/textures/item/leather_chestplate_overlay.png and b/static/img/textures/item/leather_chestplate_overlay.png differ diff --git a/static/img/textures/item/leather_helmet.png b/static/img/textures/item/leather_helmet.png index 6f6476387..f13bedb0c 100644 Binary files a/static/img/textures/item/leather_helmet.png and b/static/img/textures/item/leather_helmet.png differ diff --git a/static/img/textures/item/leather_helmet_overlay.png b/static/img/textures/item/leather_helmet_overlay.png index 8040d77f2..a6ef836a1 100644 Binary files a/static/img/textures/item/leather_helmet_overlay.png and b/static/img/textures/item/leather_helmet_overlay.png differ diff --git a/static/img/textures/item/leather_leggings.png b/static/img/textures/item/leather_leggings.png index c2d3f0326..73d7be6ad 100644 Binary files a/static/img/textures/item/leather_leggings.png and b/static/img/textures/item/leather_leggings.png differ diff --git a/static/img/textures/item/leather_leggings_overlay.png b/static/img/textures/item/leather_leggings_overlay.png index 813ba262d..8ad34eb5e 100644 Binary files a/static/img/textures/item/leather_leggings_overlay.png and b/static/img/textures/item/leather_leggings_overlay.png differ diff --git a/static/img/textures/item/potion.png b/static/img/textures/item/potion.png index b86b4b7f2..0c2e3c45e 100644 Binary files a/static/img/textures/item/potion.png and b/static/img/textures/item/potion.png differ diff --git a/static/img/textures/item/potion_overlay.png b/static/img/textures/item/potion_overlay.png index 852260d71..aaca8c2bb 100644 Binary files a/static/img/textures/item/potion_overlay.png and b/static/img/textures/item/potion_overlay.png differ diff --git a/static/img/textures/item/splash_potion.png b/static/img/textures/item/splash_potion.png index 0d3fa39de..63b7bb4d7 100644 Binary files a/static/img/textures/item/splash_potion.png and b/static/img/textures/item/splash_potion.png differ