Made page more responsive
This commit is contained in:
@@ -13,7 +13,6 @@ h1 {
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Navigation Header */
|
|
||||||
header {
|
header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid var(--border);
|
border-bottom: 1px solid var(--border);
|
||||||
@@ -74,7 +73,6 @@ nav a:hover, nav a.active {
|
|||||||
border-color: var(--accent);
|
border-color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Profile Dropdown Component */
|
|
||||||
.profile-dropdown {
|
.profile-dropdown {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -133,7 +131,6 @@ nav a:hover, nav a.active {
|
|||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show menu on hover OR when active via click class */
|
|
||||||
.profile-dropdown:hover .dropdown-menu,
|
.profile-dropdown:hover .dropdown-menu,
|
||||||
.dropdown-menu.show {
|
.dropdown-menu.show {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -174,7 +171,6 @@ nav a:hover, nav a.active {
|
|||||||
color: #f87171;
|
color: #f87171;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stats Cards Grid */
|
|
||||||
.stats-grid {
|
.stats-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||||
@@ -207,7 +203,6 @@ nav a:hover, nav a.active {
|
|||||||
letter-spacing: 0.05em;
|
letter-spacing: 0.05em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Controls & Search */
|
|
||||||
.action-bar {
|
.action-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -220,7 +215,6 @@ nav a:hover, nav a.active {
|
|||||||
max-width: 320px;
|
max-width: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Data Tables */
|
|
||||||
.table-container {
|
.table-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: var(--card);
|
background: var(--card);
|
||||||
@@ -262,41 +256,52 @@ tr:hover td {
|
|||||||
background: rgba(255, 255, 255, 0.01);
|
background: rgba(255, 255, 255, 0.01);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Modals & Placeholders */
|
|
||||||
#modal {
|
#modal {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
right: 0;
|
||||||
|
width: 200px;
|
||||||
|
background: #1f2937;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu.show {
|
||||||
|
display: flex !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main-nav {
|
||||||
|
z-index: 900;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.nav-container {
|
.menu-trigger { display: block; background: none; border: 1px solid var(--border); color: var(--text); padding: 0.4rem 0.8rem; border-radius: 6px; }
|
||||||
|
|
||||||
|
#main-nav {
|
||||||
|
display: none;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: auto;
|
position: absolute;
|
||||||
|
top: 4rem;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
background: #111827;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
gap: 1rem;
|
z-index: 100;
|
||||||
}
|
border-bottom: 1px solid var(--border);
|
||||||
.nav-left {
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
nav {
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
.profile-dropdown {
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.dropdown-menu {
|
|
||||||
position: static;
|
|
||||||
width: 100%;
|
|
||||||
box-shadow: none;
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
}
|
|
||||||
.action-bar {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
.search-input {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main-nav.show { display: flex; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 769px) {
|
||||||
|
.menu-trigger { display: none; }
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
<div class="nav-container">
|
<div class="nav-container">
|
||||||
<div class="nav-left">
|
<div class="nav-left">
|
||||||
<div class="brand">Miau<span>Inv</span></div>
|
<div class="brand">Miau<span>Inv</span></div>
|
||||||
|
|
||||||
|
<button class="menu-trigger" id="menu-btn" aria-label="Menu">Menu</button>
|
||||||
|
|
||||||
<nav id="main-nav">
|
<nav id="main-nav">
|
||||||
<a href="/dashboard">Dashboard</a>
|
<a href="/dashboard">Dashboard</a>
|
||||||
<a href="/inventory">Inventory</a>
|
<a href="/inventory">Inventory</a>
|
||||||
@@ -25,7 +28,6 @@
|
|||||||
<div class="profile-dropdown">
|
<div class="profile-dropdown">
|
||||||
<button class="profile-trigger" id="profile-btn">
|
<button class="profile-trigger" id="profile-btn">
|
||||||
<div class="avatar">M</div>
|
<div class="avatar">M</div>
|
||||||
<span class="username">Profile</span>
|
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" id="dropdown-menu">
|
<div class="dropdown-menu" id="dropdown-menu">
|
||||||
<a href="/profile/settings">Account Settings</a>
|
<a href="/profile/settings">Account Settings</a>
|
||||||
@@ -33,18 +35,7 @@
|
|||||||
<hr class="dropdown-divider">
|
<hr class="dropdown-divider">
|
||||||
<button class="logout-btn"
|
<button class="logout-btn"
|
||||||
hx-post="/api/logout"
|
hx-post="/api/logout"
|
||||||
hx-trigger="click"
|
hx-on::after-request="window.location.href='/login'">
|
||||||
hx-on::after-request="
|
|
||||||
if (event.detail.successful) {
|
|
||||||
localStorage.removeItem('access_token');
|
|
||||||
localStorage.removeItem('refresh_token');
|
|
||||||
document.cookie = 'access_token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;';
|
|
||||||
document.cookie = 'refresh_token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;';
|
|
||||||
window.location.href = '/login';
|
|
||||||
} else {
|
|
||||||
alert('Logout failed. Please try again.');
|
|
||||||
}
|
|
||||||
">
|
|
||||||
Log Out
|
Log Out
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -57,24 +48,31 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.querySelectorAll('#main-nav a').forEach(link => {
|
|
||||||
if (link.getAttribute('href') === window.location.pathname) {
|
|
||||||
link.classList.add('active');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const profileBtn = document.getElementById('profile-btn');
|
const profileBtn = document.getElementById('profile-btn');
|
||||||
const dropdownMenu = document.getElementById('dropdown-menu');
|
const dropdownMenu = document.getElementById('dropdown-menu');
|
||||||
|
const menuBtn = document.getElementById('menu-btn');
|
||||||
|
const mainNav = document.getElementById('main-nav');
|
||||||
|
|
||||||
|
// Profil-Menü Toggle
|
||||||
profileBtn.addEventListener('click', (e) => {
|
profileBtn.addEventListener('click', (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
dropdownMenu.classList.toggle('show');
|
dropdownMenu.classList.toggle('show');
|
||||||
|
mainNav.classList.remove('show'); // Mobile Nav schließen
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('click', () => {
|
// Mobile Nav Toggle
|
||||||
if (dropdownMenu.classList.contains('show')) {
|
menuBtn.addEventListener('click', (e) => {
|
||||||
dropdownMenu.classList.remove('show');
|
console.log("Button wurde geklickt!"); // Wird das im Browser angezeigt?
|
||||||
}
|
e.stopPropagation();
|
||||||
|
e.preventDefault(); // Verhindert Standard-Browser-Aktionen
|
||||||
|
mainNav.classList.toggle('show');
|
||||||
|
dropdownMenu.classList.remove('show');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Alles schließen bei Klick in den Body
|
||||||
|
window.addEventListener('click', () => {
|
||||||
|
dropdownMenu.classList.remove('show');
|
||||||
|
mainNav.classList.remove('show');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user