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 {
|
.nav-links a {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
transition: background 0.2s ease, color 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-links a:hover {
|
.nav-links a:hover {
|
||||||
color: var(--brand);
|
color: var(--brand);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-links .nav-user-link {
|
.nav-links .nav-user-link,
|
||||||
|
.nav-links .nav-mobile-action {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,72 +388,65 @@
|
|||||||
.nav-links {
|
.nav-links {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: calc(100% + 0.8rem);
|
top: calc(100% + 0.6rem);
|
||||||
transform: translateX(-50%) translateY(-5px);
|
transform: translateX(-50%) translateY(-10px);
|
||||||
width: min(100%, calc(100% - 2rem));
|
width: min(100%, calc(100% - 1.5rem));
|
||||||
max-width: 420px;
|
max-width: 520px;
|
||||||
background: rgba(255, 255, 255, 0.96);
|
background: rgba(255, 255, 255, 0.98);
|
||||||
border: 1px solid #d8dfdb;
|
border: 1px solid #d8dfdb;
|
||||||
border-radius: 18px;
|
border-radius: 20px;
|
||||||
padding: 1rem;
|
padding: 0.9rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.5rem;
|
gap: 0.6rem;
|
||||||
z-index: 25;
|
z-index: 25;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
visibility: hidden;
|
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;
|
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-links .nav-user-link {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-links.open {
|
.nav-links.open {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
|
pointer-events: auto;
|
||||||
transform: translateX(-50%) translateY(0);
|
transform: translateX(-50%) translateY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-links a {
|
.nav-links a {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0.85rem 1rem;
|
width: 100%;
|
||||||
border-radius: 14px;
|
padding: 1rem 1rem;
|
||||||
|
border-radius: 16px;
|
||||||
background: #f7f5f0;
|
background: #f7f5f0;
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
font-weight: 700;
|
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:hover,
|
||||||
.nav-links a:focus-visible {
|
.nav-links a:focus-visible {
|
||||||
background: #e7f0ec;
|
background: #e7f0ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-actions {
|
.nav-links .nav-user-link,
|
||||||
gap: 0.55rem;
|
.nav-links .nav-mobile-action {
|
||||||
width: 100%;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-links .nav-user-link {
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-actions .nav-btn {
|
.nav-links .nav-user-link {
|
||||||
padding: 0.42rem 0.72rem;
|
padding-left: 1rem;
|
||||||
font-size: 0.85rem;
|
border-left: 3px solid rgba(28, 90, 99, 0.18);
|
||||||
min-width: 120px;
|
background: #f1f6f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu {
|
.nav-links .nav-mobile-action {
|
||||||
right: auto;
|
border: 1px solid #bcd0de;
|
||||||
left: 0;
|
background: #ffffff;
|
||||||
min-width: 200px;
|
color: #1b4b52;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-actions {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-wrap {
|
.main-wrap {
|
||||||
@@ -470,6 +465,12 @@
|
|||||||
.cookie-btn {
|
.cookie-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
right: auto;
|
||||||
|
left: 0;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 520px) {
|
@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('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_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('user_tickets') }}">Support Tickets</a>
|
||||||
|
<a class="nav-user-link" href="{{ url_for('logout') }}">Abmelden</a>
|
||||||
{% if session.get('is_admin') %}
|
{% 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_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_users') }}">Userverwaltung</a>
|
||||||
<a class="nav-user-link" href="{{ url_for('admin_invoices') }}">Rechnungsverwaltung</a>
|
<a class="nav-user-link" href="{{ url_for('admin_invoices') }}">Rechnungsverwaltung</a>
|
||||||
{% endif %}
|
{% 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 %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-actions">
|
<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 () {
|
window.addEventListener('resize', function () {
|
||||||
if (window.innerWidth > 820 && navLinks.classList.contains('open')) {
|
if (window.innerWidth > 820 && navLinks.classList.contains('open')) {
|
||||||
menuToggle.setAttribute('aria-expanded', 'false');
|
menuToggle.setAttribute('aria-expanded', 'false');
|
||||||
|
|||||||
Reference in New Issue
Block a user