From a7255393ac86b091772189469fc1806ded1595d1 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 22 Dec 2023 03:07:04 -0800
Subject: feat(wrapped): full-year activity history

---
 src/lib/Tools/ActivityHistory.svelte | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

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

diff --git a/src/lib/Tools/ActivityHistory.svelte b/src/lib/Tools/ActivityHistory.svelte
index 17067ec4..8194ad0a 100644
--- a/src/lib/Tools/ActivityHistory.svelte
+++ b/src/lib/Tools/ActivityHistory.svelte
@@ -12,6 +12,7 @@
 	} from '$lib/AniList/identity';
 	import { clearAllParameters } from './tool.js';
 	import { domToBlob } from 'modern-screenshot';
+	import ActivityHistoryGrid from './ActivityHistoryGrid.svelte';
 
 	export let user: AniListAuthorisation;
 
@@ -88,25 +89,8 @@
 			Loading ...
 		{:else}
 			{@const filledActivities = fillMissingDays(activities)}
-			{@const highestActivity = Math.max(...filledActivities.map((activity) => activity.amount))}
-
-			<div class="grid">
-				{#each filledActivities as activity}
-					<div
-						class="grid-item"
-						style="background-color: {gradientColour(activity.amount, highestActivity, baseHue)}"
-						on:click={() => (baseHue = Math.floor(Math.random() * 360))}
-						on:keydown={() => {
-							return;
-						}}
-						role="button"
-						tabindex="0"
-						title={`Date: ${new Date(activity.date * 1000).toLocaleDateString()}\nAmount: ${
-							activity.amount
-						}`}
-					/>
-				{/each}
-			</div>
+
+			<ActivityHistoryGrid {user} />
 
 			<p />
 
-- 
cgit v1.2.3

