Zoeken...  ⌘K GitHub

HeroSplitReversed Hero

Split hero omgekeerd: afbeelding links, tekst rechts. Met decoratief offset-frame, features-lijst en avatar trust-bar.

/hero-split-reversed
src/components/hero/HeroSplitReversed.astro
---
/**
 * HeroSplitReversed
 * Split hero maar met afbeelding links en tekst rechts (reverse van HeroSplit).
 * Voegt ook een trust bar toe met avatar groep + "X klanten vertrouwen ons".
 */
interface Props {
  headline: string;
  sub: string;
  ctaLabel?: string;
  ctaHref?: string;
  imageSrc: string;
  imageAlt?: string;
  trustCount?: string;
  trustLabel?: string;
  avatars?: string[];
  features?: string[];
}

const {
  headline,
  sub,
  ctaLabel = 'Gratis starten',
  ctaHref = '#',
  imageSrc,
  imageAlt = '',
  trustCount,
  trustLabel,
  avatars = [],
  features = [],
} = Astro.props;
---

<section class="hsr" data-component="hero-split-reversed">
  <div class="hsr__inner">
    <!-- Image links -->
    <div class="hsr__visual">
      <div class="hsr__img-frame">
        <img src={imageSrc} alt={imageAlt} class="hsr__img" loading="eager" />
        <div class="hsr__img-decor"></div>
      </div>
    </div>

    <!-- Text rechts -->
    <div class="hsr__content">
      <h1 class="hsr__headline" set:html={headline} />
      <p class="hsr__sub">{sub}</p>

      {features.length > 0 && (
        <ul class="hsr__features">
          {features.map(f => (
            <li class="hsr__feature">
              <svg class="hsr__check" width="16" height="16" viewBox="0 0 16 16" fill="none">
                <circle cx="8" cy="8" r="8" fill="currentColor" opacity="0.12"/>
                <path d="M5 8.5l2 2 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
              </svg>
              {f}
            </li>
          ))}
        </ul>
      )}

      <a href={ctaHref} class="hsr__cta">{ctaLabel}</a>

      {(trustCount || avatars.length > 0) && (
        <div class="hsr__trust">
          {avatars.length > 0 && (
            <div class="hsr__avatars">
              {avatars.slice(0, 4).map(av => (
                <img src={av} alt="" class="hsr__avatar-img" />
              ))}
            </div>
          )}
          {trustCount && (
            <p class="hsr__trust-text">
              <strong>{trustCount}</strong>
              {trustLabel ?? 'klanten vertrouwen op ons'}
            </p>
          )}
        </div>
      )}
    </div>
  </div>
</section>

<style>
  .hsr {
    background: var(--color-bg, #fff);
    padding: 5rem 1.5rem;
    overflow: hidden;
  }

  .hsr__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
  }

  /* Visual */
  .hsr__img-frame {
    position: relative;
  }

  .hsr__img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    border-radius: calc(var(--radius, 0.5rem) * 2);
    display: block;
    position: relative;
    z-index: 1;
  }

  .hsr__img-decor {
    position: absolute;
    inset: 1.5rem -1.5rem -1.5rem 1.5rem;
    background: color-mix(in srgb, var(--color-accent, #6366f1) 12%, transparent);
    border-radius: calc(var(--radius, 0.5rem) * 2);
    z-index: 0;
  }

  /* Content */
  .hsr__headline {
    font-size: clamp(2rem, 3.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--color-primary, #0a0a0a);
    margin-bottom: 1.25rem;
  }

  .hsr__headline :global(em) {
    font-style: normal;
    color: var(--color-accent, #6366f1);
  }

  .hsr__sub {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--color-muted, #6b7280);
    margin-bottom: 1.5rem;
  }

  .hsr__features {
    list-style: none;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }

  .hsr__feature {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    color: var(--color-primary, #0a0a0a);
    font-weight: 500;
  }

  .hsr__check {
    flex-shrink: 0;
    color: var(--color-accent, #6366f1);
  }

  .hsr__cta {
    display: inline-block;
    background: var(--color-accent, #6366f1);
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: var(--radius, 0.5rem);
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    margin-bottom: 2rem;
    transition: all 0.2s;
  }

  .hsr__cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
  }

  /* Trust */
  .hsr__trust {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0,0,0,0.07);
  }

  .hsr__avatars {
    display: flex;
  }

  .hsr__avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-bg, #fff);
    object-fit: cover;
    margin-left: -8px;
  }

  .hsr__avatars .hsr__avatar-img:first-child { margin-left: 0; }

  .hsr__trust-text {
    font-size: 0.8125rem;
    color: var(--color-muted, #6b7280);
  }

  .hsr__trust-text strong {
    color: var(--color-primary, #0a0a0a);
    font-weight: 700;
  }

  @media (max-width: 768px) {
    .hsr__inner {
      grid-template-columns: 1fr;
      gap: 2rem;
    }

    .hsr__img { height: 280px; }
    .hsr__img-decor { display: none; }
  }
</style>

Props

Prop Type Default Beschrijving
headline * string H1 — gebruik <em> voor accent
sub * string Subtitel
imageSrc * string Hero afbeelding
features string[] Checkmarks lijst
trustCount string Getal voor trust bar (bv. "500+")

* = verplicht