Zoeken...  ⌘K GitHub

ImageSplit image

Afbeelding naast tekst, koptitel en CTA-knop.

/image-split
src/components/image/ImageSplit.astro
---
interface Props {
  src?: string;
  alt?: string;
  title?: string;
  body?: string;
  cta?: string;
  ctaHref?: string;
  reverse?: boolean;
}

const {
  src = '',
  alt = 'Afbeelding',
  title = 'Wij bouwen merken die groeien',
  body = 'BLURR combineert strategie, design en performance marketing in één geïntegreerde aanpak. Geen losse schakels — één team dat verantwoordelijkheid neemt voor het resultaat.',
  cta = 'Bekijk onze werkwijze',
  ctaHref = '#',
  reverse = false,
} = Astro.props;
---

<section class:list={['isp', reverse && 'isp--reverse']}>
  <div class="isp__media">
    {src ? (
      <img class="isp__img" src={src} alt={alt} />
    ) : (
      <div class="isp__placeholder" aria-label={alt}></div>
    )}
  </div>
  <div class="isp__content">
    <h2 class="isp__title">{title}</h2>
    <p class="isp__body">{body}</p>
    {cta && <a class="isp__cta" href={ctaHref}>{cta}</a>}
  </div>
</section>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .isp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 480px;
  }
  .isp--reverse { direction: rtl; }
  .isp--reverse > * { direction: ltr; }
  .isp__media {
    position: relative;
    overflow: hidden;
  }
  .isp__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .isp__placeholder {
    width: 100%;
    height: 100%;
    min-height: 360px;
    background: linear-gradient(135deg, #e8e8f0 0%, #d0d0e8 100%);
  }
  .isp__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    background: #fff;
  }
  .isp__title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--color-primary, #0a0a0a);
    margin: 0 0 1.25rem;
    line-height: 1.2;
  }
  .isp__body {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.7;
    margin: 0 0 2rem;
  }
  .isp__cta {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: var(--color-accent, #6366f1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    align-self: flex-start;
    transition: opacity 0.2s;
  }
  .isp__cta:hover { opacity: 0.85; }
  @media (max-width: 768px) {
    .isp { grid-template-columns: 1fr; }
    .isp__content { padding: 2rem; }
    .isp--reverse { direction: ltr; }
  }
</style>

Props

Prop Type Default Beschrijving
src string Afbeelding URL
alt string Alt-tekst
title string Koptitel
body string Beschrijvende tekst
cta string CTA-knop label
ctaHref string CTA-knop URL
reverse boolean Spiegel de volgorde (tekst links, afbeelding rechts)

* = verplicht