refactor: 네비게이션 헤더 최신 디자인으로 전면 개편 및 로그인 버그 수정

- fix: 로그인 API에서 user.role_name 필드 올바르게 사용 (auth.service.js)
- refactor: navbar 컴포넌트를 최신 dashboard-header 스타일로 전환
- refactor: 구버전 work-report-header 제거 (6개 페이지)
- refactor: load-navbar.js를 최신 헤더 구조에 맞게 업데이트
- style: 파란색 그라데이션 헤더, 실시간 시계, 향상된 프로필 메뉴
- docs: 2026-01-20 개발 로그 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-01-20 08:40:19 +09:00
parent 6933f67a2e
commit 4ac0605887
24 changed files with 1614 additions and 524 deletions

View File

@@ -1,470 +1,287 @@
<!-- components/navbar.html -->
<!-- 프로필 드롭다운이 추가된 개선된 네비게이션바 -->
<nav class="navbar">
<div class="navbar-brand">
<img src="/img/logo.png" alt="로고" class="logo-small">
<div class="brand-content">
<span class="brand-text">테크니컬코리아</span>
<span class="brand-subtitle">생산팀 포털</span>
<!-- 최신 대시보드 헤더 -->
<header class="dashboard-header">
<div class="header-content">
<div class="header-left">
<div class="brand">
<img src="/img/logo.png" alt="테크니컬코리아" class="brand-logo">
<div class="brand-text">
<h1 class="brand-title">테크니컬코리아</h1>
<p class="brand-subtitle">생산팀 포털</p>
</div>
</div>
</div>
</div>
<div class="navbar-center">
<div class="current-time" id="current-time"></div>
</div>
<div class="navbar-menu">
<!-- 프로필 드롭다운 추가 -->
<div class="profile-dropdown">
<div class="user-info" id="user-info-dropdown">
<div class="user-avatar">👤</div>
<div class="user-details">
<span class="user-name" id="user-name">사용자</span>
<span class="user-role" id="user-role">작업자</span>
</div>
<span class="dropdown-arrow"></span>
</div>
<!-- 드롭다운 메뉴 -->
<div class="dropdown-menu" id="profile-dropdown-menu">
<div class="dropdown-header">
<div class="dropdown-user-name" id="dropdown-user-fullname">사용자</div>
<div class="dropdown-user-id" id="dropdown-user-id">@username</div>
</div>
<div class="dropdown-divider"></div>
<a href="/pages/profile/my-dashboard.html" class="dropdown-item">
<span class="dropdown-icon">📊</span>
나의 대시보드
</a>
<a href="/pages/profile/my-profile.html" class="dropdown-item">
<span class="dropdown-icon">👤</span>
내 프로필
</a>
<a href="/pages/profile/change-password.html" class="dropdown-item">
<span class="dropdown-icon">🔐</span>
비밀번호 변경
</a>
<a href="/pages/profile/admin-settings.html" class="dropdown-item admin-only">
<span class="dropdown-icon">⚙️</span>
관리자 설정
</a>
<div class="dropdown-divider"></div>
<button class="dropdown-item logout-item" id="dropdown-logout">
<span class="dropdown-icon">🚪</span>
로그아웃
</button>
<div class="header-center">
<div class="current-time" id="currentTime">
<span class="time-label">현재 시각</span>
<span class="time-value" id="timeValue">--:--:--</span>
</div>
</div>
<div class="navbar-buttons">
<button class="nav-btn dashboard-btn" title="대시보드">
🏠 대시보드
</button>
<button class="nav-btn system-btn" title="시스템 관리자" id="systemBtn" style="display: none;">
🔧 시스템
</button>
<div class="header-right">
<div class="user-profile" id="userProfile">
<div class="user-avatar">
<span class="avatar-text" id="userInitial"></span>
</div>
<div class="user-info">
<span class="user-name" id="userName">사용자</span>
<span class="user-role" id="userRole">작업자</span>
</div>
<div class="profile-menu" id="profileMenu">
<a href="/pages/profile/my-dashboard.html" class="menu-item">
<span class="menu-icon">📊</span>
나의 대시보드
</a>
<a href="/pages/profile/my-profile.html" class="menu-item">
<span class="menu-icon">👤</span>
내 프로필
</a>
<a href="/pages/profile/change-password.html" class="menu-item">
<span class="menu-icon">🔐</span>
비밀번호 변경
</a>
<a href="/pages/profile/admin-settings.html" class="menu-item admin-only">
<span class="menu-icon">⚙️</span>
관리자 설정
</a>
<button class="menu-item logout-btn" id="logoutBtn">
<span class="menu-icon">🚪</span>
로그아웃
</button>
</div>
</div>
</div>
</div>
</nav>
</header>
<style>
.navbar {
background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
padding: 0.75rem 1.5rem;
/* 최신 대시보드 헤더 스타일 */
.dashboard-header {
background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
color: white;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
gap: 1rem;
box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.15);
font-family: 'Malgun Gothic', sans-serif;
padding: 1rem 1.5rem;
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 1000;
min-height: 4rem;
z-index: 100;
}
.navbar-brand {
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
max-width: 1400px;
margin: 0 auto;
}
.header-left .brand {
display: flex;
align-items: center;
gap: 0.75rem;
min-width: 0;
flex-shrink: 0;
}
.logo-small {
height: 2.5rem;
width: auto;
border-radius: 0.375rem;
flex-shrink: 0;
}
.brand-content {
.header-right {
display: flex;
flex-direction: column;
min-width: 0;
align-items: center;
gap: 1rem;
}
.brand-text {
font-size: 1.125rem;
.brand-logo {
width: 48px;
height: 48px;
border-radius: 0.75rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.brand-title {
font-size: 1.5rem;
font-weight: 700;
margin: 0;
line-height: 1.2;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.brand-subtitle {
font-size: 0.75rem;
opacity: 0.9;
font-weight: 400;
white-space: nowrap;
}
.navbar-center {
display: flex;
align-items: center;
flex: 0 1 auto;
justify-content: center;
min-width: 0;
}
.current-time {
font-size: 0.875rem;
font-weight: 500;
padding: 0.5rem 1rem;
background: rgba(255,255,255,0.1);
border-radius: 1.25rem;
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
white-space: nowrap;
opacity: 0.9;
margin: 0;
font-weight: 400;
}
.navbar-menu {
.header-center .current-time {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 9999px;
padding: 0.75rem 1rem;
text-align: center;
}
.time-label {
display: block;
font-size: 0.75rem;
opacity: 0.8;
margin-bottom: 4px;
}
.time-value {
display: block;
font-size: 1.125rem;
font-weight: 700;
font-family: 'Courier New', monospace;
}
.header-right .user-profile {
position: relative;
display: flex;
align-items: center;
gap: 1.25rem;
flex-shrink: 1;
flex-wrap: nowrap;
justify-content: flex-end;
min-width: 0;
gap: 0.75rem;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 9999px;
padding: 0.5rem 1rem;
cursor: pointer;
transition: all 0.25s ease;
}
/* 프로필 드롭다운 스타일 */
.profile-dropdown {
position: relative;
.user-profile:hover {
background: rgba(255, 255, 255, 0.2);
}
.user-avatar {
width: 40px;
height: 40px;
border-radius: 9999px;
background: #90caf9;
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
color: #0d47a1;
}
.user-info {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 1rem;
background: rgba(255,255,255,0.1);
border-radius: 1.5625rem;
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
cursor: pointer;
transition: all 0.3s ease;
min-width: 0;
max-width: 15rem;
flex-shrink: 0;
}
.user-info:hover {
background: rgba(255,255,255,0.2);
transform: translateY(-1px);
}
.user-info.active {
background: rgba(255,255,255,0.25);
box-shadow: 0 0 0 0.1875rem rgba(255,255,255,0.2);
}
.dropdown-arrow {
font-size: 0.625rem;
margin-left: 0.25rem;
transition: transform 0.3s ease;
flex-shrink: 0;
}
.user-info.active .dropdown-arrow {
transform: rotate(180deg);
}
.user-avatar {
width: 2.25rem;
height: 2.25rem;
background: rgba(255,255,255,0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.125rem;
flex-shrink: 0;
}
.user-details {
display: flex;
flex-direction: column;
align-items: flex-start;
min-width: 0;
}
.user-name {
font-weight: 600;
font-size: 0.875rem;
font-weight: 600;
line-height: 1.2;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.user-role {
font-size: 0.6875rem;
font-size: 0.75rem;
opacity: 0.8;
font-weight: 400;
white-space: nowrap;
}
/* 드롭다운 메뉴 */
.dropdown-menu {
.profile-menu {
position: absolute;
top: calc(100% + 0.5rem);
top: 100%;
right: 0;
background: white;
margin-top: 0.5rem;
background: linear-gradient(135deg, #ffffff, #f8fafc);
border-radius: 0.75rem;
box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.15);
min-width: 15rem;
max-width: 20rem;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
border: 2px solid rgba(59, 130, 246, 0.2);
min-width: 220px;
opacity: 0;
visibility: hidden;
transform: translateY(-0.625rem);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden;
transform: translateY(-10px);
transition: all 0.3s ease;
z-index: 1000;
backdrop-filter: blur(20px);
}
.dropdown-menu.show {
.user-profile:hover .profile-menu,
.profile-menu:hover {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.dropdown-header {
padding: 16px 20px;
background: #f5f5f5;
border-bottom: 1px solid #e0e0e0;
}
.dropdown-user-name {
font-weight: 600;
color: #333;
font-size: 1rem;
margin-bottom: 4px;
}
.dropdown-user-id {
font-size: 0.85rem;
color: #666;
}
.dropdown-divider {
height: 1px;
background: #e0e0e0;
margin: 0;
}
.dropdown-item {
.menu-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 20px;
color: #333;
gap: 0.75rem;
padding: 0.875rem 1.25rem;
color: #374151;
text-decoration: none;
transition: background 0.2s ease;
border: none;
background: none;
background: transparent;
width: 100%;
text-align: left;
font-size: 0.9rem;
cursor: pointer;
font-family: inherit;
}
.dropdown-item:hover {
background: #f5f5f5;
}
.dropdown-item:active {
background: #e0e0e0;
}
.dropdown-icon {
font-size: 1.1rem;
width: 24px;
text-align: center;
}
.logout-item {
color: #f44336;
}
.logout-item:hover {
background: #ffebee;
}
/* 버튼 스타일 */
.navbar-buttons {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
}
.nav-btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 1.25rem;
font-size: 0.8125rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
align-items: center;
gap: 0.375rem;
transition: all 0.3s ease;
border-radius: 0.5rem;
margin: 0.25rem;
font-family: inherit;
white-space: nowrap;
}
.dashboard-btn {
background: rgba(255,255,255,0.15);
color: white;
border: 1px solid rgba(255,255,255,0.3);
.menu-item:hover {
background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
color: #1f2937;
transform: translateX(2px);
}
.dashboard-btn:hover {
background: rgba(255,255,255,0.25);
transform: translateY(-0.0625rem);
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
.menu-item:first-child {
border-radius: 0.5rem;
margin-top: 0.5rem;
}
.system-btn {
background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
color: white;
border: 1px solid rgba(255,255,255,0.3);
box-shadow: 0 0.125rem 0.5rem rgba(156,39,176,0.3);
.menu-item:last-child {
border-radius: 0.5rem;
margin-bottom: 0.5rem;
}
.system-btn:hover {
background: linear-gradient(135deg, #8e24aa 0%, #5e35b1 100%);
transform: translateY(-0.0625rem);
box-shadow: 0 0.25rem 0.75rem rgba(156,39,176,0.4);
.menu-icon {
font-size: 1.1rem;
width: 1.5rem;
text-align: center;
opacity: 0.8;
}
.menu-item:hover .menu-icon {
opacity: 1;
}
.logout-btn {
color: #dc2626 !important;
border-top: 1px solid #e5e7eb;
margin-top: 0.5rem;
padding-top: 0.875rem;
font-weight: 600;
}
.logout-btn:hover {
background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
color: #b91c1c !important;
}
/* 반응형 디자인 */
@media (max-width: 1200px) {
.navbar {
justify-content: space-between;
}
.navbar-center {
display: none;
}
}
@media (max-width: 768px) {
.navbar {
padding: 0.625rem 1rem;
gap: 0.75rem;
.dashboard-header {
padding: 0.75rem 1rem;
}
.navbar-brand {
gap: 0.5rem;
flex: 0 0 auto;
}
.brand-text {
font-size: 1rem;
}
.brand-subtitle {
font-size: 0.6875rem;
}
.navbar-menu {
gap: 0.75rem;
flex-wrap: wrap;
}
.navbar-buttons {
gap: 0.5rem;
}
.nav-btn {
padding: 0.4rem 0.75rem;
font-size: 0.75rem;
}
.user-info {
max-width: 12rem;
}
.dropdown-menu {
right: 0;
min-width: 12rem;
}
}
@media (max-width: 640px) {
.brand-content {
display: none;
}
.navbar-center {
display: none;
}
.navbar-buttons .nav-btn {
font-size: 0;
padding: 0.5rem;
gap: 0;
}
.navbar-buttons .nav-btn::before {
content: attr(title);
.brand-title {
font-size: 1.125rem;
}
.user-details {
display: none;
.brand-subtitle {
font-size: 0.75rem;
}
.dropdown-arrow {
.header-center {
display: none;
}
.user-info {
padding: 0.5rem;
}
}
@media (max-width: 480px) {
.navbar {
padding: 0.5rem 0.75rem;
}
.logo-small {
height: 2rem;
}
.navbar-buttons {
gap: 0.375rem;
}
.dropdown-menu {
right: -0.5rem;
min-width: 10rem;
display: none;
}
}
</style>