| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  | <!DOCTYPE html> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  | <html lang="{{ session.get('lang', 'en') }}" data-bs-theme="{{ theme }}"> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  | <head> | 
					
						
							|  |  |  |     <meta charset="UTF-8"> | 
					
						
							|  |  |  |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |     <meta name="csrf-token" content="{{ csrf_token() }}"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |     <meta name="description" content="Manage your Steam and GOG keys efficiently. Track redemption dates, share games, and export lists."> | 
					
						
							|  |  |  |     <meta name="theme-color" content="#212529"> | 
					
						
							|  |  |  |     <link rel="manifest" href="{{ url_for('static', filename='manifest.json') }}"> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |     <title>{{ _('Game Key Manager') }}</title> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |     <!-- Preload Bootstrap CSS for better LCP --> | 
					
						
							|  |  |  |     <link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> | 
					
						
							|  |  |  |     <noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"></noscript> | 
					
						
							|  |  |  |     <!-- Eigene Styles --> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |     <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |     {# LCP-Optimierung: Preload für das erste Cover-Bild, falls vorhanden #} | 
					
						
							|  |  |  |     {% if games and games[0].steam_appid %} | 
					
						
							|  |  |  |     <link rel="preload" | 
					
						
							|  |  |  |           as="image" | 
					
						
							|  |  |  |           href="https://cdn.cloudflare.steamstatic.com/steam/apps/{{ games[0].steam_appid }}/header.jpg" | 
					
						
							|  |  |  |           imagesrcset="https://cdn.cloudflare.steamstatic.com/steam/apps/{{ games[0].steam_appid }}/header.jpg 368w" | 
					
						
							|  |  |  |           fetchpriority="high" | 
					
						
							|  |  |  |           type="image/jpeg"> | 
					
						
							|  |  |  |     {% endif %} | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  | </head> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  | <script> | 
					
						
							|  |  |  | (function() { | 
					
						
							|  |  |  |   try { | 
					
						
							|  |  |  |     var theme = localStorage.getItem('theme'); | 
					
						
							|  |  |  |     if (!theme) { | 
					
						
							|  |  |  |       // Systempräferenz als Fallback | 
					
						
							|  |  |  |       theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     document.documentElement.setAttribute('data-bs-theme', theme); | 
					
						
							|  |  |  |   } catch(e) {} | 
					
						
							|  |  |  | })(); | 
					
						
							|  |  |  | </script> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  | <body> | 
					
						
							|  |  |  |     <nav class="navbar navbar-expand-lg bg-body-tertiary"> | 
					
						
							|  |  |  |         <div class="container"> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |             <a class="navbar-brand d-flex align-items-center gap-2" href="/"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                 <img src="{{ url_for('static', filename='logo_small.webp') }}" alt="Logo" width="150" height="116" style="object-fit:contain; border-radius:8px;"> | 
					
						
							|  |  |  |                 <span>Game Key Manager</span> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |             </a> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |             <div class="d-flex align-items-center gap-3"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                 <form class="d-flex" action="{{ url_for('index') }}" method="GET" role="search" aria-label="{{ _('Search games') }}"> | 
					
						
							|  |  |  |                     <label for="searchInput" class="visually-hidden">{{ _('Search') }}</label> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |                     <input class="form-control me-2"  | 
					
						
							|  |  |  |                            type="search"  | 
					
						
							|  |  |  |                            name="q" | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                            id="searchInput" | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |                            placeholder="{{ _('Search') }}" | 
					
						
							|  |  |  |                            value="{{ search_query }}"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                     <button class="btn btn-outline-success" type="submit" aria-label="{{ _('Search') }}">🔍</button> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |                 </form> | 
					
						
							|  |  |  |                 <div class="form-check form-switch"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                     <input class="form-check-input" | 
					
						
							|  |  |  |                            type="checkbox" | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |                            id="darkModeSwitch" {% if theme == 'dark' %}checked{% endif %}> | 
					
						
							|  |  |  |                     <label class="form-check-label" for="darkModeSwitch">{{ _('Dark Mode') }}</label> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |                 <div class="dropdown ms-3"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                     <div hidden id="locale-debug" data-locale="{{ session.get('lang', 'en') }}"></div> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |                     <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                         {% if session.get('lang', 'en') == 'de' %} Deutsch {% elif session.get('lang', 'en') == 'en' %} English {% else %} Sprache {% endif %} | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |                     </button> | 
					
						
							|  |  |  |                     <ul class="dropdown-menu"> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                         <li><a class="dropdown-item {% if session.get('lang', 'en') == 'de' %}active{% endif %}" href="{{ url_for('set_lang', lang='de') }}">Deutsch</a></li> | 
					
						
							|  |  |  |                         <li><a class="dropdown-item {% if session.get('lang', 'en') == 'en' %}active{% endif %}" href="{{ url_for('set_lang', lang='en') }}">English</a></li> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  |                     </ul> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |                 </div> | 
					
						
							|  |  |  |                 {% if current_user.is_authenticated %} | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |                     <li class="nav-item"> | 
					
						
							|  |  |  |                         <a class="nav-link" href="{{ url_for('change_password') }}">🔒 {{ _('Password') }}</a> | 
					
						
							|  |  |  |                     </li> | 
					
						
							|  |  |  |                     <li class="nav-item"> | 
					
						
							|  |  |  |                         <a class="nav-link" href="{{ url_for('logout') }}">🚪 {{ _('Logout') }}</a> | 
					
						
							|  |  |  |                     </li> | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |                 {% endif %} | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |     </nav> | 
					
						
							|  |  |  |     <div class="container mt-4"> | 
					
						
							|  |  |  |         {% with messages = get_flashed_messages(with_categories=true) %} | 
					
						
							|  |  |  |             {% if messages %} | 
					
						
							|  |  |  |                 {% for category, message in messages %} | 
					
						
							|  |  |  |                 <div class="alert alert-{{ category }} alert-dismissible fade show"> | 
					
						
							|  |  |  |                     {{ message }} | 
					
						
							|  |  |  |                     <button type="button" class="btn-close" data-bs-dismiss="alert"></button> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |                 {% endfor %} | 
					
						
							|  |  |  |             {% endif %} | 
					
						
							|  |  |  |         {% endwith %} | 
					
						
							|  |  |  |         {% block content %}{% endblock %} | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |     <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> | 
					
						
							|  |  |  |     <script> | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |     // Service Worker Registration for PWA | 
					
						
							|  |  |  |     if ('serviceWorker' in navigator) { | 
					
						
							|  |  |  |       window.addEventListener('load', () => { | 
					
						
							|  |  |  |         navigator.serviceWorker.register('{{ url_for("static", filename="serviceworker.js") }}', {scope: '/'}) | 
					
						
							|  |  |  |           .then(registration => { | 
					
						
							|  |  |  |             console.log('ServiceWorker registered:', registration.scope); | 
					
						
							|  |  |  |           }) | 
					
						
							|  |  |  |           .catch(error => { | 
					
						
							|  |  |  |             console.log('ServiceWorker registration failed:', error); | 
					
						
							|  |  |  |           }); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // Dark Mode Switch | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |     document.addEventListener('DOMContentLoaded', function() { | 
					
						
							| 
									
										
										
										
											2025-05-03 11:37:42 +02:00
										 |  |  |         const toggle = document.getElementById('darkModeSwitch'); | 
					
						
							|  |  |  |         const html = document.documentElement; | 
					
						
							|  |  |  |         if (toggle) { | 
					
						
							|  |  |  |             toggle.checked = (html.getAttribute('data-bs-theme') === 'dark') | 
					
						
							|  |  |  |             toggle.addEventListener('change', function() { | 
					
						
							|  |  |  |                 const theme = this.checked ? 'dark' : 'light'; | 
					
						
							|  |  |  |                 document.cookie = "theme=" + theme + ";path=/;max-age=31536000"; | 
					
						
							|  |  |  |                 html.setAttribute('data-bs-theme', theme); | 
					
						
							|  |  |  |                 fetch('/set-theme/' + theme); | 
					
						
							|  |  |  |             }); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // Set theme on page load | 
					
						
							|  |  |  |         function getThemeCookie() { | 
					
						
							|  |  |  |           const cookies = document.cookie.split(';'); | 
					
						
							|  |  |  |             for (let cookie of cookies) { | 
					
						
							|  |  |  |               const [name, value] = cookie.trim().split('='); | 
					
						
							|  |  |  |               if (name === 'theme') return value; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             return null; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         const savedTheme = getThemeCookie() || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'); | 
					
						
							|  |  |  |         document.documentElement.setAttribute('data-bs-theme', savedTheme); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  |     </script> | 
					
						
							| 
									
										
										
										
											2025-04-26 14:32:07 +02:00
										 |  |  | {% include "footer.html" %} | 
					
						
							| 
									
										
										
										
											2025-04-21 11:56:29 +00:00
										 |  |  | </body> | 
					
						
							|  |  |  | </html> |