src/components/video/VideoMagazine.astro
---
interface Props {
poster?: string;
category?: string;
title?: string;
teaser?: string;
author?: string;
date?: string;
readTime?: string;
href?: string;
}
const {
poster = '',
category = 'Strategie',
title = 'Hoe wij TechFlow transformeerden van 0 naar marktleider',
teaser = 'Een kijkje achter de schermen van onze meest ambitieuze campagne ooit — en wat jij ervan kunt leren.',
author = 'Lotte van den Berg',
date = 'April 2024',
readTime = '8 min',
href = '#',
} = Astro.props;
---
<article class="vmag">
<div class="vmag__media">
{poster ? (
<img class="vmag__poster" src={poster} alt={title} />
) : (
<div class="vmag__placeholder" aria-label={title}>
<span class="vmag__play" aria-hidden="true">
<svg width="44" height="44" viewBox="0 0 44 44">
<circle cx="22" cy="22" r="22" fill="rgba(99,102,241,0.85)"/>
<polygon points="17,11 37,22 17,33" fill="#fff"/>
</svg>
</span>
</div>
)}
{category && <span class="vmag__category">{category}</span>}
</div>
<div class="vmag__content">
<h2 class="vmag__title">
<a class="vmag__title-link" href={href}>{title}</a>
</h2>
<p class="vmag__teaser">{teaser}</p>
<footer class="vmag__footer">
<span class="vmag__author">{author}</span>
<span class="vmag__meta">{date} · {readTime} lezen</span>
</footer>
</div>
</article>
<style>
:root {
--color-accent: #6366f1;
--color-primary: #0a0a0a;
}
.vmag {
display: grid;
grid-template-columns: 2fr 3fr;
border-radius: 12px;
overflow: hidden;
border: 1px solid #eee;
background: #fff;
}
.vmag__media {
position: relative;
aspect-ratio: auto;
min-height: 240px;
}
.vmag__poster { width: 100%; height: 100%; object-fit: cover; }
.vmag__placeholder {
width: 100%;
height: 100%;
background: linear-gradient(160deg, #0a0a1a 0%, #1a1a3a 100%);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.vmag__category {
position: absolute;
top: 1rem;
left: 1rem;
background: var(--color-accent, #6366f1);
color: #fff;
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
padding: 0.25rem 0.6rem;
border-radius: 4px;
}
.vmag__content {
padding: 2rem;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.vmag__title {
font-size: clamp(1.1rem, 2vw, 1.5rem);
font-weight: 700;
line-height: 1.3;
margin: 0 0 1rem;
}
.vmag__title-link {
color: var(--color-primary, #0a0a0a);
text-decoration: none;
}
.vmag__title-link:hover { color: var(--color-accent, #6366f1); }
.vmag__teaser {
font-size: 0.9rem;
color: #666;
line-height: 1.65;
margin: 0 0 1.5rem;
flex: 1;
}
.vmag__footer {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.8rem;
color: #999;
border-top: 1px solid #eee;
padding-top: 0.75rem;
gap: 0.5rem;
flex-wrap: wrap;
}
.vmag__author { font-weight: 600; color: var(--color-primary, #0a0a0a); }
@media (max-width: 640px) {
.vmag { grid-template-columns: 1fr; }
.vmag__media { min-height: 180px; }
}
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
category | string | — | Categorie label |
title | string | — | Videotitel |
teaser | string | — | Teasertekst |
author | string | — | Auteur |
* = verplicht