Files
eapim-portal/src/main/resources/static/sass/layout/_header.scss
T
2025-12-04 14:34:57 +09:00

945 lines
18 KiB
SCSS

// -----------------------------------------------------------------------------
// Header styles - Modern & Responsive Design
// -----------------------------------------------------------------------------
// CSS Variables for modern header styling
:root {
// Enhanced color palette from design
--primary-blue: #4B9BFF;
--secondary-blue: #2E7FF7;
--accent-cyan: #00D4FF;
--accent-yellow: #FFD93D;
--accent-orange: #FF6B6B;
--accent-green: #6BCF7F;
--accent-purple: #A78BFA;
// Base colors
--text-dark: #1A1A2E;
--text-gray: #64748B;
--text-light: #94A3B8;
--white: #FFFFFF;
--gray-bg: #F8FAFC;
--light-bg: #EFF6FF;
--border-gray: #E2E8F0;
// Shadows
--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 12px rgba(75, 155, 255, 0.1);
--shadow-lg: 0 8px 24px rgba(75, 155, 255, 0.15);
--shadow-xl: 0 16px 40px rgba(75, 155, 255, 0.2);
}
// Blind text for screen readers
.blind {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
// ===========================
// Modern Header Structure
// ===========================
.global-header {
position: fixed;
top: 0;
left: 0;
right: 0;
//background-color: #C3DFEA;
background-color: #ffffff;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
z-index: $z-index-header;
height: 112px;
transition: all 0.3s ease;
border-bottom: 1px solid #dddddd;
}
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
height: 65px;
max-width: 1920px;
margin: 0 auto;
padding: 0 20px;
margin-top: 20px;
}
// ===========================
// Header Layout Components
// ===========================
// Header Left Section
.header-left {
display: flex;
align-items: center;
.logo {
height: 22px;
width: 114px;
}
}
// Logo Wrapper
.logo-wrapper {
display: flex;
align-items: center;
gap: 12px;
}
// Logo with modern styling
.logo {
display: flex;
align-items: center;
gap: 12px;
height: 22px;
z-index: 10;
a {
display: flex;
align-items: center;
gap: 12px;
height: 100%;
text-decoration: none;
}
img {
height: 22px;
width: 114px;
}
}
.logo-text {
font-size: 16px;
font-weight: 700;
color: var(--text-dark);
text-decoration: none;
display: inline-block;
transition: all 0.3s ease;
// When logo-text is a link
&:hover {
color: var(--primary-blue);
}
&:visited {
color: var(--text-dark);
}
}
// Logo link styles
.logo-link,
.mobile-logo-link,
.drawer-logo-link {
display: inline-block;
text-decoration: none;
transition: transform 0.3s ease;
&:hover {
transform: scale(1.05);
}
img {
display: block;
}
}
// Header Right Section
.header-right {
display: flex;
align-items: center;
gap: 16px;
}
// Search Button
.search-btn {
width: 40px;
height: 40px;
background: var(--gray-bg);
border: none;
border-radius: 50%;
cursor: pointer;
font-size: 16px;
color: var(--text-gray);
transition: all 0.3s ease;
&:hover {
background: var(--light-bg);
color: var(--primary-blue);
transform: scale(1.1);
}
}
// ===========================
// Desktop/Mobile Layout Control
// ===========================
.desktop-header {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
@media (max-width: 768px) {
display: none;
}
}
.mobile-header {
display: none;
align-items: center;
justify-content: space-between;
width: 100%;
@media (max-width: 768px) {
display: flex;
}
}
// ===========================
// Mobile Header Components
// ===========================
.mobile-left {
.mobile-logo {
height: 32px;
width: auto;
}
}
.mobile-center {
flex: 1;
text-align: center;
.mobile-title {
font-size: 18px;
font-weight: 700;
color: var(--text-dark);
margin: 0;
}
}
.mobile-right {
.mobile-menu-btn {
width: 40px;
height: 40px;
background: transparent;
border: none;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 4px;
padding: 8px;
border-radius: 8px;
transition: background-color 0.3s ease;
&:hover {
background: var(--gray-bg);
}
.hamburger-line {
width: 24px;
height: 2px;
background: var(--text-dark);
transition: all 0.3s ease;
border-radius: 1px;
}
&.active {
.hamburger-line {
&:nth-child(1) {
transform: rotate(45deg) translateY(6px);
}
&:nth-child(2) {
opacity: 0;
}
&:nth-child(3) {
transform: rotate(-45deg) translateY(-6px);
}
}
}
}
}
// ===========================
// Mobile Drawer/Modal
// ===========================
.mobile-drawer {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
visibility: hidden;
opacity: 0;
transition: all 0.3s ease;
&.active {
visibility: visible;
opacity: 1;
.drawer-content {
transform: translateY(0);
}
}
.drawer-overlay {
display: none; // Not needed for full-screen drawer
}
.drawer-content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background: var(--white);
transform: translateY(100%);
transition: transform 0.3s ease;
display: flex;
flex-direction: column;
}
.drawer-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
border-bottom: 2px solid var(--border-gray);
background: var(--white);
box-shadow: var(--shadow-sm);
min-height: 60px;
.drawer-logo {
display: flex;
align-items: center;
gap: 12px;
.logo {
height: 32px;
width: auto;
}
.logo-text {
font-size: 16px;
font-weight: 700;
color: var(--primary-blue);
}
}
.drawer-close {
width: 40px;
height: 40px;
background: transparent;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
font-size: 18px;
color: var(--text-gray);
transition: all 0.3s ease;
&:hover {
background: var(--white);
color: var(--text-dark);
}
}
}
.drawer-nav {
flex: 1;
padding: 0;
overflow-y: auto;
background: var(--white);
.drawer-menu {
list-style: none;
margin: 0;
padding: 20px 0;
li {
margin-bottom: 8px;
.drawer-link {
display: block;
padding: 16px 24px;
margin: 0 20px;
color: var(--text-dark);
text-decoration: none;
font-size: 18px;
font-weight: 500;
border-radius: 12px;
transition: all 0.3s ease;
&:hover, &:active {
background: var(--light-bg);
color: var(--primary-blue);
transform: translateX(4px);
box-shadow: var(--shadow-sm);
}
}
}
}
}
.drawer-actions {
padding: 24px;
border-top: 2px solid var(--border-gray);
background: var(--white);
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
.drawer-login-btn {
display: block;
text-align: center;
padding: 14px 20px;
color: var(--text-dark);
text-decoration: none;
border: 2px solid var(--primary-blue);
border-radius: 12px;
font-weight: 600;
font-size: 16px;
margin-bottom: 12px;
transition: all 0.3s ease;
&:hover {
background: var(--light-bg);
color: var(--primary-blue);
}
}
.drawer-signup-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 14px 20px;
color: var(--white);
text-decoration: none;
border-radius: 12px;
font-weight: 600;
font-size: 16px;
margin-bottom: 12px;
transition: all 0.3s ease;
box-shadow: var(--shadow-md);
&:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-lg);
}
}
.drawer-search-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 14px 20px;
background: var(--gray-bg);
color: var(--text-dark);
border: none;
border-radius: 12px;
font-weight: 500;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
background: var(--light-bg);
color: var(--primary-blue);
}
}
}
}
.btn-mobilemenu {
position: absolute;
right: $spacing-md;
top: 50%;
transform: translateY(-50%);
width: 40px;
height: 40px;
background: transparent;
border: none;
cursor: pointer;
padding: 8px;
z-index: $z-index-modal + 1; // Above the nav
span {
display: block;
width: 24px;
height: 2px;
background: $text-dark;
position: relative;
transition: all $transition-fast;
text-indent: -9999px;
&::before,
&::after {
content: '';
position: absolute;
left: 0;
width: 24px;
height: 2px;
background: $text-dark;
transition: all $transition-fast;
}
&::before { top: -8px; }
&::after { top: 8px; }
}
&.on span {
background: transparent;
&::before { top: 0; transform: rotate(45deg); }
&::after { top: 0; transform: rotate(-45deg); }
}
}
// ===========================
// Unified Navigation (Mobile-First)
// ===========================
.main-nav.m-nav {
// Mobile: Off-canvas menu
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: $white;
z-index: $z-index-modal;
right: -100%; // Initial state for JS animation
transition: none; // JS handles animation
overflow-y: auto;
display: flex;
flex-direction: column;
// The JS will directly manipulate the 'right' property, not toggle a class for this element.
// So, no .active or .on state here for the main nav panel.
.nav-header {
padding: $spacing-lg;
background: $gray-bg;
border-bottom: 1px solid $border-gray;
}
.nav-list {
list-style: none;
margin: 0;
padding: 0;
flex-grow: 1;
.nav-item {
border-bottom: 1px solid $border-gray;
> a {
display: flex;
align-items: center;
padding: $spacing-lg;
color: $text-dark;
font-size: $font-size-md;
font-weight: $font-weight-medium;
text-decoration: none;
position: relative;
}
&.has-submenu > a::after {
content: '';
position: absolute;
right: $spacing-lg;
top: 50%;
width: 8px;
height: 8px;
border-right: 2px solid $text-gray;
border-bottom: 2px solid $text-gray;
transform: translateY(-50%) rotate(45deg);
transition: transform $transition-fast;
}
&.expanded > a::after {
transform: translateY(-25%) rotate(-135deg);
}
.sub-menu {
display: none;
list-style: none;
padding: 0;
margin: 0;
background: $gray-bg;
a {
display: block;
padding: $spacing-md $spacing-lg $spacing-md ($spacing-lg * 2);
color: $text-gray;
font-size: $font-size-sm;
text-decoration: none;
&:hover {
background: $white;
color: $primary-blue;
}
}
}
&.expanded .sub-menu {
display: block;
}
}
}
.info_wrap {
padding: $spacing-xl $spacing-lg;
background: $white;
border-top: 1px solid $border-gray;
margin-top: auto;
// styles for tit1, tit2...
}
}
// ===========================
// Modern Navigation Menu
// ===========================
.nav-menu {
display: flex;
list-style: none;
gap: 8px;
margin: 0;
padding: 0;
// Navigation item with submenu
> li {
position: relative;
&.submenu-open {
> .nav-link {
background: var(--light-bg);
color: var(--primary-blue);
}
.sub-menu {
visibility: visible;
opacity: 1;
transform: translateY(0);
}
}
.sub-menu {
position: absolute;
top: calc(100% + 8px);
left: 0;
min-width: 200px;
background: var(--white);
border: 1px solid var(--border-gray);
border-radius: $border-radius-lg;
box-shadow: var(--shadow-xl);
padding: $spacing-sm 0;
visibility: hidden;
opacity: 0;
transform: translateY(-10px);
transition: all 0.3s ease;
z-index: $z-index-dropdown;
list-style: none;
margin: 0;
li {
margin: 0;
a {
display: block;
padding: $spacing-sm $spacing-lg;
color: var(--text-dark);
text-decoration: none;
font-size: $font-size-sm;
font-weight: $font-weight-medium;
transition: all 0.3s ease;
&:hover {
background: var(--light-bg);
color: var(--primary-blue);
}
}
}
}
}
}
.nav-link {
display: flex;
align-items: center;
gap: 6px;
text-decoration: none;
color: var(--text-dark);
font-weight: 500;
font-size: 15px;
padding: 8px 16px;
border-radius: 8px;
transition: all 0.3s ease;
&:hover {
color: var(--primary-blue);
}
}
.nav-icon {
font-size: 18px;
}
.signup-btn {
display: flex;
align-items: center;
gap: 8px;
text-decoration: none;
color: var(--white);
padding: 12px 24px;
border-radius: 50px;
font-weight: 600;
transition: all 0.3s ease;
box-shadow: var(--shadow-md);
&:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-lg);
}
}
// ===========================
// Desktop Navigation Styles
// ===========================
@include respond-to('desktop') {
.m-only { display: none !important; }
.pc-only { display: block !important; }
.btn-mobilemenu { display: none; }
.main-nav.m-nav {
position: static;
right: auto;
transition: none;
flex-direction: row;
align-items: center;
overflow: visible;
background: transparent;
height: 100%;
flex: 1;
.nav-header { display: none; }
.info_wrap { display: none; }
.nav-list {
display: flex;
height: 100%;
flex-grow: 1;
.nav-item {
border-bottom: none;
position: relative;
height: 100%;
> a {
height: 100%;
padding: 0 24px;
color: var(--text-dark);
font-weight: 500;
font-size: 15px;
transition: all 0.3s ease;
&:hover {
color: var(--primary-blue);
&::after {
content: '';
position: absolute;
bottom: 0;
left: 24px;
right: 24px;
height: 3px;
background: var(--primary-blue);
border-radius: 2px;
}
}
}
&.has-submenu > a::after { display: none; }
}
}
}
}
// ===========================
// Body Layout Compensation
// ===========================
body {
padding-top: 112px; // Compensate for fixed header (112px height)
}
// ===========================
// Mobile Responsive Design
// ===========================
@media (max-width: 768px) {
.global-header {
height: 90px;
.container .header-content {
padding: 0 16px;
height: 60px;
}
}
body {
padding-top: 60px; // Smaller header on mobile
}
}
@media (max-width: 480px) {
.global-header {
.header-content {
padding: 0 12px;
}
}
.logo {
.logo-text {
display: none; // Hide logo text on very small screens
}
}
}
// ===========================
// Header User Info (Authenticated State)
// ===========================
.header-user-info {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 6px;
border-radius: 6px;
.user-identity {
display: flex;
align-items: center;
gap: 2px;
.user-icon {
width: 16px;
height: 18px;
display: block;
}
.user-name {
font-family: 'Noto Sans CJK KR', sans-serif;
font-size: 16px;
font-weight: 400;
color: #515961;
white-space: nowrap;
}
}
.divider {
font-size: 8px;
color: var(--text-gray);
line-height: 1;
}
.header-link {
font-family: 'Noto Sans CJK KR', sans-serif;
font-size: 16px;
font-weight: 400;
color: #515961;
text-decoration: none;
white-space: nowrap;
background: none;
border: none;
padding: 0;
cursor: pointer;
transition: color 0.3s ease;
&:hover {
color: var(--primary-blue);
}
}
.mypage-dropdown {
position: relative;
.mypage-toggle {
display: flex;
align-items: center;
gap: 4px;
}
.mypage-dropdown-menu {
position: absolute;
top: calc(100% + 8px);
right: 0;
min-width: 200px;
background: var(--white);
border: 1px solid var(--border-gray);
border-radius: $border-radius-lg;
box-shadow: var(--shadow-xl);
padding: $spacing-sm 0;
visibility: hidden;
opacity: 0;
transform: translateY(-10px);
transition: all 0.3s ease;
z-index: $z-index-dropdown;
.mypage-menu-list {
list-style: none;
margin: 0;
padding: 0;
li {
margin: 0;
a {
display: flex;
align-items: center;
gap: 8px;
padding: $spacing-sm $spacing-lg;
color: var(--text-dark);
text-decoration: none;
font-size: $font-size-sm;
font-weight: $font-weight-medium;
transition: all 0.3s ease;
i {
font-size: 14px;
width: 16px;
text-align: center;
}
&:hover {
background: var(--light-bg);
color: var(--primary-blue);
}
}
}
}
}
&.active .mypage-dropdown-menu {
visibility: visible;
opacity: 1;
transform: translateY(0);
}
}
}
// Mobile responsive
@media (max-width: 768px) {
.header-user-info {
display: none; // Hide on mobile, use drawer instead
}
}