Redesign Premades roster as a fixed 5-slot grid of angled cards
Replaces the pill chips with bigger rectangular cards (two per row, corners diagonally cut for a parallelogram-ish look via clip-path) matching the request for something closer to a raid-group roster. A premade always shows exactly 5 slots - lead, accepted members, pending invites, then grayed-out empty placeholders (a muted "+" card) for whatever's left, so a half-full group still reads as a group with open spots rather than a short list. The lead's card gets a solid gold outer frame with a dark gold-tinted fill and a crown icon; getting the tint right took a second pass - using rgba() on the inner fill blended against the gold "border" layer underneath instead of the page background, which just looked like solid gold, so it's a flat dark-gold hex instead. The border itself is simulated with a two-layer trick (colored outer + inset inner, both clip-path'd) since clip-path crops away any border drawn on a single element's diagonal edges. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
fc0ba31ea2
commit
43aa0e9c66
2 changed files with 108 additions and 70 deletions
|
|
@ -782,48 +782,87 @@ input:focus, select:focus, textarea:focus {
|
||||||
|
|
||||||
.raid-premade-row select { width: auto; }
|
.raid-premade-row select { width: auto; }
|
||||||
|
|
||||||
.premade-members {
|
.premade-roster {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 0.5rem;
|
gap: 0.75rem;
|
||||||
margin: 0.75rem 0 0;
|
margin: 0.75rem 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.premade-chip {
|
@media (max-width: 480px) {
|
||||||
|
.premade-roster { grid-template-columns: 1fr; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Rechteck mit angeschraegten Ecken (Parallelogramm-Anmutung) statt eines reinen
|
||||||
|
Rechtecks. clip-path schneidet dabei auch einen ggf. gesetzten "border" weg,
|
||||||
|
deshalb simuliert ein aeusseres (Rahmenfarbe) + inneres (Fuellfarbe) Element
|
||||||
|
in Kombination einen sauber umlaufenden Rahmen. */
|
||||||
|
.premade-slot {
|
||||||
|
background: var(--border);
|
||||||
|
padding: 1.5px;
|
||||||
|
clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.premade-slot-inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.75rem;
|
||||||
padding: 0.3rem 0.65rem 0.3rem 0.3rem;
|
height: 100%;
|
||||||
|
min-height: 64px;
|
||||||
|
padding: 0.7rem 1rem;
|
||||||
background: var(--bg-panel-alt);
|
background: var(--bg-panel-alt);
|
||||||
border: 1px solid var(--border);
|
clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
|
||||||
border-radius: 999px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.premade-chip-lead {
|
.premade-slot-lead { background: var(--gold); }
|
||||||
border-color: var(--gold);
|
.premade-slot-lead .premade-slot-inner { background: #332b18; }
|
||||||
background: rgba(201, 162, 39, 0.12);
|
|
||||||
}
|
|
||||||
|
|
||||||
.premade-chip-pending {
|
.premade-slot-pending .premade-slot-inner { color: var(--text-muted); }
|
||||||
border-style: dashed;
|
|
||||||
|
.premade-slot-empty { opacity: 0.4; }
|
||||||
|
|
||||||
|
.premade-slot-empty .premade-slot-inner {
|
||||||
|
justify-content: center;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.premade-slot-empty .premade-slot-inner::before { content: "+"; }
|
||||||
|
|
||||||
|
.premade-slot-name {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
gap: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.premade-slot-name strong {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.premade-slot-name .text-muted { font-size: 0.78rem; }
|
||||||
|
|
||||||
.premade-crown {
|
.premade-crown {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
color: var(--gold);
|
color: var(--gold);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.premade-crown .icon { width: 15px; height: 15px; }
|
.premade-crown .icon { width: 18px; height: 18px; }
|
||||||
|
|
||||||
.premade-chip .icon-button {
|
.premade-slot .icon-button {
|
||||||
width: 22px;
|
width: 26px;
|
||||||
height: 22px;
|
height: 26px;
|
||||||
margin-left: 0.1rem;
|
flex-shrink: 0;
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.premade-chip .icon-button .icon { width: 13px; height: 13px; }
|
.premade-slot .icon-button .icon { width: 14px; height: 14px; }
|
||||||
|
|
||||||
.premade-invite-row {
|
.premade-invite-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
97
premades.php
97
premades.php
|
|
@ -164,55 +164,54 @@ include __DIR__ . '/includes/header.php';
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="premade-members">
|
<?php
|
||||||
<?php
|
// Premades bilden eine volle 5er-Gruppe ab (Lead + bis zu 4 weitere) - freie
|
||||||
$ownerName = premade_name_for($ownerId, $namesByDiscordId, $premade['owner_name'] ?? null);
|
// Plaetze werden mit ausgegrauten Platzhaltern aufgefuellt.
|
||||||
$ownerAvatarUser = premade_avatar_user($ownerId, $linkedUsersByDiscordId, $ownerName);
|
$ownerName = premade_name_for($ownerId, $namesByDiscordId, $premade['owner_name'] ?? null);
|
||||||
?>
|
$slots = [['type' => 'lead', 'id' => $ownerId, 'name' => $ownerName]];
|
||||||
<div class="premade-chip premade-chip-lead">
|
foreach ($accepted as $member) {
|
||||||
<?= avatar_html($ownerAvatarUser, 28) ?>
|
$mid = (int) ($member['user_id'] ?? 0);
|
||||||
<span><?= e($ownerName) ?></span>
|
$slots[] = ['type' => 'accepted', 'id' => $mid, 'name' => premade_name_for($mid, $namesByDiscordId, $member['name'] ?? null)];
|
||||||
<span class="premade-crown" title="Lead der Premade"><?= icon('crown') ?></span>
|
}
|
||||||
</div>
|
foreach ($pending as $member) {
|
||||||
<?php foreach ($accepted as $member): ?>
|
$mid = (int) ($member['user_id'] ?? 0);
|
||||||
<?php
|
$slots[] = ['type' => 'pending', 'id' => $mid, 'name' => premade_name_for($mid, $namesByDiscordId, $member['name'] ?? null)];
|
||||||
$memberId = (int) ($member['user_id'] ?? 0);
|
}
|
||||||
$memberName = premade_name_for($memberId, $namesByDiscordId, $member['name'] ?? null);
|
while (count($slots) < 5) {
|
||||||
$memberAvatarUser = premade_avatar_user($memberId, $linkedUsersByDiscordId, $memberName);
|
$slots[] = ['type' => 'empty'];
|
||||||
?>
|
}
|
||||||
<div class="premade-chip">
|
?>
|
||||||
<?= avatar_html($memberAvatarUser, 28) ?>
|
<div class="premade-roster">
|
||||||
<span><?= e($memberName) ?></span>
|
<?php foreach ($slots as $slot): ?>
|
||||||
<?php if ($canManageThis): ?>
|
<?php if ($slot['type'] === 'empty'): ?>
|
||||||
<form method="post" action="/premade_action.php" class="inline-form">
|
<div class="premade-slot premade-slot-empty">
|
||||||
<?= csrf_field() ?>
|
<div class="premade-slot-inner"></div>
|
||||||
<input type="hidden" name="action" value="remove_member">
|
</div>
|
||||||
<input type="hidden" name="premade_id" value="<?= $premadeId ?>">
|
<?php else: ?>
|
||||||
<input type="hidden" name="user_id" value="<?= $memberId ?>">
|
<?php $slotUser = premade_avatar_user((int) $slot['id'], $linkedUsersByDiscordId, $slot['name']); ?>
|
||||||
<button type="submit" class="icon-button icon-button-danger" title="Aus der Premade entfernen"><?= icon('x') ?></button>
|
<div class="premade-slot premade-slot-<?= e($slot['type']) ?>">
|
||||||
</form>
|
<div class="premade-slot-inner">
|
||||||
<?php endif; ?>
|
<?= avatar_html($slotUser, 40) ?>
|
||||||
</div>
|
<div class="premade-slot-name">
|
||||||
<?php endforeach; ?>
|
<strong><?= $slot['type'] === 'pending' ? '⏳ ' : '' ?><?= e($slot['name']) ?></strong>
|
||||||
<?php foreach ($pending as $member): ?>
|
<?php if ($slot['type'] === 'pending'): ?>
|
||||||
<?php
|
<span class="text-muted">Einladung offen</span>
|
||||||
$memberId = (int) ($member['user_id'] ?? 0);
|
<?php endif; ?>
|
||||||
$memberName = premade_name_for($memberId, $namesByDiscordId, $member['name'] ?? null);
|
</div>
|
||||||
$memberAvatarUser = premade_avatar_user($memberId, $linkedUsersByDiscordId, $memberName);
|
<?php if ($slot['type'] === 'lead'): ?>
|
||||||
?>
|
<span class="premade-crown" title="Lead der Premade"><?= icon('crown') ?></span>
|
||||||
<div class="premade-chip premade-chip-pending" title="Einladung offen">
|
<?php elseif ($canManageThis): ?>
|
||||||
<?= avatar_html($memberAvatarUser, 28) ?>
|
<form method="post" action="/premade_action.php" class="inline-form">
|
||||||
<span>⏳ <?= e($memberName) ?></span>
|
<?= csrf_field() ?>
|
||||||
<?php if ($canManageThis): ?>
|
<input type="hidden" name="action" value="remove_member">
|
||||||
<form method="post" action="/premade_action.php" class="inline-form">
|
<input type="hidden" name="premade_id" value="<?= $premadeId ?>">
|
||||||
<?= csrf_field() ?>
|
<input type="hidden" name="user_id" value="<?= (int) $slot['id'] ?>">
|
||||||
<input type="hidden" name="action" value="remove_member">
|
<button type="submit" class="icon-button icon-button-danger" title="<?= $slot['type'] === 'pending' ? 'Einladung zurückziehen' : 'Aus der Premade entfernen' ?>"><?= icon('x') ?></button>
|
||||||
<input type="hidden" name="premade_id" value="<?= $premadeId ?>">
|
</form>
|
||||||
<input type="hidden" name="user_id" value="<?= $memberId ?>">
|
<?php endif; ?>
|
||||||
<button type="submit" class="icon-button icon-button-danger" title="Einladung zurückziehen"><?= icon('x') ?></button>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue