oops went on a massive code sesh and theres like a whole website now

This commit is contained in:
2026-11-03 19:01:41 +00:00
parent e4e28174bf
commit 7e8f329109
27 changed files with 492 additions and 102 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ devenv.local.yaml
# pre-commit
.pre-commit-config.yaml
/.env

View File

@@ -4,25 +4,24 @@ let v:this_session=expand("<sfile>:p")
doautoall SessionLoadPre
silent only
silent tabonly
cd ~/Projects/homepage
cd ~/Projects/voidarc-homepage
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
set shortmess+=aoO
badd +1 Syntax\ tree\ for\ src/routes/+layout.svelte
badd +114 src/routes/layout.css
badd +9 src/app.html
badd +3 src/routes/+page.svelte
badd +17 .prettierrc
badd +12 tsconfig.json
badd +4 src/routes/+layout.svelte
badd +52 health://
badd +24 .nvim.lua
badd +1 svelte.config.js
badd +8 src/env.ts
badd +1 src/lib/server/jellyfin.ts
badd +6 src/routes/+page.server.ts
badd +15 vite.config.ts
badd +61 src/routes/+page.svelte
badd +5 src/routes/artwork/\[itemId]/+server.ts
badd +165 src/routes/layout.css
argglobal
%argdel
$argadd src/routes/layout.css
edit src/routes/layout.css
$argadd src/routes/+page.server.ts
edit src/routes/+page.svelte
let s:save_splitbelow = &splitbelow
let s:save_splitright = &splitright
set splitbelow splitright
@@ -39,10 +38,10 @@ set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe 'vert 1resize ' . ((&columns * 77 + 77) / 155)
exe 'vert 2resize ' . ((&columns * 77 + 77) / 155)
exe 'vert 1resize ' . ((&columns * 103 + 104) / 208)
exe 'vert 2resize ' . ((&columns * 104 + 104) / 208)
argglobal
balt src/routes/+page.svelte
balt src/routes/layout.css
setlocal foldmethod=manual
setlocal foldexpr=0
setlocal foldmarker={{{,}}}
@@ -53,17 +52,17 @@ setlocal foldnestmax=20
setlocal foldenable
silent! normal! zE
let &fdl = &fdl
let s:l = 120 - ((24 * winheight(0) + 22) / 44)
let s:l = 36 - ((29 * winheight(0) + 27) / 54)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 120
normal! 0
keepjumps 36
normal! 020|
wincmd w
argglobal
if bufexists(fnamemodify("src/routes/+page.svelte", ":p")) | buffer src/routes/+page.svelte | else | edit src/routes/+page.svelte | endif
if bufexists(fnamemodify("src/routes/+page.server.ts", ":p")) | buffer src/routes/+page.server.ts | else | edit src/routes/+page.server.ts | endif
if &buftype ==# 'terminal'
silent file src/routes/+page.svelte
silent file src/routes/+page.server.ts
endif
balt src/routes/layout.css
setlocal foldmethod=manual
@@ -76,16 +75,16 @@ setlocal foldnestmax=20
setlocal foldenable
silent! normal! zE
let &fdl = &fdl
let s:l = 3 - ((2 * winheight(0) + 22) / 44)
let s:l = 6 - ((5 * winheight(0) + 27) / 54)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 3
normal! 020|
keepjumps 6
normal! 0
wincmd w
2wincmd w
exe 'vert 1resize ' . ((&columns * 77 + 77) / 155)
exe 'vert 2resize ' . ((&columns * 77 + 77) / 155)
exe 'vert 1resize ' . ((&columns * 103 + 104) / 208)
exe 'vert 2resize ' . ((&columns * 104 + 104) / 208)
tabnext 1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf

View File

@@ -3,9 +3,11 @@ export const immutable = [];
export const prerendered = [];
export const assets = [
{"path":"robots.txt"},
{"path":"adumh00man.png"}
];
export const routes = [
{"id":"/","page":true,"endpoint":false},
{"id":"/artwork/[itemId]","page":false,"endpoint":true}
];

View File

@@ -9,7 +9,7 @@ export const nodes = [
export const server_loads = [];
export const dictionary = {
"/": [2]
"/": [~2]
};
export const hooks = {

View File

@@ -1,5 +1,5 @@
const variables = {};
const handle_issues = () => {};
import { variables } from "../../../../src/env.ts";
import { validate, handle_issues } from '@sveltejs/kit/internal/env';
const issues = {};
@@ -15,8 +15,15 @@ handle_issues(issues);
export function set_env(env) {
const issues = {};
const JELLYFIN_URL = validate(variables, env.JELLYFIN_URL, "JELLYFIN_URL", issues);
dynamic_private_env.JELLYFIN_URL = JELLYFIN_URL;
const JELLYFIN_API_KEY = validate(variables, env.JELLYFIN_API_KEY, "JELLYFIN_API_KEY", issues);
dynamic_private_env.JELLYFIN_API_KEY = JELLYFIN_API_KEY;
const JELLYFIN_PLAYLIST_ID = validate(variables, env.JELLYFIN_PLAYLIST_ID, "JELLYFIN_PLAYLIST_ID", issues);
dynamic_private_env.JELLYFIN_PLAYLIST_ID = JELLYFIN_PLAYLIST_ID;
const JELLYFIN_USER_ID = validate(variables, env.JELLYFIN_USER_ID, "JELLYFIN_USER_ID", issues);
dynamic_private_env.JELLYFIN_USER_ID = JELLYFIN_USER_ID;
handle_issues(issues);
}
set_env({});
set_env({JELLYFIN_URL:"http://192.168.1.180:8096",JELLYFIN_API_KEY:"2727181a933049dcbc8d63cf0bcc15f3",JELLYFIN_PLAYLIST_ID:"e3088b1ab54766ad3668bc71a574a2f7",JELLYFIN_USER_ID:"5824596713e44e8c949f529e1a081393"});

View File

@@ -0,0 +1,6 @@
import { dynamic_private_env as env } from '../config.js';
export const JELLYFIN_URL = env.JELLYFIN_URL;
export const JELLYFIN_API_KEY = env.JELLYFIN_API_KEY;
export const JELLYFIN_PLAYLIST_ID = env.JELLYFIN_PLAYLIST_ID;
export const JELLYFIN_USER_ID = env.JELLYFIN_USER_ID;

View File

@@ -0,0 +1,2 @@
const { env } = globalThis.__sveltekit_dev;

View File

@@ -0,0 +1,2 @@
import { rendered_env as env } from '../config.js';

View File

@@ -3,5 +3,5 @@ globalThis.__sveltekit_dev = {
env: {
// empty
},
version: "1793620726000"
version: "1793725498340"
};

View File

@@ -7,7 +7,7 @@ export const options = {
csrf_trusted_origins: [],
service_worker_options: undefined,
templates: {
app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\t\t<meta name=\"text-scale\" content=\"scale\" />\n\t\t" + head + "\n\t</head>\n\t<body class=\"bg-ctp-mantle text-ctp-text\" data-sveltekit-preload-data=\"hover\">\n\t\t<div style=\"display: contents\">" + body + "</div>\n\t</body>\n</html>\n",
app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<!-- Fonts -->\n\t\t<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n\t\t<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\n\t\t<link\n\t\t\thref=\"https://fonts.googleapis.com/css2?family=Squada+One&display=swap\"\n\t\t\trel=\"stylesheet\"\n\t\t/>\n\t\t<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n\t\t<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\n\t\t<link\n\t\t\thref=\"https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap\"\n\t\t\trel=\"stylesheet\"\n\t\t/>\n\n\t\t<!-- Not Fonts -->\n\t\t<meta charset=\"utf-8\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\t\t<meta name=\"text-scale\" content=\"scale\" />\n\t\t" + head + "\n\t</head>\n\t<style>\n\t\t.fira-mono-regular {\n\t\t\tfont-family: 'Fira Mono', monospace;\n\t\t\tfont-weight: 400;\n\t\t\tfont-style: normal;\n\t\t}\n\n\t\t.fira-mono-medium {\n\t\t\tfont-family: 'Fira Mono', monospace;\n\t\t\tfont-weight: 500;\n\t\t\tfont-style: normal;\n\t\t}\n\n\t\t.fira-mono-bold {\n\t\t\tfont-family: 'Fira Mono', monospace;\n\t\t\tfont-weight: 700;\n\t\t\tfont-style: normal;\n\t\t}\n\t</style>\n\t<body class=\"fira-mono-regular bg-ctp-mantle text-ctp-text\" data-sveltekit-preload-data=\"hover\">\n\t\t<div style=\"display: contents\">" + body + "</div>\n\t</body>\n</html>\n",
error
}
};

View File

@@ -1,3 +1,8 @@
{
"/": []
"/": [
"src/routes/+page.server.ts"
],
"/artwork/[itemId]": [
"src/routes/artwork/[itemId]/+server.ts"
]
}

View File

@@ -12,14 +12,21 @@ type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends
/** @deprecated Use the `snapshot` helper from `$app/navigation` instead. */
export type Snapshot<T = any> = Kit.Snapshot<T>;
export type ErrorProps = { error: App.Error };
type PageServerParentData = EnsureDefined<LayoutServerData>;
type PageParentData = EnsureDefined<LayoutData>;
type LayoutRouteId = RouteId | "/" | null
type LayoutParams = RouteParams & { }
type LayoutParentData = EnsureDefined<{}>;
export type PageServerData = null;
export type PageData = Expand<PageParentData>;
export type PageProps = { params: RouteParams; data: PageData }
export type PageServerLoad<OutputData extends OutputDataShape<PageServerParentData> = OutputDataShape<PageServerParentData>> = Kit.ServerLoad<RouteParams, PageServerParentData, OutputData, RouteId>;
export type PageServerLoadEvent = Parameters<PageServerLoad>[0];
export type ActionData = unknown;
export type PageServerData = Expand<OptionalUnion<EnsureDefined<Kit.LoadProperties<Awaited<ReturnType<typeof import('./proxy+page.server.js').load>>>>>>;
export type PageData = Expand<Omit<PageParentData, keyof PageServerData> & EnsureDefined<PageServerData>>;
export type Action<OutputData extends Record<string, any> | void = Record<string, any> | void> = Kit.Action<RouteParams, OutputData, RouteId>
export type Actions<OutputData extends Record<string, any> | void = Record<string, any> | void> = Kit.Actions<RouteParams, OutputData, RouteId>
export type PageProps = { params: RouteParams; data: PageData; form: ActionData }
export type LayoutServerData = null;
export type LayoutData = Expand<LayoutParentData>;
export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet }
export type RequestEvent = Kit.RequestEvent<RouteParams, RouteId>;

View File

@@ -0,0 +1,10 @@
import type * as Kit from '@sveltejs/kit';
import { MatcherParam } from '@sveltejs/kit/params';
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
type RouteParams = { itemId: string };
type RouteId = '/artwork/[itemId]';
export type EntryGenerator = () => Promise<Array<RouteParams>> | Array<RouteParams>;
export type RequestHandler = Kit.RequestHandler<RouteParams, RouteId>;
export type RequestEvent = Kit.RequestEvent<RouteParams, RouteId>;

View File

@@ -0,0 +1,17 @@
// @ts-nocheck
import type { PageServerLoad } from './$types';
import { getLatestPlaylistSong } from '#lib/server/jellyfin';
import { JELLYFIN_PLAYLIST_ID } from '$app/env/private';
export const load = () => {
const latestSong = getLatestPlaylistSong(globalThis.fetch, JELLYFIN_PLAYLIST_ID);
latestSong.catch(() => {});
return {
streamed: {
latestSong
}
};
};
;null as any as PageServerLoad;

6
node_modules/$app/types/env.d.ts generated vendored
View File

@@ -1,7 +1,11 @@
// This file is generated from ../../../src/env.ts.
// See https://svelte.dev/docs/kit/environment-variables for more information
declare module '$app/env/private' {
// no private environment variables were defined
export const JELLYFIN_URL: string;
export const JELLYFIN_API_KEY: string;
export const JELLYFIN_PLAYLIST_ID: string;
export const JELLYFIN_USER_ID: string;
}
declare module '$app/env/public' {

12
node_modules/$app/types/index.d.ts generated vendored
View File

@@ -6,17 +6,17 @@ import './env.js';
declare module "$app/types" {
export interface AppTypes {
PageRouteId(): "/";
EndpointRouteId(): never;
RouteId(): "/";
EndpointRouteId(): "/artwork/[itemId]";
RouteId(): "/" | "/artwork/[itemId]";
RouteParams(): {
"/artwork/[itemId]": { itemId: string }
};
LayoutParams(): {
"/": Record<string, never>
"/": { itemId?: string | undefined }
};
Path(): "";
Path(): "" | `artwork/${string}` & {};
ResolvedPathname(): `${"/" | `/${string}/`}${ReturnType<AppTypes['Path']>}`;
AssetPath(): "robots.txt";
AssetPath(): "robots.txt" | "adumh00man.png";
}
}

View File

@@ -1,127 +1,127 @@
{
"hash": "1095f90b",
"configHash": "457bb450",
"hash": "7f5566a2",
"configHash": "ad009091",
"lockfileHash": "a0bb1066",
"browserHash": "8bcbfda6",
"browserHash": "21e238fb",
"optimized": {
"@sveltejs/kit > devalue": {
"src": "../../devalue/index.js",
"file": "@sveltejs_kit_n_devalue.js",
"fileHash": "32e44f67",
"fileHash": "05fd5c52",
"needsInterop": false
},
"@sveltejs/kit > esm-env": {
"src": "../../esm-env/index.js",
"file": "@sveltejs_kit_n_esm-env.js",
"fileHash": "9f06982b",
"fileHash": "8de47f1b",
"needsInterop": false
},
"svelte": {
"src": "../../svelte/src/index-client.js",
"file": "svelte.js",
"fileHash": "a866a2ad",
"fileHash": "069a69f4",
"needsInterop": false
},
"svelte/animate": {
"src": "../../svelte/src/animate/index.js",
"file": "svelte_animate.js",
"fileHash": "92299309",
"fileHash": "d5397554",
"needsInterop": false
},
"svelte/attachments": {
"src": "../../svelte/src/attachments/index.js",
"file": "svelte_attachments.js",
"fileHash": "6b8e771f",
"fileHash": "d2733c77",
"needsInterop": false
},
"svelte/easing": {
"src": "../../svelte/src/easing/index.js",
"file": "svelte_easing.js",
"fileHash": "b4f37010",
"fileHash": "7950eedd",
"needsInterop": false
},
"svelte/events": {
"src": "../../svelte/src/events/index.js",
"file": "svelte_events.js",
"fileHash": "68e2313c",
"fileHash": "8b825841",
"needsInterop": false
},
"svelte/internal": {
"src": "../../svelte/src/internal/index.js",
"file": "svelte_internal.js",
"fileHash": "3d473288",
"fileHash": "e3ce7379",
"needsInterop": true
},
"svelte/internal/client": {
"src": "../../svelte/src/internal/client/index.js",
"file": "svelte_internal_client.js",
"fileHash": "fe26d481",
"fileHash": "661e3ea4",
"needsInterop": false
},
"svelte/internal/disclose-version": {
"src": "../../svelte/src/internal/disclose-version.js",
"file": "svelte_internal_disclose-version.js",
"fileHash": "f407ea9e",
"fileHash": "65807127",
"needsInterop": false
},
"svelte/internal/flags/async": {
"src": "../../svelte/src/internal/flags/async.js",
"file": "svelte_internal_flags_async.js",
"fileHash": "cd09f588",
"fileHash": "854cf899",
"needsInterop": false
},
"svelte/internal/flags/legacy": {
"src": "../../svelte/src/internal/flags/legacy.js",
"file": "svelte_internal_flags_legacy.js",
"fileHash": "ec04ad27",
"fileHash": "dbfdeabc",
"needsInterop": false
},
"svelte/internal/flags/tracing": {
"src": "../../svelte/src/internal/flags/tracing.js",
"file": "svelte_internal_flags_tracing.js",
"fileHash": "c8c71797",
"fileHash": "97e5e247",
"needsInterop": false
},
"svelte/legacy": {
"src": "../../svelte/src/legacy/legacy-client.js",
"file": "svelte_legacy.js",
"fileHash": "d1aab751",
"fileHash": "e4e7db04",
"needsInterop": false
},
"svelte/motion": {
"src": "../../svelte/src/motion/index.js",
"file": "svelte_motion.js",
"fileHash": "62c674ab",
"fileHash": "09a4323e",
"needsInterop": false
},
"svelte > clsx": {
"src": "../../clsx/dist/clsx.mjs",
"file": "svelte_n_clsx.js",
"fileHash": "91625499",
"fileHash": "6a1d2901",
"needsInterop": false
},
"svelte/reactivity": {
"src": "../../svelte/src/reactivity/index-client.js",
"file": "svelte_reactivity.js",
"fileHash": "384f1341",
"fileHash": "1c6116c9",
"needsInterop": false
},
"svelte/reactivity/window": {
"src": "../../svelte/src/reactivity/window/index.js",
"file": "svelte_reactivity_window.js",
"fileHash": "f8ecfd74",
"fileHash": "7458bbd0",
"needsInterop": false
},
"svelte/store": {
"src": "../../svelte/src/store/index-client.js",
"file": "svelte_store.js",
"fileHash": "4eb8f483",
"fileHash": "f3340593",
"needsInterop": false
},
"svelte/transition": {
"src": "../../svelte/src/transition/index.js",
"file": "svelte_transition.js",
"fileHash": "5cec295c",
"fileHash": "33c24fad",
"needsInterop": false
}
},

View File

@@ -1,127 +1,127 @@
{
"hash": "0d8cac10",
"configHash": "8e25bbcd",
"hash": "4b99bfcb",
"configHash": "33341ae9",
"lockfileHash": "a0bb1066",
"browserHash": "26786ffb",
"browserHash": "80c818c4",
"optimized": {
"svelte": {
"src": "../../svelte/src/index-server.js",
"file": "svelte.js",
"fileHash": "1db45689",
"fileHash": "faa03922",
"needsInterop": false
},
"svelte/animate": {
"src": "../../svelte/src/animate/index.js",
"file": "svelte_animate.js",
"fileHash": "0c915f74",
"fileHash": "9afb89ad",
"needsInterop": false
},
"svelte/attachments": {
"src": "../../svelte/src/attachments/index.js",
"file": "svelte_attachments.js",
"fileHash": "e3da824b",
"fileHash": "bd7a730f",
"needsInterop": false
},
"svelte/compiler": {
"src": "../../svelte/src/compiler/index.js",
"file": "svelte_compiler.js",
"fileHash": "0bfd5a0b",
"fileHash": "30a0d3dc",
"needsInterop": false
},
"svelte/easing": {
"src": "../../svelte/src/easing/index.js",
"file": "svelte_easing.js",
"fileHash": "2a9abb2d",
"fileHash": "2a0e34db",
"needsInterop": false
},
"svelte/events": {
"src": "../../svelte/src/events/index.js",
"file": "svelte_events.js",
"fileHash": "17ba9113",
"fileHash": "0a3223e8",
"needsInterop": false
},
"svelte/internal": {
"src": "../../svelte/src/internal/index.js",
"file": "svelte_internal.js",
"fileHash": "606b0920",
"fileHash": "da00c994",
"needsInterop": true
},
"svelte/internal/client": {
"src": "../../svelte/src/internal/client/index.js",
"file": "svelte_internal_client.js",
"fileHash": "e18ce5d5",
"fileHash": "5f328f67",
"needsInterop": false
},
"svelte/internal/disclose-version": {
"src": "../../svelte/src/internal/disclose-version.js",
"file": "svelte_internal_disclose-version.js",
"fileHash": "b3f1d0c0",
"fileHash": "6db2c0d5",
"needsInterop": false
},
"svelte/internal/flags/async": {
"src": "../../svelte/src/internal/flags/async.js",
"file": "svelte_internal_flags_async.js",
"fileHash": "2628755b",
"fileHash": "c1b51946",
"needsInterop": false
},
"svelte/internal/flags/legacy": {
"src": "../../svelte/src/internal/flags/legacy.js",
"file": "svelte_internal_flags_legacy.js",
"fileHash": "c6d532b9",
"fileHash": "96fe1c55",
"needsInterop": false
},
"svelte/internal/flags/tracing": {
"src": "../../svelte/src/internal/flags/tracing.js",
"file": "svelte_internal_flags_tracing.js",
"fileHash": "702d46d4",
"fileHash": "3a42a841",
"needsInterop": false
},
"svelte/internal/server": {
"src": "../../svelte/src/internal/server/index.js",
"file": "svelte_internal_server.js",
"fileHash": "f88f2fbb",
"fileHash": "f699c82c",
"needsInterop": false
},
"svelte/legacy": {
"src": "../../svelte/src/legacy/legacy-server.js",
"file": "svelte_legacy.js",
"fileHash": "b890770c",
"fileHash": "2eb7ffe8",
"needsInterop": false
},
"svelte/motion": {
"src": "../../svelte/src/motion/index.js",
"file": "svelte_motion.js",
"fileHash": "33f9bcb2",
"fileHash": "ea143fc5",
"needsInterop": false
},
"svelte/reactivity": {
"src": "../../svelte/src/reactivity/index-server.js",
"file": "svelte_reactivity.js",
"fileHash": "18572af8",
"fileHash": "196f60a2",
"needsInterop": false
},
"svelte/reactivity/window": {
"src": "../../svelte/src/reactivity/window/index.js",
"file": "svelte_reactivity_window.js",
"fileHash": "13ccd610",
"fileHash": "5924b2e6",
"needsInterop": false
},
"svelte/server": {
"src": "../../svelte/src/server/index.js",
"file": "svelte_server.js",
"fileHash": "52957867",
"fileHash": "1cd50b48",
"needsInterop": false
},
"svelte/store": {
"src": "../../svelte/src/store/index-server.js",
"file": "svelte_store.js",
"fileHash": "4e09a113",
"fileHash": "ab97e39e",
"needsInterop": false
},
"svelte/transition": {
"src": "../../svelte/src/transition/index.js",
"file": "svelte_transition.js",
"fileHash": "97b2eb61",
"fileHash": "09df4f7b",
"needsInterop": false
}
},

View File

@@ -1,12 +1,46 @@
<!doctype html>
<html lang="en">
<head>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Squada+One&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<!-- Not Fonts -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="text-scale" content="scale" />
%sveltekit.head%
</head>
<body class="bg-ctp-mantle text-ctp-text" data-sveltekit-preload-data="hover">
<style>
.fira-mono-regular {
font-family: 'Fira Mono', monospace;
font-weight: 400;
font-style: normal;
}
.fira-mono-medium {
font-family: 'Fira Mono', monospace;
font-weight: 500;
font-style: normal;
}
.fira-mono-bold {
font-family: 'Fira Mono', monospace;
font-weight: 700;
font-style: normal;
}
</style>
<body class="fira-mono-regular bg-ctp-mantle text-ctp-text" data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

8
src/env.ts Normal file
View File

@@ -0,0 +1,8 @@
import { defineEnvVars } from '@sveltejs/kit/env';
export const variables = defineEnvVars({
JELLYFIN_URL: {},
JELLYFIN_API_KEY: {},
JELLYFIN_PLAYLIST_ID: {},
JELLYFIN_USER_ID: {}
});

124
src/lib/server/jellyfin.ts Normal file
View File

@@ -0,0 +1,124 @@
import { JELLYFIN_URL, JELLYFIN_API_KEY, JELLYFIN_USER_ID } from '$app/env/private';
const CACHE_TTL = 3 * 60 * 60 * 1000;
interface JellyfinSong {
Id: string;
Name: string;
Album?: string;
AlbumId?: string;
Artists?: string[];
DateCreated?: string;
}
interface PlaylistItemsResponse {
Items: JellyfinSong[];
TotalRecordCount: number;
}
export interface LatestSong {
id: string;
name: string;
artist: string;
album: string;
dateAdded: string | null;
coverArt: string | null;
}
interface CacheEntry<T> {
value: T;
expiresAt: number;
}
const playlistCache = new Map<string, CacheEntry<LatestSong | null>>();
const pendingRequests = new Map<string, Promise<LatestSong | null>>();
async function fetchLatestPlaylistSong(
fetch: typeof globalThis.fetch,
playlistId: string
): Promise<LatestSong | null> {
const url = new URL(`${JELLYFIN_URL}/Playlists/${playlistId}/Items`);
url.searchParams.set('UserId', JELLYFIN_USER_ID);
url.searchParams.set('Limit', '1');
const headers = {
'X-Emby-Token': JELLYFIN_API_KEY
};
const countResponse = await fetch(url, { headers });
if (!countResponse.ok) {
const body = await countResponse.text();
throw new Error(`Jellyfin error: ${countResponse.status} - ${body}`);
}
const countData: PlaylistItemsResponse = await countResponse.json();
const total = countData.TotalRecordCount;
if (!total) return null;
url.searchParams.set('StartIndex', String(total - 1));
const lastResponse = await fetch(url, { headers });
if (!lastResponse.ok) {
const body = await lastResponse.text();
throw new Error(`Jellyfin error: ${lastResponse.status} - ${body}`);
}
const lastData: PlaylistItemsResponse = await lastResponse.json();
const song = lastData.Items?.[0];
if (!song) return null;
const artworkId = song.AlbumId ?? song.Id;
return {
id: song.Id,
name: song.Name,
artist: song.Artists?.join(', ') ?? 'Unknown artist',
album: song.Album ?? 'Unknown album',
dateAdded: song.DateCreated ?? null,
coverArt: `/artwork/${encodeURIComponent(artworkId)}`
};
}
export async function getLatestPlaylistSong(
fetch: typeof globalThis.fetch,
playlistId: string
): Promise<LatestSong | null> {
const cached = playlistCache.get(playlistId);
if (cached && cached.expiresAt > Date.now()) {
return cached.value;
}
const pending = pendingRequests.get(playlistId);
if (pending) return pending;
const request = fetchLatestPlaylistSong(fetch, playlistId)
.then((song) => {
playlistCache.set(playlistId, {
value: song,
expiresAt: Date.now() + CACHE_TTL
});
return song;
})
.finally(() => {
pendingRequests.delete(playlistId);
});
pendingRequests.set(playlistId, request);
return request;
}
export function invalidatePlaylistCache(playlistId: string): void {
playlistCache.delete(playlistId);
}

View File

@@ -0,0 +1,15 @@
import type { PageServerLoad } from './$types';
import { getLatestPlaylistSong } from '#lib/server/jellyfin';
import { JELLYFIN_PLAYLIST_ID } from '$app/env/private';
export const load: PageServerLoad = () => {
const latestSong = getLatestPlaylistSong(globalThis.fetch, JELLYFIN_PLAYLIST_ID);
latestSong.catch(() => {});
return {
streamed: {
latestSong
}
};
};

View File

@@ -1,10 +1,81 @@
<div class="m-6 grid grid-cols-1 grid-rows-3 gap-5">
<div class="main-container" style="--container-color:var(--ctp-mauve);">
<p class="text-bold text-xl">Adumh00man</p>
<p></p>
<script lang="ts">
import type { PageData } from './$types';
let { data }: { data: PageData } = $props();
</script>
<div class="m-6 mx-auto grid max-w-7xl grid-cols-1 grid-rows-3 gap-5">
<div
class="main-container grid grid-cols-[2fr_1fr] py-7 pl-10"
style="--container-color:var(--ctp-mauve);"
>
<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" style="--container-color:var(--ctp-peach);">watching</div>
<div class="sub-container" style="--container-color:var(--ctp-red);">reading</div>
</div>
</div>
<div class="grid grid-cols-2 grid-rows-1 gap-4">
<div class="main-container"></div>
<div class="main-container"></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 py-2 text-4xl">Content</div>
</div>
<div class="main-container" style="--container-color:var(--ctp-green);">
<div class="section-title fira-mono-bold mr-3 py-2 text-4xl">Commits</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,32 @@
import { error } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { JELLYFIN_URL, JELLYFIN_API_KEY } from '$app/env/private';
export const GET: RequestHandler = async ({ params, fetch }) => {
const { itemId } = params;
if (!/^[a-zA-Z0-9-]+$/.test(itemId)) {
error(400, 'Invalid item ID');
}
const response = await fetch(
`${JELLYFIN_URL}/Items/${encodeURIComponent(itemId)}/Images/Primary`,
{
headers: {
'X-Emby-Token': JELLYFIN_API_KEY
}
}
);
if (!response.ok) {
error(response.status, 'Artwork unavailable');
}
return new Response(response.body, {
headers: {
'Content-Type': response.headers.get('Content-Type') ?? 'image/jpeg',
'Cache-Control': 'private, max-age=3600'
}
});
};

View File

@@ -110,7 +110,23 @@
--ctp-crust-oklch: 0.1828 0.0204 284.2038;
}
.main-container {
* {
transition:
color 200ms,
background-color 200ms,
border-color 200ms,
fill 200ms,
stroke 200ms;
}
.title-font {
font-family: 'Squada One', sans-serif;
font-weight: 400;
font-style: normal;
}
.main-container,
.sub-container {
--container-color: var(--ctp-lavender);
background-color: var(--ctp-surface0);
border-left: 10px solid var(--container-color);
@@ -118,3 +134,32 @@
padding-top: 10px;
padding-bottom: 10px;
}
.sub-container {
background-color: var(--ctp-surface1);
border-left-width: 6px;
aspect-ratio: 20/5;
}
.text-link {
text-decoration: underline;
color: var(--ctp-blue);
}
#description-block {
border-left: 10px solid var(--ctp-surface2);
}
#music-title-block {
border-left: 4px solid var(--ctp-overlay1);
}
#music-title-block:hover {
color: var(--ctp-lavender);
border-left-color: var(--ctp-mauve);
}
.section-title {
border-bottom: 2px solid var(--ctp-overlay2);
text-indent: 1ch;
}

BIN
static/adumh00man.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

View File

@@ -1,5 +1,4 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"rewriteRelativeImportExtensions": true,
"allowJs": true,