|
|
@@ -2,7 +2,6 @@
|
|
|
include 'db_config.php';
|
|
|
|
|
|
// --- 1. DATEN LADEN ---
|
|
|
-// Alle Spieler für den Filter laden
|
|
|
$allTeams = $pdo->query("SELECT * FROM spieler ORDER BY name ASC")->fetchAll();
|
|
|
|
|
|
// Filter-Logik
|
|
|
@@ -25,7 +24,7 @@ $playedGames = $stmt->fetchAll();
|
|
|
<html lang="de">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
- <title>Gespielte Spiele</title>
|
|
|
+ <title>EXIT - Gelöste Abenteuer</title>
|
|
|
<style>
|
|
|
:root {
|
|
|
--bg: #f4f7f6; --card: #ffffff; --text: #333; --border: #ddd; --accent: #e67e22;
|
|
|
@@ -35,28 +34,36 @@ $playedGames = $stmt->fetchAll();
|
|
|
}
|
|
|
|
|
|
body { font-family: 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); padding: 20px; transition: 0.3s; }
|
|
|
- header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
|
|
|
+ .container { max-width: 1200px; margin: 0 auto; }
|
|
|
+
|
|
|
+ /* HEADER ANALOG ZU ADMIN/INDEX */
|
|
|
+ header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
|
|
|
+ h1 { color: var(--accent); margin: 0; font-size: 1.8rem; }
|
|
|
|
|
|
- /* Filter Bereich */
|
|
|
- .filter-bar { background: var(--card); padding: 15px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 25px; display: flex; align-items: center; gap: 15px; }
|
|
|
- select { padding: 8px 15px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; }
|
|
|
+ .btn-nav { background: var(--accent); color: white; text-decoration: none; padding: 10px 15px; border-radius: 8px; font-weight: bold; font-size: 0.9em; display: inline-block; border: none; cursor: pointer; }
|
|
|
+ .theme-toggle { background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }
|
|
|
+
|
|
|
+ /* FILTER BAR */
|
|
|
+ .filter-bar { background: var(--card); padding: 15px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 25px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
|
|
|
+ select { padding: 8px 15px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; width: auto; }
|
|
|
|
|
|
- .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
|
|
|
- .item { background: var(--card); border-radius: 12px; text-align: center; border: 1px solid var(--border); box-shadow: 0 4px 10px rgba(0,0,0,0.1); overflow: hidden; position: relative; }
|
|
|
- .item img { width: 100%; height: 160px; object-fit: cover; background: #2a2a2a; border-bottom: 1px solid var(--border); }
|
|
|
+ /* GRID & CARDS */
|
|
|
+ .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
|
|
|
+ .item { background: var(--card); border-radius: 12px; text-align: center; border: 1px solid var(--border); box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow: hidden; }
|
|
|
+ .item img { width: 100%; height: 180px; object-fit: cover; background: #2a2a2a; border-bottom: 1px solid var(--border); }
|
|
|
|
|
|
- /* Ergebnis-Overlay / Badge */
|
|
|
- .stats { padding: 12px; }
|
|
|
- .team-badge { font-size: 0.75em; background: var(--accent); color: white; padding: 2px 8px; border-radius: 10px; margin-bottom: 5px; display: inline-block; }
|
|
|
- .game-title { font-weight: bold; display: block; margin-bottom: 8px; font-size: 1em; }
|
|
|
+ .stats { padding: 15px; }
|
|
|
+ .team-badge { font-size: 0.7em; background: var(--accent); color: white; padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; display: inline-block; text-transform: uppercase; letter-spacing: 0.5px; }
|
|
|
+ .game-title { font-weight: bold; display: block; margin-bottom: 10px; font-size: 1.1em; min-height: 2.2em; display: flex; align-items: center; justify-content: center; }
|
|
|
|
|
|
- .result-row { display: flex; justify-content: space-around; font-size: 0.85em; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
|
|
|
- .res-item span { display: block; opacity: 0.6; font-size: 0.8em; }
|
|
|
- .res-item b { color: var(--accent); }
|
|
|
+ .result-row { display: flex; justify-content: space-around; font-size: 0.85em; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 5px; }
|
|
|
+ .res-item span { display: block; opacity: 0.6; font-size: 0.75em; margin-bottom: 2px; }
|
|
|
+ .res-item b { color: var(--accent); font-size: 1em; }
|
|
|
|
|
|
- h1 { color: var(--accent); margin: 0; }
|
|
|
- .back { color: var(--accent); text-decoration: none; font-weight: bold; border: 1px solid var(--accent); padding: 5px 15px; border-radius: 6px; }
|
|
|
- .theme-toggle { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 20px; cursor: pointer; font-size: 1.1rem; }
|
|
|
+ @media (max-width: 600px) {
|
|
|
+ header { flex-direction: column; gap: 15px; text-align: center; }
|
|
|
+ .filter-bar { flex-direction: column; align-items: stretch; }
|
|
|
+ }
|
|
|
</style>
|
|
|
<script>
|
|
|
if (localStorage.getItem('theme') === 'dark') document.documentElement.classList.add('dark-theme');
|
|
|
@@ -64,20 +71,20 @@ $playedGames = $stmt->fetchAll();
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
+<div class="container">
|
|
|
<header>
|
|
|
- <a href="index.php" class="back">← Dashboard</a>
|
|
|
+ <h1>📂 Gelöste Abenteuer</h1>
|
|
|
<div style="display: flex; align-items: center; gap: 15px;">
|
|
|
<button onclick="toggleTheme()" class="theme-toggle" id="theme-icon">🌙</button>
|
|
|
+ <a href="index.php" class="btn-nav">Dashboard</a>
|
|
|
</div>
|
|
|
</header>
|
|
|
|
|
|
- <h1>📂 Gelöste Abenteuer</h1>
|
|
|
-
|
|
|
<div class="filter-bar">
|
|
|
- <span>Team-Filter:</span>
|
|
|
- <form id="filterForm">
|
|
|
- <select name="team_id" onchange="document.getElementById('filterForm').submit()">
|
|
|
- <option value="0">-- Alle Teams anzeigen --</option>
|
|
|
+ <strong>Filter nach Team:</strong>
|
|
|
+ <form id="filterForm" method="GET">
|
|
|
+ <select name="team_id" onchange="this.form.submit()">
|
|
|
+ <option value="0">-- Alle Teams --</option>
|
|
|
<?php foreach ($allTeams as $t): ?>
|
|
|
<option value="<?= $t['id'] ?>" <?= $teamFilter == $t['id'] ? 'selected' : '' ?>>
|
|
|
<?= htmlspecialchars($t['name']) ?>
|
|
|
@@ -90,13 +97,13 @@ $playedGames = $stmt->fetchAll();
|
|
|
<div class="grid">
|
|
|
<?php foreach ($playedGames as $game): ?>
|
|
|
<div class="item">
|
|
|
- <img src="<?= htmlspecialchars($game['bild_url']) ?>" onerror="this.src='https://via.placeholder.com/220x160?text=Kein+Bild'">
|
|
|
+ <img src="<?= htmlspecialchars($game['bild_url']) ?>" onerror="this.src='https://via.placeholder.com/240x180?text=EXIT+Spiel'">
|
|
|
<div class="stats">
|
|
|
<span class="team-badge"><?= htmlspecialchars($game['team_name']) ?></span>
|
|
|
<span class="game-title"><?= htmlspecialchars($game['titel']) ?></span>
|
|
|
|
|
|
<div class="result-row">
|
|
|
- <div class="res-item"><span>Zeit</span><b><?= $game['zeit'] ?> Min</b></div>
|
|
|
+ <div class="res-item"><span>Zeit</span><b><?= $game['zeit'] ?> Min.</b></div>
|
|
|
<div class="res-item"><span>Hilfe</span><b><?= $game['hilfe'] ?></b></div>
|
|
|
<div class="res-item"><span>Sterne</span><b>⭐ <?= $game['sterne'] ?></b></div>
|
|
|
</div>
|
|
|
@@ -106,18 +113,20 @@ $playedGames = $stmt->fetchAll();
|
|
|
</div>
|
|
|
|
|
|
<?php if (empty($playedGames)): ?>
|
|
|
- <p style="text-align: center; margin-top: 50px; opacity: 0.5;">Keine Spiele für dieses Team gefunden.</p>
|
|
|
+ <p style="text-align: center; margin-top: 50px; opacity: 0.5;">Hier wurden noch keine Abenteuer gelöst.</p>
|
|
|
<?php endif; ?>
|
|
|
+</div>
|
|
|
|
|
|
<script>
|
|
|
+ const themeIcon = document.getElementById('theme-icon');
|
|
|
function toggleTheme() {
|
|
|
const isDark = document.documentElement.classList.toggle('dark-theme');
|
|
|
localStorage.setItem('theme', isDark ? 'dark' : 'light');
|
|
|
- document.getElementById('theme-icon').innerText = isDark ? '☀️' : '🌙';
|
|
|
+ themeIcon.innerText = isDark ? '☀️' : '🌙';
|
|
|
}
|
|
|
|
|
|
if (localStorage.getItem('theme') === 'dark') {
|
|
|
- document.getElementById('theme-icon').innerText = '☀️';
|
|
|
+ themeIcon.innerText = '☀️';
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|