МÐНоÐСоздан компоент Steps

This commit is contained in:
Web-serfer 2026-04-04 16:18:55 +05:00
parent d5286ab980
commit 00f9b24a60
9 changed files with 1420 additions and 184 deletions

View file

@ -6,7 +6,7 @@ const titleWhite = "Защитите свои права";
const titleGold = "и водительское удостоверение";
const description = "Профессиональная юридическая помощь при ДТП, спорах с ГИБДД и страховыми компаниями. Работаем на результат в судах ХМАО-Югры.";
const btnPrimary = "Бесплатная консультация";
const btnSecondary = "Наши услуги";
const btnSecondary = "Мои услуги";
const bgImageUrl = "/images/home/bg_hero.png";
const lawyerImageUrl = "/images/home/heroImg.jpg";
@ -17,31 +17,33 @@ const lawyerImageUrl = "/images/home/heroImg.jpg";
<div class="site-container hero-grid">
<div class="hero-content">
<div class="badge">
<div class="badge animate-load" data-delay="100">
<span class="status-dot"></span>
{badgeText}
</div>
<h1 class="hero-title">
<span class="text-white">{titleWhite}</span>
<span class="text-white animate-load" data-delay="300">{titleWhite}</span>
<br />
<span class="text-gold">{titleGold}</span>
<span class="text-gold animate-load" data-delay="500">{titleGold}</span>
</h1>
<p class="hero-description">{description}</p>
<p class="hero-description animate-load" data-delay="700">{description}</p>
<div class="hero-actions">
<div class="hero-actions animate-load" data-delay="900">
<Button variant="gold" size="lg" id="consultation-btn" data-modal-target="consultation-modal">
{btnPrimary}
</Button>
<a href="/services" class="btn btn-secondary">{btnSecondary}</a>
<Button variant="outline" size="lg" href="/services" class="btn-services">
{btnSecondary}
</Button>
</div>
</div>
<div class="hero-image-wrapper">
<div class="hero-image-wrapper animate-load" data-delay="400">
<div class="image-composition">
<img src={lawyerImageUrl} alt="Юрист" class="main-image" />
<div class="experience-badge">
<div class="experience-badge animate-load" data-delay="1100">
<span class="exp-number">20+</span>
<span class="exp-text">ЛЕТ ОПЫТА В ХМАО</span>
</div>
@ -50,6 +52,21 @@ const lawyerImageUrl = "/images/home/heroImg.jpg";
</div>
</section>
<script>
// Анимация при загрузке страницы
document.addEventListener('DOMContentLoaded', () => {
const animatedElements = document.querySelectorAll('.animate-load');
animatedElements.forEach((el) => {
const delay = parseInt((el as HTMLElement).dataset.delay || '0');
setTimeout(() => {
el.classList.add('is-visible');
}, delay);
});
});
</script>
<style define:vars={{ bgImageUrl: `url("${bgImageUrl}")` }}>
.hero-section {
position: relative;
@ -61,9 +78,8 @@ const lawyerImageUrl = "/images/home/heroImg.jpg";
background-size: cover;
background-position: center;
/* ГЛАВНОЕ ИСПРАВЛЕНИЕ GAP */
margin: 0 !important;
padding-top: 80px; /* Соответствует высоте Header на десктопе */
padding-top: 80px;
box-sizing: border-box;
overflow: hidden;
}
@ -86,7 +102,59 @@ const lawyerImageUrl = "/images/home/heroImg.jpg";
width: 100%;
}
.hero-content { flex: 1.2; max-width: 700px; }
.hero-content {
flex: 1.2;
max-width: 700px;
}
/* --- АНИМАЦИИ ПРИ ЗАГРУЗКЕ --- */
.animate-load {
opacity: 0;
transform: translateY(30px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
will-change: opacity, transform;
}
.animate-load.is-visible {
opacity: 1;
transform: translateY(0);
}
/* Специальная анимация для изображения - сбоку */
.hero-image-wrapper.animate-load {
opacity: 0;
transform: translateX(50px) scale(0.95);
transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-image-wrapper.animate-load.is-visible {
opacity: 1;
transform: translateX(0) scale(1);
}
/* Анимация для бейджа опыта - снизу с масштабом */
.experience-badge.animate-load {
opacity: 0;
transform: translateY(20px) scale(0.9);
transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.experience-badge.animate-load.is-visible {
opacity: 1;
transform: translateY(0) scale(1);
}
/* Задержки для последовательного появления */
.badge[data-delay="100"] { transition-delay: 0.1s; }
.hero-image-wrapper[data-delay="400"] { transition-delay: 0.4s; }
.text-white[data-delay="300"] { transition-delay: 0.3s; }
.text-gold[data-delay="500"] { transition-delay: 0.5s; }
.hero-description[data-delay="700"] { transition-delay: 0.7s; }
.hero-actions[data-delay="900"] { transition-delay: 0.9s; }
.experience-badge[data-delay="1100"] { transition-delay: 1.1s; }
.badge {
display: inline-flex; align-items: center; gap: 0.6rem;
@ -122,55 +190,251 @@ const lawyerImageUrl = "/images/home/heroImg.jpg";
}
}
.hero-title { font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.15; margin: 0 0 2rem 0; font-weight: 800; }
.hero-title {
font-size: clamp(2rem, 5vw, 3.8rem);
line-height: 1.15;
margin: 0 0 2rem 0;
font-weight: 800;
}
.hero-title .text-white,
.hero-title .text-gold {
display: inline-block;
}
.text-white { color: #ffffff; }
.text-gold { color: #eac26e; }
.hero-description { color: rgba(255, 255, 255, 0.85); font-size: 1.15rem; line-height: 1.6; margin-bottom: 3.5rem; max-width: 580px; }
.hero-actions { display: flex; gap: 1.5rem; align-items: center; }
.btn-secondary {
display: inline-flex; padding: 1rem 2rem; background-color: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(10px); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 6px; font-weight: 600; text-decoration: none; transition: 0.3s;
.hero-description {
color: rgba(255, 255, 255, 0.85);
font-size: 1.15rem;
line-height: 1.6;
margin-bottom: 3.5rem;
max-width: 580px;
}
.btn-secondary:hover { background-color: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.hero-actions {
display: flex;
gap: 1.5rem;
align-items: stretch;
}
.hero-image-wrapper { flex: 1; display: flex; justify-content: flex-end; position: relative; }
.image-composition { position: relative; width: 100%; max-width: 480px; }
.hero-actions > * {
display: flex;
align-items: center;
}
/* Кастомные стили для кнопки "Мои услуги" */
.btn-services {
background: transparent !important;
border: 2px solid #ffffff !important;
color: #ffffff !important;
padding: 0.875rem 1.5rem !important;
font-size: 1.125rem !important;
line-height: 1.75rem !important;
position: relative;
overflow: hidden;
z-index: 1;
height: auto !important;
min-height: 3.25rem !important;
transition: all 0.3s ease;
}
.btn-services::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s ease;
z-index: -1;
}
.btn-services::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 0;
height: 100%;
background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
transition: width 0.4s ease;
z-index: -1;
}
.btn-services:hover {
background: rgba(255, 255, 255, 0.1) !important;
border-color: #eac26e !important;
color: #eac26e !important;
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(234, 194, 110, 0.3);
}
.btn-services:hover::before {
left: 100%;
}
.btn-services:hover::after {
width: 100%;
}
.btn-services:active {
transform: translateY(-1px);
box-shadow: 0 4px 15px rgba(234, 194, 110, 0.2);
}
.hero-image-wrapper {
flex: 1;
display: flex;
justify-content: flex-end;
position: relative;
}
.image-composition {
position: relative;
width: 100%;
max-width: 480px;
}
.image-composition::before {
content: ''; position: absolute; top: -10px; left: 20px; right: -20px; bottom: 10px;
background-color: #ffffff; border-radius: 12px; transform: rotate(3deg); z-index: -1;
content: '';
position: absolute;
top: -10px;
left: 20px;
right: -20px;
bottom: 10px;
background-color: #ffffff;
border-radius: 12px;
transform: rotate(3deg);
z-index: -1;
opacity: 0;
animation: fadeInRotate 0.8s ease 0.6s forwards;
}
.main-image { width: 100%; border-radius: 12px; border: 8px solid #ffffff; filter: grayscale(100%); box-shadow: 0 30px 60px rgba(0,0,0,0.4); }
@keyframes fadeInRotate {
from {
opacity: 0;
transform: rotate(0deg) translateY(20px);
}
to {
opacity: 1;
transform: rotate(3deg) translateY(0);
}
}
.main-image {
width: 100%;
border-radius: 12px;
border: 8px solid #ffffff;
filter: grayscale(100%);
box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}
.experience-badge {
position: absolute; bottom: 30px; left: -30px; background: #ffffff; padding: 1.5rem;
border-radius: 8px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); min-width: 180px;
position: absolute;
bottom: 30px;
left: -30px;
background: #ffffff;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 15px 35px rgba(0,0,0,0.2);
min-width: 180px;
}
.exp-number { font-size: 2.2rem; font-weight: 900; color: #1e3050; line-height: 1; display: block; }
.exp-text { font-size: 0.7rem; font-weight: 800; color: #535e6c; text-transform: uppercase; }
.exp-number {
font-size: 2.2rem;
font-weight: 900;
color: #1e3050;
line-height: 1;
display: block;
}
/* АДАПТИВНОСТЬ ПОД ВЫСОТУ ШАПКИ */
.exp-text {
font-size: 0.7rem;
font-weight: 800;
color: #535e6c;
text-transform: uppercase;
}
/* АДАПТИВНОСТЬ */
@media (max-width: 992px) {
.hero-section { padding-top: 70px; min-height: auto; }
.hero-grid { flex-direction: column; text-align: center; padding: 1.5rem 1.5rem 4rem; }
.hero-content { align-items: center; }
.hero-actions { justify-content: center; }
.hero-image-wrapper { margin-top: 3rem; justify-content: center; }
.experience-badge { left: 0; bottom: -20px; }
.hero-section {
padding-top: 70px;
min-height: auto;
}
.hero-grid {
flex-direction: column;
text-align: center;
padding: 1.5rem 1.5rem 4rem;
}
.hero-content {
align-items: center;
}
.hero-actions {
justify-content: center;
}
.hero-image-wrapper {
margin-top: 3rem;
justify-content: center;
}
.experience-badge {
left: 0;
bottom: -20px;
}
/* На мобильных меняем направление анимации изображения */
.hero-image-wrapper.animate-load {
transform: translateY(40px) scale(0.95);
}
.hero-image-wrapper.animate-load.is-visible {
transform: translateY(0) scale(1);
}
}
@media (max-width: 767px) {
.hero-section { padding-top: 64px; }
.hero-title { font-size: 1.8rem; }
.hero-actions { flex-direction: column; width: 100%; }
.hero-actions > * { width: 100%; }
.image-composition::before { display: none; }
.hero-section {
padding-top: 64px;
}
.hero-title {
font-size: 1.8rem;
}
.hero-actions {
flex-direction: column;
width: 100%;
}
.hero-actions > * {
width: 100%;
}
.image-composition::before {
display: none;
}
}
</style>
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.animate-load,
.hero-image-wrapper.animate-load,
.experience-badge.animate-load {
opacity: 1;
transform: none;
transition: none;
}
.image-composition::before {
animation: none;
opacity: 1;
}
}
</style>

View file

@ -0,0 +1,264 @@
---
// Данные отзывов
const reviews = [
{
name: "Алексей М.",
car: "Toyota Camry",
text: "Помогли вернуть права после того, как инспектор незаконно составил протокол за встречку. Юрист нашел кучу ошибок в схеме ДТП. Огромное спасибо!",
initial: "А",
color: "bg-blue-100 text-blue-600"
},
{
name: "Екатерина П.",
car: "Hyundai Solaris",
text: "Страховая выплатила копейки по ОСАГО. Обратилась сюда, сделали независимую экспертизу и через суд взыскали еще 120 тысяч. Профессионалы!",
initial: "Е",
color: "bg-teal-100 text-teal-600"
},
{
name: "Игорь С.",
car: "Lexus RX",
text: "Грамотно разобрали сложное ДТП на перекрестке. Доказали, что я не виноват, хотя ГИБДД изначально решило иначе. Лучшие в Сургуте.",
initial: "И",
color: "bg-orange-100 text-orange-600"
}
];
// Для эффекта бесконечности клонируем элементы (один набор в начало, один в конец)
const displayReviews = [...reviews, ...reviews, ...reviews];
---
<section class="reviews-section py-16 bg-[#ffffff] overflow-hidden">
<div class="site-container">
<div class="section-header">
<span class="subtitle animate-on-scroll" data-animation="fade-up">Отзывы клиентов</span>
<h2 class="title animate-on-scroll" data-animation="fade-up" data-delay="100">Реальные истории водителей из Сургута</h2>
</div>
</div>
<div class="slider-wrapper">
<div class="relative max-w-6xl mx-auto px-4 group">
<!-- Кнопка Назад -->
<button id="prevBtn" class="absolute left-0 top-1/2 -translate-y-1/2 -translate-x-2 md:-translate-x-10 z-10 bg-white w-12 h-12 rounded-full shadow-lg flex items-center justify-center text-slate-400 hover:text-blue-600 transition-all border border-slate-100 active:scale-95 hover:cursor-pointer animate-on-scroll" data-animation="fade-in" data-delay="200">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" /></svg>
</button>
<!-- Окно просмотра -->
<div id="sliderContainer" class="overflow-x-hidden scroll-smooth">
<div id="sliderTrack" class="flex gap-6 py-4">
{displayReviews.map((review, index) => (
<div class="card-item min-w-full md:min-w-[calc(33.333%-1rem)] bg-white p-8 rounded-2xl shadow-sm border border-slate-100 flex flex-col justify-between select-none animate-on-scroll" data-animation="scale-up" data-delay={index * 100 + 300}>
<div>
<div class="flex gap-1 mb-5">
{[...Array(5)].map(() => (
<svg class="w-5 h-5 text-[#fbbf24] fill-current" viewBox="0 0 20 20"><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" /></svg>
))}
</div>
<p class="text-slate-700 leading-relaxed italic text-[15px] mb-8">
"{review.text}"
</p>
</div>
<div class="flex items-center gap-4">
<div class={`w-12 h-12 rounded-xl flex items-center justify-center font-bold text-lg shrink-0 ${review.color}`}>
{review.initial}
</div>
<div class="text-left">
<h4 class="font-bold text-[#1e293b] leading-tight">{review.name}</h4>
<p class="text-sm text-slate-400">{review.car}</p>
</div>
</div>
</div>
))}
</div>
</div>
<!-- Кнопка Вперед -->
<button id="nextBtn" class="absolute right-0 top-1/2 -translate-y-1/2 translate-x-2 md:translate-x-10 z-10 bg-white w-12 h-12 rounded-full shadow-lg flex items-center justify-center text-slate-400 hover:text-blue-600 transition-all border border-slate-100 active:scale-95 hover:cursor-pointer animate-on-scroll" data-animation="fade-in" data-delay="200">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg>
</button>
</div>
</div>
</section>
<style>
/* Скрываем скроллбар для всех браузеров */
#sliderContainer {
-ms-overflow-style: none;
scrollbar-width: none;
}
#sliderContainer::-webkit-scrollbar {
display: none;
}
/* Плавный скролл snap-эффект */
.card-item {
scroll-snap-align: center;
}
/* --- ЗАГОЛОВОК СЕКЦИИ (как в Services) --- */
.section-header {
margin-bottom: 4rem;
text-align: center;
}
.subtitle {
display: inline-block;
color: #d4af37;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 3px;
margin-bottom: 1rem;
padding: 0.5rem 1rem;
background: rgba(212, 175, 55, 0.1);
border-radius: 6px;
}
.title {
color: #1e293b;
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 800;
margin: 0;
line-height: 1.2;
letter-spacing: -0.02em;
}
.slider-wrapper {
width: 100%;
}
/* --- АНИМАЦИИ ПРИ СКРОЛЛИНГЕ --- */
.animate-on-scroll {
opacity: 0;
will-change: opacity, transform;
}
/* Fade Up - для заголовка */
[data-animation="fade-up"] {
transform: translateY(30px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Fade In - для кнопок */
[data-animation="fade-in"] {
transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Scale Up - для карточек */
[data-animation="scale-up"] {
transform: translateY(40px) scale(0.95);
transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Активное состояние */
.animate-on-scroll.is-visible {
opacity: 1;
transform: translateY(0) scale(1);
}
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.animate-on-scroll {
opacity: 1;
transform: none;
transition: none;
}
}
</style>
<script>
// Intersection Observer для анимаций при скроллинге
const setupAnimations = () => {
const observerOptions = {
root: null,
rootMargin: '0px 0px -50px 0px',
threshold: 0.1
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const el = entry.target as HTMLElement;
const delay = parseInt(el.dataset.delay || '0');
setTimeout(() => {
el.classList.add('is-visible');
}, delay);
observer.unobserve(el);
}
});
}, observerOptions);
document.querySelectorAll('.animate-on-scroll').forEach((el) => {
observer.observe(el);
});
};
const setupSlider = () => {
const container = document.getElementById('sliderContainer');
const track = document.getElementById('sliderTrack');
const nextBtn = document.getElementById('nextBtn');
const prevBtn = document.getElementById('prevBtn');
const cards = document.querySelectorAll('.card-item');
if (!container || !track || !nextBtn || !prevBtn) return;
const totalOriginal = cards.length / 3; // Так как мы отрисовали массив 3 раза
const firstCard = cards[0] as HTMLElement;
let cardWidth = firstCard.offsetWidth + 24; // Ширина + gap
// 1. Устанавливаем начальную позицию в центр (на реальный первый элемент)
const initialScroll = cardWidth * totalOriginal;
container.scrollLeft = initialScroll;
const handleNext = () => {
container.scrollLeft += cardWidth;
};
const handlePrev = () => {
container.scrollLeft -= cardWidth;
};
// 2. Логика "Бесконечности" (Сквозной скроллинг)
container.addEventListener('scroll', () => {
const scrollPos = container.scrollLeft;
const maxScroll = container.scrollWidth - container.clientWidth;
// Если дошли почти до конца (правого края клонов), прыгаем в центр без анимации
if (scrollPos >= maxScroll - 5) {
container.style.scrollBehavior = 'auto';
container.scrollLeft = initialScroll;
container.style.scrollBehavior = 'smooth';
}
// Если дошли до самого начала (левого края клонов), прыгаем в центр
if (scrollPos <= 5) {
container.style.scrollBehavior = 'auto';
container.scrollLeft = initialScroll;
container.style.scrollBehavior = 'smooth';
}
});
nextBtn.addEventListener('click', handleNext);
prevBtn.addEventListener('click', handlePrev);
// Пересчет ширины при ресайзе
window.addEventListener('resize', () => {
const firstCard = cards[0] as HTMLElement;
cardWidth = firstCard.offsetWidth + 24;
});
};
// Запуск
setupSlider();
setupAnimations();
// Для поддержки View Transitions в Astro
document.addEventListener('astro:after-swap', () => {
setupSlider();
setupAnimations();
});
</script>

View file

@ -50,24 +50,27 @@ const {
} = Astro.props;
---
<section class="services-section">
<section class="services-section" id="services">
<div class="site-container">
<!-- Заголовок секции -->
<div class="section-header">
<span class="subtitle">{sectionSubtitle}</span>
<h2 class="title">{sectionTitle}</h2>
<span class="subtitle animate-on-scroll" data-animation="fade-up">{sectionSubtitle}</span>
<h2 class="title animate-on-scroll" data-animation="fade-up" data-delay="100">{sectionTitle}</h2>
</div>
<!-- Bento Grid -->
<div class="bento-grid">
{services.map((service: ServiceCard) => (
{services.map((service: ServiceCard, index: number) => (
<a
href={service.href || '/services'}
class={`card
class={`card animate-on-scroll
${service.type === 'wide-light' ? 'card-wide card-featured' : ''}
${service.type === 'wide-dark' ? 'card-wide card-dark' : ''}
${service.type === 'standard' ? 'card-standard' : ''}
`}
data-animation="scale-up"
data-delay={index * 150 + 200}
data-stagger={index}
>
{service.type === 'wide-light' && <div class="card-glow"></div>}
{service.type === 'standard' && <div class="card-glow"></div>}
@ -98,6 +101,43 @@ const {
</div>
</section>
<script>
// Intersection Observer для анимаций при скроллинге
const observerOptions = {
root: null,
rootMargin: '0px 0px -50px 0px',
threshold: 0.1
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const el = entry.target as HTMLElement;
const delay = parseInt(el.dataset.delay || '0');
setTimeout(() => {
el.classList.add('is-visible');
// Дополнительная анимация для иконки внутри карточки
const icon = el.querySelector('.icon-emoji');
if (icon) {
setTimeout(() => {
icon.classList.add('icon-bounce');
}, 100);
}
}, delay);
observer.unobserve(el);
}
});
}, observerOptions);
// Наблюдаем за всеми анимируемыми элементами
document.querySelectorAll('.animate-on-scroll').forEach((el) => {
observer.observe(el);
});
</script>
<style>
:root {
--color-primary: #1e3050;
@ -119,6 +159,7 @@ const {
padding: 6rem 1.5rem;
background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
font-family: 'Inter', system-ui, -apple-system, sans-serif;
overflow: hidden;
}
/* Заголовок */
@ -137,7 +178,7 @@ const {
margin-bottom: 1rem;
padding: 0.5rem 1rem;
background: rgba(212, 175, 55, 0.1);
border-radius: 999px;
border-radius: 6px;
}
.title {
@ -149,6 +190,51 @@ const {
letter-spacing: -0.02em;
}
/* --- АНИМАЦИИ ПРИ СКРОЛЛИНГЕ --- */
.animate-on-scroll {
opacity: 0;
will-change: opacity, transform;
}
/* Fade Up - для заголовка */
[data-animation="fade-up"] {
transform: translateY(30px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Scale Up - для карточек */
[data-animation="scale-up"] {
transform: translateY(40px) scale(0.95);
transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Активное состояние */
.animate-on-scroll.is-visible {
opacity: 1;
transform: translateY(0) scale(1);
}
/* Анимация иконки при появлении */
.icon-emoji {
font-size: 2rem;
line-height: 1;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
transition: transform 0.3s ease;
display: inline-block;
}
.icon-emoji.icon-bounce {
animation: iconBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes iconBounce {
0% { transform: scale(0) rotate(-45deg); }
50% { transform: scale(1.2) rotate(5deg); }
100% { transform: scale(1) rotate(0deg); }
}
/* Bento Grid */
.bento-grid {
display: grid;
@ -160,7 +246,7 @@ const {
/* Card as Link */
.card {
position: relative;
border-radius: 24px;
border-radius: 12px;
padding: 2.5rem;
overflow: hidden;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
@ -285,7 +371,7 @@ const {
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
border-radius: 8px;
margin-bottom: 1.5rem;
background: rgba(30, 48, 80, 0.08);
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
@ -293,13 +379,6 @@ const {
flex-shrink: 0;
}
.icon-emoji {
font-size: 2rem;
line-height: 1;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
transition: transform 0.3s ease;
}
.card:hover .icon-emoji {
transform: scale(1.1);
}
@ -449,29 +528,25 @@ const {
.icon-emoji {
font-size: 1.75rem;
}
/* На мобильных упрощаем анимации */
[data-animation="scale-up"] {
transform: translateY(30px) scale(0.98);
}
}
/* Animation */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.animate-on-scroll {
opacity: 1;
transform: translateY(0);
transform: none;
transition: none;
}
.icon-emoji.icon-bounce {
animation: none;
}
}
.card {
animation: fadeInUp 0.6s ease-out forwards;
opacity: 0;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
</style>
<script>

View file

@ -0,0 +1,399 @@
---
import Button from '@components/base/Button.astro';
interface Step {
number: number;
title: string;
description: string;
icon: string;
}
const {
sectionSubtitle = "ПРОСТОЙ ПРОЦЕСС",
sectionTitle = "Как мы работаем",
steps = [
{
number: 1,
title: "Бесплатная консультация",
description: "Позвоните или оставьте заявку. Разберём вашу ситуацию и оценим перспективы дела.",
icon: "📞"
},
{
number: 2,
title: "Анализ документов",
description: "Изучим протоколы, постановления и материалы дела. Найдём слабые места.",
icon: "📋"
},
{
number: 3,
title: "Разработка стратегии",
description: "Подберём оптимальную тактику защиты с учётом практики судов Сургута.",
icon: "🎯"
},
{
number: 4,
title: "Достижение результата",
description: "Представим ваши интересы в суде или ГИБДД. Добьёмся победы.",
icon: "🏆"
}
] as Step[]
} = Astro.props;
---
<section class="steps-section" id="how-we-work">
<div class="site-container">
<!-- Заголовок секции -->
<div class="section-header">
<span class="subtitle animate-on-scroll" data-animation="fade-up">{sectionSubtitle}</span>
<h2 class="title animate-on-scroll" data-animation="fade-up" data-delay="100">{sectionTitle}</h2>
</div>
<!-- Шаги -->
<div class="steps-grid">
{steps.map((step, index) => (
<div class="step-card animate-on-scroll" data-animation="fade-up" data-delay={index * 150 + 200}>
<!-- Номер шага -->
<div class="step-number-wrapper">
<div class="step-number">{step.number}</div>
{index < steps.length - 1 && (
<div class="step-connector"></div>
)}
</div>
<!-- Контент -->
<div class="step-content">
<div class="step-icon">
<span class="icon-emoji">{step.icon}</span>
</div>
<h3 class="step-title">{step.title}</h3>
<p class="step-description">{step.description}</p>
</div>
</div>
))}
</div>
<!-- Кнопка CTA -->
<div class="steps-cta animate-on-scroll" data-animation="fade-up" data-delay="800">
<Button variant="gold" size="lg" id="consultation-btn" data-modal-target="consultation-modal">
<span class="cta-text">Начать консультацию бесплатно</span>
<svg class="cta-arrow" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14M12 5l7 7-7 7"/>
</svg>
</Button>
</div>
</div>
</section>
<style>
:root {
--color-primary: #1e3050;
--color-accent: #eac26e;
--color-accent-light: #ce9f40;
--color-light: #f8fafc;
--color-gray: #64748b;
}
.steps-section {
padding: 6rem 1.5rem;
background: linear-gradient(180deg, #0b1426 0%, #1e3050 100%);
font-family: 'Inter', system-ui, -apple-system, sans-serif;
overflow: hidden;
}
.site-container {
max-width: var(--site-max-width, 1400px);
margin: 0 auto;
}
/* Заголовок секции */
.section-header {
margin-bottom: 4rem;
text-align: center;
}
.subtitle {
display: inline-block;
color: #eac26e;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 3px;
margin-bottom: 1rem;
padding: 0.5rem 1rem;
background: rgba(234, 194, 110, 0.15);
border-radius: 6px;
}
.title {
color: #ffffff;
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 800;
margin: 0;
line-height: 1.2;
letter-spacing: -0.02em;
}
/* --- АНИМАЦИИ ПРИ СКРОЛЛИНГЕ --- */
.animate-on-scroll {
opacity: 0;
will-change: opacity, transform;
}
[data-animation="fade-up"] {
transform: translateY(30px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-on-scroll.is-visible {
opacity: 1;
transform: translateY(0);
}
/* Сетка шагов */
.steps-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 2rem;
margin-bottom: 4rem;
}
/* Карточка шага */
.step-card {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
/* Номер шага */
.step-number-wrapper {
position: relative;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1.5rem;
}
.step-number {
width: 60px;
height: 60px;
border-radius: 50%;
background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
color: #ffffff;
font-size: 1.5rem;
font-weight: 900;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8px 25px rgba(234, 194, 110, 0.3);
position: relative;
z-index: 2;
}
/* Соединительная линия */
.step-connector {
position: absolute;
top: 50%;
left: calc(50% + 40px);
width: calc(100% - 80px);
height: 2px;
background: linear-gradient(90deg, var(--color-accent) 0%, rgba(234, 194, 110, 0.2) 100%);
z-index: 1;
}
/* Иконка шага */
.step-icon {
width: 64px;
height: 64px;
background: rgba(255, 255, 255, 0.08);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1.5rem;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-card:hover .step-icon {
transform: translateY(-4px);
background: rgba(234, 194, 110, 0.15);
box-shadow: 0 8px 25px rgba(234, 194, 110, 0.2);
}
.icon-emoji {
font-size: 2rem;
line-height: 1;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
transition: transform 0.3s ease;
display: inline-block;
}
.step-card:hover .icon-emoji {
transform: scale(1.1);
}
/* Текст шага */
.step-content {
width: 100%;
}
.step-title {
font-size: 1.25rem;
font-weight: 700;
color: #ffffff;
margin: 0 0 0.75rem 0;
line-height: 1.3;
}
.step-description {
font-size: 0.95rem;
line-height: 1.7;
color: rgba(255, 255, 255, 0.7);
margin: 0;
}
/* CTA кнопка */
.steps-cta {
text-align: center;
}
.steps-cta .btn {
display: inline-flex;
align-items: center;
gap: 0.75rem;
padding: 1rem 2rem;
font-size: 1.1rem;
font-weight: 700;
border-radius: 8px;
cursor: pointer;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 8px 25px rgba(234, 194, 110, 0.3);
text-transform: uppercase;
letter-spacing: 0.5px;
position: relative;
overflow: hidden;
}
.steps-cta .btn:hover {
transform: translateY(-3px);
box-shadow: 0 12px 35px rgba(234, 194, 110, 0.4);
opacity: 0.95;
}
.steps-cta .btn:active {
transform: translateY(-1px);
}
.cta-arrow {
transition: transform 0.3s ease;
}
.steps-cta .btn:hover .cta-arrow {
transform: translateX(4px);
}
/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 1024px) {
.steps-grid {
grid-template-columns: repeat(2, 1fr);
gap: 3rem;
}
.step-connector {
display: none;
}
}
@media (max-width: 768px) {
.steps-section {
padding: 4rem 1rem;
}
.steps-grid {
grid-template-columns: 1fr;
gap: 2.5rem;
}
.step-card {
text-align: left;
align-items: flex-start;
}
.step-number-wrapper {
justify-content: flex-start;
margin-bottom: 1rem;
}
.step-number {
width: 50px;
height: 50px;
font-size: 1.25rem;
}
.step-icon {
width: 56px;
height: 56px;
}
.icon-emoji {
font-size: 1.75rem;
}
.step-title {
font-size: 1.15rem;
}
.step-description {
font-size: 0.9rem;
}
.steps-cta .btn {
width: 100%;
justify-content: center;
padding: 0.875rem 1.5rem;
font-size: 1rem;
min-height: 3.25rem;
}
}
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.animate-on-scroll {
opacity: 1;
transform: none;
transition: none;
}
}
</style>
<script>
// Intersection Observer для анимаций при скроллинге
const observerOptions = {
root: null,
rootMargin: '0px',
threshold: 0.15
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const el = entry.target as HTMLElement;
const delay = parseInt(el.dataset.delay || '0');
setTimeout(() => {
el.classList.add('is-visible');
}, delay);
observer.unobserve(el);
}
});
}, observerOptions);
// Наблюдаем за всеми анимируемыми элементами
document.querySelectorAll('.animate-on-scroll').forEach((el) => {
observer.observe(el);
});
</script>

View file

@ -5,7 +5,6 @@ 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"
};
@ -13,34 +12,30 @@ 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">
<section class="why-us-section" id="why-us">
<div class="site-container">
<!-- Левая колонка: Изображение -->
<div class="image-column">
<div class="image-wrapper">
<div class="image-wrapper animate-on-scroll" data-animation="scale-in">
<img src={sectionData.imageUrl} alt="Юридическая практика" class="main-image" loading="lazy" />
<!-- Плавающая бежевая плашка -->
<div class="floating-card">
<div class="floating-card animate-on-scroll" data-animation="slide-up" data-delay="300">
<p>{sectionData.floatingText}</p>
</div>
</div>
@ -49,13 +44,13 @@ const features = [
<!-- Правая колонка: Текст и особенности -->
<div class="content-column">
<div class="section-header">
<span class="subtitle">{sectionData.subtitle}</span>
<h2 class="title">{sectionData.title}</h2>
<span class="subtitle animate-on-scroll" data-animation="fade-up">{sectionData.subtitle}</span>
<h2 class="title animate-on-scroll" data-animation="slide-right" data-delay="100">{sectionData.title}</h2>
</div>
<div class="features-list">
{features.map((feature) => (
<div class="feature-item">
{features.map((feature, index) => (
<div class="feature-item animate-on-scroll" data-animation="stagger-item" data-delay={index * 150 + 200}>
<div class="icon-box" set:html={feature.icon} />
<div class="feature-text">
<h3 class="feature-title">{feature.title}</h3>
@ -65,62 +60,150 @@ const features = [
))}
</div>
</div>
</div>
</section>
<script>
// Intersection Observer для анимаций при скроллинге
const observerOptions = {
root: null,
rootMargin: '0px',
threshold: 0.15
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const delay = (entry.target as HTMLElement).dataset.delay || '0';
setTimeout(() => {
entry.target.classList.add('is-visible');
}, parseInt(delay as string));
// Отключаем наблюдение после появления
observer.unobserve(entry.target);
}
});
}, observerOptions);
// Наблюдаем за всеми анимируемыми элементами
document.querySelectorAll('.animate-on-scroll').forEach((el) => {
observer.observe(el);
});
</script>
<style>
/* Общие стили секции */
.why-us-section {
padding: 6rem 2rem;
background-color: #f4f6f9; /* Очень светлый серо-голубой фон (из макета) */
background-color: #f4f6f9;
font-family: system-ui, -apple-system, sans-serif;
overflow: hidden; /* Предотвращаем горизонтальный скролл от анимаций */
}
.site-container {
display: grid;
grid-template-columns: 1fr 1fr; /* Две равные колонки */
gap: 6rem; /* Большой отступ между колонками */
grid-template-columns: 1fr 1fr;
gap: 6rem;
align-items: center;
max-width: 1200px;
margin: 0 auto;
}
/* --- Базовые стили анимаций --- */
.animate-on-scroll {
opacity: 0;
will-change: opacity, transform;
}
/* Fade In */
[data-animation="fade-in"] {
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Fade Up */
[data-animation="fade-up"] {
transform: translateY(30px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Slide Up (снизу вверх) */
[data-animation="slide-up"] {
transform: translateY(40px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Slide Right (справа налево) */
[data-animation="slide-right"] {
transform: translateX(-40px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Scale In (с увеличением) */
[data-animation="scale-in"] {
transform: scale(0.95);
transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Stagger Item (для списка) */
[data-animation="stagger-item"] {
transform: translateX(-30px);
transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Активное состояние анимаций */
.animate-on-scroll.is-visible {
opacity: 1;
transform: translate(0) scale(1);
}
/* --- Левая колонка (Изображение) --- */
.image-column {
position: relative;
padding-bottom: 2rem; /* Место для плавающей плашки */
padding-bottom: 2rem;
padding-right: 2rem;
}
.image-wrapper {
position: relative;
border-radius: 12px;
overflow: visible; /* Чтобы плашка могла выходить за края */
overflow: visible;
}
.main-image {
width: 100%;
height: auto;
aspect-ratio: 4/4.5; /* Пропорции картинки как на макете */
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; /* Бежево-желтый цвет */
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;
transition: box-shadow 0.5s ease 0.5s;
}
.floating-card.is-visible {
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.floating-card p {
font-family: Georgia, 'Times New Roman', Times, serif; /* Шрифт с засечками */
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 0.95rem;
font-weight: 700;
line-height: 1.5;
@ -134,50 +217,59 @@ const features = [
}
.subtitle {
display: block;
color: #1e3050;
font-size: 0.85rem;
font-weight: 800;
display: inline-block;
color: #d4af37;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 2px;
letter-spacing: 3px;
margin-bottom: 1rem;
padding: 0.5rem 1rem;
background: rgba(212, 175, 55, 0.1);
border-radius: 6px;
}
.title {
color: #1e3050;
font-size: clamp(2rem, 3vw, 2.5rem);
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 800;
line-height: 1.1;
margin: 0;
letter-spacing: -0.5px;
line-height: 1.2;
letter-spacing: -0.02em;
}
/* Список особенностей (Features) */
.features-list {
display: flex;
flex-direction: column;
gap: 2.5rem; /* Расстояние между пунктами */
gap: 2.5rem;
}
.feature-item {
display: flex;
gap: 1.5rem; /* Расстояние между иконкой и текстом */
gap: 1.5rem;
align-items: flex-start;
}
/* Темно-синие квадратные иконки */
/* Иконки с hover-эффектом */
.icon-box {
flex-shrink: 0;
width: 46px;
height: 46px;
background-color: #122138; /* Темно-синий фон иконки */
background-color: #122138;
color: #ffffff;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px; /* Внутренний отступ для SVG */
padding: 10px;
box-shadow: 0 4px 10px rgba(18, 33, 56, 0.2);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-item:hover .icon-box {
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(18, 33, 56, 0.3);
}
/* Типографика текстов особенностей */
@ -186,16 +278,19 @@ const features = [
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;
transition: color 0.3s ease;
}
.feature-item:hover .feature-title {
color: #122138;
}
/* Описание пунктов - шрифт с засечками, серый цвет */
.feature-desc {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 0.95rem;
@ -207,11 +302,11 @@ const features = [
/* --- Адаптивность --- */
@media (max-width: 1024px) {
.site-container {
gap: 3rem; /* Уменьшаем отступ между колонками на планшетах */
gap: 3rem;
}
.floating-card {
right: -10px; /* Сдвигаем плашку, чтобы не вылазила за экран */
right: -10px;
max-width: 280px;
}
}
@ -222,33 +317,119 @@ const features = [
}
.site-container {
grid-template-columns: 1fr; /* Одна колонка на мобильных */
gap: 4rem;
grid-template-columns: 1fr;
gap: 3rem;
}
/* Центрирование заголовка на мобильных */
.section-header {
text-align: center;
margin-bottom: 2.5rem;
}
.subtitle {
font-size: 0.7rem;
padding: 0.4rem 0.8rem;
}
.title {
font-size: clamp(1.5rem, 5vw, 2rem);
}
/* Мобильные анимации - упрощаем направления */
[data-animation="slide-right"] {
transform: translateY(30px);
}
[data-animation="stagger-item"] {
transform: translateY(20px);
}
/* Картинка встает сверху, плашка выравнивается */
.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;
justify-content: center;
text-align: center;
}
.feature-text {
text-align: center;
}
.feature-title {
font-size: 1.1rem;
}
.feature-desc {
font-size: 0.85rem;
}
.floating-card {
bottom: -20px;
right: 20px;
left: 20px;
max-width: none;
}
.icon-box {
width: 40px;
height: 40px;
padding: 8px;
}
}
@media (max-width: 480px) {
.why-us-section {
padding: 3rem 1rem;
}
.subtitle {
font-size: 0.65rem;
letter-spacing: 2px;
padding: 0.35rem 0.7rem;
}
.title {
font-size: 1.4rem;
}
.feature-item {
gap: 0.75rem;
}
.icon-box {
width: 36px;
height: 36px;
padding: 7px;
}
.feature-title {
font-size: 1rem;
}
.feature-desc {
font-size: 0.8rem;
line-height: 1.5;
}
.floating-card {
padding: 1.2rem;
}
.floating-card p {
font-size: 0.85rem;
}
}
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.animate-on-scroll {
opacity: 1;
transform: none;
transition: none;
}
}
</style>

View file

@ -8,17 +8,17 @@ import { COMPANY } from '@constants';
<header class="header-wrapper" id="header">
<!-- 1. Контейнер шапки -->
<div class="site-container header-container">
<div class="header-column header-left">
<div class="header-column header-left animate-load" data-delay="0">
<Logo />
</div>
<!--Navbar -->
<div class="header-column header-center">
<Navbar class="desktop-nav" />
<div class="header-column header-center desktop-nav animate-load" data-delay="100">
<Navbar />
</div>
<!-- Phone -->
<div class="header-column header-right">
<div class="header-column header-right animate-load" data-delay="200">
<div class="header-actions">
<a href={`tel:${COMPANY.phone}`} class="header-phone">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="phone-icon">
@ -37,44 +37,13 @@ import { COMPANY } from '@constants';
</div>
<!-- 2. Линия прогресса (теперь под контейнером, с высоким z-index) -->
<div class="header-progress-container">
<div class="header-progress-container animate-load" data-delay="300">
<div class="header-progress-bar" id="progress-bar"></div>
</div>
</header>
<MobileMenu />
<script>
document.addEventListener('DOMContentLoaded', () => {
const burgerBtn = document.getElementById('burger-btn');
const mobileMenuOverlay = document.getElementById('mobile-menu-overlay');
const progressBar = document.getElementById('progress-bar');
const header = document.getElementById('header');
function updateScroll() {
const scrollTop = window.scrollY || document.documentElement.scrollTop;
const docHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
if (progressBar && docHeight > 0) {
const scrollPercent = (scrollTop / docHeight) * 100;
progressBar.style.width = `${Math.min(100, Math.max(0, scrollPercent))}%`;
}
if (scrollTop > 10) header?.classList.add('scrolled');
else header?.classList.remove('scrolled');
}
window.addEventListener('scroll', updateScroll, { passive: true });
burgerBtn?.addEventListener('click', () => {
mobileMenuOverlay?.classList.toggle('active');
burgerBtn?.classList.toggle('active');
document.body.style.overflow = mobileMenuOverlay?.classList.contains('active') ? 'hidden' : '';
});
updateScroll();
});
</script>
<style>
.header-wrapper {
position: fixed;
@ -184,7 +153,7 @@ import { COMPANY } from '@constants';
.header-progress-bar {
height: 100%;
width: 0%;
background: linear-gradient(90deg, var(--color-gold) 0%, #f0d68a 50%, var(--color-gold) 100%);
background: linear-gradient(90deg, #eac26e 0%, #f0d68a 50%, #eac26e 100%);
box-shadow: 0 0 10px rgba(234, 194, 110, 0.5);
}
@ -201,7 +170,7 @@ import { COMPANY } from '@constants';
}
.burger-line {
width: 100%; height: 2.5px;
background-color: var(--color-primary);
background-color: #1e3050;
border-radius: 4px; transition: 0.3s;
}
@ -209,6 +178,35 @@ import { COMPANY } from '@constants';
.burger-btn.active .burger-line:nth-child(2) { opacity: 0; }
.burger-btn.active .burger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
/* --- АНИМАЦИИ ПРИ ЗАГРУЗКЕ --- */
.animate-load {
opacity: 0;
transform: translateY(-20px);
transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
will-change: opacity, transform;
}
.animate-load.is-visible {
opacity: 1;
transform: translateY(0);
}
/* Задержки для последовательного появления */
.header-left[data-delay="0"] { transition-delay: 0s; }
.header-center[data-delay="100"] { transition-delay: 0.1s; }
.header-right[data-delay="200"] { transition-delay: 0.2s; }
.header-progress-container[data-delay="300"] { transition-delay: 0.3s; }
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.animate-load {
opacity: 1;
transform: none;
transition: none;
}
}
@media (max-width: 992px) {
.header-container { display: flex; justify-content: space-between; height: 70px; }
.header-center { display: none; }
@ -228,4 +226,48 @@ import { COMPANY } from '@constants';
@media (max-width: 767px) {
.header-container { height: 64px; padding: 0 1rem; }
}
</style>
</style>
<script>
// Анимация при загрузке страницы
document.addEventListener('DOMContentLoaded', () => {
const animatedElements = document.querySelectorAll('.animate-load');
animatedElements.forEach((el) => {
const delay = parseInt((el as HTMLElement).dataset.delay || '0');
setTimeout(() => {
el.classList.add('is-visible');
}, delay);
});
});
document.addEventListener('DOMContentLoaded', () => {
const burgerBtn = document.getElementById('burger-btn');
const mobileMenuOverlay = document.getElementById('mobile-menu-overlay');
const progressBar = document.getElementById('progress-bar');
const header = document.getElementById('header');
function updateScroll() {
const scrollTop = window.scrollY || document.documentElement.scrollTop;
const docHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
if (progressBar && docHeight > 0) {
const scrollPercent = (scrollTop / docHeight) * 100;
progressBar.style.width = `${Math.min(100, Math.max(0, scrollPercent))}%`;
}
if (scrollTop > 10) header?.classList.add('scrolled');
else header?.classList.remove('scrolled');
}
window.addEventListener('scroll', updateScroll, { passive: true });
burgerBtn?.addEventListener('click', () => {
mobileMenuOverlay?.classList.toggle('active');
burgerBtn?.classList.toggle('active');
document.body.style.overflow = mobileMenuOverlay?.classList.contains('active') ? 'hidden' : '';
});
updateScroll();
});
</script>

View file

@ -1,5 +1,5 @@
---
import { NAV_LINKS } from '@constants';
import { NAV_LINKS, COMPANY } from '@constants';
---
<div class="mobile-menu-overlay" id="mobile-menu-overlay">
@ -60,11 +60,15 @@ import { NAV_LINKS } from '@constants';
</ul>
</nav>
<!-- Контакты - кнопка входа ОСТАВЛЕНА ВНИЗУ -->
<!-- Контакты -->
<div class="mobile-contacts">
<div class="mobile-contact-card">
<div class="contact-icon">📞</div>
<a href="tel:+73462000000" class="mobile-phone">+7 (3462) 00-00-00</a>
<a href={`tel:${COMPANY.phone}`} class="mobile-phone">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="phone-icon">
<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
</svg>
<span>{COMPANY.phone}</span>
</a>
<span class="contact-label">Ежедневно 9:0021:00</span>
</div>
@ -340,7 +344,10 @@ import { NAV_LINKS } from '@constants';
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
padding: 1rem;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
transition: all 0.3s ease;
}
@ -349,26 +356,26 @@ import { NAV_LINKS } from '@constants';
transform: translateY(-2px);
}
.contact-icon {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.mobile-phone {
display: block;
display: flex;
align-items: center;
gap: 0.5rem;
color: #eac26e;
font-size: 1.2rem;
font-size: 1.1rem;
font-weight: 700;
text-decoration: none;
margin-bottom: 0.25rem;
transition: all 0.3s ease;
}
.mobile-phone:hover {
transform: scale(1.05);
color: #f0d68a;
}
.phone-icon {
flex-shrink: 0;
color: #eac26e;
}
.contact-label {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.6);

View file

@ -10,7 +10,7 @@ export const COMPANY = {
name: 'Автоюрист 086',
fullName: 'Центр защиты прав водителей "Автоюрист 086"',
phone: '+7 (922) 253-83-75',
email: 'info@avtourist086.ru',
email: 'redibedi2019@gmail.com',
address: 'г. Сургут, ул. Примерная, д. 1',
workHours: 'Пн-Пт: 9:00 - 18:00',
} as const;

View file

@ -1,9 +1,11 @@
---
import Layout from '@layouts/Layout.astro';
import { SITE_URL } from '@constants';
import Hero from '@components/home/Hero.astro';
import Services from "@components/home/Services.astro";
import Steps from "@components/home/Steps.astro";
import WhyUs from "@components/home/WhyUs.astro";
import Reviews from "@components/home/Reviews.astro";
import { SITE_URL } from '@constants';
---
<Layout
@ -13,5 +15,7 @@ import WhyUs from "@components/home/WhyUs.astro";
>
<Hero />
<Services />
<Steps />
<WhyUs />
<Reviews />
</Layout>