feat: Improve navigation styling and functionality with enhanced user links and mobile actions
This commit is contained in:
+59
-36
@@ -164,13 +164,15 @@
|
||||
|
||||
.nav-links a {
|
||||
white-space: nowrap;
|
||||
transition: background 0.2s ease, color 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
color: var(--brand);
|
||||
}
|
||||
|
||||
.nav-links .nav-user-link {
|
||||
.nav-links .nav-user-link,
|
||||
.nav-links .nav-mobile-action {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -386,72 +388,65 @@
|
||||
.nav-links {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: calc(100% + 0.8rem);
|
||||
transform: translateX(-50%) translateY(-5px);
|
||||
width: min(100%, calc(100% - 2rem));
|
||||
max-width: 420px;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
top: calc(100% + 0.6rem);
|
||||
transform: translateX(-50%) translateY(-10px);
|
||||
width: min(100%, calc(100% - 1.5rem));
|
||||
max-width: 520px;
|
||||
background: rgba(255, 255, 255, 0.98);
|
||||
border: 1px solid #d8dfdb;
|
||||
border-radius: 18px;
|
||||
padding: 1rem;
|
||||
border-radius: 20px;
|
||||
padding: 0.9rem;
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
gap: 0.6rem;
|
||||
z-index: 25;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 18px 40px rgba(23, 44, 57, 0.12);
|
||||
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-links .nav-user-link {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-links.open {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
display: block;
|
||||
padding: 0.85rem 1rem;
|
||||
border-radius: 14px;
|
||||
width: 100%;
|
||||
padding: 1rem 1rem;
|
||||
border-radius: 16px;
|
||||
background: #f7f5f0;
|
||||
color: var(--text-main);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.nav-links .nav-user-link {
|
||||
padding-left: 1rem;
|
||||
border-left: 3px solid rgba(28, 90, 99, 0.18);
|
||||
}
|
||||
|
||||
.nav-links a:hover,
|
||||
.nav-links a:focus-visible {
|
||||
background: #e7f0ec;
|
||||
}
|
||||
|
||||
.nav-actions {
|
||||
gap: 0.55rem;
|
||||
width: 100%;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.nav-links .nav-user-link {
|
||||
.nav-links .nav-user-link,
|
||||
.nav-links .nav-mobile-action {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-actions .nav-btn {
|
||||
padding: 0.42rem 0.72rem;
|
||||
font-size: 0.85rem;
|
||||
min-width: 120px;
|
||||
.nav-links .nav-user-link {
|
||||
padding-left: 1rem;
|
||||
border-left: 3px solid rgba(28, 90, 99, 0.18);
|
||||
background: #f1f6f4;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
right: auto;
|
||||
left: 0;
|
||||
min-width: 200px;
|
||||
.nav-links .nav-mobile-action {
|
||||
border: 1px solid #bcd0de;
|
||||
background: #ffffff;
|
||||
color: #1b4b52;
|
||||
}
|
||||
|
||||
.nav-actions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-wrap {
|
||||
@@ -470,6 +465,12 @@
|
||||
.cookie-btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
right: auto;
|
||||
left: 0;
|
||||
min-width: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
@@ -518,11 +519,15 @@
|
||||
<a class="nav-user-link" href="{{ url_for('my_instance_management') }}">Meine Instanz</a>
|
||||
<a class="nav-user-link" href="{{ url_for('user_chat') }}">Chat mit Admin</a>
|
||||
<a class="nav-user-link" href="{{ url_for('user_tickets') }}">Support Tickets</a>
|
||||
<a class="nav-user-link" href="{{ url_for('logout') }}">Abmelden</a>
|
||||
{% if session.get('is_admin') %}
|
||||
<a class="nav-user-link" href="{{ url_for('admin_dashboard') }}">Admin Dashboard</a>
|
||||
<a class="nav-user-link" href="{{ url_for('admin_users') }}">Userverwaltung</a>
|
||||
<a class="nav-user-link" href="{{ url_for('admin_invoices') }}">Rechnungsverwaltung</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a class="nav-mobile-action nav-btn primary" href="{{ url_for('login') }}">Login</a>
|
||||
<a class="nav-mobile-action nav-btn" href="{{ url_for('register') }}">Registrieren</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="nav-actions">
|
||||
@@ -719,6 +724,24 @@
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
if (!navLinks.contains(event.target) && !menuToggle.contains(event.target) && navLinks.classList.contains('open')) {
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
navLinks.classList.remove('open');
|
||||
navLinks.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
});
|
||||
|
||||
navLinks.querySelectorAll('a').forEach(function (link) {
|
||||
link.addEventListener('click', function () {
|
||||
if (navLinks.classList.contains('open')) {
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
navLinks.classList.remove('open');
|
||||
navLinks.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('resize', function () {
|
||||
if (window.innerWidth > 820 && navLinks.classList.contains('open')) {
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
|
||||
Reference in New Issue
Block a user