From c6b939f303356bacb8fe52b21e82f28d7d22108b Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Sun, 3 Apr 2022 21:46:52 +0000
Subject: Forgot to git add lol!

---
 src/lib/sections/FarmingContests.svelte | 57 +++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 src/lib/sections/FarmingContests.svelte

(limited to 'src/lib/sections/FarmingContests.svelte')

diff --git a/src/lib/sections/FarmingContests.svelte b/src/lib/sections/FarmingContests.svelte
new file mode 100644
index 0000000..ca4f1a7
--- /dev/null
+++ b/src/lib/sections/FarmingContests.svelte
@@ -0,0 +1,57 @@
+<script lang="ts">
+	import type { CleanMemberProfile } from '$lib/APITypes'
+	import Emoji from '$lib/Emoji.svelte'
+	import ListItemWithIcon from '$lib/ListItemWithIcon.svelte'
+	import { skyblockItemToUrl } from '$lib/minecraft/inventory'
+	import Item from '$lib/minecraft/Item.svelte'
+	import { cleanId, millisecondsToTime, skyblockTime, toTitleCase } from '$lib/utils'
+
+	export let data: CleanMemberProfile
+</script>
+
+<div class="info-text primary-info-text">
+	<p>Talked to Jacob: <Emoji value={data.member.farmingContests.talkedToJacob ? '✅' : '❌'} /></p>
+</div>
+<div class="farming-contests-list">
+	{#each data.member.farmingContests.list as farmingContest}
+		<div class="farming-contest">
+			<p class="farming-contest-date">
+				{new Date(
+					skyblockTime(farmingContest.year, farmingContest.month, farmingContest.day)
+				).toUTCString()}
+			</p>
+			<ul>
+				{#each farmingContest.crops as crop}
+					<ListItemWithIcon src={skyblockItemToUrl(crop.item)}>
+						<b>{crop.amount.toLocaleString()}</b> collected
+						{#if crop.position}
+							<span class="farming-contest-item-placement">
+								(#{crop.position}/{crop.participants})
+							</span>
+						{/if}
+					</ListItemWithIcon>
+				{/each}
+			</ul>
+		</div>
+	{/each}
+</div>
+
+<style>
+	p,
+	ul {
+		margin: 0;
+	}
+
+	.primary-info-text {
+		margin: 0.5em 0;
+	}
+
+	.info-text {
+		color: var(--theme-darker-text);
+	}
+
+	.farming-contest-item-placement,
+	.farming-contest-date {
+		color: var(--theme-darker-text);
+	}
+</style>
-- 
cgit 

