pop34
This commit is contained in:
parent
910d861c78
commit
71dd938144
@ -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 {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user