- less
- {#each levelOpacity as opacity, level (level)}
-
- {/each}
- more
+
{:else}
connecting to github...
@@ -76,25 +98,57 @@
display: block;
aspect-ratio: 1;
min-width: 4px;
- background: var(--green);
border-radius: 1px;
}
- .day.empty {
+ .empty {
background: color-mix(in srgb, var(--foreground) 10%, transparent);
}
.legend {
display: flex;
+ flex-wrap: wrap;
align-items: center;
- justify-content: flex-end;
- gap: 3px;
- margin-top: 0.4rem;
- font-size: 0.7rem;
+ gap: 0.3rem 0.9rem;
+ margin-top: 0.5rem;
+ font-size: 0.72rem;
}
- .legend .day {
+ .source {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.3rem;
+ }
+
+ .source:hover {
+ color: var(--accent);
+ }
+
+ .source b {
+ color: var(--blue);
+ }
+
+ .scale {
+ display: inline-flex;
+ align-items: center;
+ gap: 3px;
+ margin-left: auto;
+ }
+
+ .swatch {
+ display: inline-block;
width: 9px;
+ height: 9px;
+ border-radius: 1px;
+ background: var(--green);
+ }
+
+ .swatch.gitea {
+ background: var(--orange);
+ }
+
+ .swatch.empty {
+ background: color-mix(in srgb, var(--foreground) 10%, transparent);
}
.loading {
diff --git a/src/lib/content/types.ts b/src/lib/content/types.ts
index d3b02b6..6aca701 100644
--- a/src/lib/content/types.ts
+++ b/src/lib/content/types.ts
@@ -18,6 +18,7 @@ export interface Profile {
title: string;
email: string;
donateUrl?: string;
+ giteaUrl?: string;
avatar: string;
photo?: string;
bio: string;
diff --git a/src/lib/server/btop.ts b/src/lib/server/btop.ts
index 71ef4c0..c6bb528 100644
--- a/src/lib/server/btop.ts
+++ b/src/lib/server/btop.ts
@@ -1,6 +1,7 @@
import { profile } from '#lib/content';
import type { BtopData, GithubSummary, RepoProcess } from '#lib/btop/types';
-import { fetchContributionCalendar } from './contributions';
+import { buildCalendar, fetchGithubCalendar } from './contributions';
+import { fetchGiteaDailyCounts, parseGiteaProfile } from './gitea';
const cacheDuration = 60 * 60 * 1000;
const githubHeaders = { Accept: 'application/vnd.github+json', 'User-Agent': 'portfolio-website' };
@@ -36,6 +37,17 @@ async function fetchSummary(username: string): Promise
{
return { username, profileUrl: user.html_url, publicRepos: user.public_repos, followers: user.followers };
}
+async function fetchGiteaCounts(): Promise