diff --git a/src/routes/logs/+page.svelte b/src/routes/logs/+page.svelte index 12ddcbe..95d20da 100644 --- a/src/routes/logs/+page.svelte +++ b/src/routes/logs/+page.svelte @@ -311,6 +311,27 @@ return chatLogs.length.toLocaleString(); }); + const hourlyActivity = $derived.by(() => { + const counts = Array.from({ length: 24 }, () => 0); + for (const msg of chatLogs) { + counts[new Date(msg.timestamp).getHours()]++; + } + const maxCount = Math.max(1, ...counts); + return { counts, maxCount }; + }); + + // the busier the hour, the stronger the purple gets + const hourlyBarFill = (count: number, maxCount: number, resolvedMode: string | undefined) => { + if (count <= 0) return "transparent"; + const strength = Math.min(1, count / maxCount); + if (resolvedMode === "dark") { + const alpha = 0.2 + 0.72 * strength; + return `hsl(270 88% 68% / ${alpha})`; + } + const alpha = 0.14 + 0.8 * strength; + return `hsl(271 78% 46% / ${alpha})`; + }; + $effect(() => { if (!filteredChatLogs) return; untrack(async () => { @@ -882,9 +903,34 @@ - - - + + + +
+

Messages by hour for the timeframe

+ +
+ {#if statsError}

{statsError}

{:else}