Zoeken...  ⌘K GitHub

VideoLoop video

Loopende ambient video achtergrond sectie.

/video-loop
src/components/video/VideoLoop.astro
---
/**
 * VideoLoop
 * Sfeervol herhalend video-achtergrond gedeelte
 */
interface Props {
  headline?: string;
  body?: string;
}
const {
  headline = 'Wij werken. Altijd.',
  body = 'Terwijl jij je focust op je bedrijf, optimaliseren wij continu je campagnes, content en conversies.',
} = Astro.props;
---

<section class="vlp">
  <div class="vlp__video-wrap">
    <video
      class="vlp__video"
      autoplay
      muted
      loop
      playsinline
      aria-hidden="true"
    >
      <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4" />
    </video>
    <div class="vlp__gradient"></div>
  </div>
  <div class="vlp__content">
    <h2 class="vlp__headline">{headline}</h2>
    {body && <p class="vlp__body">{body}</p>}
  </div>
</section>

<style>
  .vlp {
    position: relative;
    height: 480px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .vlp__video-wrap {
    position: absolute;
    inset: 0;
  }
  .vlp__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.4) brightness(0.75);
  }
  .vlp__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.2) 60%, transparent 100%);
  }
  .vlp__content {
    position: relative;
    z-index: 1;
    padding: 2.5rem 1.5rem 3rem;
    text-align: center;
    max-width: 680px;
    width: 100%;
  }
  .vlp__headline {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }
  .vlp__body {
    color: rgba(255,255,255,0.65);
    font-size: 0.97rem;
    line-height: 1.65;
    margin: 0;
  }
</style>

Props

Prop Type Default Beschrijving
headline string Headline
body string Body tekst

* = verplicht