Responsive navigation menu

This commit is contained in:
2025-06-01 00:06:10 +02:00
parent ca961320e7
commit 504702700c
3 changed files with 193 additions and 53 deletions

View File

@@ -1,43 +1,123 @@
:root {
--barca-blue: #002147;
--barca-red: #A50044;
--barca-gold: #FDB913;
--polska-red-dark: #DC143C;
--polska-red: #E30B17;
--polska-white: #FFFFFF;
}
/* Podstawowy styl */ /* Podstawowy styl */
body { body {
font-family: 'Arial', sans-serif; font-family: 'Segoe UI', sans-serif;
margin: 0; margin: 0;
padding: 0; padding: 0;
background: #f7f7f7; background: white;
color: #222; color: #222;
transition: all 0s ease; transition: all 0s ease;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; /* Wyśrodkowanie elementów w poziomie */ align-items: stretch; /* Wyśrodkowanie elementów w poziomie */
justify-content: flex-start; /* Ustalamy początek na górze */ justify-content: flex-start; /* Ustalamy początek na górze */
min-height: 100vh; min-height: 100vh;
} }
/* Styl nawigacji */ /* Styl nawigacji */
nav { .navbar {
background: #d32f2f; background: linear-gradient(to right, #002147, #A50044);
padding: 0px; /*background: linear-gradient(to right, #E30B17, #FFFFFF);*/
color: white;
padding: 1rem 1rem;
height: 1.5rem;
position: sticky;
top: 0;
left: 0;
width: 100% - 2rem;
z-index: 999;
display: flex; display: flex;
justify-content: center; /* Wyśrodkowanie linków */ justify-content: space-between;
width: 100%; align-items: center;
color: white; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
} }
nav a, nav button { .logo {
color: white; font-size: 1.5rem;
text-decoration: none; font-weight: bold;
font-weight: bold; color: var(--barca-gold);
background: none; }
border: none;
cursor: pointer; .nav-links {
margin: 0 15px; /* Odstęp między elementami */ display: flex;
} gap: 0rem;
list-style: none;
}
.nav-links li a,
.nav-links li button {
background-color: rgba(255, 255, 255, 0.05);
padding: 1rem 1.25rem; /* dopasowane do .navbar padding */
height: 100%;
border-radius: 0;
color: var(--barca-gold);
text-decoration: none;
font-weight: 500;
border: none;
cursor: pointer;
transition: 0.3s ease;
align-items: center;
}
.nav-links li a:hover,
.nav-links li button:hover {
background-color: var(--barca-gold, #FDB913);
color: var(--barca-blue, #002147);
}
.hamburger {
display: none;
font-size: 2rem;
color: var(--barca-gold);
cursor: pointer;
}
@media (max-width: 768px) {
.nav-links {
display: none;
flex-direction: column;
background-color: #002147;
position: absolute;
top: 2.5rem;
right: 0rem;
padding: 0rem;
gap: 0;
width: 200px;
}
.nav-links li {
width: 100%;
}
.nav-links li a,
.nav-links li button {
display: block;
width: 100%;
text-align: left;
padding: 1rem;
margin: 0;
border-radius: 0; /* brak zaokrągleń w mobilnym menu */
}
.nav-links.show {
display: flex;
}
.hamburger {
display: block;
}
}
/* Wyśrodkowanie głównej zawartości */ /* Wyśrodkowanie głównej zawartości */
main { main {
padding: 0px; padding: 0px; /* Maksymalna szerokość treści */
width: 100%;
max-width: 980px; /* Maksymalna szerokość treści */
text-align: center; /* Wyśrodkowanie tekstu */ text-align: center; /* Wyśrodkowanie tekstu */
} }
@@ -110,29 +190,51 @@ header button {
transition: background-color 0.3s; transition: background-color 0.3s;
} }
header button:hover { header button:hover {
background-color: #0056b3; background-color: #0056b3;
} }
/* Style dla listy meczów */ /* Style dla listy meczów */
ul { .section-stats {
list-style: none; background: linear-gradient(135deg, #002147, #A50044);
padding: 0; color: white;
display: flex; border-radius: 20px;
flex-direction: column; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
align-items: center; /* Wyśrodkowanie listy */ padding: 2rem 2rem;
max-width: 1000px;
margin: 0 auto;
margin-bottom: 10px;
}
.section-stats h2 {
font-size: 2rem;
margin-bottom: 1rem;
color: var(--barca-red);
}
.stats {
display: flex;
justify-content: space-around;
text-align: center;
margin-top: 2rem;
flex-wrap: wrap;
gap: 2rem;
} }
ul li { .stat-box {
background-color: #eaeaea; background-color: rgba(255, 255, 255, 0.1);
margin-bottom: 10px; border: 2px solid var(--barca-gold);
padding: 10px; color: white;
border-radius: 5px; padding: 2rem;
transition: background-color 0.3s; border-radius: 15px;
width: 90%; /* Szerokość li z marginesem */ width: 160px;
max-width: 800px; /* Maksymalna szerokość elementu */ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
} transition: transform 0.3s ease;
}
ul li:hover { .stat-box h3 {
background-color: #d1d1d1; font-size: 2.5rem;
} margin-bottom: 0.5rem;
color: var(--barca-gold);
}
.stat-box p {
font-size: 1.1rem;
}

View File

@@ -14,11 +14,16 @@
<meta property="og:image:width" content = "100"> <meta property="og:image:width" content = "100">
</head> </head>
<body> <body>
<nav> <nav class="navbar">
<a href="/">🏠 Strona główna</a> | <div class="logo">Robert Lewandowski</div>
<a href="/mecze">📅 Mecze</a> | <ul class="nav-links">
<a href="/statystyki">📊 Statystyki</a> | <li><a href="/">🏠 Strona główna</a></li>
<button id="theme-toggle" onclick="toggleTheme()">🌙 / 🌞</button> <li><a href="/mecze">📅 Mecze</a></li>
<li><a href="/statystyki">📊 Statystyki</a></li>
<li><a href="/statystyki">📊 Statystyki</a></li>
<!--<li><button id="theme-toggle" onclick="toggleTheme()">🌙 / 🌞</button></li>-->
</ul>
<div class="hamburger"></div>
</nav> </nav>
<header> <header>
@@ -31,7 +36,12 @@
<main> <main>
{% block content %}{% endblock %} {% block content %}{% endblock %}
</main> </main>
<script>
const hamburger = document.querySelector('.hamburger');
const navLinks = document.querySelector('.nav-links');
hamburger.addEventListener('click', () => {
navLinks.classList.toggle('show');});
</script>
<script> <script>
function toggleTheme() { function toggleTheme() {
const currentMode = document.body.classList.contains('dark-mode') ? 'dark' : 'light'; const currentMode = document.body.classList.contains('dark-mode') ? 'dark' : 'light';

View File

@@ -3,10 +3,38 @@
{% block title %}Statystyki{% endblock %} {% block title %}Statystyki{% endblock %}
{% block content %} {% block content %}
<h2>Statystyki Roberta Lewandowskiego</h2> <section class="section-stats">
<ul> <h2>All time stats</h2>
<li>Gole: {{ stats.goals }}</li> <div class="stats">
<li>Asysty: {{ stats.assists }}</li> <div class="stat-box">
<li>Mecze: {{ stats.matches }}</li> <h3>{{ stats.goals }}</h3>
</ul> <p>Goals</p>
</div>
<div class="stat-box">
<h3>{{ stats.assists }}</h3>
<p>Assists</p>
</div>
<div class="stat-box">
<h3>{{ stats.matches }}</h3>
<p>Apps</p>
</div>
</div>
</section>
<section class="section-stats">
<h2>All time stats</h2>
<div class="stats">
<div class="stat-box">
<h3>{{ stats.goals }}</h3>
<p>Goals</p>
</div>
<div class="stat-box">
<h3>{{ stats.assists }}</h3>
<p>Assists</p>
</div>
<div class="stat-box">
<h3>{{ stats.matches }}</h3>
<p>Apps</p>
</div>
</div>
</section>
{% endblock %} {% endblock %}