PageSourceSearch

https://tonywack.com/ind-script/optimizer_user.php?filename=lZBBCg…c7e6a98b9df58e4ad491005&t=1790584788&user=T

js tonywack.com collected 2026-10-06 14:02:34 UTC 36,053 bytes, 1,066 lines download raw bytes

1const storesPage = document.querySelector("#stores-page");
2const swiper = storesPage.querySelector(".swiper");
3
4const getStoreImages = () => {
5	try {
6		const baseUrl = "/web/upload/stores";
7		const extension = "jpg";
8		let checkImageLoop = true;
9		let index = 1;
10		const images = [];
11
12		while (checkImageLoop) {
13			const imagePath = `${baseUrl}/${index}.${extension}`;
14			var http = new XMLHttpRequest();
15			http.open("HEAD", imagePath, false);
16			http.send();
17			if (http.status != 404) {
18				index = index + 1;
19				images.push(imagePath);
20			} else {
21				checkImageLoop = false;
22			}
23		}
24		return images;
25	} catch (error) {
26		return [];
27	}
28};
29
30const drawStoreImages = (images) => {
31	const swiperWrapper = swiper.querySelector(".swiper-wrapper");
32	const template = swiperWrapper.querySelector(".swiper-slide.template");
33	images.forEach((image) => {
34		const cloned = template.cloneNode(true);
35		cloned.classList.remove("template");
36		const imageTag = cloned.querySelector("img");
37		imageTag.setAttribute("src", image);
38		swiperWrapper.appendChild(cloned);
39	});
40	template.remove();
41};
42
43const setSlider = () => {
44	new Swiper(swiper, {
45		// speed: 400,
46		// spaceBetween: 0,
47
48		// Optional parameters
49		// direction: "horizontal",
50		// initialSlide: index,
51		centeredSlides: true,
52		loop: true,
53		// // Navigation arrows
54		navigation: {
55			nextEl: ".button-navigation.next",
56			prevEl: ".button-navigation.prev",
57		},
58	});
59};
60
61const initStores = () => {
62	const images = getStoreImages();
63	drawStoreImages(images);
64	setSlider();
65};
66
67initStores();
68
69/**
70 * 움직이는 배너 Jquery Plug-in
71 * @author  cafe24
72 */
73
74(function ($) {
75	$.fn.floatBanner = function (options) {
76		options = $.extend({}, $.fn.floatBanner.defaults, options);
77
78		return this.each(function () {
79			var aPosition = $(this).position();
80			var jbOffset = $(this).offset();
81			var node = this;
82
83			$(window).on("scroll", function () {
84				var _top = $(document).scrollTop();
85				_top = aPosition.top < _top ? _top : aPosition.top;
86
87				setTimeout(function () {
88					var newinit = $(document).scrollTop();
89
90					if (newinit > jbOffset.top) {
91						_top -= jbOffset.top;
92						var container_height = $("#wrap").height();
93						var quick_height = $(node).height();
94						var cul = container_height - quick_height;
95						if (_top > cul) {
96							_top = cul;
97						}
98					} else {
99						_top = 0;
100					}
101
102					$(node).stop().animate({ top: _top }, options.animate);
103				}, options.delay);
104			});
105		});
106	};
107
108	$.fn.floatBanner.defaults = {
109		animate: 500,
110		delay: 500,
111	};
112})(jQuery);
113
114/**
115 * 문서 구동후 시작
116 */
117$(function () {
118	$("#banner:visible, #quick:visible").floatBanner();
119
120	//placeholder
121	$(".xans-product-addoption .ePlaceholder input").each(function (i) {
122		var Area = $(this).parents(".ePlaceholder").siblings(".optionTit").text();
123		$(this).attr("placeholder", Area);
124	});
125
126	//placeholder
127	$(".ePlaceholder input, .ePlaceholder textarea").each(function (i) {
128		var placeholderName = $(this).parents().attr("title");
129		$(this).attr("placeholder", placeholderName);
130	});
131
132	/* placeholder ie8, ie9 */
133	$.fn.extend({
134		placeholder: function () {
135			//IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴
136			if (hasPlaceholderSupport() === true) {
137				return this;
138			}
139			//hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행
140			return this.each(function () {
141				var findThis = $(this);
142				var sPlaceholder = findThis.attr("placeholder");
143				if (!sPlaceholder) {
144					return;
145				}
146				findThis.wrap('<label class="ePlaceholder" />');
147				var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : "";
148				findThis.before("<span" + sDisplayPlaceHolder + ">" + sPlaceholder + "</span>");
149				this.onpropertychange = function (e) {
150					e = event || e;
151					if (e.propertyName == "value") {
152						$(this).trigger("focusout");
153					}
154				};
155				//공통 class
156				var agent = navigator.userAgent.toLowerCase();
157				if (agent.indexOf("msie") != -1) {
158					$(".ePlaceholder").css({ position: "relative" });
159					$(".ePlaceholder span").css({ position: "absolute", padding: "0 4px", color: "#878787" });
160					$(".ePlaceholder label").css({ padding: "0" });
161				}
162			});
163		},
164	});
165
166	$(":input[placeholder]").placeholder(); //placeholder() 함수를 호출
167
168	//클릭하면 placeholder 숨김
169	$("body").on("click", ".ePlaceholder span", function () {
170		$(this).hide();
171	});
172
173	//input창 포커스 인 일때 placeholder 숨김
174	$("body").on("focusin", ".ePlaceholder :input", function () {
175		$(this).prev("span").hide();
176	});
177
178	//input창 포커스 아웃 일때 value 가 true 이면 숨김, false 이면 보여짐
179	$("body").on("focusout", ".ePlaceholder :input", function () {
180		if (this.value) {
181			$(this).prev("span").hide();
182		} else {
183			$(this).prev("span").show();
184		}
185	});
186
187	//input에 placeholder가 지원이 되면 true를 안되면 false를 리턴값으로 던져줌
188	function hasPlaceholderSupport() {
189		if ("placeholder" in document.createElement("input")) {
190			return true;
191		} else {
192			return false;
193		}
194	}
195
196	// 품절 표시
197	$(".ec-base-product .prdList > li .icon img").each(function () {
198		var alt = $(this).attr("alt");
199		if (alt == "품절") {
200			$(this).parents(".ec-base-product .prdList > li").find(".soldout").show();
201		}
202	});
203
204	// 리스탁 표시
205	$(".ec-base-product .prdList > li").each(function () {
206		var restock = $(this).find('.description li .title:contains("요약")').siblings("span").addClass("restock");
207		var soldout = $(this).find(".soldout");
208		restock.insertAfter(soldout).show();
209	});
210
211	// 배너관리 img 마우스오버시 타이틀 노출 취소
212	$(".xans-bannermanage2 a img").attr("title", "");
213
214	// 썸네일 아이콘 .button 에 .buttonIn 삽입
215	//$(".ec-base-product .prdList .thumbnail .button li img").wrap('<div class="buttonIn"></div>');
216
217	// 박스 스타일 카테고리 중 내가 선택한 카테고리에 seleted 클래스 삽입하기 - company, shop
218	var li = $(".box_menu > ul > li");
219	li.find("a").each(function (i, e) {
220		var a_link = $(this).attr("href");
221		if (0 <= location.href.indexOf(a_link)) {
222			$(this).parent().addClass("selected");
223		}
224	});
225
226	// BEST 상품 번호
227	var bestLi = $(".xans-product-listrecommend > .prdList > li");
228	bestLi.each(function (e) {
229		var no = $(this).index() + 1;
230		$(this).find(".best_cnt i").text(no);
231	});
232
233	// NEW 상품 번호
234	var bestLi = $(".xans-product-listnew > .prdList > li");
235	bestLi.each(function (e) {
236		var no = $(this).index() + 1;
237		$(this).find(".new_cnt i").text(no);
238	});
239
240	// 게시판 내 카테고리 select를 li로 변경하기
241	/*$('.xans-board-listpackage #board_category option').each(function(i, e){
242        var option = $(this).attr("value");                
243        $(this).wrapInner('<li><a alt='+option+'></a></li>');
244        $('option[selected=selected]').find('li').addClass('selected'); //박스 스타일 카테고리 중 내가 선택한 카테고리에 seleted 클래스 삽입하기 - 게시판        
245        $(this).find('li').unwrap();
246        $('.xans-board-listpackage .boardSort select li').unwrap();
247        $('.box_menu > ul').css('display','inline-block');
248        
249        // 게시판 내 카테고리 링크 option 값을 이용하여 링크하기
250        $(".boardSort li a").click(function(){        
251            var path = $(location).attr('pathname');
252            var search = $(location).attr('search');
253            var i = $(this).attr("alt");
254            var link = path + search + '&category_no=' + i;            
255            $(this).attr("href",link);            
256        });
257    });*/
258});
259
260/**
261 *  썸네일 이미지 엑박일경우 기본값 설정
262 */
263$(window).on("load", function () {
264	$("img.thumb,img.ThumbImage,img.BigImage").each(function ($i, $item) {
265		var $img = new Image();
266		$img.onerror = function () {
267			$item.src = "//img.echosting.cafe24.com/thumb/img_product_big.gif";
268		};
269		$img.src = this.src;
270	});
271});
272
273/**
274 *  tooltip
275 */
276$(".eTooltip").each(function (i) {
277	$(this).find(".btnClose").attr("tabIndex", "-1");
278});
279//tooltip input focus
280$(".eTooltip")
281	.find("input")
282	.on("focus", function () {
283		var targetName = returnTagetName(this);
284		targetName.siblings(".ec-base-tooltip").show();
285	});
286$(".eTooltip")
287	.find("input")
288	.on("focusout", function () {
289		var targetName = returnTagetName(this);
290		targetName.siblings(".ec-base-tooltip").hide();
291	});
292function returnTagetName(_this) {
293	var ePlacename = $(_this).parent().attr("class");
294	var targetName;
295	if (ePlacename == "ePlaceholder") {
296		//ePlaceholder 대응
297		targetName = $(_this).parents();
298	} else {
299		targetName = $(_this);
300	}
301	return targetName;
302}
303
304/**
305 *  eTab
306 */
307$("body").on("click", ".eTab a", function (e) {
308	// 클릭한 li 에 selected 클래스 추가, 기존 li에 있는 selected 클래스는 삭제.
309	var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"),
310		_target = $(this).attr("href"),
311		_siblings = $(_target).attr("class"),
312		_arr = _siblings.split(" "),
313		_classSiblings = "." + _arr[0];
314
315	//클릭한 탭에 해당하는 요소는 활성화, 기존 요소는 비활성화 함.
316	$(_target).show().siblings(_classSiblings).hide();
317
318	//preventDefault 는 a 태그 처럼 클릭 이벤트 외에 별도의 브라우저 행동을 막기 위해 사용됨.
319	e.preventDefault();
320});
321
322//window popup script
323function winPop(url) {
324    window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
325}
326/**
327 * document.location.href split
328 * return array Param
329 */
330function getQueryString(sKey)
331{
332    var sQueryString = document.location.search.substring(1);
333    var aParam       = {};
334
335    if (sQueryString) {
336        var aFields = sQueryString.split("&");
337        var aField  = [];
338        for (var i=0; i<aFields.length; i++) {
339            aField = aFields[i].split('=');
340            aParam[aField[0]] = aField[1];
341        }
342    }
343
344    aParam.page = aParam.page ? aParam.page : 1;
345    return sKey ? aParam[sKey] : aParam;
346};
347
348$(function(){
349    // tab
350    $.eTab = function(ul){
351        $(ul).find('a').on('click', function(){
352            var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
353                _target = $(this).attr('href'),
354                _siblings = '.' + $(_target).attr('class');
355            $(_target).show().siblings(_siblings).hide();
356            return false
357        });
358    }
359    if ( window.call_eTab ) {
360        call_eTab();
361    };
362});
363(function($){
364    $.fn.extend({
365        center: function() {
366            this.each(function() {
367                var
368                    $this = $(this),
369                    $w = $(window);
370                $this.css({
371                    position: "absolute",
372                    top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px",
373                    left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px"
374                });
375            });
376            return this;
377        }
378    });
379    $(function() {
380        var $container = function(){/*
381    <div id="modalContainer">
382        <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe>
383    </div>');
384    */}.toString().slice(14,-3);
385        $('body')
386        .append($('<div id="modalBackpanel"></div>'))
387        .append($($container));
388        function closeModal () {
389            $('#modalContainer').hide();
390            $('#modalBackpanel').hide();
391        }
392        $('#modalBackpanel').on('click',closeModal);
393        zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) {
394            var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup;
395            $('#modalContent').attr('src', $url);
396            $('#modalContent').on("load",function(){
397                $(".header .close",this.contentWindow.document.body).on("click", closeModal);
398            });
399            $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show();
400            $('#modalContainer').center().show();
401        }
402    });
403})(jQuery);
404const initFullHeight = () => {
405	const onResize = () => {
406		let vh = window.innerHeight * 0.01;
407		document.documentElement.style.setProperty("--vh", `${vh}px`);
408	};
409	window.addEventListener("resize", onResize);
410
411	onResize();
412};
413
414initFullHeight();
415
416const layoutInit = () => {
417	// ✅ field
418	const wrapDom = document.querySelector("#wrap");
419
420	// ✅ check path for padding top on wrap
421	const lists = [
422		"/board/notice",
423		"/board/event",
424		"/board/review",
425		"/myshop",
426		"/order/",
427		"/member/",
428		"/product/search",
429		"/shopinfo/company",
430		"/article/",
431		"/product/recent_view_product",
432		"/shopinfo/stores.html",
433		"/shopinfo/stockist.html",
434		"/shop1/front/php/",
435	];
436	const path = window.location.pathname;
437	const check = lists.some((t) => path.includes(t));
438
439	if (check) {
440		wrapDom.classList.add("withPadding");
441	}
442	wrapDom.classList.add("active");
443};
444
445layoutInit();
446
447$(document).ready(function(){
448    if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
449        var sShippingCountryCode4Cookie = 'shippingCountryCode';
450        var bShippingCountryProc = false;
451
452        // 배송국가 선택 설정이 사용안함이면 숨김
453        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
454            $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
455            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
456        } else {
457            $('.thumb .xans-layout-multishoplistitem').hide();
458            var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
459            if (typeof(aShippingCountryCode) != 'undefined' && aS
459hippingCountryCode != null && aShippingCountryCode.length > 2) {
460                var sShippingCountryValue = aShippingCountryCode[2];
461            }
462
463            // query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
464            var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
465
466            if (aHrefCountryValue.length == 2) {
467                var sShippingCountryValue = aHrefCountryValue[1];
468            }
469
470            // 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
471            if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
472                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
473
474                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
475                    $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
476                }
477            }
478            if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
479                sShippingCountryValue = sShippingCountryValue.split("#")[0];
480                var bShippingCountryProc = true;
481
482                $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
483                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
484                var expires = new Date();
485                expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
486                document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
487                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
488                    $("#f_country").val(sShippingCountryValue).change();;
489                }
490            }
491        }
492        // 언어선택 설정이 사용안함이면 숨김
493        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
494            $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
495            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
496        } else {
497            $('.thumb .xans-layout-multishoplistitem').hide();
498        }
499
500        // 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
501        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
502            $(".xans-layout-multishopshipping").hide();
503            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
504        } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
505            var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
506            $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
507            $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
508            // 배송국가 선택을 사용해야 레이어를 보이게 함
509            if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
510                $(".xans-layout-multishopshipping").show();
511            }
512        }
513
514        $(".xans-layout-multishopshipping .close").bind("click", function() {
515            $(".xans-layout-multishopshipping").hide();
516        });
517
518        $(".xans-layout-multishopshipping .ec-base-button a").bind("click", function() {
519            var expires = new Date();
520            expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
521            document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
522
523            // 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값
523을 넘김
524            var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
525
526            location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
527        });
528        $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").bind("click", function() {
529            $(".xans-layout-multishopshipping").show();
530        });
531    }
532});
533const checkPathInit = () => {
534	const header = document.querySelector("#header.header-desktop");
535	const path = window.location.pathname.replace(/^\/skin-skin\d+/, "") || "/";
536	const checkIsHome = path === "/" || path === "/index.html";
537	if (checkIsHome) {
538		header.classList.add("home");
539	} else {
540		header.classList.remove("home");
541	}
542};
543
544checkPathInit();
545const drawCategoryInit = () => {
546	const parents = document.querySelector("#header.header-desktop  .header-category-left").querySelectorAll("li");
547
548	const getCategoryCodeFromLiTag = (liTag) => {
549		const splitArr = liTag
550			.querySelector("a")
551			.href.split("/")
552			.filter((t) => t !== "");
553		return Number(splitArr[splitArr.length - 1]);
554	};
555
556	const parentsCode = Array.from(parents).map((el) => {
557		return getCategoryCodeFromLiTag(el);
558	});
559	let subCategoryObj = {};
560
561	// METHOD
562	const genSubCategoryTag = (href, text, className) => {
563		const liTag = document.createElement("li");
564		if (className) {
565			liTag.classList.add(className);
566		}
567		const aTag = document.createElement("a");
568		aTag.setAttribute("href", href);
569		aTag.innerText = text;
570		liTag.appendChild(aTag);
571		return liTag;
572	};
573
574	const get = () => {
575		$.ajax({
576			url: "/exec/front/Product/SubCategory",
577			dataType: "json",
578			success: function (aData) {
579				if (aData == null || aData == "undefined") return;
580
581				const depthCategories = [];
582				// : filter sub category data
583				aData
584					// .sort((a, b) => a.cate_no - b.cate_no)
585					.forEach((d) => {
586						if (parentsCode.includes(d.parent_cate_no)) {
587							subCategoryObj = { ...subCategoryObj, [d.parent_cate_no]: subCategoryObj[d.parent_cate_no] ? [...subCategoryObj[d.parent_cate_no], d] : [d] };
588						}
589						depthCategories.push(d);
590					});
591
592				// second depth
593				depthCategories.forEach((d) => {
594					Object.keys(subCategoryObj).forEach((code) => {
595						const checkInclude = subCategoryObj[code].find((menu) => menu.cate_no === d.parent_cate_no);
596						if (!checkInclude) return;
597
598						subCategoryObj = {
599							...subCategoryObj,
600							[code]: subCategoryObj[code].map((menu) =>
601								menu.cate_no === d.parent_cate_no
602									? {
603											...menu,
604											children: menu.children ? [...menu.children, d] : [d],
605									  }
606									: menu
607							),
608						};
609					});
610				});
611
612				// : draw sub on desktop
613				parents.forEach((el) => {
614					const code = getCategoryCodeFromLiTag(el);
615
616					if (!subCategoryObj[code] || !subCategoryObj[code].length) return;
617					const subDatas = subCategoryObj[code];
618
619					const subDiv = document.createElement("div");
620					subDiv.classList.add("sub-category-left");
621					subDiv.classList.add("sub-category");
622
623					const ulTag = document.createElement("ul");
624					subDiv.appendChild(ulTag);
625
626					subDatas.forEach((d) => {
627						const liTag = genSubCategoryTag(d.link_product_list, d.name);
628						if (d.children) {
629							const secondUl = document.createElement("ul");
630							secondUl.classList.add("second-category");
631							d.children.forEach((secondMenu) => {
632								const secondLi = genSubCategoryTag(secondMenu.link_product_list, secondMenu.name);
633								secondUl.appendChild(secondLi);
634							});
635							liTag.appendChild(secondUl);
636						}
637
638						ulTag.appendChild(liTag);
639					});
640
641					el.appendChild(subDiv);
642				});
643
644				// : draw sub on mobile
645				const filtedData = Array.from(parents).reduce((prev, current) => {
646					const code = getCategoryCodeFromLiTag(current);
647					const title = current.querySelector("a").innerText;
648					let children = subCategoryObj[code];
649					if (current.classList.contains("collection")) {
650						const liTags = current.querySelectorAll("ul li");
651						children = Array.from(liTags).map((el) => {
652							const aTag = el.querySelector("a");
653							return {
654								name: aTag.innerText,
655								link_product_list: aTag.getAttribute("href"),
656							};
657						});
658					}
659
660					prev.push({
661						code,
662						title,
663						children,
664					});
665					return prev;
666				}, []);
667
668				headerMobile(filtedData);
669			},
670		});
671	};
672
673	get();
674};
675
676drawCategoryInit();
677
678const scrollAnimationInit = () => {
679	// Field
680	const header = document.querySelector("#header.header-desktop");
681	const scrolledClassName = "scrolled";
682	const hideClassName = "hide";
683	let lastScrollTop = 0;
684
685	// METHOD
686	// : Set window scroll event
687	window.addEventListener("scroll", () => {
688		// ✅ check scroll position
689		if (window.scrollY > 0) {
690			addScrolled();
691		} else {
692			removeScrolled();
693		}
694
695		// ✅ check scroll direction
696		const st = window.pageYOffset || document.documentElement.scrollTop;
697		if (st > lastScrollTop) {
698			hideHeader();
699		} else if (st < lastScrollTop) {
700			activeHeader();
701		}
702		lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
703	});
704
705	// add header logo class [scrolled]
706	const addScrolled = () => {
707		header.classList.add(scrolledClassName);
708	};
709
710	// remove header logo class [scrolled]
711	const removeScrolled = () => {
712		header.classList.remove(scrolledClassName);
713	};
714
715	const hideHeader = () => {
716		header.classList.add(hideClassName);
717	};
718
719	const activeHeader = () => {
720		header.classList.remove(hideClassName);
721	};
722};
723
724scrollAnimationInit();
725
726const categoryInit = () => {
727	// FIELD
728	const header = document.querySelector("#header.header-desktop");
729	const categories = header.querySelectorAll(".categories>li");
730	const subCategoryBg = header.querySelector(".sub-category-bg");
731	const classNameOn = "on";
732	const classOpen = "open";
733
734	// ✅ add mouse hover event on right categories
735	categories.forEach((el, index) => {
736		el.addEventListener("mouseenter", () => {
737			categories.forEach((sub, subIndex) => (subIndex === index ? sub.classList.add(classNameOn) : sub.classList.remove(classNameOn)));
738		});
739	});
740
741	// ✅ on mouse leave on sub category area
742	subCategoryBg.addEventListener("mouseout", () => {
743		categories.forEach((sub) => sub.classList.remove(classNameOn));
744	});
745
746	// ✅ detect class changed
747	categories.forEach((el) => {
748		var observer = new MutationObserver(function (event) {
749			const checkOn = Array.from(categories).find((element) => element.classList.contains(classNameOn));
750			if (!checkOn) {
751				setSubCategoryBgHeight(0);
752				header.classList.remove(classOpen);
753				return;
754			}
755
756			// ✅ if class on, add background
757			const subCategoryEl = checkOn.querySelector("ul");
758			const bgHeight = subCategoryEl?.clientHeight ?? 0;
759			setSubCategoryBgHeight(bgHeight);
760			if (!header.classList.contains(classOpen)) {
761				header.classList.add(classOpen);
762			}
763		});
764
765		observer.observe(el, {
766			attributes: true,
767			attributeOldValue: false,
768			attributeFilter: ["class"],
769			childList: false,
770			characterData: false,
771		});
772	});
773
774	// METHOD
775	const setSubCategoryBgHeight = (height) => {
776		subCategoryBg.style.height = `${height}px`;
777	};
778};
779
780categoryInit();
781
782// 📎 Check menu name here! : start
783const DATA_MENU_COLLECTION = ["FALL WINTER 2026 MEN COLLECTION", "FALL WINTER 2026 WOMEN COLLECTION", "RESORT 2026 MEN COLLECTION", "RESORT 2026 WOMEN COLLECTION","SPRING 2026 MEN COLLECTION", "SPRING 2026 WOMEN COLLECTION"];
784const DATA_MENU_CAMPAIGN = ["FALL WINTER 2026 CAMPAIGN", "SPRING 2026 CAMPAIGN", "KALEG X TONYWACK"];
785// 📎 Check menu name here! : end
786
787const setCollectionMenu = (name, ulTag, baseUrl, className) => {
788	const path = name.toLowerCase().replaceAll(" ", "_");
789	const liTag = document.createElement("li");
790	const aTag = document.createElement("a");
791	aTag.innerHTML = name;
792	aTag.setAttribute("href", `${baseUrl}?type=${path}`);
793	liTag.appendChild(aTag);
794	liTag.classList.add(path);
795	if (className) {
796		liTag.classList.add(className);
797	}
798	ulTag.appendChild(liTag);
799};
800
801const collectionInit = () => {
802	const menu = document.querySelector(".header-category .collection");
803	const ulTag = menu.querySelector("ul");
804	const templateLi = ulTag.querySelector("li");
805	const aTag = templateLi.querySelector("a");
806	const href = aTag.getAttribute("href");
807
808	DATA_MENU_COLLECTION.forEach((name, index) => {
809		setCollectionMenu(name, ulTag, `${href === "/" ? "" : href}/collection`, `collection-${index + 1}`);
810	});
811
812	DATA_MENU_CAMPAIGN.forEach((name, index) => {
813		setCollectionMenu(name, ulTag, `${href === "/" ? "" : href}/campaign`, `campaign-${index + 1}`);
814	});
815
816	templateLi.remove();
817};
818
819collectionInit();
820
821// FW 2026 컬렉션(MEN/WOMEN)만 5열 처리
822(function () {
823	var type = new URLSearchParams(window.location.search).get("type") || "";
824	type = decodeURIComponent(type);
825	if (type.indexOf("fall_winter_2026") !== -1) {
826		document.body.classList.add("collection-fw2026");
827	}
828})();
829
830const headerMobile = (data) => {
831	data.forEach((category, index) => {
832		// ✅ draw sub screens
833		if (!category.children) return;
834		drawMobileCategoryScreen(category.title, category.children, index === data.length - 1);
835	});
836
837	// ✅ add events : menu
838	addMobileHeaderEvents();
839
840	// ✅ add events : backbutton
841	addBackBtnEvent();
842
843	// ✅ parse category men, women, kaleg x tonywack
844	parseCategoryLink();
845};
846
847const drawMobileCategoryScreen = (title, subCategoryArr, isEnd) => {
848	// get template
849	const menuLists = document.querySelector("#header .header-mobile-menu-lists");
850	const template = document.querySelector("#header .header-mobile-template");
851	if (!menuLists || !template) return; // 요소가 없을 경우 예외 처리
852    
853	const cloned = template.cloneNode(true);
854
855	// change data
856	cloned.classList.remove("header-mobile-template");
857	cloned.dataset.targetScreen = title.toLowerCase();
858	// : title
859	cloned.querySelector(".header-mobile-subcategory-title").innerHTML = title;
860
861	// : contents
862	const categoryWrapper = cloned.querySelector(".header-mobile-menu-group.category");
863	let groupName = "";
864	subCategoryArr.forEach((el, index) => {
865		const liTag = document.createElement("li");
866
867		// if category is collection or campaign
868		if (el.link_product_list && el.link_product_list.includes("?")) {
869			const base = el.link_product_list.split("?")[0];
870			const categoryName = base.split("/")[2];
871			if (groupName !== categoryName) {
872				if (groupName !== "") {
873					liTag.classList.add(`group-top`);
874				}
875				groupName = categoryName;
876			}
877		}
878
879		const aTag = document.createElement("a");
880		aTag.innerHTML = el.name;
881		aTag.setAttribute("href", el.link_product_list);
882		liTag.appendChild(aTag);
883		categoryWrapper.appendChild(liTag);
884
885		if (el.children) {
886			aTag.addEventListener("click", (e) => {
887				e.preventDefault();
888
889				const secondUl = liTag.querySelector(".second-category");
890				const isOpen = secondUl.classList.contains("active");
891
892				// 다른 열린 메뉴 모두 닫기
893				const allSeconds = categoryWrapper.querySelectorAll(".second-category.active");
894				allSeconds.forEach((s) => s.classList.remove("active"));
895
896				// 토글
897				if (!isOpen) {
898					secondUl.classList.add("active");
899				}
900			});
901
902			const secondUl = document.createElement("ul");
903			secondUl.classList.add("second-category");
904			liTag.appendChild(secondUl);
905
906			el.children.forEach((menu) => {
907				const secondLi = document.createElement("li");
908				const aTag = document.createElement("a");
909				aTag.innerHTML = menu.name;
910				aTag.setAttribute("href", menu.link_product_list);
911				secondLi.appendChild(aTag);
912				secondUl.appendChild(secondLi);
913			});
914		}
915	});
916
917	// add
918	menuLists.appendChild(cloned);
919
920	// remove template
921	if (isEnd) {
922		template.remove();
923	}
924};
925
926const addMobileHeaderEvents = () => {
927	// add button
928	const btns = document.querySelectorAll(".header-mobile-btn");
929
930	btns.forEach((btn) =>
931		btn.addEventListener("click", () => {
932			moveToSubSCreen(btn.dataset.target);
933		})
934	);
935};
936
937const moveToSubSCreen = (target) => {
938	const menuScreens = document.querySelectorAll("#header.header-mobile .header-mobile-menu");
939	const targetScreen = Array.from(menuScreens).find((el) => {
940		return el.dataset.targetScreen === target;
941	});
942	if (targetScreen) {
943		targetScreen.classList.add("active");
944	}
945};
946
947const addBackBtnEvent = () => {
948	const menuLists = document.querySelector("#header .header-mobile-menu-lists").querySelectorAll(".header-mobile-menu");
949	menuLists.forEach((el) => {
950		const backBtn = el.querySelector(".header-mobile-menu-top button");
951		if (backBtn) {
952			backBtn.addEventListener("click", () => el.classList.remove("active"));
953		}
954	});
955};
956
957const parseCategoryLink = () => {
958	const screenMenu = document.querySelector("#header.header-mobile .header-mobile-menu.menu");
959	if (!screenMenu) return;
960
961	const category = screenMenu.querySelector("#category");
962	if (!category) return;
963
964	const categoryList = category.querySelectorAll(".header-mobile-category-name");
965	
966	categoryList.forEach((el) => {
967		const name = el.innerText ? el.innerText.trim() : "";
968		if (!name) return; // 텍스트가 비어있으면 패스
969
970		// 하위 화면이 있는 경우만 버튼으로 변환
971		const menuScreens = document.querySelectorAll("#header.header-mobile .header-mobile-menu");
972		const targetScreen = Array.from(menuScreens).find((screen) => {
973			return screen.dataset.targetScreen === name.toLowerCase();
974		});
975		
976		if (!targetScreen) return; // 하위 화면 없으면 원래 링크 유지
977		
978		const btn = document.createElement("button");
979		btn.type = "button";
980		btn.innerHTML = name;
981		btn.addEventListener("click", () => {
982			moveToSubSCreen(name.toLowerCase());
983		});
984		el.innerHTML = "";
985		el.appendChild(btn);
986	});
987
988	// =================================================================
989	// ✨ [완벽 해결] LOGIN, CHECK ORDER 아래 그룹에 COMMUNITY 드롭다운 주입
990	// =================================================================
991	// 사이드바 내에서 메뉴 그룹(ul) 리스트를 전부 찾습니다.
992	const subMenuGroups = screenMenu.querySelectorAll(".header-mobile-menu-group");
993	
994	// LOGIN, CHECK ORDER 항목들이 모여 있는 두 번째 그룹이 정상적으로 존재할 때만 실행
995	if (subMenuGroups.length > 1) {
996		const targetGroup = subMenuGroups[1]; // 두 번째 메뉴 그룹 (하단 영역)
997		
998		if (!targetGroup.querySelector('.custom-community-dropdown')) {
999			const communityLi = document.createElement("li");
1000			// 디자인 동일성을 확보하기 위해 스킨 고유 대메뉴 클래스 매칭
1001			communityLi.classList.add("header-mobile-category-name", "custom-community-dropdown");
1002			communityLi.style.position = "relative";
1003			communityLi.style.width = "100%";
1004
1005			// 1. 모바일에서 터치할 가로 대메뉴 버튼 (COMMUNITY)
1006			const toggleBtn = document.createElement("button");
1007			toggleBtn.type = "button";
1008			toggleBtn.innerHTML = "COMMUNITY";
1009			toggleBtn.style.width = "100%";
1010			toggleBtn.style.textAlign = "left";
1011			toggleBtn.style.display = "block";
1012			toggleBtn.style.background = "none";
1013			toggleBtn.style.border = "none";
1014			toggleBtn.style.padding = "initial";
1015			toggleBtn.style.font = "inherit";
1016			toggleBtn.style.color = "inherit";
1017			toggleBtn.style.cursor = "pointer";
1018
1019			// 2. 버튼 클릭 시 아래로 열릴 드롭다운 서브 메뉴 컨테이너(ul)
1020			const dropdownUl = document.createElement("ul");
1021			dropdownUl.classList.add("second-category"); // 스킨 서브 카테고리 클래스 매칭
1022			dropdownUl.style.display = "none";            // 초기 상태는 숨김
1023			dropdownUl.style.paddingLeft = "15px";
1024			dropdownUl.style.marginTop = "10px";
1025
1026			// 3. 연동할 진짜 게시판 데이터 설정 (어드민 번호 세팅 반영)
1027			const boards = [
1028				{ name: "NOTICE", link: "/board/free/list.html?board_no=2" },
1029				{ name: "EVENT", link: "/board/free/list.html?board_no=3001" },
1030				{ name: "REVIEW", link: "/board/product/list.html?board_no=4" }
1031			];
1032
1033			// 4. 서브 리스트 태그 생성 및 쨍한 검은색 스타일 속성 강제 부여
1034			boards.forEach(board => {
1035				const li = document.createElement("li");
1036				li.style.margin = "12px 0"; // 모바일 터치 미스 방지를 위한 상하 간격 보정
1037				
1038				const a = document.createElement("a");
1039				a.innerHTML = board.name;
1040				a.setAttribute("href", board.link);
1041				
1042				// 흐리멍텅하게 죽어 보이던 투명도 규칙을 해제하고 선명한 블랙으로 강제 고정
1043				a.style.fontSize = "11px";
1044				a.style.color = "#000000";      // 리얼 블랙 컬러
1045				a.style.opacity = "1";          // 투명도 100% 선명하게
1046				a.style.fontWeight = "500";     // 도톰한 굵기감 지정
1047				
1048				li.appendChild(a);
1049				dropdownUl.appendChild(li);
1050			});
1051
1052			// 5. COMMUNITY 버튼 클릭 시 드롭다운 토글 이벤트 바인딩
1053			toggleBtn.addEventListener("click", (e) => {
1054				e.preventDefault();
1055				const isHidden = dropdownUl.style.display === "none";
1056				dropdownUl.style.display = isHidden ? "block" : "none";
1057				toggleBtn.classList.toggle("active", isHidden);
1058			});
1059
1060			// 6. 요소 최종 조립 후 하단 두 번째 그룹(targetGroup) 맨 밑에 장착
1061			communityLi.appendChild(toggleBtn);
1062			communityLi.appendChild(dropdownUl);
1063			targetGroup.appendChild(communityLi);
1064		}
1065	}
1066};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.