From fbb5d90301c60308071bcd01b65c3dba34ba5725 Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Fri, 20 May 2022 22:26:23 -0500
Subject: Improve achievements

---
 src/lib/sections/Achievements.svelte | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

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

diff --git a/src/lib/sections/Achievements.svelte b/src/lib/sections/Achievements.svelte
index 61f320e..92ba468 100644
--- a/src/lib/sections/Achievements.svelte
+++ b/src/lib/sections/Achievements.svelte
@@ -8,7 +8,7 @@
 	<h3>
 		Tiered
 		<span class="achievement-count">
-			({data.member.achievements.tiered.filter(a => a.value).length}/{data.member.achievements
+			({data.member.achievements.tiered.filter(a => a.amount).length}/{data.member.achievements
 				.tiered.length})
 		</span>
 	</h3>
@@ -20,15 +20,13 @@
 						{achievement.description}
 					</span>
 
-					{#if achievement.value}
-						<span>
-							{achievement.name}: <b>{achievement.value}</b>
-						</span>
-					{:else}
-						<span class="achievement-locked">
-							{achievement.name}
-						</span>
-					{/if}
+					<span class:achievement-locked={achievement.amount === 0}>
+						{achievement.name}: {#if achievement.next}
+							<b class="achievement-amount">{achievement.amount}</b>/{achievement.next}
+						{:else}
+							<span class="achievement-amount achievement-amount-maxed">{achievement.amount}</span>
+						{/if}
+					</span>
 				</Tooltip>
 			</li>
 		{/each}
@@ -78,4 +76,12 @@
 		color: var(--theme-darker-text);
 		font-weight: normal;
 	}
+
+	.achievement-amount {
+		opacity: 0.9;
+	}
+	.achievement-amount-maxed {
+		color: #0e0;
+		opacity: 1;
+	}
 </style>
-- 
cgit 

