first commit 2
This commit is contained in:
+90
@@ -0,0 +1,90 @@
|
||||
var cbpHorizontalMenu = (function () {
|
||||
var b = $("#cbp-hrmenu > ul > li"),
|
||||
g = b.children("a"),
|
||||
c = $("body"),
|
||||
d = -1,
|
||||
closeTimer;
|
||||
|
||||
function f() {
|
||||
b.on("mouseenter", a);
|
||||
b.on("mouseleave", e);
|
||||
}
|
||||
|
||||
function a(event) {
|
||||
var currentLink = $(event.currentTarget).children("a");
|
||||
var i = $(event.currentTarget),
|
||||
h = i.index();
|
||||
|
||||
clearTimeout(closeTimer);
|
||||
|
||||
if (d !== -1 && d !== h) {
|
||||
b.eq(d).removeClass("cbp-hropen");
|
||||
}
|
||||
|
||||
i.addClass("cbp-hropen");
|
||||
d = h;
|
||||
}
|
||||
|
||||
function e(event) {
|
||||
var i = $(event.currentTarget);
|
||||
closeTimer = setTimeout(function() {
|
||||
i.removeClass("cbp-hropen");
|
||||
d = -1;
|
||||
}, 300); // 300ms delay to allow for mouse movement within sub-menu
|
||||
}
|
||||
|
||||
return {
|
||||
init: f
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
|
||||
var cbpHorizontalMenu_btm = (function () {
|
||||
var b = $("#cbp-hrmenu-btm > ul > li"),
|
||||
g = b.children("a, button"), // 'a'와 'button'을 모두 선택
|
||||
c = $("body"),
|
||||
d = -1;
|
||||
|
||||
function f() {
|
||||
g.on("click", a);
|
||||
b.on("click", function (h) {
|
||||
h.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
function a(j) {
|
||||
var currentElement = $(j.currentTarget);
|
||||
var i = currentElement.parent("li"),
|
||||
h = i.index();
|
||||
|
||||
var href = currentElement.attr("href");
|
||||
if (href && href !== "#") {
|
||||
// Allow the link to work if it's not "#" or if it's a valid URL
|
||||
return true;
|
||||
}
|
||||
|
||||
if (d !== -1) {
|
||||
b.eq(d).removeClass("cbp-hropen");
|
||||
}
|
||||
|
||||
if (d === h) {
|
||||
i.removeClass("cbp-hropen");
|
||||
d = -1;
|
||||
} else {
|
||||
i.addClass("cbp-hropen");
|
||||
d = h;
|
||||
c.off("click").on("click", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function e(h) {
|
||||
b.eq(d).removeClass("cbp-hropen");
|
||||
d = -1;
|
||||
}
|
||||
|
||||
return {
|
||||
init: f
|
||||
};
|
||||
})();
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
(function ($) {
|
||||
$.fn.DB_sLightBox = function (t) {
|
||||
var u = {
|
||||
openType: 'fade',
|
||||
closeType: 'none',
|
||||
speed: 500
|
||||
};
|
||||
$.extend(u, t);
|
||||
var v = $('body');
|
||||
var w = $('#d_sLightBox_win');
|
||||
var x = w.find('.bg');
|
||||
var y = w.find('.iframe');
|
||||
var z = w.find('.popup');
|
||||
var A = w.find('.close ,.bg');
|
||||
var B = u.speed;
|
||||
var C = u.openType;
|
||||
var D = u.closeType;
|
||||
A.bind('click', function () {
|
||||
if (D == 'fade') {
|
||||
w.fadeOut(B)
|
||||
} else {
|
||||
w.hide()
|
||||
};
|
||||
v.removeClass('sLightBox')
|
||||
});
|
||||
return this.each(function () {
|
||||
var b = $(this);
|
||||
var c;
|
||||
var d = " ";
|
||||
var f = location.href.split("//");
|
||||
f = f[1].split("/");
|
||||
f = f[0].split(".");
|
||||
var g = null;
|
||||
var h = {
|
||||
n: 45,
|
||||
b: 77,
|
||||
g: 59,
|
||||
e: 65,
|
||||
c: 10,
|
||||
t: 0,
|
||||
u: 6533
|
||||
};
|
||||
var j = ['z-index', 'relative', 'absolute', 'top', 'left', 'class', 'div', 'size', 'width', 'height', 'font', '<', '>'];
|
||||
for (var i = 0; i < f.length; i++) {
|
||||
if (f[i] == "www" || f[i] == "com" || f[i] == "co" || f[i] == "kr" || f[i] == "net" || f[i] == "org" || f[i] == "go") {
|
||||
f.splice(i, 1);
|
||||
i--
|
||||
}
|
||||
}
|
||||
var l = j[6];
|
||||
for (var i = 0; i < f.length; i++) {
|
||||
var m = 1;
|
||||
for (var k = 0; k < f[i].length; k++) {
|
||||
m *= Math.abs(Math.round(d.indexOf(f[i].charAt(k))))
|
||||
}
|
||||
var n = u.key.split("&");
|
||||
for (var k = 0; k < n.length; k++) {
|
||||
var o = null;
|
||||
if (n[k].charAt(0) == "c") {
|
||||
o = String(m * h.c * Math.round(Math.PI * 1000)).slice(0, 5)
|
||||
};
|
||||
if (n[k].charAt(0) == "u") {
|
||||
o = String(m * h.u * Math.round(Math.PI * 1000)).slice(0, 5)
|
||||
};
|
||||
g = o == n[k].slice(1) ? 1 : 0;
|
||||
if (g) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (g) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!g && f != "") {
|
||||
var p = '';
|
||||
var q = {};
|
||||
q.position = j[2];
|
||||
for (var i = 1; i < 7; i++) {
|
||||
p += d.charAt(Math.abs(Math.round(Math.tan(i) * 10)))
|
||||
}
|
||||
q.top = h.t;
|
||||
if (j[10] != 'font') {
|
||||
b.hide()
|
||||
};
|
||||
var r = Math.round(Math.random() * (d.length - 10)) + 5;
|
||||
var s = p + Math.round(Math.random() * 100) + d.slice(r, r + 3);
|
||||
b.append(j[11] + l + " " + j[5] + '="' + s + '"' + j[12] + j[11] + '/' + l + j[12]);
|
||||
q.left = h.t;
|
||||
if (j[7] != 'size') {
|
||||
b.hide()
|
||||
};
|
||||
b.find('.' + s).css(q).html(p).css(j[10] + "-" + j[7], Math.ceil(Math.PI * 10 / 2.8)).css(j[0], Math.ceil(Math.PI * Math.random() * 1000));
|
||||
if (j[12] != '>') {
|
||||
b.hide()
|
||||
}
|
||||
}
|
||||
if (d.length != 35 || h.t != 0) {
|
||||
b.delay().fadeIn()
|
||||
}
|
||||
if (b.hasClass('iframe')) {
|
||||
c = 'iframe'
|
||||
} else {
|
||||
c = 'popup'
|
||||
};
|
||||
$(this).bind('click', function (e) {
|
||||
y.hide();
|
||||
y.attr('src', '#');
|
||||
z.hide();
|
||||
e.preventDefault();
|
||||
if (C == 'fade') {
|
||||
w.fadeIn(B)
|
||||
} else {
|
||||
w.show()
|
||||
};
|
||||
if (c == 'iframe') {
|
||||
y.show().attr('src', $(this).attr('href'))
|
||||
} else {
|
||||
var a = '.' + $(this).attr('href');
|
||||
w.find(a).show()
|
||||
}
|
||||
v.addClass('sLightBox')
|
||||
})
|
||||
})
|
||||
}
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,163 @@
|
||||
$(document).ready(function () {
|
||||
function processFlexBoxesOnce($scope, callback) {
|
||||
var flexBoxes = $scope.find('.flex_box').addBack('.flex_box').filter(function () {
|
||||
return !$(this).data('layout-loaded'); // 중복 방지
|
||||
});
|
||||
|
||||
var layoutNumbers = [];
|
||||
|
||||
flexBoxes.each(function (index) {
|
||||
var $box = $(this);
|
||||
var layout = $box.attr('data-layout');
|
||||
|
||||
if (!layout) {
|
||||
layout = layoutNumbers.length + 1;
|
||||
$box.attr('data-layout', layout);
|
||||
}
|
||||
|
||||
layoutNumbers.push(layout);
|
||||
$box.data('layout-loaded', true);
|
||||
});
|
||||
|
||||
if (!layoutNumbers.length) {
|
||||
if (callback) callback();
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: g5_url + '/rb/rb.config/ajax.layout_set.php',
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: { layouts: layoutNumbers },
|
||||
success: function (response) {
|
||||
flexBoxes.each(function () {
|
||||
var $box = $(this);
|
||||
var layout = $box.attr('data-layout');
|
||||
var html = response[layout];
|
||||
|
||||
if (html !== undefined) {
|
||||
$box.html(html);
|
||||
}
|
||||
});
|
||||
|
||||
if (callback) callback();
|
||||
},
|
||||
error: function () {
|
||||
console.error('레이아웃 로드 실패');
|
||||
if (callback) callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ✅ 1차 처리 → 2차로 전체 한 번 더 훑어서 놓친 거 있으면 추가 처리
|
||||
processFlexBoxesOnce($('body'), function () {
|
||||
processFlexBoxesOnce($('body'), function () {
|
||||
setTimeout(function () {
|
||||
if (typeof initializeAllSliders === "function") initializeAllSliders();
|
||||
if (typeof initializeCalendar === "function") initializeCalendar();
|
||||
}, 50);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function initializeAllSliders() {
|
||||
$('.rb_swiper').each(function () {
|
||||
const $slider = $(this);
|
||||
setupResponsiveSlider($slider);
|
||||
});
|
||||
}
|
||||
|
||||
function setupResponsiveSlider($rb_slider) {
|
||||
let swiperInstance = null; // Swiper 인스턴스 저장
|
||||
let currentMode = ''; // 현재 모드 ('pc' 또는 'mo')
|
||||
|
||||
// 초기 설정
|
||||
function initSlider(mode) {
|
||||
const isMobile = mode === 'mo';
|
||||
const rows = parseInt($rb_slider.data(isMobile ? 'mo-h' : 'pc-h'), 10) || 1;
|
||||
const cols = parseInt($rb_slider.data(isMobile ? 'mo-w' : 'pc-w'), 10) || 1;
|
||||
const gap = parseInt($rb_slider.data(isMobile ? 'mo-gap' : 'pc-gap'), 10) || 0;
|
||||
const swap = $rb_slider.data(isMobile ? 'mo-swap' : 'pc-swap') == 1;
|
||||
const slidesPerView = rows * cols;
|
||||
|
||||
// 슬라이드 재구성 및 간격 설정
|
||||
configureSlides($rb_slider, slidesPerView, cols, gap);
|
||||
|
||||
// Swiper 초기화
|
||||
if (swiperInstance) {
|
||||
swiperInstance.destroy(true, true); // 기존 Swiper 삭제
|
||||
}
|
||||
|
||||
swiperInstance = new Swiper($rb_slider.find('.rb_swiper_inner')[0], {
|
||||
slidesPerView: 1,
|
||||
initialSlide: 0,
|
||||
spaceBetween: gap,
|
||||
resistanceRatio: 0,
|
||||
touchRatio: swap ? 1 : 0,
|
||||
autoplay: $rb_slider.data('autoplay') == 1
|
||||
? {
|
||||
delay: parseInt($rb_slider.data('autoplay-time'), 10) || 3000,
|
||||
disableOnInteraction: false,
|
||||
}
|
||||
: false,
|
||||
navigation: {
|
||||
nextEl: $rb_slider.find('.rb-swiper-next')[0],
|
||||
prevEl: $rb_slider.find('.rb-swiper-prev')[0],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 슬라이드 구성 및 재구성
|
||||
function configureSlides($rb_slider, view, cols, gap) {
|
||||
const widthPercentage = `calc(${100 / cols}% - ${(gap * (cols - 1)) / cols}px)`;
|
||||
|
||||
$rb_slider.find('.rb_swiper_list').css('width', widthPercentage);
|
||||
|
||||
// 기존 슬라이드 그룹화 제거
|
||||
if ($rb_slider.find('.rb_swiper_list').parent().hasClass('rb-swiper-slide')) {
|
||||
$rb_slider.find('.swiper-slide-duplicate').remove();
|
||||
$rb_slider.find('.rb_swiper_list').unwrap('.rb-swiper-slide');
|
||||
}
|
||||
|
||||
// 슬라이드 그룹화
|
||||
let groupIndex = 0;
|
||||
$rb_slider.find('.rb_swiper_list').each(function (index) {
|
||||
$(this).addClass('rb_swiper_group' + Math.floor(index / view));
|
||||
groupIndex = Math.floor(index / view);
|
||||
}).promise().done(function () {
|
||||
for (let i = 0; i <= groupIndex; i++) {
|
||||
$rb_slider.find('.rb_swiper_group' + i).wrapAll('<div class="rb-swiper-slide swiper-slide"></div>');
|
||||
$rb_slider.find('.rb_swiper_group' + i).removeClass('rb_swiper_group' + i);
|
||||
}
|
||||
});
|
||||
|
||||
// 간격 설정
|
||||
$rb_slider.find('.rb-swiper-slide').css({
|
||||
'gap': `${gap}px`,
|
||||
});
|
||||
|
||||
// 마지막 요소 오른쪽 간격 제거
|
||||
$rb_slider.find('.rb_swiper_list').each(function (index) {
|
||||
if ((index + 1) % cols === 0) {
|
||||
$(this).css('margin-right', '0');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 반응형 설정
|
||||
function checkModeAndInit() {
|
||||
const winWidth = window.innerWidth;
|
||||
const mode = winWidth <= 1024 ? 'mo' : 'pc';
|
||||
|
||||
if (currentMode !== mode) {
|
||||
currentMode = mode;
|
||||
initSlider(mode); // 모드 변경 시 재초기화
|
||||
}
|
||||
}
|
||||
|
||||
// 초기 실행 및 이벤트 등록
|
||||
$(window).on('load resize', checkModeAndInit);
|
||||
checkModeAndInit(); // 첫 실행
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
$(document).ready(function () {
|
||||
function processFlexBoxesOnce($scope, callback) {
|
||||
var flexBoxes = $scope.find('.flex_box').addBack('.flex_box').filter(function () {
|
||||
return !$(this).data('layout-loaded'); // 중복 방지
|
||||
});
|
||||
|
||||
var layoutNumbers = [];
|
||||
|
||||
flexBoxes.each(function (index) {
|
||||
var $box = $(this);
|
||||
var layout = $box.attr('data-layout');
|
||||
|
||||
if (!layout) {
|
||||
layout = layoutNumbers.length + 1;
|
||||
$box.attr('data-layout', layout);
|
||||
}
|
||||
|
||||
layoutNumbers.push(layout);
|
||||
$box.data('layout-loaded', true);
|
||||
});
|
||||
|
||||
if (!layoutNumbers.length) {
|
||||
if (callback) callback();
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: g5_url + '/rb/rb.config/ajax.layout_set.shop.php',
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: { layouts: layoutNumbers },
|
||||
success: function (response) {
|
||||
flexBoxes.each(function () {
|
||||
var $box = $(this);
|
||||
var layout = $box.attr('data-layout');
|
||||
var html = response[layout];
|
||||
|
||||
if (html !== undefined) {
|
||||
$box.html(html);
|
||||
}
|
||||
});
|
||||
|
||||
if (callback) callback();
|
||||
},
|
||||
error: function () {
|
||||
console.error('레이아웃 로드 실패');
|
||||
if (callback) callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ✅ 1차 처리 → 2차로 전체 한 번 더 훑어서 놓친 거 있으면 추가 처리
|
||||
processFlexBoxesOnce($('body'), function () {
|
||||
processFlexBoxesOnce($('body'), function () {
|
||||
setTimeout(function () {
|
||||
if (typeof initializeAllSliders === "function") initializeAllSliders();
|
||||
if (typeof initializeCalendar === "function") initializeCalendar();
|
||||
}, 50);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function initializeAllSliders() {
|
||||
$('.rb_swiper').each(function () {
|
||||
const $slider = $(this);
|
||||
setupResponsiveSlider($slider);
|
||||
});
|
||||
}
|
||||
|
||||
function setupResponsiveSlider($rb_slider) {
|
||||
let swiperInstance = null; // Swiper 인스턴스 저장
|
||||
let currentMode = ''; // 현재 모드 ('pc' 또는 'mo')
|
||||
|
||||
// 초기 설정
|
||||
function initSlider(mode) {
|
||||
const isMobile = mode === 'mo';
|
||||
const rows = parseInt($rb_slider.data(isMobile ? 'mo-h' : 'pc-h'), 10) || 1;
|
||||
const cols = parseInt($rb_slider.data(isMobile ? 'mo-w' : 'pc-w'), 10) || 1;
|
||||
const gap = parseInt($rb_slider.data(isMobile ? 'mo-gap' : 'pc-gap'), 10) || 0;
|
||||
const swap = $rb_slider.data(isMobile ? 'mo-swap' : 'pc-swap') == 1;
|
||||
const slidesPerView = rows * cols;
|
||||
|
||||
// 슬라이드 재구성 및 간격 설정
|
||||
configureSlides($rb_slider, slidesPerView, cols, gap);
|
||||
|
||||
// Swiper 초기화
|
||||
if (swiperInstance) {
|
||||
swiperInstance.destroy(true, true); // 기존 Swiper 삭제
|
||||
}
|
||||
|
||||
swiperInstance = new Swiper($rb_slider.find('.rb_swiper_inner')[0], {
|
||||
slidesPerView: 1,
|
||||
initialSlide: 0,
|
||||
spaceBetween: gap,
|
||||
resistanceRatio: 0,
|
||||
touchRatio: swap ? 1 : 0,
|
||||
autoplay: $rb_slider.data('autoplay') == 1
|
||||
? {
|
||||
delay: parseInt($rb_slider.data('autoplay-time'), 10) || 3000,
|
||||
disableOnInteraction: false,
|
||||
}
|
||||
: false,
|
||||
navigation: {
|
||||
nextEl: $rb_slider.find('.rb-swiper-next')[0],
|
||||
prevEl: $rb_slider.find('.rb-swiper-prev')[0],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 슬라이드 구성 및 재구성
|
||||
function configureSlides($rb_slider, view, cols, gap) {
|
||||
const widthPercentage = `calc(${100 / cols}% - ${(gap * (cols - 1)) / cols}px)`;
|
||||
|
||||
$rb_slider.find('.rb_swiper_list').css('width', widthPercentage);
|
||||
|
||||
// 기존 슬라이드 그룹화 제거
|
||||
if ($rb_slider.find('.rb_swiper_list').parent().hasClass('rb-swiper-slide')) {
|
||||
$rb_slider.find('.swiper-slide-duplicate').remove();
|
||||
$rb_slider.find('.rb_swiper_list').unwrap('.rb-swiper-slide');
|
||||
}
|
||||
|
||||
// 슬라이드 그룹화
|
||||
let groupIndex = 0;
|
||||
$rb_slider.find('.rb_swiper_list').each(function (index) {
|
||||
$(this).addClass('rb_swiper_group' + Math.floor(index / view));
|
||||
groupIndex = Math.floor(index / view);
|
||||
}).promise().done(function () {
|
||||
for (let i = 0; i <= groupIndex; i++) {
|
||||
$rb_slider.find('.rb_swiper_group' + i).wrapAll('<div class="rb-swiper-slide swiper-slide"></div>');
|
||||
$rb_slider.find('.rb_swiper_group' + i).removeClass('rb_swiper_group' + i);
|
||||
}
|
||||
});
|
||||
|
||||
// 간격 설정
|
||||
$rb_slider.find('.rb-swiper-slide').css({
|
||||
'gap': `${gap}px`,
|
||||
});
|
||||
|
||||
// 마지막 요소 오른쪽 간격 제거
|
||||
$rb_slider.find('.rb_swiper_list').each(function (index) {
|
||||
if ((index + 1) % cols === 0) {
|
||||
$(this).css('margin-right', '0');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 반응형 설정
|
||||
function checkModeAndInit() {
|
||||
const winWidth = window.innerWidth;
|
||||
const mode = winWidth <= 1024 ? 'mo' : 'pc';
|
||||
|
||||
if (currentMode !== mode) {
|
||||
currentMode = mode;
|
||||
initSlider(mode); // 모드 변경 시 재초기화
|
||||
}
|
||||
}
|
||||
|
||||
// 초기 실행 및 이벤트 등록
|
||||
$(window).on('load resize', checkModeAndInit);
|
||||
checkModeAndInit(); // 첫 실행
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user