HeroSplitAngle Hero
Split hero met schuin afgesneden grens via clip-path. Tekst links, afbeelding rechts.
src/components/hero/HeroSplitAngle.astro
---
/**
* HeroSplitAngle
* Split hero met schuin afgesneden grens tussen tekst en afbeelding.
* Clip-path geometrisch effect voor een frisse, dynamische look.
*/
interface Props {
eyebrow?: string;
headline: string;
sub?: string;
ctaPrimary?: { label: string; href: string };
ctaSecondary?: { label: string; href: string };
image: string;
imageAlt?: string;
accentColor?: string;
}
const { eyebrow, headline, sub, ctaPrimary, ctaSecondary, image, imageAlt = '', accentColor = '#6366f1' } = Astro.props;
---
<section class="hsa" style={`--hsa-accent:${accentColor}`}>
<div class="hsa-text">
{eyebrow && <span class="hsa-eyebrow">{eyebrow}</span>}
<h1 class="hsa-headline">{headline}</h1>
{sub && <p class="hsa-sub">{sub}</p>}
<div class="hsa-actions">
{ctaPrimary && <a href={ctaPrimary.href} class="hsa-btn hsa-btn--primary">{ctaPrimary.label}</a>}
{ctaSecondary && <a href={ctaSecondary.href} class="hsa-btn hsa-btn--ghost">{ctaSecondary.label}</a>}
</div>
</div>
<div class="hsa-visual">
<img src={image} alt={imageAlt} class="hsa-img" />
</div>
</section>
<style>
.hsa { display: grid; grid-template-columns: 1fr 1fr; min-height: 90vh; overflow: hidden; }
.hsa-text { display: flex; flex-direction: column; justify-content: center; padding: 5rem clamp(2rem, 6vw, 5rem); background: #fff; clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); z-index: 1; }
.hsa-eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hsa-accent); margin-bottom: 1.25rem; }
.hsa-headline { font-size: clamp(2.25rem, 4vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: #0a0a0a; margin: 0 0 1.25rem; }
.hsa-sub { font-size: 1.0625rem; color: #6b7280; line-height: 1.65; margin: 0 0 2.5rem; max-width: 440px; }
.hsa-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hsa-btn { display: inline-flex; align-items: center; padding: 0.8125rem 1.75rem; border-radius: 0.5rem; font-size: 0.9375rem; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.hsa-btn--primary { background: var(--hsa-accent); color: #fff; }
.hsa-btn--primary:hover { opacity: 0.9; transform: translateY(-1px); }
.hsa-btn--ghost { border: 1.5px solid #e2e8f0; color: #374151; }
.hsa-visual { overflow: hidden; margin-left: -8%; }
.hsa-img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 768px) { .hsa { grid-template-columns: 1fr; min-height: auto; } .hsa-text { clip-path: none; padding: 4rem 1.5rem 2rem; } .hsa-visual { height: 300px; margin: 0; } }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
headline * | string | — | H1 tekst |
image * | string | — | Afbeelding URL (rechterhelft) |
eyebrow | string | — | Label boven headline |
sub | string | — | Ondertitel |
ctaPrimary | { label: string; href: string } | — | Primaire CTA |
ctaSecondary | { label: string; href: string } | — | Secundaire CTA |
accentColor | string | '#6366f1' | Accent kleur |
* = verplicht