This commit is contained in:
Cay 2026-03-13 18:36:59 +00:00
parent 910d861c78
commit 71dd938144
2 changed files with 25 additions and 14 deletions

View File

@ -381,13 +381,14 @@ body {
display: grid;
grid-template-columns: repeat(8, 70px);
grid-auto-rows: 70px;
grid-template-rows: repeat(4, 70px);
gap: 8px;
justify-content: center;
max-height: 320px;
overflow-y: auto;
margin-top: 30px;
padding: 10px;
}
.inventory-slot {

View File

@ -105,21 +105,31 @@ async function loadInventory() {
let html = "";
items.forEach((item) => {
const icon = item.icon || "/images/items/default.png";
/* feste 32 slots erzeugen */
html += `
<div class="inventory-slot"
data-slot="${item.equip_slot || ""}"
data-id="${item.id}"
data-level="${item.level}"
draggable="true">
for (let i = 0; i < 32; i++) {
const item = items[i];
<img src="${icon}">
if (item) {
const icon = item.icon || "/images/items/default.png";
</div>
html += `
<div class="inventory-slot"
data-slot="${item.equip_slot || ""}"
data-id="${item.id}"
data-level="${item.level}"
draggable="true">
<img src="${icon}">
</div>
`;
} else {
html += `
<div class="inventory-slot empty"></div>
`;
});
}
}
grid.innerHTML = html;
}