Новые правки в Header
This commit is contained in:
parent
95333dbb8c
commit
a2985e736c
1 changed files with 39 additions and 28 deletions
|
|
@ -47,29 +47,31 @@ import { COMPANY } from "@constants";
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<a href={`tel:${COMPANY.phoneClean}`} class="mobile-phone-btn" aria-label="Позонить: {COMPANY.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"
|
||||
>
|
||||
<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>
|
||||
</a>
|
||||
<div class="mobile-actions">
|
||||
<a href={`tel:${COMPANY.phoneClean}`} class="mobile-phone-btn" aria-label="Позонить: {COMPANY.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"
|
||||
>
|
||||
<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>
|
||||
</a>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
|
@ -252,6 +254,12 @@ import { COMPANY } from "@constants";
|
|||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.mobile-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
/* Скрытие гамбургера при открытом меню */
|
||||
.burger-btn.active {
|
||||
opacity: 0;
|
||||
|
|
@ -259,6 +267,11 @@ import { COMPANY } from "@constants";
|
|||
}
|
||||
|
||||
/* --- АНИМАЦИИ ПРИ ЗАГРУЗКЕ --- */
|
||||
@media (min-width: 993px) {
|
||||
.mobile-actions {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.animate-load {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
|
|
@ -306,7 +319,7 @@ import { COMPANY } from "@constants";
|
|||
display: none;
|
||||
}
|
||||
.header-right {
|
||||
gap: 1.25rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.header-phone {
|
||||
display: none;
|
||||
|
|
@ -323,6 +336,9 @@ import { COMPANY } from "@constants";
|
|||
.header-phone {
|
||||
display: flex;
|
||||
}
|
||||
.mobile-phone-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
|
|
@ -337,7 +353,6 @@ import { COMPANY } from "@constants";
|
|||
// Проверка авторизации и отображение правильного меню
|
||||
function initAuth() {
|
||||
const authSection = document.getElementById('auth-section');
|
||||
const phoneEl = document.getElementById('header-phone');
|
||||
if (!authSection) return;
|
||||
|
||||
const token = localStorage.getItem('auth_token');
|
||||
|
|
@ -349,7 +364,6 @@ import { COMPANY } from "@constants";
|
|||
const firstLetter = (user.name || user.email || 'U').charAt(0).toUpperCase();
|
||||
|
||||
// Скрываем телефон, показываем аватар и кнопку выхода
|
||||
if (phoneEl) phoneEl.style.display = 'none';
|
||||
const displayName = user.name || user.email || 'Пользователь';
|
||||
|
||||
authSection.innerHTML = `
|
||||
|
|
@ -384,9 +398,6 @@ import { COMPANY } from "@constants";
|
|||
|
||||
function showPhone() {
|
||||
const authSection = document.getElementById('auth-section');
|
||||
const phoneEl = document.getElementById('header-phone');
|
||||
|
||||
if (phoneEl) phoneEl.style.display = 'flex';
|
||||
if (authSection) authSection.innerHTML = '';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue