NavBar & SideBar Works... Kinda. Not Customized Yet.

This commit is contained in:
2026-09-03 19:51:44 -05:00
parent 41383b8fe7
commit faeab2134c
7 changed files with 134 additions and 36 deletions
+32 -8
View File
@@ -1,8 +1,32 @@
<aside id="sidebar" class="sidebar">
<ul class="sidebar__list">
<li><a href="#" class="sidebar__link"><span>🏠</span> <span class="link-text">Dashboard</span></a></li>
<li><a href="#" class="sidebar__link"><span>📦</span> <span class="link-text">Inventory</span></a></li>
<li><a href="#" class="sidebar__link"><span>⚖️</span> <span class="link-text">Auction House</span></a></li>
<li><a href="#" class="sidebar__link"><span>⚙️</span> <span class="link-text">Settings</span></a></li>
</ul>
</aside>
<?php global $current_file, $active_profession_title; ?>
<?php
// Skip rendering the sidebar if we are on the homepage
if (!empty($active_profession) && $active_profession !== 'index'):
// 2. Define the static utilities/tools every profession uses
$sidebar_tools = [
'ingredients' => ['Supplies Needed', 'profession_supplies.php'],
'market' => ['Current Market Prices', 'profession_market.php'],
'leveling' => ['Leveling Guide', 'profession_leveling.php'],
];
?>
<aside class="sidebar" aria-label="<?= htmlspecialchars($active_profession_title) ?> Tools">
<h3 class="sidebar__title"><?= htmlspecialchars($active_profession_title) ?> Utilities</h3>
<ul class="sidebar__list">
<?php foreach ($sidebar_tools as $key => $tool_info): ?>
<?php
// Generate link like: profession_supplies.php?prof=blacksmithing
$target_url = $tool_info[1] . '?prof=' . urlencode($active_profession);
// Check if this specific tool page is the one currently loaded
$is_tool_active = ($current_file === $tool_info[1]) ? ' sidebar__link--active' : '';
?>
<li class="sidebar__item">
<a href="<?= htmlspecialchars($target_url) ?>" class="sidebar__link<?= $is_tool_active ?>">
<?= htmlspecialchars($tool_info[0]) ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</aside>
<?php endif; ?>