This commit is contained in:
Fabian Schieder 2026-01-21 15:22:15 +00:00
parent cc451a102f
commit b3de19a2e4
4 changed files with 470 additions and 281 deletions

View File

@ -1,4 +0,0 @@
<header>
awdasd
vfffbgfbgf

View File

@ -1,2 +1,9 @@
<?php <?php
echo "Test123"; ini_set('display_errors', 1);
error_reporting(E_ALL);
include 'navbar.php';
echo "test123";
include 'footer.php';

View File

@ -1,20 +1,464 @@
<?php
$currentPage = basename($_SERVER['PHP_SELF']);
?>
<nav class="navbar">
<ul> <!DOCTYPE html>
<input type="text" name="q" placeholder="Produkt Suchen..." required> <html lang="en">
<button type="submit">Suchen</button>
<li class="<?= $currentPage === 'index.php' ? 'active' : '' ?>"> <style>
<a href="index.php">Wunschliste</a> /*=============== GOOGLE FONTS ===============*/
</li> @import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600&display=swap");
<li class="<?= $currentPage === 'produkte.php' ? 'active' : '' ?>">
<a href="produkte.php">Warenkorb</a> /*=============== VARIABLES CSS ===============*/
</li> :root {
<li class="<?= $currentPage === 'kontakt.php' ? 'active' : '' ?>"> --header-height: 3.5rem;
<a href="kontakt.php">Account</a>
</li> /*========== Colors ==========*/
</ul> /*Color mode HSL(hue, saturation, lightness)*/
</nav> --first-color: hsl(230, 75%, 56%);
--title-color: hsl(230, 75%, 15%);
--text-color: hsl(230, 12%, 40%);
--body-color: hsl(230, 100%, 98%);
--container-color: hsl(230, 100%, 97%);
--border-color: hsl(230, 25%, 80%);
/*========== Font and typography ==========*/
/*.5rem = 8px | 1rem = 16px ...*/
--body-font: "Syne", sans-serif;
--h2-font-size: 1.25rem;
--normal-font-size: .938rem;
/*========== Font weight ==========*/
--font-regular: 400;
--font-medium: 500;
--font-semi-bold: 600;
/*========== z index ==========*/
--z-fixed: 100;
--z-modal: 1000;
}
/*========== Responsive typography ==========*/
@media screen and (min-width: 1023px) {
:root {
--h2-font-size: 1.5rem;
--normal-font-size: 1rem;
}
}
/*=============== BASE ===============*/
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html {
scroll-behavior: smooth;
}
body,
input,
button {
font-family: var(--body-font);
font-size: var(--normal-font-size);
}
body {
background-color: var(--body-color);
color: var(--text-color);
}
input,
button {
border: none;
outline: none;
}
ul {
list-style: none;
}
a {
text-decoration: none;
}
img {
display: block;
max-width: 100%;
height: auto;
}
/*=============== REUSABLE CSS CLASSES ===============*/
.container {
max-width: 1120px;
margin-inline: 1.5rem;
}
.main {
position: relative;
height: 100vh;
}
.main__bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
z-index: -1;
}
.search,
.login {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: var(--z-modal);
background-color: hsla(230, 75%, 15%, .1);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px); /* For safari */
padding: 8rem 1.5rem 0;
opacity: 0;
pointer-events: none;
transition: opacity .4s;
}
.search__close,
.login__close {
position: absolute;
top: 2rem;
right: 2rem;
font-size: 1.5rem;
color: var(--title-color);
cursor: pointer;
}
/*=============== HEADER & NAV ===============*/
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: var(--body-color);
box-shadow: 0 2px 16px hsla(230, 75%, 32%, .15);
z-index: var(--z-fixed);
}
.nav {
height: var(--header-height);
display: flex;
justify-content: space-between;
align-items: center;
}
.nav__logo {
color: var(--title-color);
font-weight: var(--font-semi-bold);
transition: color .4s;
}
.nav__actions {
display: flex;
align-items: center;
column-gap: 1rem;
}
.nav__search,
.nav__login,
.nav__toggle,
.nav__close {
font-size: 1.25rem;
color: var(--title-color);
cursor: pointer;
transition: color .4s;
}
:is(.nav__logo, .nav__search, .nav__login, .nav__toggle, .nav__link):hover {
color: var(--first-color);
}
/* Navigation for mobile devices */
@media screen and (max-width: 1023px) {
.nav__menu {
position: fixed;
top: -100%;
left: 0;
background-color: var(--body-color);
box-shadow: 0 8px 16px hsla(230, 75%, 32%, .15);
width: 100%;
padding-block: 4.5rem 4rem;
transition: top .4s;
}
}
.nav__list {
display: flex;
flex-direction: column;
row-gap: 2.5rem;
text-align: center;
}
.nav__link {
color: var(--title-color);
font-weight: var(--font-semi-bold);
transition: color .4s;
}
.nav__close {
position: absolute;
top: 1.15rem;
right: 1.5rem;
}
/* Show menu */
.show-menu {
top: 0;
}
/*=============== SEARCH ===============*/
.search__form {
display: flex;
align-items: center;
column-gap: .5rem;
background-color: var(--container-color);
box-shadow: 0 8px 32px hsla(230, 75%, 15%, .2);
padding-inline: 1rem;
border-radius: .5rem;
transform: translateY(-1rem);
transition: transform .4s;
}
.search__icon {
font-size: 1.25rem;
color: var(--title-color);
}
.search__input {
width: 100%;
padding-block: 1rem;
background-color: var(--container-color);
color: var(--text-color);
}
.search__input::placeholder {
color: var(--text-color);
}
/* Show search */
.show-search {
opacity: 1;
pointer-events: initial;
}
.show-search .search__form {
transform: translateY(0);
}
/*=============== LOGIN ===============*/
.login__form,
.login__group {
display: grid;
}
.login__form {
background-color: var(--container-color);
padding: 2rem 1.5rem 2.5rem;
box-shadow: 0 8px 32px hsla(230, 75%, 15%, .2);
border-radius: 1rem;
row-gap: 1.25rem;
text-align: center;
transform: translateY(-1rem);
transition: transform .4s;
}
.login__title {
font-size: var(--h2-font-size);
color: var(--title-color);
}
.login__group {
row-gap: 1rem;
}
.login__label {
display: block;
text-align: initial;
color: var(--title-color);
font-weight: var(--font-medium);
margin-bottom: .25rem;
}
.login__input {
width: 100%;
background-color: var(--container-color);
border: 2px solid var(--border-color);
padding: 1rem;
border-radius: .5rem;
color: var(--text-color);
}
.login__input::placeholder {
color: var(--text-color);
}
.login__signup {
margin-bottom: .5rem;
}
.login__signup a {
color: var(--first-color);
}
.login__forgot {
display: inline-block;
color: var(--first-color);
margin-bottom: 1.25rem;
}
.login__button {
display: inline-block;
background-color: var(--first-color);
width: 100%;
color: #fff;
font-weight: var(--font-semi-bold);
padding: 1rem;
border-radius: .5rem;
cursor: pointer;
transition: box-shadow .4s;
}
.login__button:hover {
box-shadow: 0 4px 24px hsla(230, 75%, 40%, .4);
}
/* Show login */
.show-login {
opacity: 1;
pointer-events: initial;
}
.show-login .login__form {
transform: translateY(0);
}
/*=============== BREAKPOINTS ===============*/
/* For medium devices */
@media screen and (min-width: 576px) {
.search,
.login {
padding-top: 10rem;
}
.search__form {
max-width: 450px;
margin-inline: auto;
}
.search__close,
.login__close {
width: max-content;
top: 5rem;
left: 0;
right: 0;
margin-inline: auto;
font-size: 2rem;
}
.login__form {
max-width: 400px;
margin-inline: auto;
}
}
/* For large devices */
@media screen and (min-width: 1023px) {
.nav {
height: calc(var(--header-height) + 2rem);
column-gap: 3rem;
}
.nav__close,
.nav__toggle {
display: none;
}
.nav__menu {
margin-left: auto;
}
.nav__list {
flex-direction: row;
column-gap: 3rem;
}
.login__form {
padding: 3rem 2rem 3.5rem;
}
}
@media screen and (min-width: 1150px) {
.container {
margin-inline: auto;
}
}
</style>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--=============== REMIXICONS ===============-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/3.5.0/remixicon.css">
<title>Responsive navbar with search and login - Bedimcode</title>
</head>
<body>
<!--==================== HEADER ====================-->
<header class="header" id="header">
<nav class="nav container">
<a href="#" class="nav__logo">Logo</a>
<div class="nav__menu" id="nav-menu">
<ul class="nav__list">
<li class="nav__item">
<a href="#" class="nav__link">Home</a>
</li>
<li class="nav__item">
<a href="#" class="nav__link">About Us</a>
</li>
<li class="nav__item">
<a href="#" class="nav__link">Services</a>
</li>
<li class="nav__item">
<a href="#" class="nav__link">Featured</a>
</li>
<li class="nav__item">
<a href="#" class="nav__link">Contact Me</a>
</li>
</ul>
<!-- Close button -->
<div class="nav__close" id="nav-close">
<i class="ri-close-line"></i>
</div>
</div>
<div class="nav__actions">
<!-- Search button -->
<i class="ri-search-line nav__search" id="search-btn"></i>
<!-- Login button -->
<i class="ri-user-line nav__login" id="login-btn"></i>
<!-- Toggle button -->
<div class="nav__toggle" id="nav-toggle">
<i class="ri-menu-line"></i>
</div>
</div>
</nav>
</header>

258
style.css
View File

@ -1,258 +0,0 @@
/* ================================
Modernes Preisvergleich-Stylesheet
================================ */
/* --- CSS Reset (leichtgewichtig) --- */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* --- Root-Variablen --- */
:root {
--bg-main: #f4f6f8;
--bg-card: #ffffff;
--color-primary: #2563eb;
--color-secondary: #64748b;
--color-text: #0f172a;
--color-muted: #475569;
--border-radius: 10px;
--shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.08);
}
/* --- Grundlayout --- */
body {
margin: 0;
padding: 32px;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
background-color: var(--bg-main);
color: var(--color-text);
line-height: 1.6;
}
/* --- Überschrift --- */
h1 {
margin-top: 0;
margin-bottom: 24px;
font-size: 1.8rem;
font-weight: 600;
}
/* --- Formular --- */
form {
background: var(--bg-card);
padding: 16px 20px;
margin-bottom: 28px;
border-radius: var(--border-radius);
box-shadow: var(--shadow-soft);
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: center;
}
form label {
font-size: 0.9rem;
color: var(--color-muted);
}
select,
input[type="number"] {
padding: 8px 10px;
border-radius: 6px;
border: 1px solid #cbd5f5;
font-size: 0.95rem;
background: #fff;
}
select:focus,
input:focus {
outline: none;
border-color: var(--color-primary);
}
/* --- Button --- */
button {
padding: 9px 16px;
border-radius: 6px;
border: none;
background-color: var(--color-primary);
color: #fff;
font-size: 0.95rem;
cursor: pointer;
transition: background-color 0.2s ease;
}
button:hover {
background-color: #1d4ed8;
}
/* --- Produktkarte --- */
.product {
background: var(--bg-card);
padding: 18px 22px;
margin-bottom: 20px;
border-radius: var(--border-radius);
box-shadow: var(--shadow-soft);
}
/* Produkt-Titel */
.product > strong {
font-size: 1.05rem;
}
/* --- Preis --- */
.product .price {
font-size: 1.1rem;
font-weight: 600;
color: var(--color-primary);
}
/* --- Specs --- */
.spec {
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #e5e7eb;
font-size: 0.9rem;
color: var(--color-muted);
}
/* --- Angebote --- */
.offer {
margin-top: 12px;
padding-top: 10px;
border-top: 1px dashed #e5e7eb;
font-size: 0.9rem;
}
/* --- Responsive Feinschliff --- */
@media (max-width: 600px) {
body {
padding: 16px;
}
form {
flex-direction: column;
align-items: stretch;
}
button {
width: 100%;
}
}
/* ======================================
Elegant Dark Mode refined UI
====================================== */
@media (prefers-color-scheme: dark) {
:root {
/* Background Layers */
--bg-main: #0b0f19; /* App-Hintergrund */
--bg-card: #111827; /* Cards */
--bg-input: #020617; /* Inputs */
/* Text */
--color-text: #e5e7eb;
--color-muted: #9ca3af;
/* Accent */
--color-primary: #60a5fa; /* sanfteres Blau */
/* Borders & Shadow */
--border-soft: #1e293b;
--shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.65);
}
body {
background:
radial-gradient(1200px at top, #111827 0%, var(--bg-main) 60%);
color: var(--color-text);
}
/* Cards */
form,
.product {
background:
linear-gradient(
180deg,
rgba(255,255,255,0.02),
rgba(0,0,0,0.15)
),
var(--bg-card);
box-shadow: var(--shadow-soft);
border: 1px solid var(--border-soft);
}
/* Inputs */
select,
input[type="number"] {
background: var(--bg-input);
color: var(--color-text);
border: 1px solid var(--border-soft);
}
select:focus,
input:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 1px var(--color-primary);
}
/* Button */
button {
background: linear-gradient(
180deg,
#60a5fa,
#3b82f6
);
color: #020617;
box-shadow: 0 4px 12px rgba(96, 165, 250, 0.35);
}
button:hover {
filter: brightness(1.08);
}
/* Produkttext */
.product > strong {
color: #f8fafc;
}
/* Specs / Offers */
.spec,
.offer {
border-top: 1px solid var(--border-soft);
color: var(--color-muted);
}
}
/*-----------------------NAV-BAR-----------------------*/
.navbar {
background: #1e1e1e;
padding: 12px 24px;
}
.navbar ul {
list-style: none;
display: flex;
gap: 24px;
margin: 0;
padding: 0;
}
.navbar a {
color: #ddd;
text-decoration: none;
font-weight: 500;
}
.navbar li.active a {
color: #4fc3f7;
border-bottom: 2px solid #4fc3f7;
}
/*-----------------------------------------------------*/