diff options
author | mat <github@matdoes.dev> | 2022-03-04 21:48:38 +0000 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-04 21:48:38 +0000 |
commit | 962377bd7e76e3929a85f50dae821d40002aeea9 (patch) | |
tree | e7a9b2c34428fab34e2363fa7067c4fc040db6ff | |
parent | 517ca0ac61dc66a5a20cfb0468145ef33e2eefe2 (diff) | |
download | skyblock-stats-962377bd7e76e3929a85f50dae821d40002aeea9.tar.gz skyblock-stats-962377bd7e76e3929a85f50dae821d40002aeea9.tar.bz2 skyblock-stats-962377bd7e76e3929a85f50dae821d40002aeea9.zip |
bug fixes and polish
-rw-r--r-- | src/lib/layout/GlobalTooltip.svelte | 2 | ||||
-rw-r--r-- | src/lib/minecraft/Item.svelte | 2 | ||||
-rw-r--r-- | src/lib/minecraft/Username.svelte | 4 | ||||
-rw-r--r-- | src/lib/minecraft/inventory.ts | 6 | ||||
-rw-r--r-- | src/lib/profile.ts | 2 | ||||
-rw-r--r-- | src/lib/sections/Inventories.svelte | 16 | ||||
-rw-r--r-- | src/routes/index.svelte | 3 | ||||
-rw-r--r-- | svelte.config.js | 1 |
8 files changed, 21 insertions, 15 deletions
diff --git a/src/lib/layout/GlobalTooltip.svelte b/src/lib/layout/GlobalTooltip.svelte index aeb2027..72fccf7 100644 --- a/src/lib/layout/GlobalTooltip.svelte +++ b/src/lib/layout/GlobalTooltip.svelte @@ -19,7 +19,7 @@ padding: 0 0.25rem; border-radius: 3px; box-shadow: 0 0 0 3px #206, 0 0 0 6px #000; - font-family: Minecraft; + font-family: Minecraft, 'Atkinson Hyperlegible', sans-serif; white-space: nowrap; } #global-tooltip :global(p) { diff --git a/src/lib/minecraft/Item.svelte b/src/lib/minecraft/Item.svelte index 9f2dcc3..13ca8c7 100644 --- a/src/lib/minecraft/Item.svelte +++ b/src/lib/minecraft/Item.svelte @@ -84,6 +84,6 @@ position: relative; top: 1.21em; right: 0.1em; - font-family: Minecraft; + font-family: Minecraft, 'Atkinson Hyperlegible', sans-serif; } </style> diff --git a/src/lib/minecraft/Username.svelte b/src/lib/minecraft/Username.svelte index 701e50c..7f9f3bd 100644 --- a/src/lib/minecraft/Username.svelte +++ b/src/lib/minecraft/Username.svelte @@ -34,14 +34,14 @@ <style> .username { /* usernames have the minecraft font */ - font-family: Minecraft, sans-serif; + font-family: Minecraft, 'Atkinson Hyperlegible', sans-serif; /* reduce the size of the text because the font is too big */ font-size: 0.8em; overflow-wrap: anywhere; } .username-rank-prefix { - font-family: Minecraft, sans-serif; + font-family: Minecraft, 'Atkinson Hyperlegible', sans-serif; font-size: 0.8em; overflow-wrap: anywhere; } diff --git a/src/lib/minecraft/inventory.ts b/src/lib/minecraft/inventory.ts index 1990648..72d72ee 100644 --- a/src/lib/minecraft/inventory.ts +++ b/src/lib/minecraft/inventory.ts @@ -3,7 +3,7 @@ import vanilla from 'skyblock-assets/matchers/vanilla.json' import packshq from 'skyblock-assets/matchers/vanilla.json' import furfsky_reborn from 'skyblock-assets/matchers/furfsky_reborn.json' -interface Item { +export interface Item { id?: string count?: number vanillaId: string @@ -57,8 +57,8 @@ export function itemToUrl(item: Item, packName?: string): string { return textureUrl } -export function skyblockItemToUrl(skyblockItemName: string) { - const item = skyblockItemNameToItem(skyblockItemName) +export function skyblockItemToUrl(skyblockItem: string | Item) { + const item: Item = typeof skyblockItem === 'string' ? skyblockItemNameToItem(skyblockItem) : skyblockItem const itemTextureUrl = itemToUrl(item, 'packshq') return itemTextureUrl } diff --git a/src/lib/profile.ts b/src/lib/profile.ts index c2c945e..62620e4 100644 --- a/src/lib/profile.ts +++ b/src/lib/profile.ts @@ -46,7 +46,7 @@ export function generateInfobox(data: CleanMemberProfile): string[] { if (mostSignificantKillsStat) result.push( - `⚔️ ${mostSignificantKillsStat.value.toLocaleString()} ${mostSignificantKillsStat.unit || cleanId(mostSignificantKillsStat.rawName).toLowerCase()}` + `⚔ ${mostSignificantKillsStat.value.toLocaleString()} ${mostSignificantKillsStat.unit || cleanId(mostSignificantKillsStat.rawName).toLowerCase()}` ) if (mostSignificantDeathsStat) diff --git a/src/lib/sections/Inventories.svelte b/src/lib/sections/Inventories.svelte index 1f30255..8be6853 100644 --- a/src/lib/sections/Inventories.svelte +++ b/src/lib/sections/Inventories.svelte @@ -2,7 +2,7 @@ import Inventory from '$lib/minecraft/Inventory.svelte' import { fade } from 'svelte/transition' import { cleanId } from '$lib/utils' - import { skyblockItemToUrl } from '$lib/minecraft/inventory' + import { skyblockItemToUrl, type Item } from '$lib/minecraft/inventory' export let data export let pack @@ -13,11 +13,15 @@ let selectedInventoryName: string = displayingInventories[0] - const inventoryIconMap = { - inventory: 'nether_star', + const inventoryIconMap: Record<string, string | Item> = { + inventory: { + id: 'SKYBLOCK_MENU', + vanillaId: 'nether_star', + display: { name: 'SkyBlock Menu' }, + }, ender_chest: 'ender_chest', potion_bag: 'potion', - fishing_bag: 'cod', + fishing_bag: 'fishing_rod', quiver: 'arrow', wardrobe: 'leather_chestplate', } @@ -80,10 +84,10 @@ image-rendering: pixelated; } .inventory-tab-name { - vertical-align: middle; + vertical-align: text-top; } .inventory-tab:hover, .inventory-tab-active { - background-color: rgba(20, 20, 20, 0.9); + background-color: rgba(40, 40, 40, 0.9); } </style> diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 873b71d..086c7fb 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -4,6 +4,7 @@ import type { CleanUser } from '$lib/APITypes' import donators from '../_donators.json' import Head from '$lib/Head.svelte' + import Emoji from '$lib/Emoji.svelte' export const prerender = true export const hydrate = false @@ -44,7 +45,7 @@ <h2>Donators</h2> <p> Thank you to these people for - <a href="https://ko-fi.com/matdoesdev" target="_blank">donating</a>. + <a href="https://ko-fi.com/matdoesdev" target="_blank">donating</a>. <Emoji value="❤" /> </p> <ul> {#each donators as donator} diff --git a/svelte.config.js b/svelte.config.js index e20034a..9a4a558 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -14,6 +14,7 @@ function fetch(url) { }) res.on('end', () => { + console.log(data) resolve(data) }) }) |