<script lang="ts">
    import Banner2 from "$lib/banner2.svelte";
    import Content from "$lib/viewport/content.svelte";
    import { posts, type DevlogPostLink } from "./devlog/posts";
    import Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte";

    let entries: GalleryEntry[] = posts.map(mapEntries);

    function mapEntries(entry: DevlogPostLink, index: number): GalleryEntry {
        return {
            title: `${entry.post.title}`,
            subtitle: `#${(posts.length - index).toString().padStart(2, '0')} // ${entry.post.date}`,
            img: `/projects/projectn5/devlog/${entry.key}/preview.webp`,
            link: `/projects/projectn5/devlog/${entry.key}/`,
            imgAlt: `Preview image for ${entry.post.title}`,
            description: entry.post.description,
        };
    }

    // Leftpads a single-digit number to two digits
    function leftpad(n: number): String {
        var result = n.toString();
        if (n < 10) {
            result = "0" + result
        }
        return result;
    }
</script>


<svelte:head>
    <title>Project N5 | denizk0461</title> 
</svelte:head>

<Content>
    <Banner2
        title="Project N5"
        banner="/projects/projectn5/banner2.webp" />

    <p>I am currently working on a game under the working title <b>Project N5</b>! I'm aiming for it to be an action-adventure jump-and-run game inspired by games such as Ratchet & Clank. Development started on <b>2023-09-16</b> and rebooted on <b>2025-05-16</b>.</p>

    <h2 id="devlog">Development Log</h2>

    <p>Development log entries in reverse chronological order (newest to oldest).</p> 

    <Gallery {entries} />
</Content>