From 34fcffb95db91bc1db80a00af4cf9d1007a9f575 Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Mon, 21 Feb 2022 00:56:55 -0600
Subject: add minions and loader thing

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

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

diff --git a/src/lib/sections/Minions.svelte b/src/lib/sections/Minions.svelte
new file mode 100644
index 0000000..2e4483c
--- /dev/null
+++ b/src/lib/sections/Minions.svelte
@@ -0,0 +1,52 @@
+<script lang="ts">
+	import type { CleanMemberProfile } from '$lib/APITypes'
+	import { cleanId, toRomanNumerals } from '$lib/utils'
+
+	export let data: CleanMemberProfile
+</script>
+
+<p class="unique-minions-text">
+	Unique minions:
+	<span class="minions-fraction">
+		<b>{data.profile.minion_count}</b>/{data.profile.maxUniqueMinions}
+	</span>
+</p>
+<table>
+	{#each data.profile.minions as minion}
+		<tr>
+			<th>{cleanId(minion.name)}</th>
+			{#each minion.levels as unlocked, i}
+				<td class="minions-table" class:unlocked>
+					{toRomanNumerals(i)}
+				</td>
+			{/each}
+		</tr>
+	{/each}
+</table>
+
+<!-- 
+<p class="darker-text">Unique minions: <span class="main-text"><b>{{ data.profile.minion_count }}</b>/{{ getConstants().max_minions }}</span></p>
+<table>
+{%- for minion in data.profile.minions -%}
+    <tr>
+        <th>{{ minion.name|clean }}</th>
+        {%- for unlocked in minion.levels -%}
+        <td class="minions-table-{% if unlocked %}unlocked{% else %}locked{% endif %}">{{ loop.index|romanNumerals }}</td>
+        {%- endfor -%}
+    </tr>
+{%- endfor -%}
+</table> -->
+<style>
+	.unique-minions-text {
+		color: var(--theme-darker-text);
+	}
+	.minions-fraction {
+		color: var(--theme-main-text);
+	}
+	.minions-table:not(.unlocked) {
+		opacity: 0.2;
+	}
+	.minions-table.unlocked {
+		color: #3e3;
+	}
+</style>
-- 
cgit 

