jasan/nav.php
2026-02-08 18:10:54 +09:00

89 lines
No EOL
4.7 KiB
PHP

<?php
/**
* nav.php
* 공통 네비게이션 컴포넌트 (최상단 고정형 리본 메뉴)
*/
$current_page = basename($_SERVER['PHP_SELF']);
?>
<nav class="fixed top-0 left-0 right-0 bg-[#0f172a] text-white z-[100] shadow-2xl border-b border-blue-500/20 px-6">
<div class="max-w-[1600px] mx-auto h-20 flex items-center justify-between">
<!-- Logo -->
<div class="flex items-center space-x-3 mr-10">
<a href="index.php" class="flex items-center">
<div
class="w-10 h-10 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-xl flex items-center justify-center shadow-lg mr-3">
<span class="text-xl font-black italic">F</span>
</div>
<div class="hidden sm:block">
<h1 class="text-xl font-black tracking-tighter">FKI <span class="text-blue-400">ASSET</span></h1>
<p class="text-[9px] text-slate-400 font-bold uppercase tracking-widest leading-none">V2.0 Architect
</p>
</div>
</a>
</div>
<!-- Horizontal Menu -->
<div class="flex-1 flex items-center justify-center space-x-1 lg:space-x-4 overflow-x-auto no-scrollbar py-2">
<?php
$menu_items = [
['url' => 'index.php', 'name' => '대시보드', 'icon' => 'M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'],
['url' => 'rental.php', 'name' => '노트북 임대', 'icon' => 'M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4'],
['url' => 'users.php', 'name' => '직원 관리', 'icon' => 'M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z'],
['url' => 'laptops.php', 'name' => '노트북 자산', 'icon' => 'M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'],
['url' => 'cards.php', 'name' => '출입증 현황', 'icon' => 'M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z'],
['url' => 'mfp.php', 'name' => '복합기 계정', 'icon' => 'M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z'],
['url' => 'models.php', 'name' => 'DB 관리', 'icon' => 'M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4']
];
foreach ($menu_items as $item):
$is_active = ($current_page == $item['url']);
?>
<a href="<?php echo $item['url']; ?>" class="flex items-center px-4 py-2.5 rounded-xl text-sm font-bold transition-all duration-300 transform whitespace-nowrap
<?php echo $is_active
? 'bg-blue-600 text-white shadow-[0_0_20px_rgba(37,99,235,0.4)] scale-105'
: 'text-slate-400 hover:text-white hover:bg-slate-800'; ?>">
<svg class="w-5 h-5 mr-2 hidden md:block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="<?php echo $item['icon']; ?>" />
</svg>
<?php echo $item['name']; ?>
</a>
<?php endforeach; ?>
</div>
<!-- User Info -->
<div class="hidden lg:flex items-center ml-10 space-x-4 border-l border-slate-700 pl-10">
<div class="text-right">
<p class="text-xs font-black text-white">ADMIN MASTER</p>
<p class="text-[10px] text-blue-400 font-bold uppercase tracking-tight">System Online</p>
</div>
<div
class="w-10 h-10 bg-slate-800 rounded-full flex items-center justify-center border border-slate-700 shadow-inner">
<span class="text-xs font-black text-slate-300">AD</span>
</div>
</div>
<!-- Mobile Menu Placeholder -->
<div class="lg:hidden ml-4">
<div class="w-8 h-8 flex items-center justify-center">
<span class="w-1.5 h-1.5 bg-emerald-500 rounded-full animate-ping"></span>
</div>
</div>
</div>
</nav>
<!-- Global Styles for Scrollbar -->
<style>
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
body {
padding-top: 80px;
}
</style>