aboutsummaryrefslogtreecommitdiff
path: root/src/lib/sections/Collections.svelte
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-12-15 20:19:42 -0600
committerGitHub <noreply@github.com>2022-12-15 20:19:42 -0600
commited5eedab8f9fc90dadf5c442cf559572d1b35f0c (patch)
tree01a763fd11810e9970f14f7dae180e95b279de9a /src/lib/sections/Collections.svelte
parent89bf3d31e36ad3bdfd45461ee6fb69a4c791f848 (diff)
parent103689520f51991a1e9a4ca5829fe2f46d1a32c2 (diff)
downloadskyblock-stats-ed5eedab8f9fc90dadf5c442cf559572d1b35f0c.tar.gz
skyblock-stats-ed5eedab8f9fc90dadf5c442cf559572d1b35f0c.tar.bz2
skyblock-stats-ed5eedab8f9fc90dadf5c442cf559572d1b35f0c.zip
Merge pull request #6 from skyblockstats/sveltekit-v1
Sveltekit v1
Diffstat (limited to 'src/lib/sections/Collections.svelte')
-rw-r--r--src/lib/sections/Collections.svelte62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/lib/sections/Collections.svelte b/src/lib/sections/Collections.svelte
deleted file mode 100644
index 4baa660..0000000
--- a/src/lib/sections/Collections.svelte
+++ /dev/null
@@ -1,62 +0,0 @@
-<script lang="ts">
- import type { CleanMemberProfile, Collection } from '$lib/APITypes'
- import { skyblockItemToUrl } from '$lib/minecraft/inventory'
- import ListItemWithIcon from '$lib/ListItemWithIcon.svelte'
- import type { MatcherFile } from 'skyblock-assets'
- import Tooltip from '$lib/Tooltip.svelte'
- import { cleanId } from '$lib/utils'
-
- export let data: CleanMemberProfile
- export let pack: MatcherFile
-
- const categories: Record<string, Collection[]> = {}
- if (data.member.collections)
- for (const collection of data.member.collections) {
- if (!categories[collection.category]) categories[collection.category] = []
- categories[collection.category].push(collection)
- }
-</script>
-
-{#if data.member.collections}
- {#each Object.keys(categories).sort() as categoryName}
- {@const collections = categories[categoryName]}
- <h3>{cleanId(categoryName)}</h3>
- <ul>
- {#each collections as collection}
- <ListItemWithIcon
- src={skyblockItemToUrl(collection.name, pack)}
- alt={cleanId(collection.name)}
- >
- <Tooltip>
- <span slot="tooltip">
- Amount: {collection.amount.toLocaleString()}
- </span>
- {cleanId(collection.name)}
- <span class="coll-level">{collection.level}</span>
- </Tooltip>
- </ListItemWithIcon>
- {/each}
- </ul>
- {/each}
-{/if}
-
-<style>
- ul {
- margin: 0;
- display: flex;
- flex-wrap: wrap;
- width: fit-content;
- /* this ensures there's at most 2 lines */
- max-width: 30em;
- }
-
- ul > :global(li) {
- width: 12em;
- height: 1.5em;
- text-overflow: ellipsis;
- }
-
- h3 {
- margin: 0.5em 0 0.5em 0.5em;
- }
-</style>