astro_avtourist/frontend/src/components/home/WhyUs.astro

254 lines
No EOL
8.9 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
// src/components/WhyUs.astro
const sectionData = {
subtitle: "Почему мы?",
title: "Локальная экспертиза в Сургуте",
floatingText: "Знаем специфику судов Сургута и регламенты местной полиции изнутри.",
// Плейсхолдер картинки (замените на свою локальную, например src/assets/gavel.jpg)
imageUrl: "https://images.unsplash.com/photo-1589829085413-56de8ae18c73?q=80&w=1000&auto=format&fit=crop"
};
const features = [
{
title: "Местный опыт",
desc: "Мы работаем только в Сургуте и ХМАО. Это позволяет нам знать практику каждого судьи и особенности работы местных отделов ГИБДД.",
// Иконка: Пин на карте
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>`
},
{
title: "92% Успешных дел",
desc: "Высокий процент выигранных дел по возврату прав и страховым спорам. Работаем на результат, а не на процесс.",
// Иконка: Галочка-бейджик
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path><path d="m9 12 2 2 4-4"></path></svg>`
},
{
title: "Срочный выезд",
desc: "Оперативно выезжаем на место ДТП или задержания в любой район города для фиксации нарушений.",
// Иконка: Часы с историей
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path><path d="M12 7v5l4 2"></path></svg>`
}
];
---
<section class="why-us-section">
<div class="site-container">
<!-- Левая колонка: Изображение -->
<div class="image-column">
<div class="image-wrapper">
<img src={sectionData.imageUrl} alt="Юридическая практика" class="main-image" loading="lazy" />
<!-- Плавающая бежевая плашка -->
<div class="floating-card">
<p>{sectionData.floatingText}</p>
</div>
</div>
</div>
<!-- Правая колонка: Текст и особенности -->
<div class="content-column">
<div class="section-header">
<span class="subtitle">{sectionData.subtitle}</span>
<h2 class="title">{sectionData.title}</h2>
</div>
<div class="features-list">
{features.map((feature) => (
<div class="feature-item">
<div class="icon-box" set:html={feature.icon} />
<div class="feature-text">
<h3 class="feature-title">{feature.title}</h3>
<p class="feature-desc">{feature.desc}</p>
</div>
</div>
))}
</div>
</div>
</div>
</section>
<style>
/* Общие стили секции */
.why-us-section {
padding: 6rem 2rem;
background-color: #f4f6f9; /* Очень светлый серо-голубой фон (из макета) */
font-family: system-ui, -apple-system, sans-serif;
}
.site-container {
display: grid;
grid-template-columns: 1fr 1fr; /* Две равные колонки */
gap: 6rem; /* Большой отступ между колонками */
align-items: center;
}
/* --- Левая колонка (Изображение) --- */
.image-column {
position: relative;
padding-bottom: 2rem; /* Место для плавающей плашки */
padding-right: 2rem;
}
.image-wrapper {
position: relative;
border-radius: 12px;
overflow: visible; /* Чтобы плашка могла выходить за края */
}
.main-image {
width: 100%;
height: auto;
aspect-ratio: 4/4.5; /* Пропорции картинки как на макете */
object-fit: cover;
border-radius: 12px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
/* Бежевая плавающая плашка */
.floating-card {
position: absolute;
bottom: -30px;
right: -30px;
background-color: #fce1a8; /* Бежево-желтый цвет */
padding: 1.8rem;
border-radius: 6px;
max-width: 320px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
z-index: 2;
}
.floating-card p {
font-family: Georgia, 'Times New Roman', Times, serif; /* Шрифт с засечками */
font-size: 0.95rem;
font-weight: 700;
line-height: 1.5;
color: #1e3050;
margin: 0;
}
/* --- Правая колонка (Контент) --- */
.section-header {
margin-bottom: 3rem;
}
.subtitle {
display: block;
color: #1e3050;
font-size: 0.85rem;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 1rem;
}
.title {
color: #1e3050;
font-size: clamp(2rem, 3vw, 2.5rem);
font-weight: 800;
line-height: 1.1;
margin: 0;
letter-spacing: -0.5px;
}
/* Список особенностей (Features) */
.features-list {
display: flex;
flex-direction: column;
gap: 2.5rem; /* Расстояние между пунктами */
}
.feature-item {
display: flex;
gap: 1.5rem; /* Расстояние между иконкой и текстом */
align-items: flex-start;
}
/* Темно-синие квадратные иконки */
.icon-box {
flex-shrink: 0;
width: 46px;
height: 46px;
background-color: #122138; /* Темно-синий фон иконки */
color: #ffffff;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px; /* Внутренний отступ для SVG */
box-shadow: 0 4px 10px rgba(18, 33, 56, 0.2);
}
/* Типографика текстов особенностей */
.feature-text {
flex-grow: 1;
padding-top: 0.2rem;
}
/* Заголовки пунктов - шрифт с засечками */
.feature-title {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 1.2rem;
font-weight: 700;
color: #1e3050;
margin: 0 0 0.5rem 0;
}
/* Описание пунктов - шрифт с засечками, серый цвет */
.feature-desc {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 0.95rem;
line-height: 1.6;
color: #6c7a8c;
margin: 0;
}
/* --- Адаптивность --- */
@media (max-width: 1024px) {
.site-container {
gap: 3rem; /* Уменьшаем отступ между колонками на планшетах */
}
.floating-card {
right: -10px; /* Сдвигаем плашку, чтобы не вылазила за экран */
max-width: 280px;
}
}
@media (max-width: 768px) {
.why-us-section {
padding: 4rem 1.5rem;
}
.site-container {
grid-template-columns: 1fr; /* Одна колонка на мобильных */
gap: 4rem;
}
/* Картинка встает сверху, плашка выравнивается */
.image-column {
padding-right: 0;
padding-bottom: 0;
}
.floating-card {
bottom: -20px;
right: 20px; /* Не даем уйти за правый край экрана */
left: 20px; /* Растягиваем на мобилках */
max-width: none;
}
}
@media (max-width: 480px) {
.feature-item {
gap: 1rem;
}
.icon-box {
width: 40px;
height: 40px;
padding: 8px;
}
}
</style>