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

@ -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);