Files
drp-48/src/lib/components/SpaceCard.svelte
2025-06-04 18:10:53 +01:00

37 lines
697 B
Svelte

<script lang="ts">
import type { Snippet } from "svelte";
interface Props {
alt: string;
imgSrc: string;
description?: Snippet;
href?: string;
}
const { alt, imgSrc, description, href }: Props = $props();
</script>
<a class="card" {href}>
<img src={imgSrc} {alt} />
<div class="description">
{@render description?.()}
</div>
</a>
<style>
.card {
display: flex;
flex-direction: column;
background-color: #38353f;
}
.description {
padding: 0.5rem;
color: #edebe9;
font-size: 0.875rem;
}
img {
width: 16rem;
aspect-ratio: 1 / 1;
}
</style>