From cd982e64595ab47a5fa71a40f8249893dbf867df Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 16 Feb 2022 22:13:11 +0000 Subject: add --- src/lib/ListItemWithIcon.svelte | 18 ++++++++++ src/lib/Toc.svelte | 27 +++++++++++++++ src/lib/Tooltip.svelte | 75 +++++++++++++++++++++++++++++++++++++++++ src/lib/sections/Infobox.svelte | 70 ++++++++++++++++++++++++++++++++++++++ src/lib/sections/Skills.svelte | 64 +++++++++++++++++++++++++++++++++++ src/routes/constants.json.ts | 18 ++++++++++ 6 files changed, 272 insertions(+) create mode 100644 src/lib/ListItemWithIcon.svelte create mode 100644 src/lib/Toc.svelte create mode 100644 src/lib/Tooltip.svelte create mode 100644 src/lib/sections/Infobox.svelte create mode 100644 src/lib/sections/Skills.svelte create mode 100644 src/routes/constants.json.ts (limited to 'src') diff --git a/src/lib/ListItemWithIcon.svelte b/src/lib/ListItemWithIcon.svelte new file mode 100644 index 0000000..2c7aade --- /dev/null +++ b/src/lib/ListItemWithIcon.svelte @@ -0,0 +1,18 @@ + + +
  • + +
  • + + diff --git a/src/lib/Toc.svelte b/src/lib/Toc.svelte new file mode 100644 index 0000000..190c6a4 --- /dev/null +++ b/src/lib/Toc.svelte @@ -0,0 +1,27 @@ + + + + + diff --git a/src/lib/Tooltip.svelte b/src/lib/Tooltip.svelte new file mode 100644 index 0000000..55cbc21 --- /dev/null +++ b/src/lib/Tooltip.svelte @@ -0,0 +1,75 @@ + + + + + No tooltip! + + + + + + + + diff --git a/src/lib/sections/Infobox.svelte b/src/lib/sections/Infobox.svelte new file mode 100644 index 0000000..eda7d22 --- /dev/null +++ b/src/lib/sections/Infobox.svelte @@ -0,0 +1,70 @@ + + + + +
    +

    ({data.member.profileName})

    + {#each generateInfobox(data, constants, { meta: false }) as item} +

    + {/each} +
    + + diff --git a/src/lib/sections/Skills.svelte b/src/lib/sections/Skills.svelte new file mode 100644 index 0000000..790da6d --- /dev/null +++ b/src/lib/sections/Skills.svelte @@ -0,0 +1,64 @@ + + + + + diff --git a/src/routes/constants.json.ts b/src/routes/constants.json.ts new file mode 100644 index 0000000..301da58 --- /dev/null +++ b/src/routes/constants.json.ts @@ -0,0 +1,18 @@ +import { API_URL } from '$lib/api' + +export let constants: any = {} + +async function updateConstants() { + constants = await fetch(API_URL + 'constants').then(r => r.json()) + console.log('updated constants') +} + +updateConstants() +setInterval(updateConstants, 60 * 60 * 1000) // update every hour + +export async function get({ request }) { + console.log('gotten constants') + return { + body: constants || {} + } +} \ No newline at end of file -- cgit