Gear sets on the profile page as an in-game style column, mini grid in 'Meine Sets'

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-22 11:35:15 +02:00
parent 91008dfc8b
commit 489518647c
4 changed files with 56 additions and 19 deletions

View file

@ -5573,6 +5573,18 @@ strong.grade-common, strong.grade-rare, strong.grade-epic, strong.grade-unique,
.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; }
/* Kleine Variante fuer Set-Karten (Profilseite, "Meine Sets"): sechs Slots pro Reihe */
.gear-doll.gear-doll-mini { grid-template-columns: repeat(6, minmax(0, 40px)); gap: 4px; justify-content: start; margin: 0.35rem 0 0.15rem; }
.gear-doll-mini .gear-doll-slot { border-radius: 4px; }
.gear-doll-mini .gear-doll-slot:hover { transform: none; }
.gear-doll-mini .gear-doll-enchant { right: 2px; bottom: 2px; font-size: 0.6rem; }
.gear-doll-mini .gear-doll-initial { font-size: 1rem; }
/* Saeule wie im Spiel: zwei Slots pro Reihe (Profilseite) */
.gear-doll.gear-doll-mini.gear-doll-column { grid-template-columns: repeat(2, 46px); gap: 5px; margin: 0; }
.gear-set-card-profile .gear-set-card-link { flex-direction: row; align-items: flex-start; gap: 1rem; padding-right: 1rem; }
.gear-set-card-info { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.gear-set-card-more { margin-top: 0.4rem; font-size: 0.82rem; color: var(--gold); }
.gear-set-card-profile:hover .gear-set-card-more { text-decoration: underline; }
@media (max-width: 800px) {
.gear-doll { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 520px; margin: 0 auto; }
}

View file

@ -510,11 +510,7 @@ include __DIR__ . '/includes/header.php';
<?php if ($sLevel !== null): ?> · Ø Stufe <?= e(number_format($sLevel, 1, ',', '.')) ?><?php endif; ?>
<?php if ($s['show_on_profile']): ?> · auf dem Profil<?php endif; ?>
</span>
<span class="gear-set-card-icons">
<?php foreach (GEAR_SLOTS as $slotKey => $unused): ?>
<?php if (!empty($sSlots[$slotKey]['item'])): ?><?= $itemIcon($sSlots[$slotKey]['item'], 26) ?><?php endif; ?>
<?php endforeach; ?>
</span>
<?= gear_doll_mini_html($sSlots) ?>
<?php if (!empty($s['note'])): ?><span class="gear-set-card-note"><?= e($s['note']) ?></span><?php endif; ?>
</a>
</article>

View file

@ -85,6 +85,38 @@ function gear_slot_silhouette(string $slotKey): string
. (GEAR_SLOT_SILHOUETTES[$slotKey] ?? '') . '</svg>';
}
/**
* Kleines Ausruestungsraster fuer Set-Karten: alle Slots in der Reihenfolge des grossen Rasters,
* mit Seltenheitsfarbe, Aufwertung und Silhouetten fuer leere Slots. Standard sind sechs pro
* Reihe ("Meine Sets"); $column = zwei pro Reihe als Saeule wie im Spiel (Profilseite).
*
* @param array<string, array> $slots Slots eines Sets (gear_slots_for_sets)
*/
function gear_doll_mini_html(array $slots, bool $column = false): string
{
$html = '<span class="gear-doll gear-doll-mini' . ($column ? ' gear-doll-column' : '') . '">';
foreach (GEAR_DOLL_ORDER as $slotKey) {
$row = $slots[$slotKey] ?? null;
$item = $row['item'] ?? null;
$label = GEAR_SLOTS[$slotKey][0];
$tip = $label . ': ' . ($item ? $item['name'] . ((int) $row['enchant'] > 0 ? ' +' . (int) $row['enchant'] : '') : 'leer');
$html .= '<span class="gear-doll-slot' . ($item ? ' is-filled ' . e(gear_grade_class($item['grade'])) : '') . '" title="' . e($tip) . '">';
$iconUrl = gear_icon_url($item);
if ($item && $iconUrl) {
$html .= '<img src="' . e($iconUrl) . '" alt="" loading="lazy">';
} elseif ($item) {
$html .= '<span class="gear-doll-initial">' . e(mb_substr((string) $item['name'], 0, 1)) . '</span>';
} else {
$html .= gear_slot_silhouette($slotKey);
}
if ($item && (int) $row['enchant'] > 0) {
$html .= '<span class="gear-doll-enchant">+' . (int) $row['enchant'] . '</span>';
}
$html .= '</span>';
}
return $html . '</span>';
}
// In der Nebenhand: Schilde & Co. (SubHand) und Einhandwaffen fuer zwei Waffen
const GEAR_OFFHAND_WEAPON_TYPES = ['Sword', 'Dagger', 'Mace'];

View file

@ -125,22 +125,19 @@ include __DIR__ . '/includes/header.php';
<h2>Ausrüstung</h2>
<div class="gear-set-cards">
<?php foreach ($gearSets as $gear): ?>
<article class="gear-set-card">
<article class="gear-set-card gear-set-card-profile">
<a class="gear-set-card-link" href="/gear.php?set=<?= (int) $gear['set']['id'] ?>">
<span class="gear-set-card-title"><?= e($gear['set']['name']) ?> <?= class_badge_html($gear['set']['class_name'], 20) ?></span>
<span class="text-muted">
<?= count(array_filter($gear['slots'], static fn (array $row): bool => !empty($row['item']))) ?>/<?= count(GEAR_SLOTS) ?> Slots
<?php if ($gear['item_level'] !== null): ?> · Ø Stufe <?= e(number_format($gear['item_level'], 1, ',', '.')) ?><?php endif; ?>
<?php // Ausruestung als Saeule wie im Spiel (zwei Slots pro Reihe), Angaben daneben ?>
<?= gear_doll_mini_html($gear['slots'], true) ?>
<span class="gear-set-card-info">
<span class="gear-set-card-title"><?= e($gear['set']['name']) ?> <?= class_badge_html($gear['set']['class_name'], 20) ?></span>
<span class="text-muted">
<?= count(array_filter($gear['slots'], static fn (array $row): bool => !empty($row['item']))) ?>/<?= count(GEAR_SLOTS) ?> Slots
<?php if ($gear['item_level'] !== null): ?><br>Ø Stufe <?= e(number_format($gear['item_level'], 1, ',', '.')) ?><?php endif; ?>
</span>
<?php if (!empty($gear['set']['note'])): ?><span class="gear-set-card-note"><?= e($gear['set']['note']) ?></span><?php endif; ?>
<span class="gear-set-card-more">Details ansehen &rarr;</span>
</span>
<span class="gear-set-card-icons">
<?php foreach (GEAR_SLOTS as $slotKey => $unused): ?>
<?php $slotItem = $gear['slots'][$slotKey]['item'] ?? null; ?>
<?php if ($slotItem && ($iconUrl = gear_icon_url($slotItem))): ?>
<img class="gear-icon <?= e(gear_grade_class($slotItem['grade'])) ?>" src="<?= e($iconUrl) ?>" alt="" title="<?= e($slotItem['name']) ?>" width="26" height="26" loading="lazy">
<?php endif; ?>
<?php endforeach; ?>
</span>
<?php if (!empty($gear['set']['note'])): ?><span class="gear-set-card-note"><?= e($gear['set']['note']) ?></span><?php endif; ?>
</a>
</article>
<?php endforeach; ?>