Redesign the profile page: side-by-side fields and a proper Discord card

Anzeigename and Passwort ändern now sit in a two-column grid (stacks
on narrow screens). The Discord section gets its own bordered card
with the official Discord mark (inline SVG, brand blurple accent) and
a clear Verbunden/Nicht verbunden status badge, replacing the plain
generic panel. Verified both connection states with a rendered
screenshot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-18 18:07:12 +02:00
parent 3f27a23ae0
commit be8373529a
3 changed files with 107 additions and 50 deletions

View file

@ -9,6 +9,8 @@
--gold-hover: #e0b930;
--danger: #d9534f;
--success: #4caf50;
--discord: #5865f2;
--discord-hover: #4752c4;
--sidebar-width: 260px;
}
@ -474,6 +476,41 @@ input:focus, select:focus, textarea:focus {
color: var(--gold);
}
.profile-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
align-items: start;
}
.discord-card { border-left: 3px solid var(--discord); }
.discord-card-header {
display: flex;
align-items: center;
gap: 0.85rem;
margin-bottom: 1rem;
}
.discord-card-header h2 { margin: 0 0 0.3rem; }
.discord-logo { color: var(--discord); flex-shrink: 0; }
.discord-connect-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: var(--discord);
color: #fff;
}
.discord-connect-button:hover { background: var(--discord-hover); }
.discord-connect-button .discord-logo { color: #fff; }
@media (max-width: 700px) {
.profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
.app-shell {
flex-direction: column;

View file

@ -81,6 +81,15 @@ function icon(string $name): string
. 'stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' . $path . '</svg>';
}
// Offizielles Discord-Markenzeichen (gefuellte Flaeche statt Strichgrafik).
function discord_logo(int $size = 24): string
{
$path = 'M20.317 4.3698a19.7913 19.7913 0 0 0-4.8851-1.5152.0741.0741 0 0 0-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 0 0-.0785-.037 19.7363 19.7363 0 0 0-4.8852 1.515.0699.0699 0 0 0-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 0 0 .0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 0 0 .0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 0 0-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 0 1-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 0 1 .0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 0 1 .0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 0 1-.0066.1276 12.2986 12.2986 0 0 1-1.873.8914.0766.0766 0 0 0-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 0 0 .0842.0286c1.961-.6067 3.9495-1.522 6.0023-3.0294a.077.077 0 0 0 .0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 0 0-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z';
return '<svg class="discord-logo" width="' . $size . '" height="' . $size . '" viewBox="0 0 24 24" '
. 'fill="currentColor" aria-hidden="true"><path d="' . $path . '"/></svg>';
}
// Ordnet die (teils deutschen) Klassennamen aus dem Raid-Bot den Icon-Dateien
// unter assets/images/Classes zu. Gibt null zurück, wenn keine passende
// Datei existiert (z.B. bei "Ausstehend").

View file

@ -45,58 +45,69 @@ include __DIR__ . '/includes/header.php';
<p class="text-muted">Benutzername: <strong><?= e($user['username']) ?></strong></p>
</div>
<div class="panel">
<h2>Anzeigename</h2>
<?php if ($profileError): ?>
<div class="flash flash-error"><?= e($profileError) ?></div>
<?php endif; ?>
<form method="post" action="/profile.php">
<?= csrf_field() ?>
<input type="hidden" name="action" value="update_profile">
<div>
<label for="display_name">Anzeigename</label>
<input type="text" id="display_name" name="display_name" value="<?= e($user['display_name']) ?>" required>
</div>
<button type="submit">Speichern</button>
</form>
</div>
<div class="panel">
<h2>Passwort ändern</h2>
<?php if ($passwordError): ?>
<div class="flash flash-error"><?= e($passwordError) ?></div>
<?php endif; ?>
<form method="post" action="/profile.php">
<?= csrf_field() ?>
<input type="hidden" name="action" value="change_password">
<div>
<label for="new_password">Neues Passwort</label>
<input type="password" id="new_password" name="new_password" required>
<div class="field-hint">Mindestens 8 Zeichen.</div>
</div>
<div>
<label for="new_password_confirm">Neues Passwort wiederholen</label>
<input type="password" id="new_password_confirm" name="new_password_confirm" required>
</div>
<button type="submit">Passwort speichern</button>
</form>
</div>
<div class="panel stat-card">
<div class="icon-badge"><?= icon('link') ?></div>
<div>
<h3>Discord-Verknüpfung</h3>
<?php if (!empty($user['discord_id'])): ?>
<p>Verknüpft als <strong><?= e((string) $user['discord_username']) ?></strong></p>
<form method="post" action="/discord_unlink.php" class="inline-form" onsubmit="return confirm('Discord-Verknüpfung wirklich entfernen?');">
<?= csrf_field() ?>
<button type="submit" class="button-secondary">Verknüpfung entfernen</button>
</form>
<?php else: ?>
<p class="text-muted">Verknüpfe deinen Discord-Account, um dich über die Website zu Raids anmelden zu können.</p>
<a class="button" href="/discord_login.php">Mit Discord verknüpfen</a>
<div class="profile-grid">
<div class="panel">
<h2>Anzeigename</h2>
<?php if ($profileError): ?>
<div class="flash flash-error"><?= e($profileError) ?></div>
<?php endif; ?>
<form method="post" action="/profile.php">
<?= csrf_field() ?>
<input type="hidden" name="action" value="update_profile">
<div>
<label for="display_name">Anzeigename</label>
<input type="text" id="display_name" name="display_name" value="<?= e($user['display_name']) ?>" required>
</div>
<button type="submit">Speichern</button>
</form>
</div>
<div class="panel">
<h2>Passwort ändern</h2>
<?php if ($passwordError): ?>
<div class="flash flash-error"><?= e($passwordError) ?></div>
<?php endif; ?>
<form method="post" action="/profile.php">
<?= csrf_field() ?>
<input type="hidden" name="action" value="change_password">
<div>
<label for="new_password">Neues Passwort</label>
<input type="password" id="new_password" name="new_password" required>
<div class="field-hint">Mindestens 8 Zeichen.</div>
</div>
<div>
<label for="new_password_confirm">Neues Passwort wiederholen</label>
<input type="password" id="new_password_confirm" name="new_password_confirm" required>
</div>
<button type="submit">Passwort speichern</button>
</form>
</div>
</div>
<div class="panel discord-card">
<div class="discord-card-header">
<?= discord_logo(40) ?>
<div>
<h2>Discord</h2>
<?php if (!empty($user['discord_id'])): ?>
<span class="badge badge-active">Verbunden</span>
<?php else: ?>
<span class="badge badge-disabled">Nicht verbunden</span>
<?php endif; ?>
</div>
</div>
<?php if (!empty($user['discord_id'])): ?>
<p>Verknüpft als <strong><?= e((string) $user['discord_username']) ?></strong></p>
<form method="post" action="/discord_unlink.php" class="inline-form" onsubmit="return confirm('Discord-Verknüpfung wirklich entfernen?');">
<?= csrf_field() ?>
<button type="submit" class="button-secondary">Verknüpfung entfernen</button>
</form>
<?php else: ?>
<p class="text-muted">Verknüpfe deinen Discord-Account, um dich über die Website zu Raids anmelden zu können.</p>
<a class="button discord-connect-button" href="/discord_login.php">
<?= discord_logo(18) ?> Mit Discord verknüpfen
</a>
<?php endif; ?>
</div>
<?php include __DIR__ . '/includes/footer.php'; ?>