diff options
author | mat <github@matdoes.dev> | 2022-02-20 02:16:09 -0600 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-02-20 02:16:09 -0600 |
commit | 582409e7cb1598b65bee6d1023b77620bb3791af (patch) | |
tree | 522b3cb23451c01d097386014e9b2632aab5bfbe /src/routes | |
parent | 2c09443ba23b8bfbac2eb667a036e7a7fa97b3fe (diff) | |
download | skyblock-stats-582409e7cb1598b65bee6d1023b77620bb3791af.tar.gz skyblock-stats-582409e7cb1598b65bee6d1023b77620bb3791af.tar.bz2 skyblock-stats-582409e7cb1598b65bee6d1023b77620bb3791af.zip |
add inventories
Diffstat (limited to 'src/routes')
-rw-r--r-- | src/routes/about.svelte | 50 | ||||
-rw-r--r-- | src/routes/index.svelte | 52 | ||||
-rw-r--r-- | src/routes/player/[player]/[profile].svelte | 22 |
3 files changed, 12 insertions, 112 deletions
diff --git a/src/routes/about.svelte b/src/routes/about.svelte deleted file mode 100644 index 569d3e1..0000000 --- a/src/routes/about.svelte +++ /dev/null @@ -1,50 +0,0 @@ -<script context="module"> - import { browser, dev } from '$app/env'; - - // we don't need any JS on this page, though we'll load - // it in dev so that we get hot module replacement... - export const hydrate = dev; - - // ...but if the client-side router is already loaded - // (i.e. we came here from elsewhere in the app), use it - export const router = browser; - - // since there's no dynamic data here, we can prerender - // it so that it gets served as a static asset in prod - export const prerender = true; -</script> - -<svelte:head> - <title>About</title> -</svelte:head> - -<div class="content"> - <h1>About this app</h1> - - <p> - This is a <a href="https://kit.svelte.dev">SvelteKit</a> app. You can make your own by typing the - following into your command line and following the prompts: - </p> - - <!-- TODO lose the @next! --> - <pre>npm init svelte@next</pre> - - <p> - The page you're looking at is purely static HTML, with no client-side interactivity needed. - Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening - the devtools network panel and reloading. - </p> - - <p> - The <a href="/todos">TODOs</a> page illustrates SvelteKit's data loading and form handling. Try using - it with JavaScript disabled! - </p> -</div> - -<style> - .content { - width: 100%; - max-width: var(--column-width); - margin: var(--column-margin-top) auto 0 auto; - } -</style> diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 68311dd..524df13 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,9 +1,5 @@ <script context="module" lang="ts"> - export const prerender = true; -</script> - -<script lang="ts"> - import Counter from '$lib/Counter.svelte'; + export const prerender = true </script> <svelte:head> @@ -11,49 +7,5 @@ </svelte:head> <section> - <h1> - <div class="welcome"> - <picture> - <source srcset="svelte-welcome.webp" type="image/webp" /> - <img src="svelte-welcome.png" alt="Welcome" /> - </picture> - </div> - - to your new<br />SvelteKit app - </h1> - - <h2> - try editing <strong>src/routes/index.svelte</strong> - </h2> - - <Counter /> + <h1>SkyBlock Stats</h1> </section> - -<style> - section { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - flex: 1; - } - - h1 { - width: 100%; - } - - .welcome { - position: relative; - width: 100%; - height: 0; - padding: 0 0 calc(100% * 495 / 2048) 0; - } - - .welcome img { - position: absolute; - width: 100%; - height: 100%; - top: 0; - display: block; - } -</style> diff --git a/src/routes/player/[player]/[profile].svelte b/src/routes/player/[player]/[profile].svelte index bd9402d..e28dae7 100644 --- a/src/routes/player/[player]/[profile].svelte +++ b/src/routes/player/[player]/[profile].svelte @@ -1,5 +1,4 @@ <script lang="ts" context="module"> - import { cacheInventories } from '$lib/minecraft/inventory' import type { Load } from '@sveltejs/kit' import { API_URL } from '$lib/api' @@ -12,8 +11,6 @@ const pack = params.pack ?? data?.customization?.pack - await cacheInventories(data.member.inventories, pack) - return { props: { data, @@ -24,16 +21,16 @@ </script> <script lang="ts"> + import Inventories from '$lib/sections/Inventories.svelte' import Username from '$lib/minecraft/Username.svelte' import Infobox from '$lib/sections/Infobox.svelte' + import Skills from '$lib/sections/Skills.svelte' import { generateInfobox } from '$lib/profile' + import Armor from '$lib/sections/Armor.svelte' import Header from '$lib/Header.svelte' import Emoji from '$lib/Emoji.svelte' - import { cleanId } from '$lib/utils' import Head from '$lib/Head.svelte' import Toc from '$lib/Toc.svelte' - import Skills from '$lib/sections/Skills.svelte' - import Armor from '$lib/sections/Armor.svelte' export let data export let pack: string @@ -98,13 +95,14 @@ <Armor {data} {pack} /> </section> {/if} - <!-- {%- if data.member.inventories.armor -%} - <section id="armor"{% if data.member.inventories.inventory %} class="armor-float"{% endif %}> - <h2>Armor</h2> - {%- include 'sections/armor.njk' -%} + {#if data.member.inventories.inventory} + <section id="inventories"> + <h2>Inventories</h2> + <Inventories {data} {pack} /> </section> - {%- endif -%} - {%- if data.member.inventories.inventory -%} + {/if} + + <!-- {%- if data.member.inventories.inventory -%} <section id="inventories"> <h2>Inventories</h2> {%- include 'sections/inventories.njk' -%} |