메인페이지 국문/영문 분리 및 KOR/ENG 전환
- 영문 메인 mainPageEng.jsp 추가 - menuUserType=ENG 일 때 영문 메인 표출 - 헤더 KOR/ENG 버튼 클릭 시 해당 메인으로 이동
@8e19fc4e00fba1800b379aa719ce59323737b11b
--- src/main/java/kcc/web/MainController.java
+++ src/main/java/kcc/web/MainController.java
... | ... | @@ -228,7 +228,12 @@ |
| 228 | 228 |
|
| 229 | 229 |
/** 팝업 */ |
| 230 | 230 |
model.addAttribute("popupList", this.popupList());
|
| 231 |
- |
|
| 231 |
+ |
|
| 232 |
+ /** 영문 메인 */ |
|
| 233 |
+ if ("ENG".equals(request.getParameter("menuUserType"))) {
|
|
| 234 |
+ return "web/main/mainPageEng"; |
|
| 235 |
+ } |
|
| 236 |
+ |
|
| 232 | 237 |
return "web/main/mainPage"; |
| 233 | 238 |
} |
| 234 | 239 |
|
--- src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp
+++ src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp
... | ... | @@ -145,44 +145,29 @@ |
| 145 | 145 |
<div class="lang_switch"> |
| 146 | 146 |
<i class="icon lang"></i> |
| 147 | 147 |
<button type="button" id="lang-kor" class="${param.menuUserType ne 'ENG' ? 'active' : ''}">KOR</button>
|
| 148 |
- <%-- <button type="button" id="lang-eng" class="${param.menuUserType eq 'ENG' ? 'active' : ''}">ENG</button> --%>
|
|
| 149 |
- <button type="button" id="lang-eng">ENG</button> |
|
| 150 |
- |
|
| 148 |
+ <button type="button" id="lang-eng" class="${param.menuUserType eq 'ENG' ? 'active' : ''}">ENG</button>
|
|
| 149 |
+ |
|
| 151 | 150 |
</div> |
| 152 | 151 |
<script type="text/javascript"> |
| 153 | 152 |
$(document).ready(function() {
|
| 154 |
- // Language selection handling |
|
| 155 |
- var menuUserType = sessionStorage.getItem('menuUserType');
|
|
| 156 |
- if (!menuUserType) {
|
|
| 157 |
- const urlParams = new URLSearchParams(window.location.search); |
|
| 158 |
- menuUserType = urlParams.get('menuUserType') || 'KOR';
|
|
| 159 |
- sessionStorage.setItem('menuUserType', menuUserType);
|
|
| 160 |
- } |
|
| 153 |
+ // Language selection handling (URL 파라미터 기준) |
|
| 154 |
+ var menuUserType = '${param.menuUserType eq 'ENG' ? 'ENG' : 'KOR'}';
|
|
| 155 |
+ sessionStorage.setItem('menuUserType', menuUserType);
|
|
| 161 | 156 |
|
| 162 |
- if (menuUserType === 'ENG') {
|
|
| 163 |
- $('#lang-kor').removeClass('active');
|
|
| 164 |
- $('#lang-eng').addClass('active');
|
|
| 165 |
- } else {
|
|
| 166 |
- /* $('#lang-eng').removeClass('active');
|
|
| 167 |
- $('#lang-kor').addClass('active'); */
|
|
| 168 |
- |
|
| 169 |
- } |
|
| 170 |
- |
|
| 157 |
+ // KOR : 국문 메인(mainPage.jsp), ENG : 영문 메인(mainPageEng.jsp) |
|
| 171 | 158 |
$('#lang-kor').on('click', function() {
|
| 172 | 159 |
sessionStorage.setItem('menuUserType', 'KOR');
|
| 173 |
- var url = new URL(window.location.href); |
|
| 174 |
- url.searchParams.set('menuUserType', 'KOR');
|
|
| 175 |
- window.location.href = url.href; |
|
| 160 |
+ location.href = '/web/main/mainPage.do?menuUserType=KOR'; |
|
| 176 | 161 |
}); |
| 177 | 162 |
|
| 178 | 163 |
$('#lang-eng').on('click', function() {
|
| 179 |
- /* sessionStorage.setItem('menuUserType', 'ENG');
|
|
| 180 |
- var url = new URL(window.location.href); |
|
| 181 |
- url.searchParams.set('menuUserType', 'ENG');
|
|
| 182 |
- window.location.href = url.href; */ |
|
| 183 |
- alert("준비중입니다.")
|
|
| 164 |
+ sessionStorage.setItem('menuUserType', 'ENG');
|
|
| 165 |
+ location.href = '/web/main/mainPage.do?menuUserType=ENG'; |
|
| 184 | 166 |
}); |
| 185 | 167 |
|
| 168 |
+ // 로고 클릭 시 현재 언어 메인으로 이동 |
|
| 169 |
+ $('h1.logo a').attr('href', '/web/main/mainPage.do?menuUserType=' + menuUserType);
|
|
| 170 |
+ |
|
| 186 | 171 |
// Append menuUserType to menu links |
| 187 | 172 |
var currentLang = sessionStorage.getItem('menuUserType') || 'KOR';
|
| 188 | 173 |
$('a.depth02').each(function() {
|
+++ src/main/webapp/WEB-INF/jsp/web/main/mainPageEng.jsp
... | ... | @@ -0,0 +1,298 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 4 | +<% | |
| 5 | + response.setHeader("Cache-Control","no-store"); | |
| 6 | + response.setHeader("Pragma","no-cache"); | |
| 7 | + response.setDateHeader("Expires",0); | |
| 8 | + if (request.getProtocol().equals("HTTP/1.1")) response.setHeader("Cache-Control", "no-cache"); | |
| 9 | +%> | |
| 10 | + | |
| 11 | + | |
| 12 | +<script type="text/javascript"> | |
| 13 | +$(document).ready(function (){ | |
| 14 | + | |
| 15 | +// <c:if test="${message != null}"> | |
| 16 | +// alert("<c:out value='${message}' />"); | |
| 17 | +// </c:if> | |
| 18 | + | |
| 19 | + //레이어 팝업 띄우기 | |
| 20 | + <c:forEach var="popupListData" items="${popupList}" varStatus="status" end="10"> | |
| 21 | + if(fnGetCookie("layer_<c:out value='${popupListData.popupId}' />") == null){ | |
| 22 | + $("#layer_pop_<c:out value='${popupListData.popupId}' />").fadeIn(); | |
| 23 | + }; | |
| 24 | + </c:forEach> | |
| 25 | + | |
| 26 | + // 팝업 위치 조정 | |
| 27 | + | |
| 28 | + | |
| 29 | + var bdWidth = $("body").width(); | |
| 30 | + popupSet(bdWidth); | |
| 31 | + | |
| 32 | +}); | |
| 33 | + | |
| 34 | +$(window).on("resize",function(){ | |
| 35 | + var bdWidth = $("body").width(); | |
| 36 | + popupSet(bdWidth); | |
| 37 | +}) | |
| 38 | + | |
| 39 | +// 팝업 css 설정 | |
| 40 | +function popupSet(bodyWidth){ | |
| 41 | + let offset = 30; | |
| 42 | + if(bodyWidth>1199){ | |
| 43 | + $(".popup").each(function(idx,itm) { | |
| 44 | + $(this).css({ | |
| 45 | + top: '60px', // 화면 중앙에 위치 | |
| 46 | + left: offset + 'px', // 각 팝업을 가로로 정렬 | |
| 47 | + /* transform: 'translateY(-50%)', // 세로 중앙 정렬 */ | |
| 48 | + position: 'absolute' // 부모 요소 기준으로 위치 설정 | |
| 49 | + }); | |
| 50 | + offset += $(this).outerWidth(true)+30; // 다음 팝업의 위치를 현재 팝업의 너비만큼 이동 | |
| 51 | + }); | |
| 52 | + }else{ | |
| 53 | + $(".popup").each(function(idx,itm) { | |
| 54 | + var zIndex = 1000 - idx; | |
| 55 | + var topPosi = idx * 45; | |
| 56 | + $(this).css({ | |
| 57 | + top: 'calc(1% + '+topPosi+'px)', // 화면 중앙에 위치 | |
| 58 | + left: '30px', // 각 팝업을 가로로 정렬 | |
| 59 | + /* transform: 'translateY(-50%)', // 세로 중앙 정렬 */ | |
| 60 | + position: 'absolute', // 부모 요소 기준으로 위치 설정 | |
| 61 | + "z-index":zIndex | |
| 62 | + }); | |
| 63 | + offset += $(this).outerWidth(true)+30; // 다음 팝업의 위치를 현재 팝업의 너비만큼 이동 | |
| 64 | + }); | |
| 65 | + } | |
| 66 | +} | |
| 67 | + | |
| 68 | + | |
| 69 | +/* ******************************************************** | |
| 70 | +* 팝업창 오픈 쿠키 정보 OPEN | |
| 71 | +******************************************************** */ | |
| 72 | +function fnGetCookie(name) { | |
| 73 | + var prefix = name + "="; | |
| 74 | + | |
| 75 | + var cookieStartIndex = document.cookie.indexOf(prefix); | |
| 76 | + if (cookieStartIndex == -1) return null; | |
| 77 | + var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length); | |
| 78 | + if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length; | |
| 79 | + | |
| 80 | + | |
| 81 | + return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)); | |
| 82 | +} | |
| 83 | + | |
| 84 | +/* ******************************************************** | |
| 85 | + * 쿠키설정 | |
| 86 | + ******************************************************** */ | |
| 87 | +function fnSetCookiePopup( name, value, expiredays ) { | |
| 88 | + var todayDate = new Date(); | |
| 89 | + todayDate.setDate( todayDate.getDate() + expiredays ); | |
| 90 | + document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" | |
| 91 | +} | |
| 92 | + | |
| 93 | +//팝업 다시보지않기 | |
| 94 | +function fnPopupCheck(popupId , typeFlag) { | |
| 95 | + fnSetCookiePopup( typeFlag+"_"+popupId , "done" , 1); | |
| 96 | + fn_layerClose(popupId); | |
| 97 | +} | |
| 98 | + | |
| 99 | +//팝업 닫기 | |
| 100 | +function fn_layerClose(popupId){ | |
| 101 | + $("#layer_pop_"+popupId).fadeOut(); | |
| 102 | +} | |
| 103 | + | |
| 104 | +function popzoneOpen(url,target){ | |
| 105 | + var vTarget; | |
| 106 | + if(target != "N"){ | |
| 107 | + vTarget = "_self"; | |
| 108 | + }else{ | |
| 109 | + vTarget = "_blank"; | |
| 110 | + } | |
| 111 | + window.open(url,vTarget); | |
| 112 | +} | |
| 113 | + | |
| 114 | +function fn_egov_inqire_notice(bbsId, nttId) { | |
| 115 | + document.frm.nttId.value = nttId; | |
| 116 | + document.frm.bbsId.value = bbsId; | |
| 117 | + document.frm.method = "post"; | |
| 118 | + document.frm.action = "<c:url value='/web/cop/bbsWeb/selectBoardDetail.do'/>?pubDetail=Y"; | |
| 119 | + document.frm.submit(); | |
| 120 | +} | |
| 121 | + | |
| 122 | +function commonPopWindowopenForm(surl, popupwidth, popupheight, name, frm) { | |
| 123 | + | |
| 124 | + if (popupwidth > screen.width) | |
| 125 | + popupwidth = screen.width; | |
| 126 | + | |
| 127 | + if (popupheight > screen.height) | |
| 128 | + popupheight = screen.height; | |
| 129 | + | |
| 130 | + var top = 0; | |
| 131 | + var left = 0; | |
| 132 | + | |
| 133 | + if (isNaN(parseInt(popupwidth))) { | |
| 134 | + top = (screen.availHeight - 600) / 2; | |
| 135 | + left = (screen.availWidth - 800) / 2; | |
| 136 | + } else { | |
| 137 | + top = (screen.availHeight - popupheight) / 2; | |
| 138 | + left = (screen.availWidth - popupwidth) / 2; | |
| 139 | + } | |
| 140 | + | |
| 141 | + if (top < 0) top = 0; | |
| 142 | + if (left < 0) left = 0; | |
| 143 | + | |
| 144 | + var option = "dependent=yes,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + left + ",top=" + top + ",width=" + popupwidth + ",height=" + popupheight; | |
| 145 | + | |
| 146 | + if (name == null || name == "") { name = "Popup"; } | |
| 147 | + window.open("", name, option); | |
| 148 | + frm.attr('target', name); | |
| 149 | + frm.attr('action', surl); | |
| 150 | + frm.method = "post"; | |
| 151 | + frm.submit(); | |
| 152 | + // 초기화.. | |
| 153 | + frm.attr('target', '_self'); | |
| 154 | +} | |
| 155 | +</script> | |
| 156 | + | |
| 157 | +<!-- 비주얼 --> | |
| 158 | +<c:choose> | |
| 159 | + <c:when test="${not empty mainzoneImg}"> | |
| 160 | + <c:set var="backgroundUrl" value="/uss/ion/pwm/getImage.do?atchFileId=${mainzoneImg.mainzoneImageFile}" /> | |
| 161 | + </c:when> | |
| 162 | + <c:otherwise> | |
| 163 | + <c:set var="backgroundUrl" value="/kofair_case_seed/usr/images/main/main_visual.jpg" /> | |
| 164 | + </c:otherwise> | |
| 165 | +</c:choose> | |
| 166 | + | |
| 167 | +<%-- <div class="visual" style=" | |
| 168 | + width: 100%; | |
| 169 | + padding: 70px 0; | |
| 170 | + background: url('${backgroundUrl}') no-repeat center center; | |
| 171 | + text-align: center; | |
| 172 | + background-size: cover; | |
| 173 | + "> | |
| 174 | +</div> --%> | |
| 175 | + | |
| 176 | +<!-- ============== 메인비주얼 ============== --> | |
| 177 | +<div class="main_visual"> | |
| 178 | + <div class="visual_slide swiper"> | |
| 179 | + <div class="swiper-wrapper"> | |
| 180 | + <a href="#" class="swiper-slide" style="background: url('${backgroundUrl}') no-repeat center center;"></a> | |
| 181 | + <!-- <a href="#" class="swiper-slide"></a> --> | |
| 182 | + </div> | |
| 183 | + </div> | |
| 184 | + | |
| 185 | + <div class="contents"> | |
| 186 | + <div class="inner"> | |
| 187 | + <div class="text_area"> | |
| 188 | + <b class="title">ORGASIS <span class="line">Organellostasis</span></b> | |
| 189 | + <span class="summary"> | |
| 190 | + Developing innovative new drugs and <br />anti-aging materials with organelle homeostasis platform technology | |
| 191 | + </span> | |
| 192 | + <div class="slide_pagination"> | |
| 193 | + | |
| 194 | + </div> | |
| 195 | + </div> | |
| 196 | + <ul class="box_contents"> | |
| 197 | + <li class="box purple"> | |
| 198 | + <a href="#"> | |
| 199 | + <b class="title">ORGanelle Platform Tech</b> | |
| 200 | + <span class="summary"> | |
| 201 | + Internal and external stimuli such as pathogenesis, stress and aging damage cellular organelles,<br /> | |
| 202 | + and the activity of selective autophagy that maintains their homeostasis declines or becomes deficient,<br /> | |
| 203 | + leading to a variety of diseases. | |
| 204 | + </span> | |
| 205 | + </a> | |
| 206 | + </li> | |
| 207 | + <li class="box blue"> | |
| 208 | + <a href="#"> | |
| 209 | + <b class="title">ORGASIS Pipeline</b> | |
| 210 | + <span class="summary"> | |
| 211 | + ORGASIS aims to contribute to a healthy future and a better life for humanity<br /> | |
| 212 | + through disease-specific drug development using selective autophagy<br /> | |
| 213 | + screening technology for damaged organelles and cellular waste. | |
| 214 | + </span> | |
| 215 | + </a> | |
| 216 | + </li> | |
| 217 | + <li class="box skyblue"> | |
| 218 | + <a href="#"> | |
| 219 | + <b class="title">ORGASIS Achievement</b> | |
| 220 | + <span class="summary"> | |
| 221 | + ORGASIS removes damaged cellular organelles, excess pigments and aggregates<br /> | |
| 222 | + with selective autophagy technology to realize anti-aging and Balanced Aging,<br /> | |
| 223 | + contributing to healthy aging and human longevity. | |
| 224 | + </span> | |
| 225 | + </a> | |
| 226 | + </li> | |
| 227 | + </ul> | |
| 228 | + </div> | |
| 229 | + </div> | |
| 230 | +</div> | |
| 231 | +<!-- ============== 메인비주얼 끝 ============== --> | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | +<c:if test="${fn:length(popupList) > 0}" > | |
| 237 | + <style> | |
| 238 | + | |
| 239 | + .popup { | |
| 240 | + display: none; /* 처음에는 보이지 않도록 설정 */ | |
| 241 | + position: fixed; /* 화면에 고정 */ | |
| 242 | + left: 0; /* 초기 위치 설정 */ | |
| 243 | + top: 50%; /* 화면 중앙에 위치 */ | |
| 244 | + min-width: 400px; /* 팝업 너비 */ | |
| 245 | + height: auto; /* 높이를 내용에 맞게 자동 조정 */ | |
| 246 | + border: 1px solid #e5e5e5; | |
| 247 | + background-color: #f4f5f6; | |
| 248 | + text-align: center; | |
| 249 | + z-index: 1000; /* 다른 요소들 위에 표시되도록 설정 */ | |
| 250 | + box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); /* 그림자 효과 */ | |
| 251 | + } | |
| 252 | + .popup_wrap{padding:100px 30px;left:0;top:0;z-index:10;} | |
| 253 | + .pop-conts{background:#fff;min-height:250px;font-size:1.4rem;justify-content:center;align-items:center;} | |
| 254 | + .pop-conts a{width:100%;word-break:break-word;} | |
| 255 | + .btn-r{display:flex;height:45px;padding:0 15px;justify-content:space-between;align-items:center;} | |
| 256 | + .today_close{display:flex;font-size:16px;color:#222;gap:8px;align-items:center;} | |
| 257 | + .today_close [type="checkbox"]{width:16px;height:16px;} | |
| 258 | + .btn-layerClose{display:flex;width:30px;height:30px;margin:2px 0 0 0;justify-content:center;align-items:center;} | |
| 259 | + .icon.popup_close{width:16px;height:16px;background:url(/publish/adm/images/component/icon_x.png) no-repeat center center;background-size:100% auto;} | |
| 260 | + @media screen and (max-width: 1199px){ | |
| 261 | + .popup{width:95%;min-width:auto;} | |
| 262 | + .pop-conts{min-height:auto;} | |
| 263 | + .popup_wrap img{height:auto !important;object-fit:contain;} | |
| 264 | + } | |
| 265 | + @media screen and (max-width: 640px){ | |
| 266 | + .popup{width:95% !important;left:50% !important;transform:translateX(-50%);} | |
| 267 | + } | |
| 268 | + </style> | |
| 269 | + <c:forEach var="popupListData" items="${popupList}" varStatus="status" end="4"> | |
| 270 | + <div id="layer_pop_<c:out value='${popupListData.popupId}' />" class="popup"> | |
| 271 | + <div class="pop-container"> | |
| 272 | + <div class="pop-conts"> | |
| 273 | + <c:choose> | |
| 274 | + <c:when test="${not empty popupListData.fileUrl}"> | |
| 275 | + <a href="<c:out value='${popupListData.fileUrl}' />" target="_blank"> | |
| 276 | + ${popupListData.nttCn} | |
| 277 | + </a> | |
| 278 | + </c:when> | |
| 279 | + <c:otherwise> | |
| 280 | + <a href="#"> | |
| 281 | + ${popupListData.nttCn} | |
| 282 | + </a> | |
| 283 | + </c:otherwise> | |
| 284 | + </c:choose> | |
| 285 | + </div> | |
| 286 | + <div class="btn-r"> | |
| 287 | + <div class="today_close"> | |
| 288 | + <c:if test="${popupListData.stopvewSetupAt eq 'Y' }"> | |
| 289 | + <input type="checkbox" id="chkPupup_${status.count}" name="chkPopup" tabindex="1" onClick="fnPopupCheck('<c:out value='${popupListData.popupId}' />' , 'layer')" onkeypress="fnPopupCheck('<c:out value='${popupListData.popupId}' />' , 'layer')" style="display:inline"> | |
| 290 | + <label for="chkPupup_${status.count}">Do not show for 24 hours</label> | |
| 291 | + </c:if> | |
| 292 | + </div> | |
| 293 | + <a href="#" tabindex="1" onclick="fn_layerClose('<c:out value='${popupListData.popupId}' />'); return false;" class="btn-layerClose" title="Close popup"><i class="icon popup_close"></i></a> | |
| 294 | + </div> | |
| 295 | + </div> | |
| 296 | + </div> | |
| 297 | + </c:forEach> | |
| 298 | +</c:if> (No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?