Zoeken...  ⌘K GitHub

VideoCtaOverlay video

Video thumbnail met CTA overlay.

/video-cta-overlay
src/components/video/VideoCtaOverlay.astro
---
interface Props {
  poster?: string;
  alt?: string;
  ctaTitle?: string;
  ctaBody?: string;
  ctaLabel?: string;
  ctaHref?: string;
  showAfterPercent?: number;
}

const {
  poster = '',
  alt = 'Video met CTA',
  ctaTitle = 'Klaar om te groeien?',
  ctaBody = 'Plan een gratis strategiegesprek en ontdek wat BLURR voor jouw merk kan doen.',
  ctaLabel = 'Gesprek inplannen',
  ctaHref = '#',
} = Astro.props;
---

<div class="vco">
  <div class="vco__player">
    {poster ? (
      <img class="vco__poster" src={poster} alt={alt} />
    ) : (
      <div class="vco__placeholder" aria-label={alt}>
        <svg width="48" height="48" viewBox="0 0 48 48">
          <circle cx="24" cy="24" r="24" fill="rgba(99,102,241,0.85)"/>
          <polygon points="19,12 41,24 19,36" fill="#fff"/>
        </svg>
      </div>
    )}
    <div class="vco__overlay">
      <div class="vco__cta-box">
        <h3 class="vco__cta-title">{ctaTitle}</h3>
        <p class="vco__cta-body">{ctaBody}</p>
        <a class="vco__cta-btn" href={ctaHref}>{ctaLabel}</a>
      </div>
    </div>
  </div>
</div>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .vco {}
  .vco__player {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
  }
  .vco__poster { width: 100%; height: 100%; object-fit: cover; }
  .vco__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .vco__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }
  .vco__cta-box {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  }
  .vco__cta-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary, #0a0a0a);
    margin: 0 0 0.75rem;
  }
  .vco__cta-body {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 1.5rem;
  }
  .vco__cta-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--color-accent, #6366f1);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: opacity 0.2s;
  }
  .vco__cta-btn:hover { opacity: 0.85; }
</style>

Props

Prop Type Default Beschrijving
poster string Thumbnail URL
ctaTitle string CTA titel
ctaBody string CTA tekst
ctaLabel string CTA knop

* = verplicht