main page mostly finished

This commit is contained in:
2025-04-03 20:01:00 +02:00
parent 50f0eb80aa
commit a03939d493
23 changed files with 210 additions and 10 deletions

View File

@@ -1 +1,66 @@
<ul></ul>
<script lang="ts">
export interface LinkEntry {
icon?: string;
text: string;
link: string;
}
let {
entries,
} : {
entries: LinkEntry[];
} = $props();
</script>
<ul>
{#each entries as entry}
<li>
<a href={entry.link}>
{#if entry.icon}
<img height="24px" src={entry.icon}>
{/if}
{entry.text}
</a>
</li>
{/each}
</ul>
<style>
ul {
padding: 0;
}
li::before {
content: "";
color: var(--color-highlight);
padding-right: 8px;
}
li {
display: flex;
padding-left: 0;
margin-top: 4px;
margin-bottom: 4px;
transition: background-color 0.2s ease-in-out;
padding: 2px 12px;
}
li:hover {
background-color: var(--color-background-highlight-hover);
}
a {
width: 100%;
transition: color 0.2s ease-in-out;
}
a:link, a:visited {
color: var(--color-text);
text-decoration: none;
}
a:hover {
color: var(--color-highlight);
}
img {
filter: var(--color-text-img);
margin-top: 4px;
margin-bottom: -4px;
}
</style>

View File

@@ -0,0 +1,87 @@
<script lang="ts">
export interface GalleryEntry {
title: string;
subtitle: string;
fullWidth: boolean;
img: string;
link: string;
}
let {
entries,
}: {
entries: GalleryEntry[];
} = $props();
</script>
<div class="container">
{#each entries as entry}
{#if entry.fullWidth}
<div class="entry-parent full-width">
{@render galleryEntry({entry})}
</div>
{:else}
<div class="entry-parent half-width">
{@render galleryEntry({entry})}
</div>
{/if}
{/each}
</div>
{#snippet galleryEntry({entry}: {entry: GalleryEntry})}
<a class="entry" href="{entry.link}">
<img src="{entry.img}">
<p>{entry.title}</p>
<p>{entry.subtitle}</p>
</a>
{/snippet}
<style>
.container {
margin-left: auto;
margin-right: auto;
display: flex;
flex-wrap: wrap;
/* flex-flow: row wrap; */
justify-content: left;
margin: 4px;
}
.entry-parent {
display: flex;
}
.entry {
margin: 4px;
padding-bottom: 12px;
background-color: var(--color-background-highlight);
text-decoration: none; /* removes link underline */
transition: background-color 0.16s ease-in-out;
}
.entry:hover {
background-color: var(--color-background-highlight-hover);
}
.entry img {
width: 100%;
object-fit: cover;
max-height: 300px;
}
.entry p {
margin: 0 32px;
}
/* gallery entry header */
.entry p:nth-child(2) {
font-size: 20px;
margin-top: 12px;
font-weight: 800;
font-style: italic;
}
.half-width {
width: 50%;
}
.full-width {
width: 100%;
}
</style>