From 1682e048fae37c482d20922b3c261dc83bcc0ba7 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 22 Sep 2023 23:39:34 -0700
Subject: feat(routes): tools

---
 src/routes/tools/+page.svelte | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 src/routes/tools/+page.svelte

(limited to 'src/routes/tools/+page.svelte')

diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
new file mode 100644
index 00000000..53ace72b
--- /dev/null
+++ b/src/routes/tools/+page.svelte
@@ -0,0 +1,43 @@
+<script lang="ts">
+	import { todaysCharacterBirthdays } from '$lib/AniList/character';
+
+	let tool: number;
+</script>
+
+<p>
+	<select bind:value={tool}>
+		<option value={0}>Tools</option>
+		<option value={1}>Today's Character Birthdays</option>
+	</select>
+</p>
+
+{#if tool === 0}
+	Select a tool to continue.
+{:else if tool === 1}
+	<ul>
+		{#await todaysCharacterBirthdays()}
+			<li>Loading ...</li>
+		{:then birthdays}
+			{#each birthdays as birthday}
+				<li>
+					<a href={`https://anilist.co/character/${birthday.id}`} target="_blank"
+						>{birthday.name.full}</a
+					>
+				</li>
+			{/each}
+		{:catch}
+			<li>
+				<p>
+					Characters could not be loaded. You might have been <a
+						href="https://en.wikipedia.org/wiki/Rate_limiting"
+						target="_blank">rate limited</a
+					>.
+				</p>
+				<p>
+					Try again in a few minutes. If the problem persists, please contact
+					<a href="https://anilist.co/user/fuwn" target="_blank">@fuwn</a> on AniList.
+				</p>
+			</li>
+		{/await}
+	</ul>
+{/if}
-- 
cgit v1.2.3

