Redesign inventory UI: compact equipped items grid, dedicated hotbar row, key items grid layout
- Equipped items (type 1): compact 5x2 grid matching main inventory sizing, slot labels as small uppercase badges - Hotbar (type 5): dedicated 10-column horizontal row with minimal item display - Key items (type 15): responsive card grid instead of plain vertical list - Main inventory: preserve 5x7 slot grid with correct position_index mapping
This commit is contained in:
1 parent
6fe4384d91
commit
52f2575a20
2 files changed
+240
-85
No files matched your search
+182
-59
@@ -431,6 +431,40 @@ td a:hover { text-decoration: underline; }
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.inv-grid-compact {
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.inv-grid-compact .inv-grid-slot {
|
||||
min-height: 56px;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.inv-grid-compact .inv-slot-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.inv-grid-compact .inv-slot-name {
|
||||
font-size: 7px;
|
||||
}
|
||||
|
||||
.inv-grid-compact .inv-slot-stack {
|
||||
font-size: 8px;
|
||||
bottom: 1px;
|
||||
right: 2px;
|
||||
}
|
||||
|
||||
.inv-grid-compact .inv-slot-ammo {
|
||||
font-size: 8px;
|
||||
top: 1px;
|
||||
right: 2px;
|
||||
}
|
||||
|
||||
.inv-grid-compact .inv-slot-durability-bar {
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
.inv-grid-slot {
|
||||
aspect-ratio: 1;
|
||||
border: 2px dashed var(--border);
|
||||
@@ -537,87 +571,176 @@ td a:hover { text-decoration: underline; }
|
||||
}
|
||||
|
||||
/* Equipped Items Grid */
|
||||
.inv-equipped-grid {
|
||||
.inv-equipped-compact {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.inv-equipped-slot {
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
transition: all 0.15s;
|
||||
background: var(--card-bg);
|
||||
min-height: 80px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.inv-equipped-slot:hover {
|
||||
border-color: var(--primary);
|
||||
background: var(--hover);
|
||||
}
|
||||
|
||||
.inv-equipped-slot.has-item {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.inv-equipped-label {
|
||||
font-size: 10px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 4px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.inv-equipped-slot .inv-slot-icon {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.inv-equipped-slot .inv-slot-name {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
/* Key Items List */
|
||||
.inv-key-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.inv-key-item {
|
||||
.inv-equipped-compact .inv-grid-slot {
|
||||
min-height: 56px;
|
||||
border-width: 1px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.inv-equipped-compact .inv-slot-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.inv-equipped-compact .inv-slot-name {
|
||||
font-size: 7px;
|
||||
}
|
||||
|
||||
.inv-equipped-badge {
|
||||
font-size: 7px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.3px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
/* Hotbar */
|
||||
.inv-hotbar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(10, 1fr);
|
||||
gap: 4px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.inv-hotbar-slot {
|
||||
aspect-ratio: 1;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
transition: all 0.15s;
|
||||
background: var(--card-bg);
|
||||
min-height: 52px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.inv-hotbar-slot:hover {
|
||||
border-color: var(--primary);
|
||||
background: var(--hover);
|
||||
}
|
||||
|
||||
.inv-hotbar-slot.has-item {
|
||||
border-color: var(--border);
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.inv-hotbar-slot .inv-slot-icon {
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
margin-bottom: 1px;
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
.inv-hotbar-slot .inv-slot-name {
|
||||
font-size: 7px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
line-height: 1.1;
|
||||
max-width: 95%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.inv-hotbar-slot .inv-slot-stack {
|
||||
position: absolute;
|
||||
bottom: 1px;
|
||||
right: 3px;
|
||||
font-size: 8px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
background: rgba(255,255,255,0.8);
|
||||
padding: 0 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.inv-hotbar-slot .inv-slot-empty-icon {
|
||||
color: var(--text-muted);
|
||||
opacity: 0.3;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Experimental Warning Banner */
|
||||
.experimental-banner {
|
||||
background: rgba(220, 38, 38, 0.12);
|
||||
border: 1px solid rgba(220, 38, 38, 0.5);
|
||||
border-left: 4px solid #dc2626;
|
||||
border-radius: 6px;
|
||||
padding: 10px 14px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: var(--text);
|
||||
margin: 0 16px 12px;
|
||||
}
|
||||
.experimental-banner .banner-icon {
|
||||
font-size: 18px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.experimental-banner strong {
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
/* Key Items Grid */
|
||||
.inv-key-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
||||
gap: 4px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.inv-key-grid-slot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 6px 10px;
|
||||
gap: 6px;
|
||||
padding: 5px 8px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
background: var(--card-bg);
|
||||
min-height: 32px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.inv-key-item:hover {
|
||||
.inv-key-grid-slot:hover {
|
||||
border-color: var(--primary);
|
||||
background: var(--hover);
|
||||
}
|
||||
|
||||
.inv-key-item .inv-slot-icon {
|
||||
font-size: 16px;
|
||||
.inv-key-grid-slot .inv-slot-icon {
|
||||
font-size: 14px;
|
||||
flex-shrink: 0;
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
.inv-key-item .inv-slot-name {
|
||||
font-size: 12px;
|
||||
.inv-key-grid-slot .inv-slot-name {
|
||||
font-size: 11px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.inv-key-stack {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
flex-shrink: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Unknown Section */
|
||||
|
||||
@@ -291,6 +291,10 @@
|
||||
{% if is_online %}
|
||||
<div style="font-size:12px;color:#e67e22;padding:0 16px 8px;">Player is online — editing disabled. Log out first.</div>
|
||||
{% endif %}
|
||||
<div class="experimental-banner">
|
||||
<span class="banner-icon">⚠</span>
|
||||
<span class="banner-text">Inventory editing is still being forged in the deep desert. Items may not persist, or the sandworm may eat your edits. <strong>Use with caution</strong> — the spice must flow, but bugs may flow with it.</span>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{% for inv in primary_inventories %}
|
||||
@@ -301,34 +305,35 @@
|
||||
<button onclick="openAddItemModal({{ inv.id }})" class="btn-edit" style="font-size:11px;padding:2px 8px;">+ Add Item</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="inv-grid">
|
||||
{% for item in inv.item_list %}
|
||||
<div class="inv-grid-slot has-item" onclick="openItemEditModal({{ item.id }}, '{{ item.template_id | escapejs }}', {{ item.stack_size }}, {{ item.quality_level or 0 }}, {{ item.durability | default('null') }}, {{ item.max_durability | default('null') }}, {{ item.ammo | default('null') }}, {{ inv.id }})">
|
||||
{% set max_main_slots = inv.max_item_count or 35 %}
|
||||
<div class="inv-grid inv-grid-compact">
|
||||
{% for i in range(max_main_slots) %}
|
||||
{% set slot_item = inv.item_list | selectattr('position_index', 'equalto', i) | first %}
|
||||
{% if slot_item %}
|
||||
<div class="inv-grid-slot has-item" onclick="openItemEditModal({{ slot_item.id }}, '{{ slot_item.template_id | escapejs }}', {{ slot_item.stack_size }}, {{ slot_item.quality_level or 0 }}, {{ slot_item.durability | default('null') }}, {{ slot_item.max_durability | default('null') }}, {{ slot_item.ammo | default('null') }}, {{ inv.id }})">
|
||||
<div class="inv-slot-icon">📦</div>
|
||||
<div class="inv-slot-name" title="{{ item.template_id }}">{{ item.template_id | truncate(20) }}</div>
|
||||
{% if item.stack_size and item.stack_size > 1 %}
|
||||
<div class="inv-slot-stack">{{ item.stack_size }}</div>
|
||||
<div class="inv-slot-name" title="{{ slot_item.template_id }}">{{ slot_item.template_id | truncate(20) }}</div>
|
||||
{% if slot_item.stack_size and slot_item.stack_size > 1 %}
|
||||
<div class="inv-slot-stack">{{ slot_item.stack_size }}</div>
|
||||
{% endif %}
|
||||
{% if item.ammo %}
|
||||
<div class="inv-slot-ammo">🔥{{ item.ammo }}</div>
|
||||
{% if slot_item.ammo %}
|
||||
<div class="inv-slot-ammo">🔥{{ slot_item.ammo }}</div>
|
||||
{% endif %}
|
||||
{% if item.durability and item.max_durability and item.max_durability > 0 %}
|
||||
{% set dur_pct = (item.durability / item.max_durability * 100) | int %}
|
||||
{% if slot_item.durability and slot_item.max_durability and slot_item.max_durability > 0 %}
|
||||
{% set dur_pct = (slot_item.durability / slot_item.max_durability * 100) | int %}
|
||||
{% set dur_class = 'low' if dur_pct < 30 else ('medium' if dur_pct < 70 else '') %}
|
||||
<div class="inv-slot-durability-bar"><div class="inv-slot-durability-fill {{ dur_class }}" style="width:{{ dur_pct }}%"></div></div>
|
||||
{% endif %}
|
||||
{% if item.quality_level and item.quality_level > 0 %}
|
||||
{% set tier_color = quality_tiers[item.quality_level].color if item.quality_level in quality_tiers else '#9a8a7a' %}
|
||||
{% if slot_item.quality_level and slot_item.quality_level > 0 %}
|
||||
{% set tier_color = quality_tiers[slot_item.quality_level].color if slot_item.quality_level in quality_tiers else '#9a8a7a' %}
|
||||
<div class="inv-slot-quality" style="background:{{ tier_color }}"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% set item_count = inv.item_list | length %}
|
||||
{% set max_slots = inv.max_item_count or 35 %}
|
||||
{% for i in range(item_count, max_slots) %}
|
||||
{% else %}
|
||||
<div class="inv-grid-slot" onclick="openAddItemModal({{ inv.id }})">
|
||||
<div class="inv-slot-empty-icon">+</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -339,13 +344,13 @@
|
||||
<button onclick="openAddItemModal({{ inv.id }})" class="btn-edit" style="font-size:11px;padding:2px 8px;">+ Add Item</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="inv-equipped-grid">
|
||||
<div class="inv-grid inv-equipped-compact">
|
||||
{% for slot_idx in range(10) %}
|
||||
{% set slot_label = equipped_slot_labels[slot_idx] if slot_idx in equipped_slot_labels else 'Slot ' ~ slot_idx %}
|
||||
{% set slot_item = inv.item_list | selectattr('position_index', 'equalto', slot_idx) | first %}
|
||||
{% if slot_item %}
|
||||
<div class="inv-equipped-slot has-item" onclick="openItemEditModal({{ slot_item.id }}, '{{ slot_item.template_id | escapejs }}', {{ slot_item.stack_size }}, {{ slot_item.quality_level or 0 }}, {{ slot_item.durability | default('null') }}, {{ slot_item.max_durability | default('null') }}, {{ slot_item.ammo | default('null') }}, {{ inv.id }})">
|
||||
<div class="inv-equipped-label">{{ slot_label }}</div>
|
||||
<div class="inv-grid-slot has-item" onclick="openItemEditModal({{ slot_item.id }}, '{{ slot_item.template_id | escapejs }}', {{ slot_item.stack_size }}, {{ slot_item.quality_level or 0 }}, {{ slot_item.durability | default('null') }}, {{ slot_item.max_durability | default('null') }}, {{ slot_item.ammo | default('null') }}, {{ inv.id }})">
|
||||
<div class="inv-equipped-badge">{{ slot_label }}</div>
|
||||
<div class="inv-slot-icon">📦</div>
|
||||
<div class="inv-slot-name" title="{{ slot_item.template_id }}">{{ slot_item.template_id | truncate(15) }}</div>
|
||||
{% if slot_item.stack_size and slot_item.stack_size > 1 %}
|
||||
@@ -365,9 +370,36 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="inv-equipped-slot" onclick="openAddItemModal({{ inv.id }})">
|
||||
<div class="inv-equipped-label">{{ slot_label }}</div>
|
||||
<div style="color:var(--text-muted);opacity:0.3;font-size:20px;">+</div>
|
||||
<div class="inv-grid-slot" onclick="openAddItemModal({{ inv.id }})">
|
||||
<div class="inv-equipped-badge">{{ slot_label }}</div>
|
||||
<div class="inv-slot-empty-icon" style="font-size:14px;">+</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% elif inv.inventory_type == 5 %}
|
||||
<div class="inv-section-header">
|
||||
<span>{{ inv.inventory_type | inv_label }}<span class="inv-meta">(ID: {{ inv.id }})</span></span>
|
||||
{% if not is_online %}
|
||||
<button onclick="openAddItemModal({{ inv.id }})" class="btn-edit" style="font-size:11px;padding:2px 8px;">+ Add Item</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% set hotbar_max = inv.max_item_count or 10 %}
|
||||
<div class="inv-hotbar">
|
||||
{% for i in range(hotbar_max) %}
|
||||
{% set slot_item = inv.item_list | selectattr('position_index', 'equalto', i) | first %}
|
||||
{% if slot_item %}
|
||||
<div class="inv-hotbar-slot has-item" onclick="openItemEditModal({{ slot_item.id }}, '{{ slot_item.template_id | escapejs }}', {{ slot_item.stack_size }}, {{ slot_item.quality_level or 0 }}, {{ slot_item.durability | default('null') }}, {{ slot_item.max_durability | default('null') }}, {{ slot_item.ammo | default('null') }}, {{ inv.id }})">
|
||||
<div class="inv-slot-icon">📦</div>
|
||||
<div class="inv-slot-name" title="{{ slot_item.template_id }}">{{ slot_item.template_id | truncate(12) }}</div>
|
||||
{% if slot_item.stack_size and slot_item.stack_size > 1 %}
|
||||
<div class="inv-slot-stack">{{ slot_item.stack_size }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="inv-hotbar-slot" onclick="openAddItemModal({{ inv.id }})">
|
||||
<div class="inv-slot-empty-icon">+</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -381,13 +413,13 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if inv.item_list %}
|
||||
<div class="inv-key-items">
|
||||
<div class="inv-key-grid">
|
||||
{% for item in inv.item_list %}
|
||||
<div class="inv-key-item" onclick="openItemEditModal({{ item.id }}, '{{ item.template_id | escapejs }}', {{ item.stack_size }}, {{ item.quality_level or 0 }}, {{ item.durability | default('null') }}, {{ item.max_durability | default('null') }}, {{ item.ammo | default('null') }}, {{ inv.id }})">
|
||||
<div class="inv-key-grid-slot" onclick="openItemEditModal({{ item.id }}, '{{ item.template_id | escapejs }}', {{ item.stack_size }}, {{ item.quality_level or 0 }}, {{ item.durability | default('null') }}, {{ item.max_durability | default('null') }}, {{ item.ammo | default('null') }}, {{ inv.id }})">
|
||||
<div class="inv-slot-icon">📦</div>
|
||||
<div class="inv-slot-name">{{ item.template_id }}</div>
|
||||
<div class="inv-slot-name" title="{{ item.template_id }}">{{ item.template_id | truncate(25) }}</div>
|
||||
{% if item.stack_size and item.stack_size > 1 %}
|
||||
<span style="font-size:11px;color:var(--text-muted);">x{{ item.stack_size }}</span>
|
||||
<span class="inv-key-stack">x{{ item.stack_size }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
Reference in new issue
Block a user