Major UI overhaul: bigger icons, creative inventory tabs, grouped smelting, alerts popup, analytics, mod icons

- Inventory: Bigger item icons (48px) filling their slots, MC-style hover tooltips
- Creative inventory category tabs (All/Blocks/Tools/Combat/Food/Redstone/Materials/Misc)
- Smelting recipes grouped by output item with collapsible sections
- Alerts moved from full tab to popup overlay triggered from header bell icon
- New Analytics tab with SVG charts (storage over time, top items, item trend lookup)
- Mod icon support for ComputerCraft (CC:Tweaked) via GitHub CDN fallback
- Server: new /api/history-summary endpoint for aggregate storage history
- Store: fetchHistorySummary and fetchItemHistory for analytics data
This commit is contained in:
MayaTheShy
2026-03-21 19:07:17 -04:00
parent c25ef9f2cc
commit 29498a2f6a
15 changed files with 1244 additions and 150 deletions

View File

@@ -0,0 +1,243 @@
.analytics-panel {
height: 100%;
overflow-y: auto;
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.analytics-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--mc-dark);
}
.analytics-header h2 {
font-size: 1rem;
color: var(--mc-text-yellow);
text-shadow: 2px 2px 0 var(--mc-dark);
}
/* Quick Stats */
.analytics-stats {
display: flex;
gap: 0.375rem;
flex-wrap: wrap;
}
.analytics-stat {
display: flex;
flex-direction: column;
padding: 0.5rem 0.75rem;
background: var(--mc-dark);
border: 2px solid #333;
flex: 1;
min-width: 80px;
}
.analytics-stat .stat-label {
font-size: 0.5rem;
color: var(--mc-text-gray);
font-weight: 700;
text-transform: uppercase;
}
.analytics-stat .stat-value {
font-size: 0.85rem;
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 #000;
}
/* Chart Grid */
.analytics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
gap: 0.75rem;
}
.analytics-card {
padding: 0.75rem;
background: #3b3b3b;
border: 3px solid var(--mc-dark);
box-shadow:
inset 0 2px 0 #555,
inset 0 -2px 0 #2a2a2a;
}
.analytics-card-wide {
grid-column: 1 / -1;
}
.analytics-card h3 {
font-size: 0.75rem;
color: var(--mc-text-gold);
font-weight: 700;
margin-bottom: 0.5rem;
text-shadow: 1px 1px 0 var(--mc-dark);
text-transform: uppercase;
letter-spacing: 0.05em;
}
/* SVG Charts */
.svg-chart {
display: block;
width: 100%;
height: auto;
}
.chart-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: var(--mc-text-gray);
font-size: 0.7rem;
gap: 0.25rem;
background: #2a2a2a;
border: 1px solid #333;
}
.chart-empty-sub {
font-size: 0.55rem;
color: #555;
}
/* Bar Chart */
.bar-chart {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.bar-row {
display: flex;
align-items: center;
gap: 0.375rem;
}
.bar-label {
display: flex;
align-items: center;
gap: 0.25rem;
font-size: 0.5rem;
color: var(--mc-text-gray);
min-width: 100px;
max-width: 100px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.bar-label span {
overflow: hidden;
text-overflow: ellipsis;
}
.bar-track {
flex: 1;
height: 16px;
background: #2a2a2a;
border: 1px solid #333;
}
.bar-fill {
height: 100%;
transition: width 0.3s;
}
.bar-value {
font-size: 0.55rem;
color: var(--mc-text-white);
min-width: 30px;
text-align: right;
font-weight: 700;
}
/* Item History Search */
.item-history-search {
position: relative;
margin-bottom: 0.5rem;
}
.item-history-search .search-input {
width: 100%;
background: var(--mc-dark);
border: 2px solid #333;
color: var(--mc-text-white);
font-family: 'Silkscreen', 'Courier New', monospace;
font-size: 0.65rem;
padding: 0.375rem 0.5rem;
outline: none;
}
.item-history-search .search-input:focus {
border-color: var(--mc-text-aqua);
}
.item-history-dropdown {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: #2a2a2a;
border: 2px solid #444;
z-index: 50;
max-height: 200px;
overflow-y: auto;
}
.item-history-option {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.5rem;
cursor: pointer;
font-size: 0.6rem;
color: var(--mc-text-white);
transition: background 0.05s;
}
.item-history-option:hover {
background: #3a3a3a;
}
.option-count {
margin-left: auto;
color: var(--mc-text-gray);
font-size: 0.5rem;
}
.item-history-chart {
display: flex;
flex-direction: column;
gap: 0.375rem;
}
.item-history-label {
display: flex;
align-items: center;
gap: 0.375rem;
font-size: 0.7rem;
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 var(--mc-dark);
}
/* Responsive */
@media (max-width: 768px) {
.analytics-grid {
grid-template-columns: 1fr;
}
.analytics-stats {
flex-wrap: wrap;
}
.analytics-stat {
min-width: 60px;
}
}