mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 06:26:44 -06:00
refactor: remove unused public projects page
This commit is contained in:
@@ -1,43 +0,0 @@
|
|||||||
import type { PageServerLoad } from "./$types";
|
|
||||||
import { apiFetch } from "$lib/api.server";
|
|
||||||
import { getOGImageUrl } from "$lib/og-types";
|
|
||||||
import { renderIconSVG } from "$lib/server/icons";
|
|
||||||
|
|
||||||
interface ProjectLink {
|
|
||||||
url: string;
|
|
||||||
title?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Project {
|
|
||||||
id: string;
|
|
||||||
slug: string;
|
|
||||||
name: string;
|
|
||||||
shortDescription: string;
|
|
||||||
icon?: string;
|
|
||||||
iconSvg?: string;
|
|
||||||
links: ProjectLink[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load: PageServerLoad = async ({ url }) => {
|
|
||||||
const projects = await apiFetch<Project[]>("/api/projects");
|
|
||||||
|
|
||||||
// Render icon SVGs server-side
|
|
||||||
const projectsWithIcons = await Promise.all(
|
|
||||||
projects.map(async (project) => ({
|
|
||||||
...project,
|
|
||||||
iconSvg: await renderIconSVG(project.icon ?? "lucide:heart", {
|
|
||||||
class: "text-3xl opacity-80 saturate-0",
|
|
||||||
}),
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
projects: projectsWithIcons,
|
|
||||||
metadata: {
|
|
||||||
title: "Projects | Xevion.dev",
|
|
||||||
description: "...",
|
|
||||||
ogImage: getOGImageUrl({ type: "projects" }),
|
|
||||||
url: url.toString(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import AppWrapper from "$lib/components/AppWrapper.svelte";
|
|
||||||
import type { PageData } from "./$types";
|
|
||||||
|
|
||||||
let { data }: { data: PageData } = $props();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<AppWrapper>
|
|
||||||
<div
|
|
||||||
class="relative z-10 mx-auto grid grid-cols-1 justify-center gap-y-4 px-4 py-20 align-middle sm:grid-cols-2 md:max-w-200 lg:max-w-300 lg:grid-cols-3 lg:gap-y-9"
|
|
||||||
>
|
|
||||||
<div class="mb-3 text-center sm:col-span-2 md:mb-5 lg:col-span-3 lg:mb-7">
|
|
||||||
<h1
|
|
||||||
class="pb-3 font-hanken text-4xl text-zinc-200 opacity-100 md:text-5xl"
|
|
||||||
>
|
|
||||||
Projects
|
|
||||||
</h1>
|
|
||||||
<p class="text-lg text-zinc-400">
|
|
||||||
created, maintained, or contributed to by me...
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#each data.projects as project (project.id)}
|
|
||||||
{@const links = project.links}
|
|
||||||
{@const useAnchor = links.length > 0}
|
|
||||||
{@const href = useAnchor ? links[0].url : undefined}
|
|
||||||
{@const iconSvg = project.iconSvg}
|
|
||||||
|
|
||||||
<div class="max-w-fit">
|
|
||||||
<svelte:element
|
|
||||||
this={useAnchor ? "a" : "div"}
|
|
||||||
{href}
|
|
||||||
target={useAnchor ? "_blank" : undefined}
|
|
||||||
rel={useAnchor ? "noreferrer" : undefined}
|
|
||||||
title={project.name}
|
|
||||||
class="flex items-center justify-start overflow-hidden rounded bg-black/10 pb-2.5 pl-3 pr-5 pt-1 text-zinc-400 transition-colors hover:bg-zinc-500/10 hover:text-zinc-50"
|
|
||||||
>
|
|
||||||
<div class="flex h-full w-14 items-center justify-center pr-5">
|
|
||||||
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
||||||
{@html iconSvg}
|
|
||||||
</div>
|
|
||||||
<div class="overflow-hidden">
|
|
||||||
<span class="text-sm md:text-base lg:text-lg">
|
|
||||||
{project.name}
|
|
||||||
</span>
|
|
||||||
<p
|
|
||||||
class="truncate text-xs opacity-70 md:text-sm lg:text-base"
|
|
||||||
title={project.shortDescription}
|
|
||||||
>
|
|
||||||
{project.shortDescription}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</svelte:element>
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
</AppWrapper>
|
|
||||||
Reference in New Issue
Block a user