МÐНоÐСоздан компоент 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>