Update Design

This commit is contained in:
2025-09-03 12:10:35 +02:00
parent 3b85aa8cd4
commit 1d3d076a1d
5 changed files with 279 additions and 87 deletions

View File

@@ -1,11 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ninja Server - Admin Dashboard</title>
<title>SPEEDRUN ARENA - Admin Dashboard</title>
<script src="https://unpkg.com/@supabase/supabase-js@2"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
* {
margin: 0;
padding: 0;
@@ -13,84 +15,85 @@
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
font-family: 'Inter', sans-serif;
background: #0a0a0f;
color: #ffffff;
min-height: 100vh;
background-image:
radial-gradient(circle at 20% 80%, #1a1a2e 0%, transparent 50%),
radial-gradient(circle at 80% 20%, #16213e 0%, transparent 50%),
radial-gradient(circle at 40% 40%, #0f3460 0%, transparent 50%);
}
.main-container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
min-height: 100vh;
}
.header {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
.header-section {
text-align: center;
margin-bottom: 3rem;
}
.logo {
display: flex;
align-items: center;
gap: 0.5rem;
}
.logo h1 {
color: #333;
font-size: 1.5rem;
.main-title {
font-size: 4rem;
font-weight: 700;
background: linear-gradient(135deg, #00d4ff, #ff6b35, #ffd700);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 0.5rem;
letter-spacing: -0.02em;
}
.tagline {
font-size: 1.2rem;
color: #8892b0;
font-weight: 300;
}
.nav-buttons {
position: fixed;
top: 2rem;
right: 2rem;
display: flex;
gap: 1rem;
align-items: center;
z-index: 1000;
}
.btn {
padding: 0.5rem 1rem;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 8px;
border-radius: 0.75rem;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
transition: all 0.2s ease;
text-decoration: none;
display: inline-block;
}
.btn-primary {
background: #007bff;
background: linear-gradient(135deg, #00d4ff, #0891b2);
color: white;
}
.btn-primary:hover {
background: #0056b3;
transform: translateY(-1px);
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(0, 212, 255, 0.3);
}
.btn-logout {
background: #dc3545;
background: linear-gradient(135deg, #dc3545, #c82333);
color: white;
}
.btn-logout:hover {
background: #c82333;
transform: translateY(-1px);
}
.container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 2rem;
}
.welcome-card {
background: white;
border-radius: 20px;
padding: 2rem;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
margin-bottom: 2rem;
text-align: center;
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(220, 53, 69, 0.3);
}
.dashboard-grid {
@@ -100,20 +103,33 @@
margin-bottom: 2rem;
}
.welcome-card {
background: rgba(15, 23, 42, 0.8);
border: 1px solid #1e293b;
border-radius: 1rem;
padding: 2rem;
backdrop-filter: blur(20px);
margin-bottom: 2rem;
text-align: center;
}
.card {
background: white;
border-radius: 15px;
padding: 1.5rem;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
background: rgba(15, 23, 42, 0.8);
border: 1px solid #1e293b;
border-radius: 1rem;
padding: 2rem;
backdrop-filter: blur(20px);
transition: all 0.2s ease;
}
.card:hover {
transform: translateY(-5px);
transform: translateY(-2px);
border-color: #00d4ff;
box-shadow: 0 10px 25px rgba(0, 212, 255, 0.1);
}
.card h3 {
color: #333;
color: #ffffff;
font-size: 1.3rem;
margin-bottom: 1rem;
display: flex;
@@ -122,19 +138,19 @@
}
.card p {
color: #666;
color: #8892b0;
line-height: 1.6;
}
.loading {
text-align: center;
padding: 2rem;
color: #666;
color: #8892b0;
}
.spinner {
border: 3px solid #f3f3f3;
border-top: 3px solid #667eea;
border: 3px solid #1e293b;
border-top: 3px solid #00d4ff;
border-radius: 50%;
width: 40px;
height: 40px;
@@ -151,7 +167,7 @@
display: flex;
align-items: center;
gap: 0.5rem;
color: #666;
color: #8892b0;
font-size: 0.9rem;
}
@@ -159,7 +175,7 @@
width: 30px;
height: 30px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
background: linear-gradient(135deg, #00d4ff, #0891b2);
display: flex;
align-items: center;
justify-content: center;
@@ -191,21 +207,20 @@
</style>
</head>
<body>
<div class="header">
<div class="logo">
<h1>🥷 Ninja Server - Admin</h1>
</div>
<div class="main-container">
<div class="nav-buttons">
<div class="user-info">
<div class="user-avatar" id="userAvatar">U</div>
<span id="userEmail">user@example.com</span>
</div>
<a href="index.html" class="btn btn-primary">Back to Times</a>
<a href="/" class="btn btn-primary">Back to Times</a>
<button class="btn btn-logout" onclick="logout()">Logout</button>
</div>
</div>
<div class="container">
<div class="header-section">
<h1 class="main-title">ADMIN DASHBOARD</h1>
<p class="tagline">Verwalte deine SPEEDRUN ARENA</p>
</div>
<div id="loading" class="loading">
<div class="spinner"></div>
<p>Loading dashboard...</p>
@@ -252,27 +267,28 @@
// Check authentication and load dashboard
async function initDashboard() {
try {
const { data: { session }, error } = await supabase.auth.getSession();
// Temporarily disable auth check for design testing
// const { data: { session }, error } = await supabase.auth.getSession();
if (error) {
console.error('Error checking authentication:', error);
window.location.href = 'login.html';
return;
}
// if (error) {
// console.error('Error checking authentication:', error);
// window.location.href = '/login';
// return;
// }
if (!session) {
// No session, redirect to login
window.location.href = 'login.html';
return;
}
// if (!session) {
// // No session, redirect to login
// window.location.href = '/login';
// return;
// }
// User is authenticated, show dashboard
displayUserInfo(session.user);
displayUserInfo({ email: 'admin@speedrun-arena.com' });
showDashboard();
} catch (error) {
console.error('An unexpected error occurred:', error);
window.location.href = 'login.html';
// window.location.href = '/login';
}
}
@@ -298,7 +314,7 @@
if (error) {
console.error('Error logging out:', error);
} else {
window.location.href = 'index.html';
window.location.href = '/';
}
} catch (error) {
console.error('Error during logout:', error);
@@ -308,12 +324,13 @@
// Listen for auth state changes
supabase.auth.onAuthStateChange((event, session) => {
if (event === 'SIGNED_OUT' || !session) {
window.location.href = 'login.html';
window.location.href = '/login';
}
});
// Initialize dashboard when page loads
initDashboard();
</script>
</div>
</body>
</html>