Gear planner: equipment as an in-game style grid (two square slots per row, grade colors, enchant badge, slot silhouettes)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-22 11:24:42 +02:00
parent c547e00a81
commit 91008dfc8b
3 changed files with 123 additions and 46 deletions

View file

@ -5527,34 +5527,58 @@ strong.grade-common, strong.grade-rare, strong.grade-epic, strong.grade-unique,
.gear-set-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.gear-set-actions form { margin: 0; }
.gear-compare-with select { width: auto; padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.gear-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.5rem; align-items: start; }
.gear-layout.has-editor { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .gear-layout.has-editor { grid-template-columns: 1fr; } }
.gear-group-title { margin: 1rem 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.gear-group-title:first-child { margin-top: 0; }
.gear-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 0.5rem; }
.gear-slot {
.gear-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 1.5rem; align-items: start; }
@media (max-width: 800px) { .gear-layout { grid-template-columns: 1fr; } }
/* Ausruestung als Raster wie im Spiel: zwei quadratische Slots pro Reihe */
.gear-slots-panel { padding: 1rem; }
.gear-doll { display: grid; grid-template-columns: repeat(2, 76px); gap: 8px; justify-content: center; }
.gear-doll-slot {
position: relative;
display: flex;
gap: 0.65rem;
align-items: center;
padding: 0.5rem 0.65rem;
border: 1px solid var(--border);
border-left: 3px solid var(--grade, var(--border));
border-radius: 8px;
background: rgba(255, 255, 255, 0.025);
color: var(--text);
min-width: 0;
transition: background 0.15s, border-color 0.15s;
justify-content: center;
aspect-ratio: 1;
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 6px;
background: linear-gradient(180deg, rgba(20, 22, 30, 0.9), rgba(12, 13, 18, 0.95));
color: rgba(255, 255, 255, 0.16);
overflow: hidden;
transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.gear-doll-slot:hover { border-color: rgba(201, 162, 39, 0.6); color: rgba(255, 255, 255, 0.3); text-decoration: none; transform: translateY(-1px); }
/* Belegt: Hintergrund in der Farbe der Seltenheit (wie im Spiel gruen/blau/gold ...) */
.gear-doll-slot.is-filled {
border-color: color-mix(in srgb, var(--grade) 55%, transparent);
background:
radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.08), transparent 65%),
linear-gradient(180deg, color-mix(in srgb, var(--grade) 14%, #121418), color-mix(in srgb, var(--grade) 42%, #121418));
}
.gear-doll-slot.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.45), 0 0 14px rgba(201, 162, 39, 0.35); }
.gear-doll-slot img { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.gear-doll-silhouette { width: 58%; height: 58%; }
.gear-doll-initial { font-size: 1.6rem; font-weight: 700; color: var(--grade); }
.gear-doll-enchant, .gear-doll-exceed {
position: absolute;
font-size: 0.78rem;
font-weight: 700;
line-height: 1;
color: #fff;
text-shadow: 0 0 3px #000, 0 1px 2px #000, 0 0 6px #000;
}
.gear-doll-enchant { right: 4px; bottom: 4px; }
.gear-doll-exceed { left: 4px; top: 4px; color: #ffd76b; }
/* Manasteine: Punkte unten links (gold = eingesetzt) */
.gear-doll-stones { position: absolute; left: 4px; bottom: 5px; display: flex; gap: 2px; }
.gear-doll-stones i { width: 5px; height: 5px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.gear-doll-stones i.is-set { background: var(--gold); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.gear-doll-hint { margin: 0.75rem 0 0; font-size: 0.78rem; text-align: center; }
@media (max-width: 800px) {
.gear-doll { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 520px; margin: 0 auto; }
}
@media (max-width: 420px) {
.gear-doll { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.gear-slot:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: var(--text); }
.gear-slot.is-active { border-color: var(--gold); border-left-color: var(--grade, var(--gold)); background: rgba(201, 162, 39, 0.1); }
.gear-slot-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
/* Normale Schreibweise: in Grossbuchstaben wuerde der Browser aus "Füße" "FÜSSE" machen */
.gear-slot-label { font-size: 0.76rem; letter-spacing: 0.02em; color: var(--text-muted); }
.gear-slot-name { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear-slot:not(.is-filled) .gear-slot-name { color: var(--text-muted); font-style: italic; }
.gear-slot.is-filled .gear-slot-name { color: var(--grade); }
.gear-slot-tags { font-size: 0.78rem; color: var(--text-muted); }
.gear-side { display: flex; flex-direction: column; min-width: 0; }
.gear-slot-editor h3, .gear-totals h3 { margin-top: 0; }

View file

@ -223,30 +223,41 @@ include __DIR__ . '/includes/header.php';
</div>
</div>
<div class="gear-layout<?= $activeSlot !== '' ? ' has-editor' : '' ?>">
<div class="gear-layout">
<div class="panel gear-slots-panel">
<?php foreach (['Waffen', 'Rüstung', 'Schmuck'] as $group): ?>
<h3 class="gear-group-title"><?= e($group) ?></h3>
<div class="gear-slot-grid">
<?php foreach (GEAR_SLOTS as $slotKey => [$slotLabel, $slotGroup]): ?>
<?php if ($slotGroup !== $group) continue; ?>
<?php $row = $slots[$slotKey] ?? null; $item = $row['item'] ?? null; ?>
<a class="gear-slot<?= $item ? ' is-filled ' . e(gear_grade_class($item['grade'])) : '' ?><?= $slotKey === $activeSlot ? ' is-active' : '' ?>"
href="/gear.php?set=<?= (int) $set['id'] ?>&amp;slot=<?= e($slotKey) ?>#slot">
<?= $itemIcon($item, 42) ?>
<span class="gear-slot-body">
<span class="gear-slot-label"><?= e($slotLabel) ?></span>
<span class="gear-slot-name"><?= $item ? e($item['name']) : ($isOwn ? 'leer – auswählen' : 'leer') ?></span>
<?php if ($item): ?><span class="gear-slot-tags"><?= e(implode(' · ', $slotTags($row))) ?></span><?php endif; ?>
<?php // Ausruestung als Raster wie im Spiel: zwei Slots pro Reihe, Name beim Drueberfahren ?>
<div class="gear-doll">
<?php foreach (GEAR_DOLL_ORDER as $slotKey): ?>
<?php
$slotLabel = GEAR_SLOTS[$slotKey][0];
$row = $slots[$slotKey] ?? null;
$item = $row['item'] ?? null;
$tip = $slotLabel . ': ' . ($item ? $item['name'] . ($slotTags($row) ? ' (' . implode(' · ', $slotTags($row)) . ')' : '') : 'leer');
?>
<a class="gear-doll-slot<?= $item ? ' is-filled ' . e(gear_grade_class($item['grade'])) : '' ?><?= $slotKey === $activeSlot ? ' is-active' : '' ?>"
href="/gear.php?set=<?= (int) $set['id'] ?>&amp;slot=<?= e($slotKey) ?>#slot" title="<?= e($tip) ?>" aria-label="<?= e($tip) ?>">
<?php if ($item && ($iconUrl = gear_icon_url($item))): ?>
<img src="<?= e($iconUrl) ?>" alt="" loading="lazy">
<?php elseif ($item): ?>
<span class="gear-doll-initial"><?= e(mb_substr($item['name'], 0, 1)) ?></span>
<?php else: ?>
<?= gear_slot_silhouette($slotKey) ?>
<?php endif; ?>
<?php if ($item && (int) $row['exceed'] > 0): ?><span class="gear-doll-exceed">⬆<?= (int) $row['exceed'] ?></span><?php endif; ?>
<?php if ($item && (int) $row['enchant'] > 0): ?><span class="gear-doll-enchant">+<?= (int) $row['enchant'] ?></span><?php endif; ?>
<?php if ($item && (int) $item['manastone_slots'] > 0): ?>
<span class="gear-doll-stones" aria-hidden="true">
<?php for ($i = 0; $i < (int) $item['manastone_slots']; $i++): ?><i class="<?= $i < count($row['manastones']) ? 'is-set' : '' ?>"></i><?php endfor; ?>
</span>
<?php endif; ?>
</a>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<p class="gear-doll-hint text-muted"><?= $isOwn ? 'Slot anklicken zum Bearbeiten' : 'Slot anklicken für Details' ?></p>
</div>
<?php if ($activeSlot !== ''): ?>
<div class="gear-side">
<?php if ($activeSlot !== ''): ?>
<div class="panel gear-slot-editor" id="slot">
<h3><?= e(GEAR_SLOTS[$activeSlot][0]) ?></h3>
<?php if ($activeItem): ?>
@ -390,9 +401,7 @@ include __DIR__ . '/includes/header.php';
<p class="text-muted">Dieser Slot ist leer.</p>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="panel gear-totals">
<h3>Werte gesamt</h3>
@ -428,6 +437,8 @@ include __DIR__ . '/includes/header.php';
<p class="gear-hint text-muted">Einfache Summe aller Gegenstände - Klassen- und Charakterwerte, Set-Boni und Götterstein sind nicht enthalten.</p>
<?php endif; ?>
</div>
</div>
</div>
<?php if ($isOwn): ?>
<div class="modal-overlay" id="gear-set-edit" hidden>

View file

@ -43,6 +43,48 @@ const GEAR_SLOTS = [
'amulet' => ['Amulett', 'Schmuck', ['Amulet']],
];
// Anordnung der Slots im Ausruestungsraster (zwei pro Reihe, wie im Spiel)
const GEAR_DOLL_ORDER = [
'main_hand', 'off_hand',
'head', 'shoulder',
'torso', 'belt',
'pants', 'gloves',
'cape', 'boots',
'earring_1', 'earring_2',
'necklace', 'amulet',
'ring_1', 'ring_2',
'bracelet_1', 'bracelet_2',
];
// Umriss-Silhouetten fuer leere Slots (SVG-Pfade, 24er Raster, nur Linien)
const GEAR_SLOT_SILHOUETTES = [
'main_hand' => '<path d="M14.5 17.5 3 6V3h3l11.5 11.5"/><path d="m13 19 6-6"/><path d="m16 16 4 4"/><path d="m19 21 2-2"/>',
'off_hand' => '<path d="M12 21c4.5-1.8 7-5.2 7-9.5V6l-7-3-7 3v5.5c0 4.3 2.5 7.7 7 9.5z"/><path d="M12 3v18"/>',
'head' => '<path d="M4 15a8 8 0 0 1 16 0v3h-5v3H9v-3H4z"/><path d="M8 15h8"/><path d="M12 7v4"/>',
'shoulder' => '<path d="M3 15c0-4.4 3.6-8 8-8h2c4.4 0 8 3.6 8 8l-3 2-2-3H8l-2 3z"/><path d="M8 7l2-3h4l2 3"/>',
'torso' => '<path d="M8 3 4 6v5h3v10h10V11h3V6l-4-3-2 2h-4z"/><path d="M12 5v16"/>',
'belt' => '<path d="M2 10h20v4H2z"/><path d="M10 8.5h4v7h-4z"/>',
'pants' => '<path d="M6 3h12l1 18h-5l-2-10-2 10H5z"/><path d="M6 6h12"/>',
'gloves' => '<path d="M8 21v-7L6 10V6.5a1 1 0 0 1 2 0V10"/><path d="M8 10V4.5a1 1 0 0 1 2 0V10"/><path d="M10 9V4a1 1 0 0 1 2 0v5"/><path d="M12 9.5V5a1 1 0 0 1 2 0v6l1.8-1.6a1 1 0 0 1 1.4 1.4L15 14.5V21"/>',
'cape' => '<path d="M8 3h8l4 18-4-2-4 2-4-2-4 2z"/><path d="M9 3c0 2 1.3 3 3 3s3-1 3-3"/>',
'boots' => '<path d="M7 3h6v10l6 3v5H6z"/><path d="M6 18h13"/>',
'earring_1' => '<circle cx="12" cy="4.5" r="1.5"/><path d="M12 6v4"/><path d="M12 10l-3.5 5.5a3.5 3.5 0 0 0 7 0z"/>',
'earring_2' => '<circle cx="12" cy="4.5" r="1.5"/><path d="M12 6v4"/><path d="M12 10l-3.5 5.5a3.5 3.5 0 0 0 7 0z"/>',
'necklace' => '<path d="M5 3c0 6.5 3 11 7 11s7-4.5 7-11"/><path d="M12 14l-2.5 3.5L12 21l2.5-3.5z"/>',
'amulet' => '<circle cx="12" cy="14" r="6"/><circle cx="12" cy="14" r="2.5"/><path d="M12 3v5"/>',
'ring_1' => '<circle cx="12" cy="15" r="6"/><path d="m9 6.5 3-3.5 3 3.5-3 2.5z"/>',
'ring_2' => '<circle cx="12" cy="15" r="6"/><path d="m9 6.5 3-3.5 3 3.5-3 2.5z"/>',
'bracelet_1' => '<ellipse cx="12" cy="12" rx="9" ry="5"/><ellipse cx="12" cy="12" rx="5.5" ry="2.5"/>',
'bracelet_2' => '<ellipse cx="12" cy="12" rx="9" ry="5"/><ellipse cx="12" cy="12" rx="5.5" ry="2.5"/>',
];
/** Umriss-Symbol eines leeren Slots. */
function gear_slot_silhouette(string $slotKey): string
{
return '<svg class="gear-doll-silhouette" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">'
. (GEAR_SLOT_SILHOUETTES[$slotKey] ?? '') . '</svg>';
}
// In der Nebenhand: Schilde & Co. (SubHand) und Einhandwaffen fuer zwei Waffen
const GEAR_OFFHAND_WEAPON_TYPES = ['Sword', 'Dagger', 'Mace'];