Remove unused getCategoryIcon function and associated icon display in index.php, streamlining the code and improving maintainability.

This commit is contained in:
Bram Suurd
2025-06-30 00:59:30 +02:00
parent 0d7077063f
commit cceb9b10d7

View File

@@ -72,7 +72,6 @@ if (isset($_SESSION['steamid'])) {
<?php if (empty($categoryWeapons)) continue; ?>
<div class="nav-category">
<div class="nav-item category-header" data-category="<?php echo strtolower($categoryName); ?>" onclick="toggleCategory('<?php echo strtolower($categoryName); ?>')">
<span class="nav-icon"><?php echo getCategoryIcon($categoryName); ?></span>
<div class="nav-content">
<span class="nav-text"><?php echo $categoryName; ?></span>
<span class="nav-count"><?php echo count($categoryWeapons); ?></span>
@@ -518,23 +517,4 @@ if (isset($_SESSION['steamid'])) {
<?php endif; ?>
</body>
</html>
<?php
// Helper function for category icons
function getCategoryIcon($categoryName) {
$icons = [
'Knives' => '🗡️',
'Gloves' => '🧤',
'Rifles' => '🔫',
'Pistols' => '🔫',
'SMGs' => '🔫',
'Shotguns' => '🔫',
'Snipers' => '🎯',
'Machine Guns' => '⚡',
'Grenades' => '💣'
];
return $icons[$categoryName] ?? '🔫';
}
?>
</html>