ADD: Components

Teaser, Card
This commit is contained in:
webfussel 2025-05-29 13:11:15 +02:00
parent 8943512328
commit c8e4bf4a14
8 changed files with 127 additions and 48 deletions

42
app/components/Teaser.vue Normal file
View file

@ -0,0 +1,42 @@
<template>
<article
class="Teaser z-2 card flex-col gap-sm"
:class="[image.position ?? 'left']"
>
<div class="image-container">
<img
loading="lazy"
width="550"
height="350"
:srcset="imageSet.join(', ')"
:src="initialImage"
aria-hidden="true"
alt=""
/>
</div>
<div class="text-container flex-col gap-default">
<h3>{{title}}</h3>
<main class="flex-col gap-sm">
<slot />
</main>
</div>
</article>
</template>
<script setup lang="ts">
import { getImageSet, getInitialImage } from '../utils/image'
type Props = {
title : string
image : {
path : string
name : string
position ?: 'left' | 'right'
}
}
const { image } = defineProps<Props>()
const imageSet = getImageSet(image.path, image.name)
const initialImage = getInitialImage(image.path, image.name)
</script>