src/components/image/ImageFullscreen.astro
---
interface Props {
src?: string;
alt?: string;
eyebrow?: string;
title?: string;
body?: string;
cta?: string;
ctaHref?: string;
}
const {
src = '',
alt = 'Fullscreen achtergrond',
eyebrow = 'Bureau van het jaar 2024',
title = 'Marketing die resultaat levert',
body = 'Meer dan 80 merken kozen BLURR voor structurele groei.',
cta = 'Start jouw project',
ctaHref = '#',
} = Astro.props;
---
<section class="ifs">
{src ? (
<img class="ifs__bg" src={src} alt={alt} />
) : (
<div class="ifs__placeholder" aria-label={alt}></div>
)}
<div class="ifs__overlay">
<div class="ifs__content">
{eyebrow && <p class="ifs__eyebrow">{eyebrow}</p>}
<h1 class="ifs__title">{title}</h1>
{body && <p class="ifs__body">{body}</p>}
{cta && <a class="ifs__cta" href={ctaHref}>{cta}</a>}
</div>
</div>
</section>
<style>
:root {
--color-accent: #6366f1;
--color-primary: #0a0a0a;
}
.ifs {
position: relative;
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.ifs__bg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.ifs__placeholder {
position: absolute;
inset: 0;
background: linear-gradient(160deg, #0f0f1a 0%, #1a1a3a 60%, #0d0d2b 100%);
}
.ifs__overlay {
position: absolute;
inset: 0;
background: rgba(10,10,10,0.55);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
}
.ifs__content {
text-align: center;
max-width: 800px;
}
.ifs__eyebrow {
font-size: 0.8rem;
font-weight: 700;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--color-accent, #6366f1);
margin: 0 0 1rem;
}
.ifs__title {
font-size: clamp(2.5rem, 6vw, 5rem);
font-weight: 900;
color: #fff;
margin: 0 0 1.25rem;
line-height: 1.05;
}
.ifs__body {
font-size: 1.15rem;
color: rgba(255,255,255,0.8);
margin: 0 0 2.5rem;
line-height: 1.6;
}
.ifs__cta {
display: inline-block;
padding: 1rem 2.5rem;
background: var(--color-accent, #6366f1);
color: #fff;
text-decoration: none;
border-radius: 8px;
font-weight: 700;
font-size: 1rem;
transition: transform 0.2s, opacity 0.2s;
}
.ifs__cta:hover { transform: translateY(-2px); opacity: 0.9; }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
src | string | — | Afbeelding URL |
alt | string | — | Alt-tekst |
eyebrow | string | — | Kleine tekst boven de titel |
title | string | — | Hoofdtitel |
body | string | — | Ondersteuningsstekst |
cta | string | — | CTA-knop label |
ctaHref | string | — | CTA-knop URL |
* = verplicht