<script lang="ts">
    import Banner2 from "$lib/banner2.svelte";
    import Content from "$lib/viewport/content.svelte";
    import { type Drawing, drawings } from "./drawings";
</script>

<svelte:head>
    <title>Drawing Gallery | denizk0461</title> 
</svelte:head>

{#snippet drawingGalleryEntry({d}: {d: Drawing})}
    <div class="gallery-entry">
        <div class="gallery-entry-img-container">
            <img src="{d.img}" alt="{d.imgAlt}">
        </div>
        <div class="gallery-entry-info">
            <p class="gallery-entry-title">{d.title} <span>{d.date}</span></p>
            {#each d.notes as note}
                <p class="gallery-entry-note">{note}</p>                
            {/each}
            <a href="{d.img}">view full-size</a>
        </div>
    </div>
{/snippet}

<Content>
    <Banner2
        title="Drawing Gallery"
        subtitle=""
        banner="banner.webp"
        bannerAlt="Several Faber-Castell Polychromos colour pencils lined up with markings next to them in the same colour on a sheet of paper." />

    <p>I started drawing at the start of 2026 and this is my page to show off what I make! I've mostly drawn on paper so far (I like the feel and resistance of pens on paper as well as the <a href="/blog/2026/0129">limitations</a> it imposes), but I got into digital art with Krita recently!</p>

    <p>Why have I created this page, you may wonder? to pressure myself to draw more</p>

    <p>If you're interested, here's a post about me <a href="/blog/2026/0205">drawing every day for 28 days</a> to learn to draw. You may recognise some of the drawings there; I picked out my favourite drawings and added them here!</p>

    <div class="drawing-container">
        {#each drawings as d}
            {@render drawingGalleryEntry({d})}
        {/each}
    </div>
</Content>

<style>
    .drawing-container {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .gallery-entry {
        position: relative;
        height: 340px;
    }

    .gallery-entry-img-container {
        overflow: hidden;
    }

    .gallery-entry-img-container, .gallery-entry-info {
        border-radius: 16px;
    }
    
    .gallery-entry-img-container, .gallery-entry-info {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: 0;
        height: 100%;
        width: 100%;
    }

    .gallery-entry img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: scale var(--duration-animation) var(--anim-curve);
    }

    .gallery-entry:hover img {
        scale: 1.2;
    }

    .gallery-entry:hover .gallery-entry-info {
        opacity: 1;
    }

    .gallery-entry-info {
        opacity: 0;
        display: flex;
        flex-direction: column;
        transition: opacity var(--duration-animation) var(--anim-curve);
        background-color: var(--color-header-highlight);
        padding: 12px 8px;
        gap: 4px;
        box-sizing: border-box;
        justify-content: center;
        outline: var(--border-style) var(--border-dash-size) var(--color-highlight-alt);
    }
    
    .gallery-entry-info * {
        margin: 0;
        width: fit-content;
    }

    .gallery-entry-title {
        font-family: var(--font-mono);
        font-weight: 700;
    }

    .gallery-entry-title span {
        font-size: 0.8rem;
        line-height: 0.9rem;
        font-weight: 500;
    }

    .gallery-entry-note, .gallery-entry-info a {
        font-size: 1.0rem;
        line-height: 1.3rem;
    }

    @media screen and (max-width: 1000px) {
        .drawing-container {
            grid-template-columns: 1fr 1fr;
        }
    }

    @media screen and (max-width: 600px) {
        .drawing-container {
            grid-template-columns: 1fr;
        }
    }
</style>