Files
pages/src/routes/projects/+page.svelte

91 lines
2.3 KiB
Svelte
Raw Normal View History

<script lang="ts">
import BannerTitleAlt from "$lib/banner-title-alt.svelte";
2025-04-01 22:25:10 +02:00
import TableOfContents from "$lib/table-of-contents.svelte";
import Content from "$lib/content.svelte";
2025-04-01 21:30:20 +02:00
import type { Project } from './projects';
import { projects } from './projects';
2025-04-04 19:00:47 +02:00
import LinkList from "$lib/link-list.svelte";
2025-04-01 21:30:20 +02:00
let getActiveProjects = function(projects: Project[], isActive: boolean): Project[] {
var result: Project[] = [];
projects.forEach(project => {
if (project.isActive == isActive) {
result.push(project);
}
});
return result;
}
</script>
2025-04-04 10:37:25 +02:00
<svelte:head>
<title>Projects | denizk0461</title>
</svelte:head>
<BannerTitleAlt
title="My Disordered Projects"
banner="/projects/banner.webp"
subtitle="Here's a listing of some of my more noteworthy projects that can be found on the web."
/>
2025-04-01 21:30:20 +02:00
<Content>
<TableOfContents />
<h2>Active Projects</h2>
{#each getActiveProjects(projects, true) as activeProject}
{@render projectSummary({ project: activeProject })}
{/each}
2025-04-01 21:30:20 +02:00
<h2>Past Projects</h2>
{#each getActiveProjects(projects, false) as pastProject}
{@render projectSummary({ project: pastProject })}
{/each}
</Content>
{#snippet projectSummary({
project
}: {
project: Project;
})}
<div>
<h3 id="{project.id}">{project.title}</h3>
2025-04-01 21:30:20 +02:00
{#if project.subtitle}
<p class="subtitle">» {project.subtitle}</p>
{/if}
{#if project.banner}
<img class="banner" src="{project.banner}">
{/if}
{#if project.icon}
<img class="icon" src="{project.icon}">
{/if}
{#each project.paragraphs as paragraph}
<p>{@html paragraph}</p>
{/each}
2025-04-04 19:00:47 +02:00
<LinkList entries={project.links} />
</div>
2025-04-01 21:30:20 +02:00
{/snippet}
<style>
.asdf {
display: flex;
flex-direction: row;
}
2025-04-01 21:30:20 +02:00
.subtitle {
color: var(--color-highlight);
font-weight: 700;
font-style: italic;
margin-top: 0;
}
.banner {
width: 80%;
margin-left: auto;
margin-right: auto;
display: flex;
}
.icon {
float: left;
margin: 16px 16px 16px 0;
width: 20%;
}
</style>