first commit

This commit is contained in:
Web-serfer 2026-03-31 22:53:39 +05:00
commit af43d08e90
41 changed files with 5197 additions and 0 deletions

View file

@ -0,0 +1,189 @@
---
import Logo from './Logo.astro';
import LoginButton from './LoginButton.astro';
import Navbar from './Navbar.astro';
import MobileMenu from './MobileMenu.astro';
---
<header class="header-wrapper">
<div class="header-container">
<!-- Логотип -->
<Logo />
<!-- Навигация -->
<Navbar />
<!-- Блок контактов (Кнопка входа + Гамбургер) -->
<div class="contact-block">
<LoginButton />
<!-- Кнопка гамбургера -->
<button class="burger-btn" id="burger-btn" aria-label="Открыть меню">
<span class="burger-line"></span>
<span class="burger-line"></span>
<span class="burger-line"></span>
</button>
</div>
</div>
</header>
<MobileMenu />
<script>
document.addEventListener('DOMContentLoaded', () => {
const burgerBtn = document.getElementById('burger-btn');
const mobileMenuOverlay = document.getElementById('mobile-menu-overlay');
const mobileMenuClose = document.getElementById('mobile-menu-close');
const mobileNavLinks = mobileMenuOverlay?.querySelectorAll('.mobile-nav-link');
function openMenu() {
mobileMenuOverlay?.classList.add('active');
document.body.style.overflow = 'hidden';
burgerBtn?.classList.add('active');
}
function closeMenu() {
mobileMenuOverlay?.classList.remove('active');
document.body.style.overflow = '';
burgerBtn?.classList.remove('active');
}
// Открытие меню
burgerBtn?.addEventListener('click', openMenu);
// Закрытие по крестику
mobileMenuClose?.addEventListener('click', closeMenu);
// Закрытие по клику вне меню
mobileMenuOverlay?.addEventListener('click', (e) => {
if (e.target === mobileMenuOverlay) {
closeMenu();
}
});
// Закрытие по клику на ссылку
mobileNavLinks?.forEach(link => {
link.addEventListener('click', closeMenu);
});
// Закрытие по Escape
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && mobileMenuOverlay?.classList.contains('active')) {
closeMenu();
}
});
});
</script>
<style>
/* Общая обертка хедера (фон и скругления как на скриншоте) */
.header-wrapper {
background-color: #d1d9e4; /* Серо-голубой фон */
border-top-left-radius: 8px; /* Скругления из макета */
border-top-right-radius: 8px;
padding: 1.2rem 2rem;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
/* Контейнер для выравнивания контента */
.header-container {
width: 100%;
max-width: var(--site-max-width);
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 2rem;
}
/* Блок с телефоном и кнопкой */
.contact-block {
display: flex;
align-items: center;
gap: 1rem;
}
.phone-number {
color: #1e3050;
font-weight: 700;
text-decoration: none;
font-size: 1rem;
}
/* Кнопка гамбургера */
.burger-btn {
display: none;
flex-direction: column;
justify-content: space-between;
width: 30px;
height: 21px;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
z-index: 1001;
margin-left: 1rem;
}
.burger-line {
width: 100%;
height: 3px;
background: linear-gradient(90deg, #1e3050 0%, #2a4266 100%);
border-radius: 2px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
transform-origin: center;
}
.burger-line:nth-child(1) {
transform-origin: top center;
}
.burger-line:nth-child(3) {
transform-origin: bottom center;
}
/* Анимация гамбургера в крестик */
.burger-btn.active .burger-line:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.burger-btn.active .burger-line:nth-child(2) {
opacity: 0;
transform: scaleX(0);
}
.burger-btn.active .burger-line:nth-child(3) {
transform: rotate(-45deg) translate(5px, -5px);
}
@media (max-width: 992px) {
.nav {
display: none;
}
.burger-btn {
display: flex;
}
.contact-block {
gap: 0.5rem;
}
/* Скрываем кнопку входа на мобильных */
.login-btn {
display: none;
}
}
@media (max-width: 576px) {
.contact-block {
flex-direction: column;
align-items: flex-end;
gap: 0.5rem;
}
.header-container {
padding: 0 1rem;
}
}
</style>

View file

@ -0,0 +1,98 @@
---
export interface Props {
href?: string;
variant?: 'outline' | 'primary';
size?: 'sm' | 'md' | 'lg';
class?: string;
}
const {
href = '/login',
variant = 'outline',
size = 'md',
class: className = '',
}: Props = Astro.props;
const baseClasses = 'login-btn inline-flex items-center justify-center font-semibold transition-all duration-300 rounded-md cursor-pointer';
const variantClasses = {
primary: 'bg-primary text-white hover:bg-primary-dark',
outline: 'border-2 border-[#1e3050] text-[#1e3050] hover:bg-[#1e3050] hover:text-white',
};
const sizeClasses = {
sm: 'px-3 py-1.5 text-sm',
md: 'px-4 py-2 text-base',
lg: 'px-6 py-3 text-lg',
};
const classes = `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${className}`;
---
<a href={href} class={classes}>
<div class="login-content">
<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="login-icon">
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path>
<polyline points="10 17 15 12 10 7"></polyline>
<line x1="15" y1="12" x2="3" y2="12"></line>
</svg>
<span class="login-text">Вход</span>
</div>
</a>
<style>
.login-btn {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
position: relative;
overflow: hidden;
text-decoration: none;
}
.login-content {
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.login-btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.3),
transparent
);
transition: left 0.5s ease;
}
.login-btn:hover::before {
left: 100%;
}
.login-btn:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transform: translateY(-2px);
}
.login-btn:active {
transform: translateY(0);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.login-icon {
transition: transform 0.3s ease;
}
.login-btn:hover .login-icon {
transform: translateX(3px);
}
.login-text {
white-space: nowrap;
}
</style>

View file

@ -0,0 +1,214 @@
---
export interface Props {
href?: string;
variant?: 'light' | 'dark';
class?: string;
}
const {
href = '/',
variant = 'light',
class: className = '',
}: Props = Astro.props;
const isDark = variant === 'dark';
const accentColor = '#eac26e';
---
<a href={href} class={className} aria-label="Автоюрист 086 - главная страница">
<div class="logo-container">
<!-- Иконка: щит с рулём -->
<div class="logo-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" class="shield">
<!-- Маска для анимации блика -->
<defs>
<linearGradient id="shineGradient" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="black" />
<stop offset="50%" stop-color="white" />
<stop offset="100%" stop-color="black" />
</linearGradient>
<mask id="shineMask">
<rect x="-100%" y="0" width="100%" height="48" fill="url(#shineGradient)" class="mask-rect" />
</mask>
</defs>
<!-- Базовый щит -->
<path
d="M24 4L6 10V22C6 34 24 44 24 44C24 44 42 34 42 22V10L24 4Z"
fill={accentColor}
stroke={accentColor}
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<!-- Слой блика с маской -->
<path
class="shine-layer"
d="M24 4L6 10V22C6 34 24 44 24 44C24 44 42 34 42 22V10L24 4Z"
fill="rgba(255,255,255,0.7)"
mask="url(#shineMask)"
style="opacity: 0;"
/>
<!-- Руль внутри щита -->
<circle cx="24" cy="24" r="8" fill={isDark ? '#1e3050' : '#ffffff'} opacity="0.9"/>
<circle cx="24" cy="24" r="3" fill={accentColor}/>
<!-- Спицы руля -->
<line x1="24" y1="16" x2="24" y2="20" stroke={isDark ? '#1e3050' : '#ffffff'} stroke-width="2"/>
<line x1="24" y1="28" x2="24" y2="32" stroke={isDark ? '#1e3050' : '#ffffff'} stroke-width="2"/>
<line x1="16" y1="24" x2="20" y2="24" stroke={isDark ? '#1e3050' : '#ffffff'} stroke-width="2"/>
<line x1="28" y1="24" x2="32" y2="24" stroke={isDark ? '#1e3050' : '#ffffff'} stroke-width="2"/>
</svg>
</div>
<!-- Текст логотипа -->
<div class="logo-text">
<span class="logo-name">Автоюрист</span>
<span class="logo-number">086</span>
</div>
</div>
</a>
<style>
.logo-container {
display: flex;
align-items: center;
gap: 0.75rem;
text-decoration: none;
transition: transform 0.3s ease;
}
.logo-container:hover {
transform: scale(1.02);
}
.logo-icon {
width: 42px;
height: 42px;
display: flex;
align-items: center;
justify-content: center;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
position: relative;
overflow: hidden; /* Обрезаем всё что выходит за границы */
border-radius: 8px; /* Скругление для красоты */
}
.shield {
width: 100%;
height: 100%;
transition: transform 0.3s ease;
display: block;
}
/* Маска по умолчанию слева (не видно блика) */
.mask-rect {
transform: translateX(0%);
transition: transform 0s;
}
/* Слой блика скрыт по умолчанию */
.shine-layer {
opacity: 0;
transition: opacity 0.1s ease;
}
/* При наведении — анимируем маску и показываем блик */
.logo-container:hover .shine-layer {
opacity: 1;
}
.logo-container:hover .mask-rect {
animation: shineSlide 0.8s ease-out forwards;
}
@keyframes shineSlide {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(200%);
}
}
/* CSS блик — теперь внутри иконки */
.logo-icon::after {
content: '';
position: absolute;
top: 0;
left: -50%; /* Начинаем изнутри */
width: 30%; /* Уменьшили ширину */
height: 100%;
background: linear-gradient(
90deg,
transparent 0%,
rgba(255, 255, 255, 0.9) 50%,
transparent 100%
);
transform: skewX(-25deg);
pointer-events: none;
opacity: 0;
}
.logo-container:hover .logo-icon::after {
animation: cssShine 0.7s ease-out 0.1s forwards;
}
@keyframes cssShine {
0% {
left: -30%;
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
left: 100%; /* Останавливаемся внутри иконки */
opacity: 0;
}
}
.logo-container:hover .shield {
transform: rotate(-3deg);
}
.logo-text {
display: flex;
flex-direction: column;
line-height: 1.1;
}
.logo-name {
font-size: 1rem;
font-weight: 700;
color: #1e3050;
letter-spacing: -0.3px;
}
.logo-number {
font-size: 1.1rem;
font-weight: 900;
color: #eac26e;
letter-spacing: -0.5px;
}
@media (max-width: 576px) {
.logo-icon {
width: 36px;
height: 36px;
}
.logo-name {
font-size: 0.9rem;
}
.logo-number {
font-size: 1rem;
}
}
</style>

View file

@ -0,0 +1,291 @@
---
import { NAV_LINKS } from '../../../constants/index.ts';
---
<div class="mobile-menu-overlay" id="mobile-menu-overlay">
<div class="mobile-menu">
<!-- Кнопка закрытия -->
<button class="mobile-menu-close" id="mobile-menu-close" aria-label="Закрыть меню">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
<!-- Логотип -->
<a href="/" class="mobile-logo">
<div class="logo-container">
<div class="logo-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" class="shield">
<path d="M24 4L6 10V22C6 34 24 44 24 44C24 44 42 34 42 22V10L24 4Z" fill="#eac26e" stroke="#eac26e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="24" cy="24" r="8" fill="#1e3050" opacity="0.9"/>
<circle cx="24" cy="24" r="3" fill="#eac26e"/>
<line x1="24" y1="16" x2="24" y2="20" stroke="#1e3050" stroke-width="2"/>
<line x1="24" y1="28" x2="24" y2="32" stroke="#1e3050" stroke-width="2"/>
<line x1="16" y1="24" x2="20" y2="24" stroke="#1e3050" stroke-width="2"/>
<line x1="28" y1="24" x2="32" y2="24" stroke="#1e3050" stroke-width="2"/>
</svg>
</div>
<div class="logo-text">
<span class="logo-name">Автоюрист</span>
<span class="logo-number">086</span>
</div>
</div>
</a>
<!-- Навигация -->
<nav class="mobile-nav">
<ul class="mobile-nav-list">
{NAV_LINKS.map((link, index) => (
<li style={`--item-index: ${index}`}>
<a href={link.url} class="mobile-nav-link">
{link.name}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="link-arrow">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</a>
</li>
))}
</ul>
</nav>
<!-- Контакты -->
<div class="mobile-contacts">
<a href="tel:+73462000000" class="mobile-phone">+7 (3462) 00-00-00</a>
<a href="/login" class="mobile-login-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path>
<polyline points="10 17 15 12 10 7"></polyline>
<line x1="15" y1="12" x2="3" y2="12"></line>
</svg>
<span>Вход в кабинет</span>
</a>
</div>
</div>
</div>
<style>
.mobile-menu-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(3, 21, 41, 0.95);
backdrop-filter: blur(8px);
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu-overlay.active {
opacity: 1;
visibility: visible;
}
.mobile-menu {
position: absolute;
top: 0;
right: 0;
width: 100%;
max-width: 400px;
height: 100%;
background: linear-gradient(180deg, #0a2540 0%, #031529 100%);
padding: 2rem 1.5rem;
transform: translateX(100%);
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
flex-direction: column;
overflow-y: auto;
}
.mobile-menu-overlay.active .mobile-menu {
transform: translateX(0);
}
/* Кнопка закрытия */
.mobile-menu-close {
position: absolute;
top: 1rem;
right: 1rem;
background: transparent;
border: none;
color: #8c9bb0;
cursor: pointer;
padding: 0.5rem;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
z-index: 10;
}
.mobile-menu-close:hover {
background: rgba(255, 255, 255, 0.1);
color: #eac26e;
}
/* Логотип */
.mobile-logo {
text-decoration: none;
margin-bottom: 2.5rem;
}
.logo-container {
display: flex;
align-items: center;
gap: 0.75rem;
}
.logo-icon {
width: 42px;
height: 42px;
}
.shield {
width: 100%;
height: 100%;
}
.logo-text {
display: flex;
flex-direction: column;
line-height: 1.1;
}
.logo-name {
font-size: 1rem;
font-weight: 700;
color: #ffffff;
letter-spacing: -0.3px;
}
.logo-number {
font-size: 1.1rem;
font-weight: 900;
color: #eac26e;
letter-spacing: -0.5px;
}
/* Навигация */
.mobile-nav {
flex: 1;
}
.mobile-nav-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.mobile-nav-list li {
opacity: 0;
transform: translateX(20px);
transition: opacity 0.3s ease, transform 0.3s ease;
transition-delay: calc(0.05s * var(--item-index));
}
.mobile-menu-overlay.active .mobile-nav-list li {
opacity: 1;
transform: translateX(0);
}
.mobile-nav-link {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 0.75rem;
color: #ffffff;
text-decoration: none;
font-size: 1.1rem;
font-weight: 500;
border-radius: 8px;
transition: all 0.3s ease;
}
.mobile-nav-link:hover {
background: rgba(255, 255, 255, 0.05);
color: #eac26e;
}
.mobile-nav-link:hover .link-arrow {
transform: translateX(4px);
opacity: 1;
}
.link-arrow {
opacity: 0;
transition: all 0.3s ease;
color: #eac26e;
}
/* Контакты */
.mobile-contacts {
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
flex-direction: column;
gap: 1rem;
}
.mobile-phone {
color: #eac26e;
font-size: 1.2rem;
font-weight: 700;
text-decoration: none;
text-align: center;
padding: 0.75rem;
border-radius: 8px;
background: rgba(234, 194, 110, 0.1);
transition: all 0.3s ease;
}
.mobile-phone:hover {
background: rgba(234, 194, 110, 0.2);
}
.mobile-login-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
padding: 0.875rem 1.5rem;
background: linear-gradient(135deg, #1e3050 0%, #2a4266 100%);
color: #ffffff;
border-radius: 8px;
text-decoration: none;
font-weight: 600;
font-size: 0.95rem;
transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(30, 48, 80, 0.3);
}
.mobile-login-btn:hover {
box-shadow: 0 6px 20px rgba(30, 48, 80, 0.5);
transform: translateY(-2px);
}
/* Scrollbar */
.mobile-menu::-webkit-scrollbar {
width: 6px;
}
.mobile-menu::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.05);
}
.mobile-menu::-webkit-scrollbar-thumb {
background: rgba(234, 194, 110, 0.3);
border-radius: 3px;
}
.mobile-menu::-webkit-scrollbar-thumb:hover {
background: rgba(234, 194, 110, 0.5);
}
</style>

View file

@ -0,0 +1,64 @@
---
export interface Props {
links?: Array<{ name: string; url: string }>;
class?: string;
}
const defaultLinks = [
{ name: 'Услуги', url: '/services' },
{ name: 'Кейсы', url: '/cases' },
{ name: 'Блог', url: '/blog' },
{ name: 'Отзывы', url: '/reviews' },
{ name: 'Контакты', url: '/contacts' },
];
const {
links = defaultLinks,
class: className = '',
}: Props = Astro.props;
---
<nav class={className}>
<ul class="nav-list">
{links.map((link) => (
<li>
<a href={link.url} class="nav-link">{link.name}</a>
</li>
))}
</ul>
</nav>
<style>
.nav-list {
display: flex;
gap: 2.5rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-link {
color: #535e6c;
text-decoration: none;
font-weight: 600;
font-size: 0.95rem;
transition: color 0.2s ease, background-position 0.3s ease;
background-image: linear-gradient(to right, #1e3050 0%, #1e3050 100%);
background-size: 0% 2px;
background-repeat: no-repeat;
background-position: left bottom;
padding-bottom: 2px;
}
.nav-link:hover {
color: #1e3050;
background-size: 100% 2px;
}
/* Адаптив: скрываем меню на мобильных */
@media (max-width: 992px) {
.nav-list {
display: none;
}
}
</style>