Новые правки в Header

This commit is contained in:
Web-serfer 2026-04-15 22:34:35 +05:00
parent 95333dbb8c
commit a2985e736c

View file

@ -47,29 +47,31 @@ import { COMPANY } from "@constants";
</a> </a>
</div> </div>
<a href={`tel:${COMPANY.phoneClean}`} class="mobile-phone-btn" aria-label="Позонить: {COMPANY.phone}"> <div class="mobile-actions">
<svg <a href={`tel:${COMPANY.phoneClean}`} class="mobile-phone-btn" aria-label="Позонить: {COMPANY.phone}">
xmlns="http://www.w3.org/2000/svg" <svg
width="20" xmlns="http://www.w3.org/2000/svg"
height="20" width="20"
viewBox="0 0 24 24" height="20"
fill="none" viewBox="0 0 24 24"
stroke="currentColor" fill="none"
stroke-width="2" stroke="currentColor"
stroke-linecap="round" stroke-width="2"
stroke-linejoin="round" stroke-linecap="round"
> stroke-linejoin="round"
<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
></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"
</svg> ></path>
</a> </svg>
</a>
<button class="burger-btn" id="burger-btn" aria-label="Открыть меню"> <button class="burger-btn" id="burger-btn" aria-label="Открыть меню">
<span class="burger-line"></span> <span class="burger-line"></span>
<span class="burger-line"></span> <span class="burger-line"></span>
<span class="burger-line"></span> <span class="burger-line"></span>
</button> </button>
</div>
</div> </div>
</div> </div>
@ -252,6 +254,12 @@ import { COMPANY } from "@constants";
transform: scale(0.95); transform: scale(0.95);
} }
.mobile-actions {
display: flex;
align-items: center;
gap: 16px;
}
/* Скрытие гамбургера при открытом меню */ /* Скрытие гамбургера при открытом меню */
.burger-btn.active { .burger-btn.active {
opacity: 0; opacity: 0;
@ -259,6 +267,11 @@ import { COMPANY } from "@constants";
} }
/* --- АНИМАЦИИ ПРИ ЗАГРУЗКЕ --- */ /* --- АНИМАЦИИ ПРИ ЗАГРУЗКЕ --- */
@media (min-width: 993px) {
.mobile-actions {
display: none;
}
}
.animate-load { .animate-load {
opacity: 0; opacity: 0;
transform: translateY(-20px); transform: translateY(-20px);
@ -306,7 +319,7 @@ import { COMPANY } from "@constants";
display: none; display: none;
} }
.header-right { .header-right {
gap: 1.25rem; gap: 0.5rem;
} }
.header-phone { .header-phone {
display: none; display: none;
@ -323,6 +336,9 @@ import { COMPANY } from "@constants";
.header-phone { .header-phone {
display: flex; display: flex;
} }
.mobile-phone-btn {
display: none;
}
} }
@media (max-width: 767px) { @media (max-width: 767px) {
@ -337,7 +353,6 @@ import { COMPANY } from "@constants";
// Проверка авторизации и отображение правильного меню // Проверка авторизации и отображение правильного меню
function initAuth() { function initAuth() {
const authSection = document.getElementById('auth-section'); const authSection = document.getElementById('auth-section');
const phoneEl = document.getElementById('header-phone');
if (!authSection) return; if (!authSection) return;
const token = localStorage.getItem('auth_token'); const token = localStorage.getItem('auth_token');
@ -349,7 +364,6 @@ import { COMPANY } from "@constants";
const firstLetter = (user.name || user.email || 'U').charAt(0).toUpperCase(); const firstLetter = (user.name || user.email || 'U').charAt(0).toUpperCase();
// Скрываем телефон, показываем аватар и кнопку выхода // Скрываем телефон, показываем аватар и кнопку выхода
if (phoneEl) phoneEl.style.display = 'none';
const displayName = user.name || user.email || 'Пользователь'; const displayName = user.name || user.email || 'Пользователь';
authSection.innerHTML = ` authSection.innerHTML = `
@ -384,9 +398,6 @@ import { COMPANY } from "@constants";
function showPhone() { function showPhone() {
const authSection = document.getElementById('auth-section'); const authSection = document.getElementById('auth-section');
const phoneEl = document.getElementById('header-phone');
if (phoneEl) phoneEl.style.display = 'flex';
if (authSection) authSection.innerHTML = ''; if (authSection) authSection.innerHTML = '';
} }