Макеты и Сетки layoutlandingmedia
Split Media Section
Сплит-секция для лендингов с аргументирующим текстом и графикой сбоку.
Живое превью
Build Faster with Astro
Scale with pre-built accessible components and modular designs.
⚡ Interactive Preview
Использование
Скопируйте и вставьте этот код на вашу страницу Astro:
astro
---
import { SplitMediaSection } from 'astro-component-kit';
---
<LandingSectionSplit>Content</LandingSectionSplit> ---
import { SplitMediaSection } from 'astro-component-kit';
---
<LandingSectionSplit>Content</LandingSectionSplit> Ручная установка
Если вы не используете пакет npm, создайте файл и вставьте следующий код: src/components/lib/SplitMediaSection.astro:
astro
---
/**
* LandingSectionSplit — Landing page section with text on one side and a media container on the other.
*/
interface Props {
title?: string;
subtitle?: string;
className?: string;
}
const {
title = 'Build Faster with Astro',
subtitle = 'Scale with pre-built accessible components and modular designs.',
className = ''
} = Astro.props;
---
<div class="cq-landing-section-split-cq">
<section class={`split-sec ${className}`}>
<div class="split-sec-text">
<h2>{title}</h2>
<p>{subtitle}</p>
<div class="split-sec-actions">
<slot name="actions">
<button class="split-demo-btn">Explore Docs</button>
</slot>
</div>
</div>
<div class="split-sec-media">
<slot name="media">
<div class="media-mockup">
<span>⚡ Interactive Preview</span>
</div>
</slot>
</div>
</section>
</div>
<style>
.cq-landing-section-split-cq { container-type: inline-size; }
.split-sec {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
align-items: center;
padding: 2.5rem 1rem;
width: 100%;
}
.split-sec-text h2 {
font-size: 2.2rem;
font-weight: 800;
color: #fff;
margin: 0 0 1rem;
line-height: 1.2;
}
.split-sec-text p {
font-size: 1.05rem;
color: #94a3b8;
line-height: 1.6;
margin: 0 0 1.5rem;
}
.split-demo-btn {
padding: 0.75rem 1.5rem;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border: none;
border-radius: 8px;
color: #fff;
font-weight: 600;
cursor: pointer;
}
.split-sec-media {
width: 100%;
}
.media-mockup {
height: 220px;
background: rgba(15, 23, 42, 0.6);
border-radius: 16px;
border: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.1);
display: flex;
align-items: center;
justify-content: center;
color: #94a3b8;
font-weight: 600;
}
@container (max-width: 768px) {
.split-sec {
grid-template-columns: 1fr;
gap: 2rem;
}
}
</style> ---
/**
* LandingSectionSplit — Landing page section with text on one side and a media container on the other.
*/
interface Props {
title?: string;
subtitle?: string;
className?: string;
}
const {
title = 'Build Faster with Astro',
subtitle = 'Scale with pre-built accessible components and modular designs.',
className = ''
} = Astro.props;
---
<div class="cq-landing-section-split-cq">
<section class={`split-sec ${className}`}>
<div class="split-sec-text">
<h2>{title}</h2>
<p>{subtitle}</p>
<div class="split-sec-actions">
<slot name="actions">
<button class="split-demo-btn">Explore Docs</button>
</slot>
</div>
</div>
<div class="split-sec-media">
<slot name="media">
<div class="media-mockup">
<span>⚡ Interactive Preview</span>
</div>
</slot>
</div>
</section>
</div>
<style>
.cq-landing-section-split-cq { container-type: inline-size; }
.split-sec {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
align-items: center;
padding: 2.5rem 1rem;
width: 100%;
}
.split-sec-text h2 {
font-size: 2.2rem;
font-weight: 800;
color: #fff;
margin: 0 0 1rem;
line-height: 1.2;
}
.split-sec-text p {
font-size: 1.05rem;
color: #94a3b8;
line-height: 1.6;
margin: 0 0 1.5rem;
}
.split-demo-btn {
padding: 0.75rem 1.5rem;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border: none;
border-radius: 8px;
color: #fff;
font-weight: 600;
cursor: pointer;
}
.split-sec-media {
width: 100%;
}
.media-mockup {
height: 220px;
background: rgba(15, 23, 42, 0.6);
border-radius: 16px;
border: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.1);
display: flex;
align-items: center;
justify-content: center;
color: #94a3b8;
font-weight: 600;
}
@container (max-width: 768px) {
.split-sec {
grid-template-columns: 1fr;
gap: 2rem;
}
}
</style>
Краткая информация
- Категория
- Макеты и Сетки
- Имя файла
SplitMediaSection.astro- Зависимости
- Нет — чистый Astro + CSS
- Теги
- layoutlandingmedia