Geizkragen/header.php

163 lines
7.0 KiB
PHP

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/assets/css/login.css">
<link rel="stylesheet" href="/assets/css/catbar.css">
<link rel="stylesheet" href="/assets/css/compcard.css">
<link rel="stylesheet" href="/assets/css/productpage.css">
<link rel="stylesheet" href="/assets/css/productAdder.css">
<link rel="icon" href="/assets/images/favicon.ico" sizes="any">
<title>Geizkragen</title>
<style>
/* ─── Mobile tap highlight ─── */
* { -webkit-tap-highlight-color: transparent; }
/* ─── Safe areas (notch phones) ─── */
.header { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.footer { padding-bottom: env(safe-area-inset-bottom); }
/* ─── Mobile overlay ─── */
.nav__overlay {
position: fixed;
inset: 0;
z-index: 1000;
background: rgba(0, 0, 0, 0.55);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
visibility: hidden;
opacity: 0;
transition: opacity 300ms ease, visibility 0s 300ms;
}
.nav__overlay.is-visible {
visibility: visible;
opacity: 1;
transition: opacity 300ms ease, visibility 0s 0s;
}
</style>
</head>
<body>
<!-- Overlay (klick = Menü schließen) -->
<div class="nav__overlay" id="nav-overlay"></div>
<header class="header" id="header">
<nav class="nav" aria-label="Hauptnavigation">
<a class="nav__logoLink" href="index.php">
<img class="nav__logo" src="/assets/images/logoText.png" alt="Geizkragen" width="150">
</a>
<!-- Desktop-Suche (wird per CSS auf ≤900 px ausgeblendet) -->
<form class="nav__searchForm" action="index.php" method="GET" autocomplete="off">
<div class="nav__searchField">
<input class="nav__searchInput" type="text" id="search" name="search"
placeholder="Produkte suchen…" inputmode="text">
</div>
</form>
<div class="nav__inner container">
<!-- ═══ Slide-In-Menü (wird auf Mobile per JS getoggelt) ═══ -->
<div class="nav__menu" id="nav-menu">
<!-- Mobile-Suche (nur im Hamburger sichtbar) -->
<form class="nav__searchForm nav__searchForm--mobile" action="index.php" method="GET" autocomplete="off">
<div class="nav__searchField">
<input class="nav__searchInput" type="text" name="search"
placeholder="Produkte suchen…" inputmode="text">
</div>
</form>
<ul class="nav__list">
<li class="nav__item">
<a href="index.php" class="nav__link">Home</a>
</li>
<li class="nav__item nav__item--mobile">
<a href="wunschliste.php" class="nav__link">Wunschliste</a>
</li>
<li class="nav__item nav__item--mobile">
<a href="account.php" class="nav__link">Account</a>
</li>
</ul>
<!-- Schließen-Button -->
<button class="nav__close" id="nav-close" type="button" aria-label="Menü schließen">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round">
<line x1="18" y1="6" x2="6" y2="18"/>
<line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
<!-- ═══ /Slide-In-Menü ═══ -->
<div class="nav__actions">
<a class="nav__login nav__wishlist" href="wunschliste.php" aria-label="Wunschliste">
<svg class="icon icon-user" viewBox="0 0 24 24" aria-hidden="true">
<path d="M8 6.00067L21 6.00139M8 12.0007L21 12.0015M8 18.0007L21 18.0015M3.5 6H3.51M3.5 12H3.51M3.5 18H3.51M4 6C4 6.27614 3.77614 6.5 3.5 6.5C3.22386 6.5 3 6.27614 3 6C3 5.72386 3.22386 5.5 3.5 5.5C3.77614 5.5 4 5.72386 4 6ZM4 12C4 12.2761 3.77614 12.5 3.5 12.5C3.22386 12.5 3 12.2761 3 12C3 11.7239 3.22386 11.5 3.5 11.5C3.77614 11.5 4 11.7239 4 12ZM4 18C4 18.2761 3.77614 18.5 3.5 18.5C3.22386 18.5 3 18.2761 3 18C3 17.7239 3.22386 17.5 3.5 17.5C3.77614 17.5 4 17.7239 4 18Z"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</a>
<a class="nav__login" href="account.php" aria-label="Account">
<svg class="icon icon-user" viewBox="0 0 24 24" aria-hidden="true">
<path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"/>
</svg>
</a>
<!-- Hamburger-Toggle -->
<button class="nav__toggle" id="nav-toggle" type="button" aria-label="Menü öffnen">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round">
<line x1="3" y1="6" x2="21" y2="6"/>
<line x1="3" y1="12" x2="21" y2="12"/>
<line x1="3" y1="18" x2="21" y2="18"/>
</svg>
</button>
</div>
</div>
</nav>
</header>
<script>
(function () {
var toggle = document.getElementById('nav-toggle');
var closeBtn = document.getElementById('nav-close');
var menu = document.getElementById('nav-menu');
var overlay = document.getElementById('nav-overlay');
if (!toggle || !closeBtn || !menu || !overlay) return;
function open() {
menu.classList.add('show-menu');
overlay.classList.add('is-visible');
document.body.style.overflow = 'hidden';
}
function close() {
menu.classList.remove('show-menu');
overlay.classList.remove('is-visible');
document.body.style.overflow = '';
}
toggle.addEventListener('click', open);
closeBtn.addEventListener('click', close);
overlay.addEventListener('click', close);
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape') close();
});
// Links im Menü → schließen
var links = menu.querySelectorAll('a');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('click', close);
}
})();
</script>