Added functionality to all pages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{{ define "base.html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@@ -8,14 +9,16 @@
|
||||
<link rel="stylesheet" href="/assets/css/theme.css">
|
||||
<link rel="stylesheet" href="/assets/css/dashboard.css">
|
||||
</head>
|
||||
<body>
|
||||
<body class="dashboard-layout">
|
||||
|
||||
<header>
|
||||
<div class="nav-container">
|
||||
<div class="nav-left">
|
||||
<div class="brand">Miau<span>Inv</span></div>
|
||||
|
||||
<button class="menu-trigger" id="menu-btn" aria-label="Menu">Menu</button>
|
||||
<button class="menu-trigger" id="menu-btn" aria-label="Menu">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
|
||||
</button>
|
||||
|
||||
<nav id="main-nav">
|
||||
<a href="/dashboard">Dashboard</a>
|
||||
@@ -28,6 +31,8 @@
|
||||
<div class="profile-dropdown">
|
||||
<button class="profile-trigger" id="profile-btn">
|
||||
<div class="avatar">M</div>
|
||||
<span class="username">Admin</span>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
|
||||
</button>
|
||||
<div class="dropdown-menu" id="dropdown-menu">
|
||||
<a href="/profile/settings">Account Settings</a>
|
||||
@@ -47,34 +52,7 @@
|
||||
{{ template "content" . }}
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const profileBtn = document.getElementById('profile-btn');
|
||||
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) => {
|
||||
e.stopPropagation();
|
||||
dropdownMenu.classList.toggle('show');
|
||||
mainNav.classList.remove('show'); // Mobile Nav schließen
|
||||
});
|
||||
|
||||
// Mobile Nav Toggle
|
||||
menuBtn.addEventListener('click', (e) => {
|
||||
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 src="/assets/js/api.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user