네비게이션 바 디자인 전환 기능 추가

This commit is contained in:
Rinjae
2026-01-08 11:10:47 +09:00
parent f493518a8e
commit 6e53098ed5
5 changed files with 221 additions and 1 deletions
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
@ControllerAdvice
public class GlobalControllerAdvice {
@@ -13,6 +14,9 @@ public class GlobalControllerAdvice {
@Autowired
private PageService pageService;
@Autowired
private PortalPropertyService portalPropertyService;
@ModelAttribute("breadcrumb")
public List<Map> addBreadcrumbToModel(HttpServletRequest request) {
String currentPath = request.getRequestURI();
@@ -24,4 +28,15 @@ public class GlobalControllerAdvice {
String currentPath = request.getRequestURI();
return pageService.getPageName(currentPath);
}
@ModelAttribute("designSurveyEnabled")
public boolean isDesignSurveyEnabled() {
String value = portalPropertyService.getOrCreateProperty(
"Portal",
"ui.design-survey",
"false",
"네비게이션 바 디자인 설문 활성화 여부 (true/false)"
);
return "true".equalsIgnoreCase(value);
}
}
+81
View File
@@ -628,6 +628,87 @@ hr {
--shadow-xl: 0 16px 40px rgba(75, 155, 255, 0.2);
}
.design-survey-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 48px;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
z-index: 400;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.design-survey-bar .survey-container {
display: flex;
align-items: center;
gap: 16px;
}
.design-survey-bar .survey-label {
color: #ffffff;
font-size: 14px;
font-weight: 500;
}
.design-survey-bar .survey-buttons {
display: flex;
gap: 8px;
}
.design-survey-bar .survey-btn {
padding: 6px 16px;
border: 2px solid rgba(255, 255, 255, 0.5);
border-radius: 20px;
background: transparent;
color: #ffffff;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
}
.design-survey-bar .survey-btn:hover {
background: rgba(255, 255, 255, 0.2);
border-color: #ffffff;
}
.design-survey-bar .survey-btn.active {
background: #ffffff;
color: #667eea;
border-color: #ffffff;
}
@media (max-width: 768px) {
.design-survey-bar {
height: 40px;
}
.design-survey-bar .survey-label {
display: none;
}
.design-survey-bar .survey-btn {
padding: 4px 12px;
font-size: 12px;
}
}
body.design-survey-active .global-header {
margin-top: 48px;
}
@media (max-width: 768px) {
body.design-survey-active .global-header {
margin-top: 40px;
}
}
body.design-variant-B .logo-text {
font-size: 18px !important;
}
body.design-variant-B .nav-link {
margin: 0 20px !important;
}
body.design-variant-C .nav-link {
margin: 0 20px !important;
font-weight: bold !important;
}
.blind {
position: absolute;
width: 1px;
File diff suppressed because one or more lines are too long
@@ -29,6 +29,88 @@
--shadow-xl: 0 16px 40px rgba(75, 155, 255, 0.2);
}
// ===========================
// Design Survey Bar
// ===========================
.design-survey-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 48px;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
z-index: 400;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
.survey-container {
display: flex;
align-items: center;
gap: 16px;
}
.survey-label {
color: #ffffff;
font-size: 14px;
font-weight: 500;
}
.survey-buttons {
display: flex;
gap: 8px;
}
.survey-btn {
padding: 6px 16px;
border: 2px solid rgba(255, 255, 255, 0.5);
border-radius: 20px;
background: transparent;
color: #ffffff;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
background: rgba(255, 255, 255, 0.2);
border-color: #ffffff;
}
&.active {
background: #ffffff;
color: #667eea;
border-color: #ffffff;
}
}
@media (max-width: 768px) {
height: 40px;
.survey-label { display: none; }
.survey-btn { padding: 4px 12px; font-size: 12px; }
}
}
// Body offset when survey is active
body.design-survey-active {
.global-header { margin-top: 48px; }
@media (max-width: 768px) {
.global-header { margin-top: 40px; }
}
}
// Design Variant B
body.design-variant-B {
.logo-text { font-size: 18px !important; }
.nav-link { margin: 0 20px !important; }
}
// Design Variant C
body.design-variant-C {
.nav-link { margin: 0 20px !important; font-weight: bold !important; }
}
// Blind text for screen readers
.blind {
position: absolute;
@@ -3,6 +3,18 @@
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<body>
<th:block th:fragment="headerFragment(headerClass)">
<!-- Design Survey Bar -->
<div th:if="${designSurveyEnabled}" class="design-survey-bar" id="designSurveyBar">
<div class="survey-container">
<span class="survey-label">네비게이션 디자인을 선택해주세요:</span>
<div class="survey-buttons">
<button type="button" class="survey-btn active" data-design="A">A (현재)</button>
<button type="button" class="survey-btn" data-design="B">B</button>
<button type="button" class="survey-btn" data-design="C">C</button>
</div>
</div>
</div>
<!-- Global Header Container -->
<header class="global-header" th:classappend="${headerClass}">
<div class="container">
@@ -328,6 +340,36 @@
});
}
});
// Design Survey
const surveyBar = document.getElementById('designSurveyBar');
if (surveyBar) {
const body = document.body;
const surveyButtons = surveyBar.querySelectorAll('.survey-btn');
const STORAGE_KEY = 'design-survey-selection';
body.classList.add('design-survey-active');
const savedDesign = localStorage.getItem(STORAGE_KEY) || 'A';
applyDesign(savedDesign);
surveyButtons.forEach(btn => {
btn.classList.toggle('active', btn.dataset.design === savedDesign);
});
surveyButtons.forEach(btn => {
btn.addEventListener('click', function() {
surveyButtons.forEach(b => b.classList.remove('active'));
this.classList.add('active');
applyDesign(this.dataset.design);
localStorage.setItem(STORAGE_KEY, this.dataset.design);
});
});
function applyDesign(design) {
body.classList.remove('design-variant-B', 'design-variant-C');
if (design !== 'A') body.classList.add('design-variant-' + design);
}
}
});
</script>
</th:block>