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:
@@ -12,6 +12,50 @@ export function formatItemName(name) {
|
||||
.replace(/\b\w/g, (c) => c.toUpperCase());
|
||||
}
|
||||
|
||||
// ========== Creative Inventory Categories ==========
|
||||
|
||||
export const ITEM_CATEGORIES = [
|
||||
{ id: 'all', label: 'All', icon: 'chest' },
|
||||
{ id: 'blocks', label: 'Blocks', icon: 'bricks' },
|
||||
{ id: 'tools', label: 'Tools', icon: 'iron_pickaxe' },
|
||||
{ id: 'combat', label: 'Combat', icon: 'iron_sword' },
|
||||
{ id: 'food', label: 'Food', icon: 'apple' },
|
||||
{ id: 'redstone', label: 'Redstone', icon: 'redstone' },
|
||||
{ id: 'materials', label: 'Materials', icon: 'iron_ingot' },
|
||||
{ id: 'misc', label: 'Misc', icon: 'bone' },
|
||||
];
|
||||
|
||||
export function getItemCategory(itemName) {
|
||||
if (!itemName) return 'misc';
|
||||
const n = itemName.replace(/^[a-z0-9_.-]+:/, '');
|
||||
|
||||
// Redstone (check first - redstone_block should be redstone, not blocks)
|
||||
if (/redstone|repeater|comparator|piston|observer|dropper|dispenser|hopper|lever|tripwire|daylight|note_block|sculk|target/.test(n)) return 'redstone';
|
||||
|
||||
// Combat
|
||||
if (/sword|crossbow|trident|shield|helmet|chestplate|leggings|boots|horse_armor|arrow/.test(n)) return 'combat';
|
||||
if (/bow/.test(n) && !/bowl|elbow/.test(n)) return 'combat';
|
||||
|
||||
// Tools
|
||||
if (/pickaxe|shovel|_hoe|shears|fishing_rod|flint_and_steel|compass|clock|spyglass|bucket|name_tag|brush/.test(n)) return 'tools';
|
||||
if (/axe/.test(n) && !/pickaxe/.test(n)) return 'tools';
|
||||
|
||||
// Food
|
||||
if (/apple|bread|beef|porkchop|mutton|rabbit|salmon|potato|carrot|melon_slice|berries|cookie|pie|stew|soup|honey_bottle|dried_kelp|chorus_fruit|rotten_flesh|cooked_|baked_|golden_carrot/.test(n)) return 'food';
|
||||
if (/^cake$/.test(n)) return 'food';
|
||||
|
||||
// Materials
|
||||
if (/ingot|nugget|raw_iron|raw_gold|raw_copper|_shard|_dust|_powder|_scrap|bone_meal|slime_ball|magma_cream|ender_pearl|blaze|nether_star|ghast_tear|gunpowder|phantom_membrane|experience_bottle|ink_sac|nether_wart|_dye$/.test(n)) return 'materials';
|
||||
if (/^(diamond|emerald|coal|charcoal|quartz|bone|sugar|stick|flint|paper|wheat|egg|book|leather|string|feather)$/.test(n)) return 'materials';
|
||||
if (/seeds$|enchanted_book/.test(n)) return 'materials';
|
||||
|
||||
// Blocks
|
||||
if (/planks|_log|_wood|stone|brick|_slab|stairs|_wall|_fence|_door|trapdoor|wool|concrete|terracotta|glass|_pane|sandstone|deepslate|obsidian|ore|_block|leaves|torch|lantern|crafting_table|furnace|anvil|chest|barrel|sponge|carpet|banner/.test(n)) return 'blocks';
|
||||
if (/^(dirt|mud|clay|sand|red_sand|gravel|netherrack|tnt|cactus|pumpkin|melon|bamboo|cobblestone|ice|packed_ice|blue_ice)$/.test(n)) return 'blocks';
|
||||
|
||||
return 'misc';
|
||||
}
|
||||
|
||||
// Fallback emoji mapping for common item categories
|
||||
const CATEGORY_EMOJI = {
|
||||
ingot: '🪙',
|
||||
|
||||
Reference in New Issue
Block a user