oops went on a massive code sesh and theres like a whole website now
This commit is contained in:
15
src/routes/+page.server.ts
Normal file
15
src/routes/+page.server.ts
Normal 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
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -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>
|
||||
|
||||
32
src/routes/artwork/[itemId]/+server.ts
Normal file
32
src/routes/artwork/[itemId]/+server.ts
Normal 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'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user