Compare commits
20 Commits
08c174ba82
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e1bed7cdfd | |||
| 702a9b5cea | |||
| beccb85c5f | |||
| ee40f61030 | |||
| d7d75e1f23 | |||
| 32b5eae37d | |||
| 4719048389 | |||
| 74b84b1b10 | |||
| eef465dee0 | |||
| d838bd4960 | |||
| 0b958ae3eb | |||
| a3a418a037 | |||
| 2843c5925a | |||
| c55d9daaa2 | |||
| aceee88132 | |||
| 38ce5f3554 | |||
| 5e3b5200e3 | |||
| ff839c5077 | |||
| 952cf9b949 | |||
| 844e47b88f |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -14,3 +14,5 @@ devenv.local.yaml
|
||||
/.svelte-kit/*
|
||||
/node_modules
|
||||
/node_modules/*
|
||||
/build
|
||||
/docker-compose.yml
|
||||
|
||||
@@ -52,5 +52,3 @@ npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||
|
||||
6
bun.lock
6
bun.lock
@@ -12,7 +12,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@sveltejs/adapter-auto": "^8.0.0",
|
||||
"@sveltejs/adapter-bun": "^1.0.0",
|
||||
"@sveltejs/kit": "^3.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
||||
"@tailwindcss/forms": "^0.5.11",
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
"@sveltejs/acorn-typescript": ["@sveltejs/acorn-typescript@1.0.13", "", { "peerDependencies": { "acorn": "^8.9.0" } }, "sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ=="],
|
||||
|
||||
"@sveltejs/adapter-auto": ["@sveltejs/adapter-auto@8.0.0", "", { "peerDependencies": { "@sveltejs/kit": "^3.0.0-next.0" } }, "sha512-CKOwUS865xfoZn3CpM868slPfitsQ4vmxAR/yOfTIguAwStgkhjhzV0zEhmkzPalH338LJ9XnQX9vfQeY7220A=="],
|
||||
"@sveltejs/adapter-bun": ["@sveltejs/adapter-bun@1.0.1", "", { "dependencies": { "bun-types": "^1.3.14" }, "peerDependencies": { "@sveltejs/kit": "^3.0.0-next.0" } }, "sha512-VZv1uY+gVqXjFTwP7MQgVFkTcelBYgW+nfc8Hj+q3KFPuZtaJgmrUcdK2VV4QiLzg9LuotaQaHDdS5/yLP2J1A=="],
|
||||
|
||||
"@sveltejs/kit": ["@sveltejs/kit@3.1.1", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1", "@standard-schema/spec": "^1.1.0", "cookie": "^2.0.1", "devalue": "^5.9.4", "esm-env": "^1.2.2", "magic-string": "^1.2.3", "mrmime": "^2.0.1", "sirv": "^3.0.2" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0", "@sveltejs/vite-plugin-svelte": "^7.0.0", "svelte": "^5.57.1", "typescript": "^6.0.0", "vite": "^8.0.12" }, "optionalPeers": ["@opentelemetry/api", "typescript"], "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-BiEMvekYXE9Gu/YhWJ/yJ0WDLH1PX/dmjuAeFp5rrtdmgdzkjt7DvimlSP+/U4tgposl7pkE20luHpcnc6BgRw=="],
|
||||
|
||||
@@ -212,6 +212,8 @@
|
||||
|
||||
"brace-expansion": ["brace-expansion@5.0.12", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ=="],
|
||||
|
||||
"bun-types": ["bun-types@1.4.4", "", { "dependencies": { "@types/node": "*", "undici-types": "*" } }, "sha512-yjrJh5oGX7mMPKGd19YXyIjmEuj4G4zNC30bs7PM9Az7NQ3ndF3j6hbeRdvJTRQEhJ/FYQwW0a2moweEi2hMxQ=="],
|
||||
|
||||
"cacheable": ["cacheable@2.5.0", "", { "dependencies": { "@cacheable/memory": "^2.2.0", "@cacheable/utils": "^2.5.0", "hookified": "^1.15.0", "keyv": "^5.6.0", "qified": "^0.10.1" } }, "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g=="],
|
||||
|
||||
"chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="],
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@sveltejs/adapter-auto": "^8.0.0",
|
||||
"@sveltejs/adapter-bun": "^1.0.0",
|
||||
"@sveltejs/kit": "^3.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
||||
"@tailwindcss/forms": "^0.5.11",
|
||||
|
||||
@@ -1 +1,29 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.157 22.819c-10.4-14.885-30.94-19.297-45.792-9.835L22.282 29.608A29.92 29.92 0 0 0 8.764 49.65a31.5 31.5 0 0 0 3.108 20.231 30 30 0 0 0-4.477 11.183 31.9 31.9 0 0 0 5.448 24.116c10.402 14.887 30.942 19.297 45.791 9.835l26.083-16.624A29.92 29.92 0 0 0 98.235 78.35a31.53 31.53 0 0 0-3.105-20.232 30 30 0 0 0 4.474-11.182 31.88 31.88 0 0 0-5.447-24.116" style="fill:#ff3e00"/><path d="M45.817 106.582a20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.503 18 18 0 0 1 .624-2.435l.49-1.498 1.337.981a33.6 33.6 0 0 0 10.203 5.098l.97.294-.09.968a5.85 5.85 0 0 0 1.052 3.878 6.24 6.24 0 0 0 6.695 2.485 5.8 5.8 0 0 0 1.603-.704L69.27 76.28a5.43 5.43 0 0 0 2.45-3.631 5.8 5.8 0 0 0-.987-4.371 6.24 6.24 0 0 0-6.698-2.487 5.7 5.7 0 0 0-1.6.704l-9.953 6.345a19 19 0 0 1-5.296 2.326 20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.502 17.99 17.99 0 0 1 8.13-12.052l26.081-16.623a19 19 0 0 1 5.3-2.329 20.72 20.72 0 0 1 22.237 8.243 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-.624 2.435l-.49 1.498-1.337-.98a33.6 33.6 0 0 0-10.203-5.1l-.97-.294.09-.968a5.86 5.86 0 0 0-1.052-3.878 6.24 6.24 0 0 0-6.696-2.485 5.8 5.8 0 0 0-1.602.704L37.73 51.72a5.42 5.42 0 0 0-2.449 3.63 5.79 5.79 0 0 0 .986 4.372 6.24 6.24 0 0 0 6.698 2.486 5.8 5.8 0 0 0 1.602-.704l9.952-6.342a19 19 0 0 1 5.295-2.328 20.72 20.72 0 0 1 22.237 8.242 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-8.13 12.053l-26.081 16.622a19 19 0 0 1-5.3 2.328" style="fill:#fff"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
viewBox="0 0 512.08997 443.48322"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
xml:space="preserve"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs1" /><g
|
||||
id="layer1"
|
||||
transform="matrix(0.99124422,0,0,0.99124422,2.2864692,-32.01692)"><g
|
||||
id="g26"
|
||||
style="display:inline"><path
|
||||
d="m 294.79965,34.297099 39.57108,121.763401 65.7377,0.17339 -33.25603,99.76808 33.25603,99.76611 H 334.619 L 294.79965,477.7029 h 89.20094 L 512.00024,256 384.00059,34.297099 Z"
|
||||
style="fill:#8839ef;stroke:#8839ef;stroke-width:3.99474"
|
||||
id="path26" /><path
|
||||
d="M 127.99934,34.297099 -3.0431451e-4,256 127.99934,477.7029 h 89.20094 L 177.6292,355.76808 h -65.73769 l 33.25602,-99.76611 -33.25602,-99.76808 h 65.9367 L 217.20028,34.297099 Z"
|
||||
style="fill:#8839ef;stroke:#8839ef;stroke-width:3.99474"
|
||||
id="path22" /><path
|
||||
d="m 641.64264,15.133196 -22.25661,71.01166 h 44.5142 z"
|
||||
style="opacity:1;fill:#8839ef;fill-opacity:1;stroke:#8839ef;stroke-width:1.99029;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path23"
|
||||
transform="matrix(1.9922792,0,0,1.9922792,-1022.3323,51.121339)" /><path
|
||||
d="m 619.38603,119.52877 22.25661,72.33396 22.25759,-72.33396 z"
|
||||
style="display:inline;opacity:1;fill:#8839ef;fill-opacity:1;stroke:#8839ef;stroke-width:1.99029;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path25"
|
||||
transform="matrix(1.9922792,0,0,1.9922792,-1022.3323,51.121339)" /></g></g></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -4,7 +4,8 @@ import { decode } from 'he';
|
||||
|
||||
export enum ContentType {
|
||||
YOUTUBE_VIDEO,
|
||||
BLOG_POST
|
||||
BLOG_POST,
|
||||
THOUGHT
|
||||
}
|
||||
|
||||
export interface ContentItem {
|
||||
@@ -61,7 +62,7 @@ async function fetchBlogArticles(fetch: typeof globalThis.fetch, url: string) {
|
||||
published: new Date(article.pubDate),
|
||||
link: article.link,
|
||||
image: undefined,
|
||||
type: ContentType.BLOG_POST
|
||||
type: article.title == article.description ? ContentType.THOUGHT : ContentType.BLOG_POST
|
||||
});
|
||||
}
|
||||
return items.slice(0, 5);
|
||||
@@ -126,7 +127,7 @@ async function fetchContentItems(
|
||||
|
||||
finalArray.sort((a, b) => b.published.getTime() - a.published.getTime());
|
||||
|
||||
return finalArray.slice(0, 5);
|
||||
return finalArray.slice(0, 8);
|
||||
}
|
||||
|
||||
export async function getContentItems(
|
||||
|
||||
135
src/lib/server/gitea.ts
Normal file
135
src/lib/server/gitea.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
export interface GitCommit {
|
||||
message: string;
|
||||
hash: string;
|
||||
shortHash: string;
|
||||
parentRepo: string;
|
||||
parentBranch: string;
|
||||
url: string;
|
||||
timestamp: Date;
|
||||
user: string;
|
||||
diff: Diff;
|
||||
}
|
||||
|
||||
export interface Diff {
|
||||
additions: number;
|
||||
deletions: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
const CACHE_TTL = 3 * 60 * 60 * 1000;
|
||||
|
||||
interface CacheEntry<T> {
|
||||
value: T;
|
||||
expiresAt: number;
|
||||
}
|
||||
|
||||
const commitCache = new Map<string, CacheEntry<GitCommit[]>>();
|
||||
const pendingRequests = new Map<string, Promise<GitCommit[]>>();
|
||||
|
||||
async function getGiteaRepos(fetch: typeof globalThis.fetch) {
|
||||
let response = await fetch(
|
||||
'https://git.voidarc.co.uk/api/v1/repos/search?sort=updated&order=desc&limit=10'
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Could not fetch repo information: ' + response.status);
|
||||
}
|
||||
|
||||
let data = await response.json();
|
||||
|
||||
return data.data;
|
||||
}
|
||||
|
||||
async function getRepoCommits(fetch: typeof globalThis.fetch, url: string) {
|
||||
let response = await fetch(url + '/commits?page=1&limit=15');
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Could not fetch commit information: ' + response.status);
|
||||
}
|
||||
|
||||
let data = await response.json();
|
||||
|
||||
let finalData = [];
|
||||
|
||||
for (let commit of data) {
|
||||
// Filter out other users and do a null check for non-gitea commits that might exist
|
||||
if (commit.author != null && commit.author.login == 'voidarc') {
|
||||
finalData.push(commit);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
return finalData;
|
||||
}
|
||||
|
||||
async function fetchLatestCommits(
|
||||
fetch: typeof globalThis.fetch,
|
||||
count: number
|
||||
): Promise<GitCommit[]> {
|
||||
const repos = await getGiteaRepos(fetch);
|
||||
|
||||
let commitList: GitCommit[] = [];
|
||||
for (let repo of repos) {
|
||||
let commits = await getRepoCommits(fetch, repo.url);
|
||||
for (let commit of commits) {
|
||||
// console.log(commit);
|
||||
let newCommit: GitCommit = {
|
||||
message: commit.commit.message,
|
||||
hash: commit.sha,
|
||||
shortHash: commit.sha.substring(0, 6),
|
||||
timestamp: new Date(commit.created),
|
||||
url: commit.html_url,
|
||||
parentRepo: repo.full_name,
|
||||
parentBranch: 'main', // I know this is a shit solution
|
||||
user: commit.commit.author.name,
|
||||
diff: {
|
||||
additions: commit.stats.additions,
|
||||
deletions: commit.stats.deletions,
|
||||
total: commit.stats.total
|
||||
}
|
||||
};
|
||||
commitList.push(newCommit);
|
||||
}
|
||||
}
|
||||
commitList.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
|
||||
|
||||
return commitList.slice(0, count);
|
||||
}
|
||||
|
||||
export async function getLatestCommits(
|
||||
fetch: typeof globalThis.fetch,
|
||||
count: number
|
||||
): Promise<GitCommit[]> {
|
||||
const cacheKey = String(count);
|
||||
|
||||
const cached = commitCache.get(cacheKey);
|
||||
|
||||
if (cached && cached.expiresAt > Date.now()) {
|
||||
return cached.value;
|
||||
}
|
||||
|
||||
const pending = pendingRequests.get(cacheKey);
|
||||
|
||||
if (pending) return pending;
|
||||
|
||||
const request = fetchLatestCommits(fetch, count)
|
||||
.then((commits) => {
|
||||
commitCache.set(cacheKey, {
|
||||
value: commits,
|
||||
expiresAt: Date.now() + CACHE_TTL
|
||||
});
|
||||
|
||||
return commits;
|
||||
})
|
||||
.finally(() => {
|
||||
pendingRequests.delete(cacheKey);
|
||||
});
|
||||
|
||||
pendingRequests.set(cacheKey, request);
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
export function invalidateCommitCache(count: number): void {
|
||||
commitCache.delete(String(count));
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
|
||||
<svelte:head>
|
||||
<link rel="icon" href={favicon} />
|
||||
<title>Voidarc</title>
|
||||
</svelte:head>
|
||||
|
||||
{@render children()}
|
||||
|
||||
<div class="h-20 w-full place-content-center bg-ctp-surface0 text-center">
|
||||
Copyright Adumh00man 2026
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,9 @@ import type { PageServerLoad } from './$types';
|
||||
import { getLatestPlaylistSong, getLatestWatchedSeries } from '#lib/server/jellyfin';
|
||||
import { getLatestBook } from '#lib/server/komga';
|
||||
import { getContentItems } from '#lib/server/content';
|
||||
import { getLatestCommits } from '#lib/server/gitea';
|
||||
import type { ContentItem } from '#lib/server/content';
|
||||
import type { GitCommit } from '#lib/server/gitea';
|
||||
import {
|
||||
JELLYFIN_PLAYLIST_ID,
|
||||
JELLYFIN_LIBRARY_ID,
|
||||
@@ -17,19 +19,22 @@ export const load: PageServerLoad = () => {
|
||||
const latestBook = getLatestBook(globalThis.fetch, KOMGA_LIBRARY_ID);
|
||||
|
||||
const contentItems: ContentItem = getContentItems(globalThis.fetch, CHANNEL_ID, BLOG_URL);
|
||||
const latestCommits: GitCommit = getLatestCommits(globalThis.fetch, 50);
|
||||
|
||||
latestSong.catch(() => {});
|
||||
latestSeries.catch(() => {});
|
||||
latestBook.catch(() => {});
|
||||
|
||||
contentItems.catch(() => {});
|
||||
latestCommits.catch(() => {});
|
||||
|
||||
return {
|
||||
streamed: {
|
||||
latestSong,
|
||||
latestSeries,
|
||||
latestBook,
|
||||
contentItems
|
||||
contentItems,
|
||||
latestCommits
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,192 +1,282 @@
|
||||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
import { SiGit, SiHugo, SiYoutube } from '@icons-pack/svelte-simple-icons';
|
||||
import { SiGit, SiMaildotru, SiHugo, SiMatrix, SiYoutube } from '@icons-pack/svelte-simple-icons';
|
||||
|
||||
import Content from './Content.svelte';
|
||||
import Commits from './Commits.svelte';
|
||||
|
||||
let { data }: { data: PageData } = $props();
|
||||
import voidarcIcon from '../voidarc-hollow.svg?raw';
|
||||
|
||||
let contentHeight = $state(0);
|
||||
</script>
|
||||
|
||||
<div class="fira-mono-bold mt-5 flex h-40 w-full items-center justify-center text-center text-6xl">
|
||||
<div class="absolute aspect-[2/1.732] h-40 text-ctp-surface0">
|
||||
{@html voidarcIcon}
|
||||
</div>
|
||||
<span class="absolute text-ctp-mauve">[VOIDARC INCORPORATED]</span>
|
||||
</div>
|
||||
<div class="m-6 mx-auto grid max-w-6xl grid-flow-row auto-rows-min gap-5">
|
||||
<div class="page-frame">
|
||||
<div
|
||||
class="main-container grid grid-cols-[2fr_1fr] py-7 pl-10"
|
||||
style="--container-color:var(--ctp-mauve);"
|
||||
class="fira-mono-bold relative mt-5 flex h-40 w-full items-center justify-center text-center"
|
||||
>
|
||||
<div class="ml-6 py-4">
|
||||
<div class="flex">
|
||||
<img src="/adumh00man.png" class="mt-[13px] mr-2 ml-[-15px] h-12" alt="" />
|
||||
<p class="title-font text-bold text-[50px]">Adumh00man</p>
|
||||
</div>
|
||||
<p id="description-block" class="pr-10 pl-4 text-justify">
|
||||
Adumh00man is a mysterious all-powerful being pretending to be a cat pretending to be a nix
|
||||
youtuber. Currently maintaining an awesome nix config, and using nixos fulltime, his
|
||||
programming languages of choice are rust and svelte (if you can count svelte as a language).
|
||||
He is also an avid homelabber, running all of his services on-prem so that the evil
|
||||
corporations that be can't control him when the world is eventually owned by them. This
|
||||
includes his
|
||||
<a class="text-link" href="https://git.voidarc.co.uk/voidarc">git server</a>, his
|
||||
<a class="text-link" href="https://blog.voidarc.co.uk">blog</a>, and some other services he
|
||||
uses to "legally aqquire media" (yarr me hearties).
|
||||
</p>
|
||||
</div>
|
||||
<div class="my-4 mr-4 grid min-w-100 flex-col gap-2 pr-3">
|
||||
<div
|
||||
class="sub-container flex items-center gap-3 overflow-hidden pr-3"
|
||||
style="--container-color:var(--ctp-green);"
|
||||
>
|
||||
{#await data.streamed.latestSong}
|
||||
<p>Loading latest song...</p>
|
||||
{:then song}
|
||||
<img src={song.coverArt} class="h-full w-auto shrink-0 object-contain" alt="" />
|
||||
<div class="flex min-w-0 flex-col justify-center">
|
||||
<p class="fira-mono-medium">Currently Listening to…</p>
|
||||
<div
|
||||
id="music-title-block"
|
||||
onclick={() =>
|
||||
window.open(
|
||||
`https://soundcloud.com/search?q=${song.name} ${song.artist}`,
|
||||
'_blank'
|
||||
)}
|
||||
style="cursor: pointer;"
|
||||
role="link"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
}
|
||||
}}
|
||||
tabindex="0"
|
||||
title="{song.name} - {song.artist}"
|
||||
class="pl-2"
|
||||
>
|
||||
<p class="fira-mono-bold w-full truncate text-2xl">
|
||||
{song.name}
|
||||
</p>
|
||||
<p class="fira-mono-medium w-full truncate text-xl">
|
||||
{song.artist} - {song.album}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{:catch error}
|
||||
<p>{error}</p>
|
||||
{/await}
|
||||
</div>
|
||||
<div
|
||||
class="sub-container flex items-center gap-3 overflow-hidden pr-3"
|
||||
style="--container-color:var(--ctp-peach);"
|
||||
>
|
||||
{#await data.streamed.latestSeries}
|
||||
<p>Loading Latest Watched Series...</p>
|
||||
{:then series}
|
||||
<img
|
||||
src={series.poster}
|
||||
class="aspect-1/1 h-full w-auto shrink-0 object-contain"
|
||||
alt=""
|
||||
/>
|
||||
<div class="flex min-w-0 flex-col justify-center">
|
||||
<p class="fira-mono-medium">Currently Watching…</p>
|
||||
<div
|
||||
id="music-title-block"
|
||||
onclick={() =>
|
||||
window.open(`https://thetvdb.com/search?query=${series.name}`, '_blank')}
|
||||
style="cursor: pointer;"
|
||||
role="link"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
}
|
||||
}}
|
||||
tabindex="0"
|
||||
title="{series.name} S{series.episode.seasonNumber}E{series.episode
|
||||
.episodeNumber} - {series.episode.name}"
|
||||
class="pl-2"
|
||||
>
|
||||
<p class="fira-mono-bold w-full truncate text-2xl">
|
||||
{series.name}
|
||||
</p>
|
||||
<p class="fira-mono-medium w-full truncate text-xl">
|
||||
S{series.episode.seasonNumber}E{series.episode.episodeNumber} - {series.episode
|
||||
.name}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{:catch error}
|
||||
<p>{error}</p>
|
||||
{/await}
|
||||
</div>
|
||||
<div
|
||||
class="sub-container flex items-center gap-3 overflow-hidden pr-3"
|
||||
style="--container-color:var(--ctp-red);"
|
||||
>
|
||||
{#await data.streamed.latestBook}
|
||||
<p>Loading Latest Book...</p>
|
||||
{:then book}
|
||||
<img
|
||||
src={book.coverArt}
|
||||
class="aspect-1/1 h-full w-auto shrink-0 object-contain"
|
||||
alt=""
|
||||
/>
|
||||
<div class="flex min-w-0 flex-col justify-center">
|
||||
<p class="fira-mono-medium">Currently Reading…</p>
|
||||
<div
|
||||
id="music-title-block"
|
||||
onclick={() =>
|
||||
window.open(
|
||||
`https://bookbrainz.org/search?q=${book.series} ${book.number}`,
|
||||
'_blank'
|
||||
)}
|
||||
style="cursor: pointer;"
|
||||
role="link"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
}
|
||||
}}
|
||||
tabindex="0"
|
||||
class="pl-2"
|
||||
>
|
||||
<p class="fira-mono-bold w-full truncate text-2xl">
|
||||
{book.series}
|
||||
</p>
|
||||
<p class="fira-mono-medium w-full truncate text-xl">
|
||||
v{book.number} p{book.currentPage}/{book.totalPages}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/await}
|
||||
</div>
|
||||
<div class="absolute aspect-[2/1.732] h-40 text-ctp-surface0">
|
||||
{@html voidarcIcon}
|
||||
</div>
|
||||
<span class="banner-text absolute inset-x-0 text-ctp-mauve">[VOIDARC INCORPORATED]</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-[4fr_3fr] grid-rows-1 gap-4">
|
||||
<div class="main-container" style="--container-color:var(--ctp-blue);">
|
||||
<div class="section-title fira-mono-bold mr-3 flex py-2 text-4xl">
|
||||
Content <div class="flex w-full flex-row-reverse items-center gap-4 pr-4">
|
||||
<a href="https://youtube.com/@adumh00man">
|
||||
<SiYoutube size="40" class="hover:text-ctp-red" />
|
||||
</a>
|
||||
<a href="https://blog.voidarc.co.uk">
|
||||
<SiHugo size="35" class="hover:text-ctp-mauve" />
|
||||
</a>
|
||||
<div class="my-6 grid grid-flow-row auto-rows-min gap-3">
|
||||
<div
|
||||
class="main-container grid grid-cols-1 py-7 pl-4 min-[900px]:grid-cols-[2fr_1fr] min-[900px]:pl-10"
|
||||
style="--container-color:var(--ctp-mauve);"
|
||||
>
|
||||
<div class="py-4 min-[900px]:ml-6">
|
||||
<div class="flex">
|
||||
<img src="/adumh00man.png" class="mt-[13px] mr-2 ml-[-15px] h-12" alt="" />
|
||||
<p class="title-font text-bold text-[clamp(2.25rem,10vw,3.125rem)]">Adumh00man</p>
|
||||
</div>
|
||||
<p id="description-block" class="pr-4 pl-0 text-justify min-[900px]:pr-10 min-[900px]:pl-4">
|
||||
Adumh00man is a mysterious all-powerful being pretending to be a cat pretending to be a
|
||||
nix youtuber. Currently maintaining an awesome nix config, and using nixos fulltime, his
|
||||
programming languages of choice are rust and svelte (if you can count svelte as a
|
||||
language). He is also an avid homelabber, running all of his services on-prem so that the
|
||||
evil corporations that be can't control him when the world is eventually owned by them.
|
||||
This includes his
|
||||
<a class="text-link" href="https://git.voidarc.co.uk/voidarc">git server</a>, his
|
||||
<a class="text-link" href="https://blog.voidarc.co.uk">blog</a>, and some other services
|
||||
he uses to "legally aqquire media" (yarr me hearties).
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="my-4 mr-4 grid min-w-0 grid-cols-1 flex-col gap-2 min-[900px]:min-w-100 min-[900px]:pr-3"
|
||||
>
|
||||
<div
|
||||
class="sub-container flex items-center gap-3 overflow-hidden min-[900px]:pr-3"
|
||||
style="--container-color:var(--ctp-green);"
|
||||
>
|
||||
{#await data.streamed.latestSong}
|
||||
<p>Loading latest song...</p>
|
||||
{:then song}
|
||||
<img src={song.coverArt} class="h-full w-auto shrink-0 object-contain" alt="" />
|
||||
<div class="flex min-w-0 flex-col justify-center">
|
||||
<p class="fira-mono-medium">Currently Listening to…</p>
|
||||
<div
|
||||
id="music-title-block"
|
||||
onclick={() =>
|
||||
window.open(
|
||||
`https://soundcloud.com/search?q=${song.name} ${song.artist}`,
|
||||
'_blank'
|
||||
)}
|
||||
style="cursor: pointer;"
|
||||
role="link"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
}
|
||||
}}
|
||||
tabindex="0"
|
||||
title="{song.name} - {song.artist}"
|
||||
class="pl-2"
|
||||
>
|
||||
<p class="fira-mono-bold w-full truncate text-2xl">
|
||||
{song.name}
|
||||
</p>
|
||||
<p class="fira-mono-medium w-full truncate text-xl">
|
||||
{song.artist} - {song.album}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{:catch error}
|
||||
<p>{error}</p>
|
||||
{/await}
|
||||
</div>
|
||||
<div
|
||||
class="sub-container flex items-center gap-3 overflow-hidden min-[900px]:pr-3"
|
||||
style="--container-color:var(--ctp-peach);"
|
||||
>
|
||||
{#await data.streamed.latestSeries}
|
||||
<p>Loading Latest Watched Series...</p>
|
||||
{:then series}
|
||||
<img
|
||||
src={series.poster}
|
||||
class="aspect-1/1 h-full w-auto shrink-0 object-contain"
|
||||
alt=""
|
||||
/>
|
||||
<div class="flex min-w-0 flex-col justify-center">
|
||||
<p class="fira-mono-medium">Currently Watching…</p>
|
||||
<div
|
||||
id="music-title-block"
|
||||
onclick={() =>
|
||||
window.open(`https://thetvdb.com/search?query=${series.name}`, '_blank')}
|
||||
style="cursor: pointer;"
|
||||
role="link"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
}
|
||||
}}
|
||||
tabindex="0"
|
||||
title="{series.name} S{series.episode.seasonNumber}E{series.episode
|
||||
.episodeNumber} - {series.episode.name}"
|
||||
class="pl-2"
|
||||
>
|
||||
<p class="fira-mono-bold w-full truncate text-2xl">
|
||||
{series.name}
|
||||
</p>
|
||||
<p class="fira-mono-medium w-full truncate text-xl">
|
||||
S{series.episode.seasonNumber}E{series.episode.episodeNumber} - {series.episode
|
||||
.name}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{:catch error}
|
||||
<p>{error}</p>
|
||||
{/await}
|
||||
</div>
|
||||
<div
|
||||
class="sub-container flex items-center gap-3 overflow-hidden min-[900px]:pr-3"
|
||||
style="--container-color:var(--ctp-red);"
|
||||
>
|
||||
{#await data.streamed.latestBook}
|
||||
<p>Loading Latest Book...</p>
|
||||
{:then book}
|
||||
<img
|
||||
src={book.coverArt}
|
||||
class="aspect-1/1 h-full w-auto shrink-0 object-contain"
|
||||
alt=""
|
||||
/>
|
||||
<div class="flex min-w-0 flex-col justify-center">
|
||||
<p class="fira-mono-medium">Currently Reading…</p>
|
||||
<div
|
||||
id="music-title-block"
|
||||
onclick={() =>
|
||||
window.open(
|
||||
`https://bookbrainz.org/search?q=${book.series} ${book.number}`,
|
||||
'_blank'
|
||||
)}
|
||||
style="cursor: pointer;"
|
||||
role="link"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
}
|
||||
}}
|
||||
tabindex="0"
|
||||
class="pl-2"
|
||||
>
|
||||
<p class="fira-mono-bold w-full truncate text-2xl">
|
||||
{book.series}
|
||||
</p>
|
||||
<p class="fira-mono-medium w-full truncate text-xl">
|
||||
v{book.number} p{book.currentPage}/{book.totalPages}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
{#await data.streamed.contentItems}
|
||||
<p>Loading latest Content...</p>
|
||||
{:then items}
|
||||
<Content {items} />
|
||||
{/await}
|
||||
</div>
|
||||
<div class="main-container" style="--container-color:var(--ctp-green);">
|
||||
<div class="section-title fira-mono-bold mr-3 flex py-2 text-4xl">
|
||||
Commits
|
||||
<div class="flex w-full flex-row-reverse items-center gap-4 pr-4">
|
||||
<a href="https://git.voidarc.co.uk">
|
||||
<SiGit size="35" class="hover:text-ctp-peach" />
|
||||
</a>
|
||||
<div
|
||||
class="main-container grid grid-rows-2 min-[700px]:grid-cols-2 min-[700px]:grid-rows-1"
|
||||
style="--container-color:var(--ctp-yellow);"
|
||||
>
|
||||
<a
|
||||
class="group mr-10 ml-5 flex flex-row place-items-center justify-center py-2 hover:bg-ctp-surface2 min-[700px]:mr-0 min-[700px]:ml-10"
|
||||
href="https://matrix.to/#/#space:voidarc.co.uk"
|
||||
title="Join #space:voidarc.co.uk"
|
||||
>
|
||||
<div class="aspect-[2/1.732] h-10 group-hover:text-ctp-mauve">
|
||||
{@html voidarcIcon}
|
||||
</div>
|
||||
<p class="ml-2 text-xl font-bold group-hover:text-ctp-mauve group-hover:underline">
|
||||
VOIDARC MATRIX SPACE
|
||||
</p>
|
||||
</a>
|
||||
<div
|
||||
class="group mr-10 ml-5 flex flex-row place-items-center justify-center gap-8 py-2 min-[700px]:ml-0"
|
||||
>
|
||||
<a href="mailto://admin@voidarc.co.uk">
|
||||
<SiMaildotru class="hover:text-ctp-sky" title="Email admin@voidarc.co.uk" size="30" />
|
||||
</a>
|
||||
<a href="https://matrix.to/#/admin:voidarc.co.uk">
|
||||
<SiMatrix
|
||||
class="hover:text-ctp-green"
|
||||
title="Matrix address admin:voidarc.co.uk"
|
||||
size="30"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-4 min-[900px]:grid-cols-[9fr_7fr] min-[900px]:grid-rows-1">
|
||||
<div
|
||||
class="main-container"
|
||||
bind:clientHeight={contentHeight}
|
||||
style="--container-color:var(--ctp-blue);"
|
||||
>
|
||||
<div class="section-title fira-mono-bold mr-3 flex py-2 text-4xl">
|
||||
Content <div
|
||||
class="flex w-full flex-row-reverse items-center gap-4 pr-4 max-[400px]:gap-2"
|
||||
>
|
||||
<a href="https://youtube.com/@adumh00man">
|
||||
<SiYoutube size="40" class="hover:text-ctp-red" />
|
||||
</a>
|
||||
<a href="https://blog.voidarc.co.uk">
|
||||
<SiHugo size="35" class="hover:text-ctp-mauve" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{#await data.streamed.contentItems}
|
||||
<p>Loading latest Content...</p>
|
||||
{:then items}
|
||||
<Content {items} />
|
||||
{/await}
|
||||
</div>
|
||||
<!-- The wrapper contributes no height, so the row is sized by the Content column alone.
|
||||
On narrow screens it is placed below the Content column and given the same height. -->
|
||||
<div
|
||||
class="commits-column relative min-h-0"
|
||||
style={contentHeight ? `--content-height: ${contentHeight}px` : undefined}
|
||||
>
|
||||
<div
|
||||
class="main-container absolute inset-0 flex flex-col overflow-hidden"
|
||||
style="--container-color:var(--ctp-green);"
|
||||
>
|
||||
<div class="section-title fira-mono-bold mr-3 flex py-2 text-4xl">
|
||||
Commits
|
||||
<div class="flex w-full flex-row-reverse items-center gap-4 pr-4 max-[400px]:gap-2">
|
||||
<a href="https://git.voidarc.co.uk">
|
||||
<SiGit size="35" class="hover:text-ctp-peach" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="min-h-0 flex-1 overflow-hidden">
|
||||
{#await data.streamed.latestCommits}
|
||||
<p>loading commits...</p>
|
||||
{:then commits}
|
||||
{console.log(commits)}
|
||||
<Commits items={commits} />
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.page-frame {
|
||||
box-sizing: content-box;
|
||||
margin-inline: auto;
|
||||
max-width: 80rem;
|
||||
padding-inline: clamp(1rem, 2.5vw, 2rem);
|
||||
}
|
||||
|
||||
.banner-text {
|
||||
font-size: min(3.75rem, 6vw);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.banner-text {
|
||||
font-size: 3.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 899.98px) {
|
||||
.commits-column {
|
||||
height: var(--content-height, auto);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
244
src/routes/Commits.svelte
Normal file
244
src/routes/Commits.svelte
Normal file
@@ -0,0 +1,244 @@
|
||||
<script lang="ts">
|
||||
import { tick } from 'svelte';
|
||||
|
||||
import type { GitCommit } from './types';
|
||||
|
||||
let { items }: { items: GitCommit[] } = $props();
|
||||
|
||||
let containerElement = $state<HTMLDivElement>();
|
||||
let listElement = $state<HTMLDivElement>();
|
||||
|
||||
let graphHeight = $state(0);
|
||||
let nodePositions = $state<{ x: number; y: number }[]>([]);
|
||||
|
||||
// Render commits until the available height is filled. The last row may be clipped.
|
||||
let visibleCount = $state(0);
|
||||
let measurementVersion = 0;
|
||||
|
||||
const visibleItems = $derived(items.slice(0, visibleCount));
|
||||
|
||||
async function fitVisibleItems() {
|
||||
const version = ++measurementVersion;
|
||||
const allItems = items;
|
||||
const list = listElement;
|
||||
const parent = containerElement?.parentElement;
|
||||
|
||||
if (!list || !parent) return;
|
||||
|
||||
// Render every commit first so each row's full height can be measured.
|
||||
visibleCount = allItems.length;
|
||||
await tick();
|
||||
|
||||
if (version !== measurementVersion) return;
|
||||
|
||||
const rows = Array.from(list.children) as HTMLElement[];
|
||||
|
||||
if (rows.length !== allItems.length) return;
|
||||
|
||||
const available = parent.getBoundingClientRect().bottom - list.getBoundingClientRect().top;
|
||||
|
||||
let used = 0;
|
||||
let fit = 0;
|
||||
|
||||
for (const row of rows) {
|
||||
if (used >= available) break;
|
||||
|
||||
used += row.getBoundingClientRect().height;
|
||||
fit += 1;
|
||||
}
|
||||
|
||||
if (version !== measurementVersion) return;
|
||||
|
||||
visibleCount = fit;
|
||||
}
|
||||
|
||||
// Re-measure whenever the items or the available space change.
|
||||
$effect(() => {
|
||||
void items;
|
||||
|
||||
const parent = containerElement?.parentElement;
|
||||
if (!parent) return;
|
||||
|
||||
void fitVisibleItems();
|
||||
|
||||
let frame = 0;
|
||||
|
||||
function schedule() {
|
||||
cancelAnimationFrame(frame);
|
||||
frame = requestAnimationFrame(() => void fitVisibleItems());
|
||||
}
|
||||
|
||||
const observer = new ResizeObserver(schedule);
|
||||
observer.observe(parent);
|
||||
|
||||
window.addEventListener('resize', schedule);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
window.removeEventListener('resize', schedule);
|
||||
cancelAnimationFrame(frame);
|
||||
};
|
||||
});
|
||||
|
||||
// Measure the actual centre of every visible article card.
|
||||
$effect(() => {
|
||||
const currentItems = visibleItems;
|
||||
const container = containerElement;
|
||||
const list = listElement;
|
||||
|
||||
if (!container || !list) return;
|
||||
|
||||
const containerEl: HTMLDivElement = container;
|
||||
const listEl: HTMLDivElement = list;
|
||||
|
||||
function updatePositions() {
|
||||
const rows = Array.from(listEl.children) as HTMLElement[];
|
||||
|
||||
if (rows.length !== currentItems.length) return;
|
||||
|
||||
const containerRect = containerEl.getBoundingClientRect();
|
||||
const listRect = listEl.getBoundingClientRect();
|
||||
|
||||
nodePositions = rows.map((row) => {
|
||||
const card = row.children[1] as HTMLElement;
|
||||
const rect = card.getBoundingClientRect();
|
||||
|
||||
return {
|
||||
x: 10,
|
||||
y: rect.top - containerRect.top + rect.height / 2
|
||||
};
|
||||
});
|
||||
|
||||
// Measure the list instead of the container: the absolutely positioned SVG
|
||||
// is part of the container's scroll height, which would make graphHeight
|
||||
// grow and never shrink again when the viewport widens.
|
||||
graphHeight = listRect.bottom - containerRect.top;
|
||||
}
|
||||
|
||||
// Initial measurement.
|
||||
updatePositions();
|
||||
|
||||
// Watch for changes in card or container dimensions.
|
||||
const observer = new ResizeObserver(updatePositions);
|
||||
|
||||
observer.observe(containerEl);
|
||||
observer.observe(listEl);
|
||||
|
||||
// Also handle viewport changes.
|
||||
window.addEventListener('resize', updatePositions);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
window.removeEventListener('resize', updatePositions);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<div bind:this={containerElement} class="relative mt-1">
|
||||
<!-- SVG timeline overlay -->
|
||||
<svg
|
||||
class="pointer-events-none absolute top-0 left-0 z-0 overflow-visible"
|
||||
width="10"
|
||||
height={graphHeight}
|
||||
viewBox={`0 0 10 ${graphHeight}`}
|
||||
>
|
||||
<!-- Connecting lines -->
|
||||
{#each nodePositions as node, index}
|
||||
{#if nodePositions[index + 1]}
|
||||
<line
|
||||
x1={node.x}
|
||||
y1={node.y}
|
||||
x2={nodePositions[index + 1].x}
|
||||
y2={nodePositions[index + 1].y}
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-dasharray={visibleItems[index + 1]?.parentRepo != visibleItems[index]?.parentRepo
|
||||
? '5,4'
|
||||
: '0'}
|
||||
class={visibleItems[index + 1]?.parentRepo == visibleItems[index]?.parentRepo
|
||||
? 'text-ctp-green'
|
||||
: 'text-ctp-surface2'}
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
<!-- Commit nodes -->
|
||||
{#each nodePositions as node}
|
||||
<circle
|
||||
cx={node.x}
|
||||
cy={node.y}
|
||||
r="7"
|
||||
fill="#313244"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
class="text-ctp-green"
|
||||
/>
|
||||
{/each}
|
||||
</svg>
|
||||
|
||||
<div bind:this={listElement} class="mr-3 grid grid-flow-row auto-rows-min">
|
||||
{#each visibleItems as commit, index (commit.hash)}
|
||||
<div class="relative z-10 grid grid-cols-[1.25rem_minmax(0,1fr)] gap-x-3.5 gap-y-2 pb-2">
|
||||
<!-- Timeline space -->
|
||||
<div></div>
|
||||
|
||||
<div class="min-w-0">
|
||||
<div class="block">
|
||||
{#if visibleItems[index - 1]?.parentRepo != commit.parentRepo}
|
||||
<p>
|
||||
<span class="text-ctp-red">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
height="20px"
|
||||
width="20px"
|
||||
class="mr-1 inline-flex items-center whitespace-nowrap"
|
||||
fill="var(--ctp-peach)"
|
||||
><path
|
||||
d="M16.18,13H4V11H16.18l-5.6-5.6L12,4l8,8l-8,8l-1.42-1.4l5.6-5.6Z"
|
||||
/></svg
|
||||
><a
|
||||
class="hover:font-medium hover:underline"
|
||||
href={'https://git.voidarc.co.uk/' + commit.user}>{commit.user}</a
|
||||
></span
|
||||
>
|
||||
on
|
||||
<a href={'https://git.voidarc.co.uk/' + commit.parentRepo} class="group">
|
||||
<span class="text-ctp-mauve group-hover:font-medium group-hover:underline"
|
||||
>{commit.parentRepo}</span
|
||||
><span class="text-ctp-yellow group-hover:font-medium group-hover:underline"
|
||||
>@</span
|
||||
><span class="text-ctp-green group-hover:font-medium group-hover:underline"
|
||||
>{commit.parentBranch}</span
|
||||
>
|
||||
</a>
|
||||
</p>
|
||||
{/if}
|
||||
<a href={commit.url} style="cursor: pointer;" class="group flex justify-items-stretch">
|
||||
<p
|
||||
class="rounded-md bg-ctp-surface2 px-1 group-hover:font-bold group-hover:text-ctp-mauve group-hover:underline"
|
||||
>
|
||||
{commit.shortHash}
|
||||
</p>
|
||||
<p class="ml-2 line-clamp-1 min-w-0 group-hover:font-semibold">{commit.message}</p>
|
||||
<div class="flex flex-1 flex-row">
|
||||
<!-- spacer -->
|
||||
<div class="flex-1"></div>
|
||||
|
||||
<div class="mx-1 mr-2 flex flex-row font-bold text-ctp-mantle">
|
||||
{#if commit.diff.deletions > 0}
|
||||
<div class="rounded-l-lg bg-ctp-green px-1">+{commit.diff.additions}</div>
|
||||
<div class="rounded-r-lg bg-ctp-red px-1">-{commit.diff.deletions}</div>
|
||||
{:else}
|
||||
<div class="rounded-lg bg-ctp-green px-1">+{commit.diff.additions}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,6 +4,7 @@
|
||||
let { items }: { items: ContentItem[] } = $props();
|
||||
|
||||
let containerElement: HTMLDivElement;
|
||||
let listElement = $state<HTMLDivElement>();
|
||||
let cardElements = $state<HTMLElement[]>([]);
|
||||
|
||||
let graphHeight = $state(0);
|
||||
@@ -14,11 +15,15 @@
|
||||
const currentItems = items;
|
||||
const cards = cardElements.filter(Boolean);
|
||||
const container = containerElement;
|
||||
const list = listElement;
|
||||
|
||||
if (!container || cards.length !== currentItems.length) return;
|
||||
if (!container || !list || cards.length !== currentItems.length) return;
|
||||
|
||||
const listEl: HTMLDivElement = list;
|
||||
|
||||
function updatePositions() {
|
||||
const containerRect = container.getBoundingClientRect();
|
||||
const listRect = listEl.getBoundingClientRect();
|
||||
|
||||
nodePositions = cards.map((card) => {
|
||||
const rect = card.getBoundingClientRect();
|
||||
@@ -29,7 +34,10 @@
|
||||
};
|
||||
});
|
||||
|
||||
graphHeight = container.scrollHeight;
|
||||
// Measure the list instead of the container: the absolutely positioned SVG
|
||||
// is part of the container's scroll height, which would make graphHeight
|
||||
// grow and never shrink again when the viewport widens.
|
||||
graphHeight = listRect.bottom - containerRect.top;
|
||||
}
|
||||
|
||||
// Initial measurement.
|
||||
@@ -54,7 +62,7 @@
|
||||
<div bind:this={containerElement} class="relative mt-1">
|
||||
<!-- SVG timeline overlay -->
|
||||
<svg
|
||||
class="pointer-events-none absolute top-0 left-0 z-0 overflow-visible"
|
||||
class="pointer-events-none absolute top-0 left-0 z-0 overflow-visible max-[600px]:-left-1"
|
||||
width="32"
|
||||
height={graphHeight}
|
||||
viewBox={`0 0 32 ${graphHeight}`}
|
||||
@@ -90,9 +98,11 @@
|
||||
</svg>
|
||||
|
||||
<!-- Article list -->
|
||||
<div class="mt-3 mr-4 grid grid-flow-row auto-rows-min">
|
||||
<div bind:this={listElement} class="mt-3 mr-4 grid grid-flow-row auto-rows-min">
|
||||
{#each items as item, index (item.link)}
|
||||
<div class="relative z-10 grid grid-cols-[2rem_minmax(0,1fr)] gap-4 pb-3">
|
||||
<div
|
||||
class="relative z-10 grid grid-cols-[2rem_minmax(0,1fr)] gap-4 pb-3 max-[600px]:grid-cols-[1.25rem_minmax(0,1fr)] max-[600px]:gap-2"
|
||||
>
|
||||
<!-- Timeline space -->
|
||||
<div></div>
|
||||
|
||||
@@ -100,18 +110,34 @@
|
||||
<div bind:this={cardElements[index]} class="min-w-0">
|
||||
<a
|
||||
href={item.link}
|
||||
style:--container-color={item.type == 0 ? 'var(--ctp-red)' : 'var(--ctp-lavender)'}
|
||||
class="group dynamic-container flex bg-ctp-surface1 p-3 pl-2"
|
||||
style:--container-color={item.type == 0
|
||||
? 'var(--ctp-red)'
|
||||
: item.type == 2
|
||||
? 'var(--ctp-pink)'
|
||||
: 'var(--ctp-lavender)'}
|
||||
class="group dynamic-container flex bg-ctp-surface1 p-3 pl-2 max-[600px]:flex-col"
|
||||
>
|
||||
{#if item.image}
|
||||
<div class="mr-2 flex aspect-16/9 max-w-40 min-w-40 items-center">
|
||||
<div
|
||||
class="mr-2 flex aspect-16/9 max-w-40 min-w-40 items-center max-[600px]:mr-0 max-[600px]:mb-2 max-[600px]:w-full max-[600px]:max-w-none max-[600px]:min-w-0"
|
||||
>
|
||||
<img src={item.image} class="aspect-16/9" alt="" />
|
||||
</div>
|
||||
{/if}
|
||||
<div style:padding-left={!item.image ? '4px' : 0}>
|
||||
<p class="font-medium group-hover:text-ctp-mauve group-hover:underline">
|
||||
{item.title}
|
||||
</p>
|
||||
<div class="min-w-0" style:padding-left={!item.image ? '4px' : 0}>
|
||||
{#if item.type == 2}
|
||||
<p
|
||||
class="line-clamp-3 font-medium italic group-hover:text-ctp-mauve group-hover:underline"
|
||||
>
|
||||
{item.title}
|
||||
</p>
|
||||
{:else}
|
||||
<p
|
||||
class="line-clamp-2 font-medium group-hover:text-ctp-mauve group-hover:underline"
|
||||
>
|
||||
{item.title}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
{#if item.description != item.title}
|
||||
<p class="text-muted-foreground mt-1 line-clamp-2 text-sm">
|
||||
|
||||
@@ -4,110 +4,219 @@
|
||||
@import '@catppuccin/tailwindcss/mocha.css';
|
||||
|
||||
:root {
|
||||
--ctp-rosewater: #f5e0dc;
|
||||
--ctp-rosewater-rgb: 245 224 220;
|
||||
--ctp-rosewater-hsl: 9.6 55.556% 91.176%;
|
||||
--ctp-rosewater-oklch: 0.9226 0.0238 30.4919;
|
||||
--ctp-flamingo: #f2cdcd;
|
||||
--ctp-flamingo-rgb: 242 205 205;
|
||||
--ctp-flamingo-hsl: 0 58.73% 87.647%;
|
||||
--ctp-flamingo-oklch: 0.8797 0.0418 17.975;
|
||||
--ctp-pink: #f5c2e7;
|
||||
--ctp-pink-rgb: 245 194 231;
|
||||
--ctp-pink-hsl: 316.471 71.831% 86.078%;
|
||||
--ctp-pink-oklch: 0.87 0.0752 336.3041;
|
||||
--ctp-mauve: #cba6f7;
|
||||
--ctp-mauve-rgb: 203 166 247;
|
||||
--ctp-mauve-hsl: 267.407 83.505% 80.98%;
|
||||
--ctp-mauve-oklch: 0.7871 0.1187 304.7693;
|
||||
--ctp-red: #f38ba8;
|
||||
--ctp-red-rgb: 243 139 168;
|
||||
--ctp-red-hsl: 343.269 81.25% 74.902%;
|
||||
--ctp-red-oklch: 0.7556 0.1297 2.7642;
|
||||
--ctp-maroon: #eba0ac;
|
||||
--ctp-maroon-rgb: 235 160 172;
|
||||
--ctp-maroon-hsl: 350.4 65.217% 77.451%;
|
||||
--ctp-maroon-oklch: 0.7821 0.0903 8.8482;
|
||||
--ctp-peach: #fab387;
|
||||
--ctp-peach-rgb: 250 179 135;
|
||||
--ctp-peach-hsl: 22.957 92% 75.49%;
|
||||
--ctp-peach-oklch: 0.8237 0.1015 52.6294;
|
||||
--ctp-yellow: #f9e2af;
|
||||
--ctp-yellow-rgb: 249 226 175;
|
||||
--ctp-yellow-hsl: 41.351 86.047% 83.137%;
|
||||
--ctp-yellow-oklch: 0.9193 0.0704 86.5281;
|
||||
--ctp-green: #a6e3a1;
|
||||
--ctp-green-rgb: 166 227 161;
|
||||
--ctp-green-hsl: 115.455 54.098% 76.078%;
|
||||
--ctp-green-oklch: 0.8577 0.1092 142.7153;
|
||||
--ctp-teal: #94e2d5;
|
||||
--ctp-teal-rgb: 148 226 213;
|
||||
--ctp-teal-hsl: 170 57.353% 73.333%;
|
||||
--ctp-teal-oklch: 0.8585 0.0792 182.7495;
|
||||
--ctp-sky: #89dceb;
|
||||
--ctp-sky-rgb: 137 220 235;
|
||||
--ctp-sky-hsl: 189.184 71.014% 72.941%;
|
||||
--ctp-sky-oklch: 0.8467 0.0833 210.2545;
|
||||
--ctp-sapphire: #74c7ec;
|
||||
--ctp-sapphire-rgb: 116 199 236;
|
||||
--ctp-sapphire-hsl: 198.5 75.949% 69.02%;
|
||||
--ctp-sapphire-oklch: 0.7906 0.0965 228.6527;
|
||||
--ctp-blue: #89b4fa;
|
||||
--ctp-blue-rgb: 137 180 250;
|
||||
--ctp-blue-hsl: 217.168 91.87% 75.882%;
|
||||
--ctp-blue-oklch: 0.7664 0.1113 259.885;
|
||||
--ctp-lavender: #b4befe;
|
||||
--ctp-lavender-rgb: 180 190 254;
|
||||
--ctp-lavender-hsl: 231.892 97.368% 85.098%;
|
||||
--ctp-lavender-oklch: 0.8166 0.091 277.3092;
|
||||
--ctp-text: #cdd6f4;
|
||||
--ctp-text-rgb: 205 214 244;
|
||||
--ctp-text-hsl: 226.154 63.934% 88.039%;
|
||||
--ctp-text-oklch: 0.8787 0.0426 272.2767;
|
||||
--ctp-subtext1: #bac2de;
|
||||
--ctp-subtext1-rgb: 186 194 222;
|
||||
--ctp-subtext1-hsl: 226.667 35.294% 80%;
|
||||
--ctp-subtext1-oklch: 0.8168 0.0403 272.8622;
|
||||
--ctp-subtext0: #a6adc8;
|
||||
--ctp-subtext0-rgb: 166 173 200;
|
||||
--ctp-subtext0-hsl: 227.647 23.611% 71.765%;
|
||||
--ctp-subtext0-oklch: 0.751 0.0396 273.932;
|
||||
--ctp-overlay2: #9399b2;
|
||||
--ctp-overlay2-rgb: 147 153 178;
|
||||
--ctp-overlay2-hsl: 228.387 16.757% 63.725%;
|
||||
--ctp-overlay2-oklch: 0.6865 0.0374 274.7253;
|
||||
--ctp-overlay1: #7f849c;
|
||||
--ctp-overlay1-rgb: 127 132 156;
|
||||
--ctp-overlay1-hsl: 229.655 12.775% 55.49%;
|
||||
--ctp-overlay1-oklch: 0.6176 0.0367 276.0047;
|
||||
--ctp-overlay0: #6c7086;
|
||||
--ctp-overlay0-rgb: 108 112 134;
|
||||
--ctp-overlay0-hsl: 230.769 10.744% 47.451%;
|
||||
--ctp-overlay0-oklch: 0.5497 0.0345 277.0951;
|
||||
--ctp-surface2: #585b70;
|
||||
--ctp-surface2-rgb: 88 91 112;
|
||||
--ctp-surface2-hsl: 232.5 12% 39.216%;
|
||||
--ctp-surface2-oklch: 0.4765 0.034 278.643;
|
||||
--ctp-surface1: #45475a;
|
||||
--ctp-surface1-rgb: 69 71 90;
|
||||
--ctp-surface1-hsl: 234.286 13.208% 31.176%;
|
||||
--ctp-surface1-oklch: 0.4037 0.032 280.152;
|
||||
--ctp-surface0: #313244;
|
||||
--ctp-surface0-rgb: 49 50 68;
|
||||
--ctp-surface0-hsl: 236.842 16.239% 22.941%;
|
||||
--ctp-surface0-oklch: 0.324 0.0319 281.9784;
|
||||
--ctp-base: #1e1e2e;
|
||||
--ctp-base-rgb: 30 30 46;
|
||||
--ctp-base-hsl: 240 21.053% 14.902%;
|
||||
--ctp-base-oklch: 0.2429 0.0304 283.911;
|
||||
--ctp-mantle: #181825;
|
||||
--ctp-mantle-rgb: 24 24 37;
|
||||
--ctp-mantle-hsl: 240 21.311% 11.961%;
|
||||
--ctp-mantle-oklch: 0.2155 0.0254 284.0647;
|
||||
--ctp-crust: #11111b;
|
||||
--ctp-crust-rgb: 17 17 27;
|
||||
--ctp-crust-hsl: 240 22.727% 8.627%;
|
||||
--ctp-crust-oklch: 0.1828 0.0204 284.2038;
|
||||
--ctp-rosewater: #dc8a78;
|
||||
--ctp-rosewater-rgb: 220 138 120;
|
||||
--ctp-rosewater-hsl: 10.8 58.824% 66.667%;
|
||||
--ctp-rosewater-oklch: 0.7141 0.1045 33.0967;
|
||||
--ctp-flamingo: #dd7878;
|
||||
--ctp-flamingo-rgb: 221 120 120;
|
||||
--ctp-flamingo-hsl: 0 59.763% 66.863%;
|
||||
--ctp-flamingo-oklch: 0.6856 0.1259 20.867;
|
||||
--ctp-pink: #ea76cb;
|
||||
--ctp-pink-rgb: 234 118 203;
|
||||
--ctp-pink-hsl: 316.034 73.418% 69.02%;
|
||||
--ctp-pink-oklch: 0.7256 0.1739 338.4333;
|
||||
--ctp-mauve: #8839ef;
|
||||
--ctp-mauve-rgb: 136 57 239;
|
||||
--ctp-mauve-hsl: 266.044 85.047% 58.039%;
|
||||
--ctp-mauve-oklch: 0.5547 0.2503 297.0156;
|
||||
--ctp-red: #d20f39;
|
||||
--ctp-red-rgb: 210 15 57;
|
||||
--ctp-red-hsl: 347.077 86.667% 44.118%;
|
||||
--ctp-red-oklch: 0.5505 0.2155 19.8095;
|
||||
--ctp-maroon: #e64553;
|
||||
--ctp-maroon-rgb: 230 69 83;
|
||||
--ctp-maroon-hsl: 354.783 76.303% 58.627%;
|
||||
--ctp-maroon-oklch: 0.6252 0.1967 20.2724;
|
||||
--ctp-peach: #fe640b;
|
||||
--ctp-peach-rgb: 254 100 11;
|
||||
--ctp-peach-hsl: 21.975 99.184% 51.961%;
|
||||
--ctp-peach-oklch: 0.692 0.2041 42.4293;
|
||||
--ctp-yellow: #df8e1d;
|
||||
--ctp-yellow-rgb: 223 142 29;
|
||||
--ctp-yellow-hsl: 34.948 76.984% 49.412%;
|
||||
--ctp-yellow-oklch: 0.714 0.1494 67.7767;
|
||||
--ctp-green: #40a02b;
|
||||
--ctp-green-rgb: 64 160 43;
|
||||
--ctp-green-hsl: 109.231 57.635% 39.804%;
|
||||
--ctp-green-oklch: 0.625 0.1772 140.4448;
|
||||
--ctp-teal: #179299;
|
||||
--ctp-teal-rgb: 23 146 153;
|
||||
--ctp-teal-hsl: 183.231 73.864% 34.51%;
|
||||
--ctp-teal-oklch: 0.6023 0.0981 201.1047;
|
||||
--ctp-sky: #04a5e5;
|
||||
--ctp-sky-rgb: 4 165 229;
|
||||
--ctp-sky-hsl: 197.067 96.567% 45.686%;
|
||||
--ctp-sky-oklch: 0.682 0.1448 235.3822;
|
||||
--ctp-sapphire: #209fb5;
|
||||
--ctp-sapphire-rgb: 32 159 181;
|
||||
--ctp-sapphire-hsl: 188.859 69.953% 41.765%;
|
||||
--ctp-sapphire-oklch: 0.6477 0.1068 212.8893;
|
||||
--ctp-blue: #1e66f5;
|
||||
--ctp-blue-rgb: 30 102 245;
|
||||
--ctp-blue-hsl: 219.907 91.489% 53.922%;
|
||||
--ctp-blue-oklch: 0.5586 0.2255 262.0867;
|
||||
--ctp-lavender: #7287fd;
|
||||
--ctp-lavender-rgb: 114 135 253;
|
||||
--ctp-lavender-hsl: 230.935 97.203% 71.961%;
|
||||
--ctp-lavender-oklch: 0.6638 0.1751 273.1346;
|
||||
--ctp-text: #4c4f69;
|
||||
--ctp-text-rgb: 76 79 105;
|
||||
--ctp-text-hsl: 233.793 16.022% 35.49%;
|
||||
--ctp-text-oklch: 0.4355 0.043 279.325;
|
||||
--ctp-subtext1: #5c5f77;
|
||||
--ctp-subtext1-rgb: 92 95 119;
|
||||
--ctp-subtext1-hsl: 233.333 12.796% 41.373%;
|
||||
--ctp-subtext1-oklch: 0.492 0.0385 279.2992;
|
||||
--ctp-subtext0: #6c6f85;
|
||||
--ctp-subtext0-rgb: 108 111 133;
|
||||
--ctp-subtext0-hsl: 232.8 10.373% 47.255%;
|
||||
--ctp-subtext0-oklch: 0.5471 0.0343 279.0837;
|
||||
--ctp-overlay2: #7c7f93;
|
||||
--ctp-overlay2-rgb: 124 127 147;
|
||||
--ctp-overlay2-hsl: 232.174 9.623% 53.137%;
|
||||
--ctp-overlay2-oklch: 0.6009 0.0305 278.6944;
|
||||
--ctp-overlay1: #8c8fa1;
|
||||
--ctp-overlay1-rgb: 140 143 161;
|
||||
--ctp-overlay1-hsl: 231.429 10.048% 59.02%;
|
||||
--ctp-overlay1-oklch: 0.6536 0.0269 278.1208;
|
||||
--ctp-overlay0: #9ca0b0;
|
||||
--ctp-overlay0-rgb: 156 160 176;
|
||||
--ctp-overlay0-hsl: 228 11.236% 65.098%;
|
||||
--ctp-overlay0-oklch: 0.7077 0.0237 274.6008;
|
||||
--ctp-surface2: #acb0be;
|
||||
--ctp-surface2-rgb: 172 176 190;
|
||||
--ctp-surface2-hsl: 226.667 12.162% 70.98%;
|
||||
--ctp-surface2-oklch: 0.7584 0.0205 273.1536;
|
||||
--ctp-surface1: #bcc0cc;
|
||||
--ctp-surface1-rgb: 188 192 204;
|
||||
--ctp-surface1-hsl: 225 13.559% 76.863%;
|
||||
--ctp-surface1-oklch: 0.8083 0.0174 271.1982;
|
||||
--ctp-surface0: #ccd0da;
|
||||
--ctp-surface0-rgb: 204 208 218;
|
||||
--ctp-surface0-hsl: 222.857 15.909% 82.745%;
|
||||
--ctp-surface0-oklch: 0.8575 0.0145 268.4756;
|
||||
--ctp-base: #eff1f5;
|
||||
--ctp-base-rgb: 239 241 245;
|
||||
--ctp-base-hsl: 220 23.077% 94.902%;
|
||||
--ctp-base-oklch: 0.9578 0.0058 264.5322;
|
||||
--ctp-mantle: #e6e9ef;
|
||||
--ctp-mantle-rgb: 230 233 239;
|
||||
--ctp-mantle-hsl: 220 21.951% 91.961%;
|
||||
--ctp-mantle-oklch: 0.9335 0.0087 264.5206;
|
||||
--ctp-crust: #dce0e8;
|
||||
--ctp-crust-rgb: 220 224 232;
|
||||
--ctp-crust-hsl: 220 20.69% 88.627%;
|
||||
--ctp-crust-oklch: 0.906 0.0117 264.5071;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--ctp-rosewater: #f5e0dc;
|
||||
--ctp-rosewater-rgb: 245 224 220;
|
||||
--ctp-rosewater-hsl: 9.6 55.556% 91.176%;
|
||||
--ctp-rosewater-oklch: 0.9226 0.0238 30.4919;
|
||||
--ctp-flamingo: #f2cdcd;
|
||||
--ctp-flamingo-rgb: 242 205 205;
|
||||
--ctp-flamingo-hsl: 0 58.73% 87.647%;
|
||||
--ctp-flamingo-oklch: 0.8797 0.0418 17.975;
|
||||
--ctp-pink: #f5c2e7;
|
||||
--ctp-pink-rgb: 245 194 231;
|
||||
--ctp-pink-hsl: 316.471 71.831% 86.078%;
|
||||
--ctp-pink-oklch: 0.87 0.0752 336.3041;
|
||||
--ctp-mauve: #cba6f7;
|
||||
--ctp-mauve-rgb: 203 166 247;
|
||||
--ctp-mauve-hsl: 267.407 83.505% 80.98%;
|
||||
--ctp-mauve-oklch: 0.7871 0.1187 304.7693;
|
||||
--ctp-red: #f38ba8;
|
||||
--ctp-red-rgb: 243 139 168;
|
||||
--ctp-red-hsl: 343.269 81.25% 74.902%;
|
||||
--ctp-red-oklch: 0.7556 0.1297 2.7642;
|
||||
--ctp-maroon: #eba0ac;
|
||||
--ctp-maroon-rgb: 235 160 172;
|
||||
--ctp-maroon-hsl: 350.4 65.217% 77.451%;
|
||||
--ctp-maroon-oklch: 0.7821 0.0903 8.8482;
|
||||
--ctp-peach: #fab387;
|
||||
--ctp-peach-rgb: 250 179 135;
|
||||
--ctp-peach-hsl: 22.957 92% 75.49%;
|
||||
--ctp-peach-oklch: 0.8237 0.1015 52.6294;
|
||||
--ctp-yellow: #f9e2af;
|
||||
--ctp-yellow-rgb: 249 226 175;
|
||||
--ctp-yellow-hsl: 41.351 86.047% 83.137%;
|
||||
--ctp-yellow-oklch: 0.9193 0.0704 86.5281;
|
||||
--ctp-green: #a6e3a1;
|
||||
--ctp-green-rgb: 166 227 161;
|
||||
--ctp-green-hsl: 115.455 54.098% 76.078%;
|
||||
--ctp-green-oklch: 0.8577 0.1092 142.7153;
|
||||
--ctp-teal: #94e2d5;
|
||||
--ctp-teal-rgb: 148 226 213;
|
||||
--ctp-teal-hsl: 170 57.353% 73.333%;
|
||||
--ctp-teal-oklch: 0.8585 0.0792 182.7495;
|
||||
--ctp-sky: #89dceb;
|
||||
--ctp-sky-rgb: 137 220 235;
|
||||
--ctp-sky-hsl: 189.184 71.014% 72.941%;
|
||||
--ctp-sky-oklch: 0.8467 0.0833 210.2545;
|
||||
--ctp-sapphire: #74c7ec;
|
||||
--ctp-sapphire-rgb: 116 199 236;
|
||||
--ctp-sapphire-hsl: 198.5 75.949% 69.02%;
|
||||
--ctp-sapphire-oklch: 0.7906 0.0965 228.6527;
|
||||
--ctp-blue: #89b4fa;
|
||||
--ctp-blue-rgb: 137 180 250;
|
||||
--ctp-blue-hsl: 217.168 91.87% 75.882%;
|
||||
--ctp-blue-oklch: 0.7664 0.1113 259.885;
|
||||
--ctp-lavender: #b4befe;
|
||||
--ctp-lavender-rgb: 180 190 254;
|
||||
--ctp-lavender-hsl: 231.892 97.368% 85.098%;
|
||||
--ctp-lavender-oklch: 0.8166 0.091 277.3092;
|
||||
--ctp-text: #cdd6f4;
|
||||
--ctp-text-rgb: 205 214 244;
|
||||
--ctp-text-hsl: 226.154 63.934% 88.039%;
|
||||
--ctp-text-oklch: 0.8787 0.0426 272.2767;
|
||||
--ctp-subtext1: #bac2de;
|
||||
--ctp-subtext1-rgb: 186 194 222;
|
||||
--ctp-subtext1-hsl: 226.667 35.294% 80%;
|
||||
--ctp-subtext1-oklch: 0.8168 0.0403 272.8622;
|
||||
--ctp-subtext0: #a6adc8;
|
||||
--ctp-subtext0-rgb: 166 173 200;
|
||||
--ctp-subtext0-hsl: 227.647 23.611% 71.765%;
|
||||
--ctp-subtext0-oklch: 0.751 0.0396 273.932;
|
||||
--ctp-overlay2: #9399b2;
|
||||
--ctp-overlay2-rgb: 147 153 178;
|
||||
--ctp-overlay2-hsl: 228.387 16.757% 63.725%;
|
||||
--ctp-overlay2-oklch: 0.6865 0.0374 274.7253;
|
||||
--ctp-overlay1: #7f849c;
|
||||
--ctp-overlay1-rgb: 127 132 156;
|
||||
--ctp-overlay1-hsl: 229.655 12.775% 55.49%;
|
||||
--ctp-overlay1-oklch: 0.6176 0.0367 276.0047;
|
||||
--ctp-overlay0: #6c7086;
|
||||
--ctp-overlay0-rgb: 108 112 134;
|
||||
--ctp-overlay0-hsl: 230.769 10.744% 47.451%;
|
||||
--ctp-overlay0-oklch: 0.5497 0.0345 277.0951;
|
||||
--ctp-surface2: #585b70;
|
||||
--ctp-surface2-rgb: 88 91 112;
|
||||
--ctp-surface2-hsl: 232.5 12% 39.216%;
|
||||
--ctp-surface2-oklch: 0.4765 0.034 278.643;
|
||||
--ctp-surface1: #45475a;
|
||||
--ctp-surface1-rgb: 69 71 90;
|
||||
--ctp-surface1-hsl: 234.286 13.208% 31.176%;
|
||||
--ctp-surface1-oklch: 0.4037 0.032 280.152;
|
||||
--ctp-surface0: #313244;
|
||||
--ctp-surface0-rgb: 49 50 68;
|
||||
--ctp-surface0-hsl: 236.842 16.239% 22.941%;
|
||||
--ctp-surface0-oklch: 0.324 0.0319 281.9784;
|
||||
--ctp-base: #1e1e2e;
|
||||
--ctp-base-rgb: 30 30 46;
|
||||
--ctp-base-hsl: 240 21.053% 14.902%;
|
||||
--ctp-base-oklch: 0.2429 0.0304 283.911;
|
||||
--ctp-mantle: #181825;
|
||||
--ctp-mantle-rgb: 24 24 37;
|
||||
--ctp-mantle-hsl: 240 21.311% 11.961%;
|
||||
--ctp-mantle-oklch: 0.2155 0.0254 284.0647;
|
||||
--ctp-crust: #11111b;
|
||||
--ctp-crust-rgb: 17 17 27;
|
||||
--ctp-crust-hsl: 240 22.727% 8.627%;
|
||||
--ctp-crust-oklch: 0.1828 0.0204 284.2038;
|
||||
}
|
||||
}
|
||||
|
||||
* {
|
||||
@@ -141,6 +250,36 @@
|
||||
aspect-ratio: 20/5;
|
||||
}
|
||||
|
||||
@media (max-width: 899.98px) {
|
||||
/* Let the boxes size to their content instead of the wide-screen 20/5 ratio. */
|
||||
.sub-container {
|
||||
aspect-ratio: auto;
|
||||
}
|
||||
|
||||
.sub-container img {
|
||||
height: auto;
|
||||
max-height: 5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* On phone-sized screens the boxes are narrow, so give the text more room. */
|
||||
@media (max-width: 499.98px) {
|
||||
.sub-container img {
|
||||
height: auto;
|
||||
max-height: 4rem;
|
||||
}
|
||||
|
||||
.sub-container .fira-mono-medium {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
|
||||
.sub-container .fira-mono-bold {
|
||||
font-size: 1.125rem;
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.dynamic-container {
|
||||
--container-color: var(--ctp-lavender);
|
||||
border-left: 5px solid var(--container-color);
|
||||
@@ -155,6 +294,13 @@
|
||||
border-left: 10px solid var(--ctp-surface2);
|
||||
}
|
||||
|
||||
/* Remove the description's left border on smaller screens. */
|
||||
@media (max-width: 899.98px) {
|
||||
#description-block {
|
||||
border-left: none;
|
||||
}
|
||||
}
|
||||
|
||||
#music-title-block {
|
||||
border-left: 4px solid var(--ctp-overlay1);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import adapter from '@sveltejs/adapter-auto';
|
||||
import adapter from '@sveltejs/adapter-bun';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
@@ -12,10 +12,6 @@ export default defineConfig({
|
||||
runes: ({ filename }) =>
|
||||
filename.split(/[/\\]/).includes('node_modules') ? undefined : true
|
||||
},
|
||||
|
||||
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
||||
adapter: adapter()
|
||||
})
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user