fucked up my commit history and removed node modules folder from tree
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { getLatestPlaylistSong, getLatestWatchedSeries } from '#lib/server/jellyfin';
|
||||
import { getLatestBook } from '#lib/server/komga';
|
||||
import { fetchBlogArticles, getChannelInfo } from '#lib/server/content';
|
||||
import { getContentItems } from '#lib/server/content';
|
||||
import type { ContentItem } from '#lib/server/content';
|
||||
import {
|
||||
JELLYFIN_PLAYLIST_ID,
|
||||
JELLYFIN_LIBRARY_ID,
|
||||
@@ -12,21 +13,23 @@ import {
|
||||
|
||||
export const load: PageServerLoad = () => {
|
||||
const latestSong = getLatestPlaylistSong(globalThis.fetch, JELLYFIN_PLAYLIST_ID);
|
||||
console.log(JELLYFIN_LIBRARY_ID);
|
||||
const latestSeries = getLatestWatchedSeries(globalThis.fetch, JELLYFIN_LIBRARY_ID);
|
||||
const latestBook = getLatestBook(globalThis.fetch, KOMGA_LIBRARY_ID);
|
||||
const blogArticles = fetchBlogArticles(BLOG_URL);
|
||||
const info = getChannelInfo(CHANNEL_ID);
|
||||
|
||||
const contentItems: ContentItem = getContentItems(globalThis.fetch, CHANNEL_ID, BLOG_URL);
|
||||
|
||||
latestSong.catch(() => {});
|
||||
latestSeries.catch(() => {});
|
||||
latestBook.catch(() => {});
|
||||
|
||||
contentItems.catch(() => {});
|
||||
|
||||
return {
|
||||
streamed: {
|
||||
latestSong,
|
||||
latestSeries,
|
||||
latestBook
|
||||
latestBook,
|
||||
contentItems
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
import { SiGit, SiHugo, SiYoutube } from '@icons-pack/svelte-simple-icons';
|
||||
|
||||
import Content from './Content.svelte';
|
||||
|
||||
@@ -11,9 +12,9 @@
|
||||
<div class="absolute aspect-[2/1.732] h-40 text-ctp-surface0">
|
||||
{@html voidarcIcon}
|
||||
</div>
|
||||
<span class="absolute">[VOIDARC INCORPORATED]</span>
|
||||
<span class="absolute text-ctp-mauve">[VOIDARC INCORPORATED]</span>
|
||||
</div>
|
||||
<div class="m-6 mx-auto grid max-w-6xl grid-cols-1 grid-rows-3 gap-5">
|
||||
<div class="m-6 mx-auto grid max-w-6xl grid-flow-row auto-rows-min gap-5">
|
||||
<div
|
||||
class="main-container grid grid-cols-[2fr_1fr] py-7 pl-10"
|
||||
style="--container-color:var(--ctp-mauve);"
|
||||
@@ -161,11 +162,31 @@
|
||||
</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>
|
||||
<Content items={['some']} />
|
||||
<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>
|
||||
</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 py-2 text-4xl">Commits</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,125 @@
|
||||
<script lang="ts">
|
||||
let { items } = $props();
|
||||
import type { ContentItem } from './types';
|
||||
|
||||
let { items }: { items: ContentItem[] } = $props();
|
||||
|
||||
let containerElement: HTMLDivElement;
|
||||
let cardElements = $state<HTMLElement[]>([]);
|
||||
|
||||
let graphHeight = $state(0);
|
||||
let nodePositions = $state<{ x: number; y: number }[]>([]);
|
||||
|
||||
// Measure the actual centre of every article card.
|
||||
$effect(() => {
|
||||
const currentItems = items;
|
||||
const cards = cardElements.filter(Boolean);
|
||||
const container = containerElement;
|
||||
|
||||
if (!container || cards.length !== currentItems.length) return;
|
||||
|
||||
function updatePositions() {
|
||||
const containerRect = container.getBoundingClientRect();
|
||||
|
||||
nodePositions = cards.map((card) => {
|
||||
const rect = card.getBoundingClientRect();
|
||||
|
||||
return {
|
||||
x: 16,
|
||||
y: rect.top - containerRect.top + rect.height / 2
|
||||
};
|
||||
});
|
||||
|
||||
graphHeight = container.scrollHeight;
|
||||
}
|
||||
|
||||
// Initial measurement.
|
||||
updatePositions();
|
||||
|
||||
// Watch for changes in card or container dimensions.
|
||||
const observer = new ResizeObserver(updatePositions);
|
||||
|
||||
observer.observe(container);
|
||||
cards.forEach((card) => observer.observe(card));
|
||||
|
||||
// Also handle viewport changes.
|
||||
window.addEventListener('resize', updatePositions);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
window.removeEventListener('resize', updatePositions);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>{items[0]}</div>
|
||||
<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="32"
|
||||
height={graphHeight}
|
||||
viewBox={`0 0 32 ${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="3"
|
||||
class="text-ctp-mauve"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
<!-- Commit nodes -->
|
||||
{#each nodePositions as node}
|
||||
<circle
|
||||
cx={node.x}
|
||||
cy={node.y}
|
||||
r="10"
|
||||
fill="#313244"
|
||||
stroke="currentColor"
|
||||
stroke-width="3"
|
||||
class="text-ctp-mauve"
|
||||
/>
|
||||
{/each}
|
||||
</svg>
|
||||
|
||||
<!-- Article list -->
|
||||
<div 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">
|
||||
<!-- Timeline space -->
|
||||
<div></div>
|
||||
|
||||
<!-- Article card -->
|
||||
<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"
|
||||
>
|
||||
{#if item.image}
|
||||
<div class="mr-2 flex aspect-16/9 max-w-40 min-w-40 items-center">
|
||||
<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>
|
||||
|
||||
<p class="text-muted-foreground mt-1 line-clamp-2 text-sm">
|
||||
{item.description}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -141,6 +141,11 @@
|
||||
aspect-ratio: 20/5;
|
||||
}
|
||||
|
||||
.dynamic-container {
|
||||
--container-color: var(--ctp-lavender);
|
||||
border-left: 5px solid var(--container-color);
|
||||
}
|
||||
|
||||
.text-link {
|
||||
text-decoration: underline;
|
||||
color: var(--ctp-blue);
|
||||
|
||||
Reference in New Issue
Block a user