feat: Refactor inventory display to use a grid layout with improved styling and responsiveness

This commit is contained in:
MayaTheShy
2026-02-19 22:40:23 -05:00
parent a3fe5c7471
commit 38b7846607

View File

@@ -564,49 +564,100 @@
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
} }
/* Inventory List */ /* Inventory Grid */
.inventory-list { .inventory-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 0.5rem;
max-height: 400px;
overflow-y: auto;
padding: 0.5rem;
background: #0f172a;
border-radius: 0.5rem;
border: 1px solid #1e293b;
}
.inventory-slot {
aspect-ratio: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem;
max-height: 300px;
overflow-y: auto;
}
.inventory-item {
display: flex;
align-items: center; align-items: center;
gap: 0.625rem; justify-content: center;
padding: 0.625rem; background: #1e293b;
background: #1f2937; border: 2px solid #334155;
border: 1px solid #374151;
border-radius: 0.375rem; border-radius: 0.375rem;
padding: 0.5rem;
transition: all 0.2s; transition: all 0.2s;
cursor: pointer;
position: relative;
overflow: hidden;
} }
.inventory-item:hover { .inventory-slot.empty {
background: #0f172a;
border-style: dashed;
border-color: #1e293b;
}
.inventory-slot.filled {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #3b82f6;
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.inventory-slot.filled:hover {
border-color: #60a5fa; border-color: #60a5fa;
background: #1e3a5f; background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
transform: translateX(4px); box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
transform: translateY(-2px);
} }
.item-icon { .slot-item {
font-size: 1.25rem; display: flex;
flex-shrink: 0; flex-direction: column;
align-items: center;
gap: 0.25rem;
} }
.item-name { .slot-item .item-icon {
flex: 1; font-size: 1.5rem;
color: #e5e7eb; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
font-size: 0.8125rem;
text-transform: capitalize;
} }
.item-count { .slot-item .item-count {
color: #9ca3af; position: absolute;
font-weight: 600; bottom: 0.25rem;
right: 0.25rem;
background: rgba(0, 0, 0, 0.8);
color: #fff;
font-size: 0.625rem;
font-weight: 700;
padding: 0.125rem 0.375rem;
border-radius: 0.25rem;
font-family: 'Courier New', monospace; font-family: 'Courier New', monospace;
font-size: 0.8125rem; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.slot-name {
position: absolute;
top: 0.25rem;
left: 0.25rem;
right: 0.25rem;
font-size: 0.5rem;
color: #94a3b8;
font-weight: 600;
text-transform: uppercase;
text-align: center;
line-height: 1.1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.slot-number {
font-size: 0.75rem;
color: #475569;
font-weight: 600;
} }
/* Responsive Design */ /* Responsive Design */
@@ -618,10 +669,43 @@
.action-grid { .action-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.inventory-grid {
grid-template-columns: repeat(4, 1fr);
}
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.turtle-grid { .turtle-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.panel-content {
flex-direction: column;
}
.turtle-list {
border-bottom: 1px solid #374151;
border-right: none;
}
.inventory-grid {
grid-template-columns: repeat(4, 1fr);
}
} }
@media (max-width: 480px) {
.inventory-grid {
grid-template-columns: repeat(4, 1fr);
gap: 0.375rem;
}
.inventory-slot {
padding: 0.375rem;
}
.slot-item .item-icon {
font-size: 1.25rem;
}
}