From 4caa690002a05793a8f1af0626fa7ee1ba68ea9e Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 12 Nov 2023 20:23:23 -0800
Subject: refactor(tools): move birthdays to module

---
 src/lib/Tools/CharacterBirthdays.svelte | 34 +++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 src/lib/Tools/CharacterBirthdays.svelte

(limited to 'src/lib/Tools/CharacterBirthdays.svelte')

diff --git a/src/lib/Tools/CharacterBirthdays.svelte b/src/lib/Tools/CharacterBirthdays.svelte
new file mode 100644
index 00000000..56b332a5
--- /dev/null
+++ b/src/lib/Tools/CharacterBirthdays.svelte
@@ -0,0 +1,34 @@
+<script>
+	import { todaysCharacterBirthdays } from '$lib/AniList/character';
+	import Error from '$lib/Error.svelte';
+</script>
+
+{#await todaysCharacterBirthdays()}
+	Loading ...
+{:then birthdays}
+	<div id="characters">
+		{#each birthdays as birthday}
+			<div>
+				<a href={`https://anilist.co/character/${birthday.id}`} target="_blank">
+					{birthday.name.full}
+					<img src={birthday.image.large} alt="Character (Large)" class="character-image" />
+				</a>
+			</div>
+		{/each}
+	</div>
+{:catch}
+	<Error type="Character" />
+{/await}
+
+<style>
+	#characters {
+		display: grid;
+		grid-template-columns: repeat(auto-fill, minmax(8%, 1fr));
+		grid-gap: 0;
+		grid-row-gap: 1rem;
+	}
+
+	.character-image {
+		height: 20vh;
+	}
+</style>
-- 
cgit v1.2.3

