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,7 +105,12 @@ async function loadInventory() {
let html = "";
items.forEach((item) => {
/* feste 32 slots erzeugen */
for (let i = 0; i < 32; i++) {
const item = items[i];
if (item) {
const icon = item.icon || "/images/items/default.png";
html += `
@ -119,7 +124,12 @@ draggable="true">
</div>
`;
});
} else {
html += `
<div class="inventory-slot empty"></div>
`;
}
}
grid.innerHTML = html;
}