(function($) {
$('.main-slider').on('init', function(event, slick) {
$('.main-slider').find('.slick-current').removeClass('slick-active').addClass('reset-animation');
setTimeout( function() {
$('.main-slider').find('.slick-current').removeClass('reset-animation').addClass('slick-active');
}, 1);
});
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', vh + 'px');
window.addEventListener('resize', function () {
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', vh + 'px');
});
// ¸ÞÀÎ ºñÁÖ¾ó ½½¶óÀÌ´õ
$('.main-slider').slick({
fade:true,
slidesToShow: 1,
draggable:true,
speed:1200,
lazyLoad: true,
autoplay: true,
dots: true,
autoplaySpeed:4000,
pauseOnFocus:false,
pauseOnHover:false,
pauseOnDotsHover:false,
pauseOnArrowsHover:false,
appendArrows:$('.arrow-con > .arrows'),
prevArrow:'',
nextArrow:'',
});
$('.main-slider').on('touchstart', e => {
$('.main-slider').slick('slickPlay');
});
// OUR WORK ½½¶óÀÌ´õ
$('.single-item').slick({
dots: false,
centerMode: true,
slidesToShow: 1,
autoplay: true,
speed: 1200,
autoplaySpeed: 2500,
dots: true,
lazyLoad: false,
pauseOnFocus:false,
pauseOnHover:false,
arrows: true,
});
// À¯Æ©ºê ½½¶óÀÌ´õ
$('.youtube-item').slick({
dots: false,
centerMode: true,
centerPadding: '10px',
slidesToShow: 3,
autoplay: true,
speed: 1200,
autoplaySpeed: 2500,
dots: true,
lazyLoad: false,
pauseOnFocus:false,
pauseOnHover:false,
arrows: true,
responsive: [
{
breakpoint: 520,
settings: {
centerMode: true,
centerPadding: '0px',
slidesToShow: 1.7,
arrows: false,
}
}
]
});
// ¾ÏÄ¡·á¸ñÇ¥ ÁÖº¯È¯°æ
$('.slider-for').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: '.slider-nav',
lazyLoad: false,
autoplay: true,
speed: 1200,
autoplaySpeed: 2500,
});
$('.slider-nav').slick({
slidesToShow: 5.5,
slidesToScroll: 1,
asNavFor: '.slider-for',
dots: true,
centerMode: true,
focusOnSelect: true,
autoplay: true,
speed: 1200,
autoplaySpeed: 2500,
responsive: [
{ breakpoint: 768, // ȸéÀÇ ³ÐÀÌ°¡ 768px ÀÌ»óÀÏ ¶§
settings: {
slidesToShow: 3,
slidesToScroll: 1
}},
{ breakpoint: 480, // ȸéÀÇ ³ÐÀÌ°¡ 320px ÀÌ»óÀÏ ¶§
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
$(function() {
$('.dropdown > .caption').on('click', function() {
$(this).parent().toggleClass('open');
});
$('.dropdown > .list > .item').on('click', function() {
$('.dropdown > .list > .item').removeClass('selected');
});
$(document).on('keyup', function(evt) {
if ( (evt.keyCode || evt.which) === 27 ) {
$('.dropdown').removeClass('open');
}
});
$(document).on('click', function(evt) {
if ( $(evt.target).closest(".dropdown > .caption").length === 0 ) {
$('.dropdown').removeClass('open');
}
});
});
$('.footer-select').on('click','.placeholder',function(){
var parent = $(this).closest('.footer-select');
if ( ! parent.hasClass('is-open')){
parent.addClass('is-open');
$('.footer-select.is-open').not(parent).removeClass('is-open');
}else{
parent.removeClass('is-open');
}
}).on('click','ul>li',function(){
var parent = $(this).closest('.footer-select');
parent.removeClass('is-open').find('.placeholder').text( $(this).text() );
});
$(".nav-mobile-button").click(function() {
$('.nav-mobile-bar').toggleClass('active');
$('.nav-mobile-menu').toggleClass('active');
});
var currentScrollTop = 0;
window.onload = function() {
scrollController();
$(window).on('scroll', function() {
scrollController();
});
}
function scrollController() {
currentScrollTop = $(window).scrollTop();
if (currentScrollTop < 0.1) {
$('#blog-header-container').css('top', -(currentScrollTop));
$('.main-menu').css('top', 0.1-(currentScrollTop));
if ($('.main-menu').hasClass('fixed')) {
$('.main-menu').removeClass('fixed');
$('.main-menu .menu-icon').removeClass('on');
}
} else {
if (!$('.main-menu').hasClass('fixed')) {
$('#blog-header-container').css('top', -0.1);
$('.main-menu').css('top', 0);
$('.main-menu').addClass('fixed');
$('.main-menu .menu-icon').addClass('on');
}
}
}
jQuery(document).ready(function($){
var current_path =window.location.pathname;
console.log(current_path);
$('.submenu ul li a[href="'+current_path+'"]').addClass('active');
var search = window.location.search;
$('.sul_menu div a[href="'+current_path+search+'"]').parent().addClass('on');
});
$(document).ready(function(){
$("#go-top").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 0.2) {
$('#go-top').fadeIn();
} else {
$('#go-top').fadeOut();
}
});
$('#go-top a').click(function () {
$('body,html').animate({
scrollTop: 0
});
return false;
});
});
});
$(document).ready(function(){
$(".quick").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 0) {
$('.quick').fadeIn();
} else {
$('.quick').fadeOut();
}
});
/*$('.quick a').click(function () {
$('body,html').animate({
scrollTop: 0
});
return false;
});*/
});
});
jQuery(document).ready(function($){
var current_path =window.location.pathname;
console.log(current_path);
$('.sul_menu ul li a[href="'+current_path+'"]').addClass('active');
var code = getParameter('com_board_category_code')
if (code) {
code = code.split("c")[1]
$('.sul_menu a').eq(code).addClass("active_menu")
} else {
$('.sul_menu a').eq(0).addClass("active_menu") }
function getParameter(name) {
var half = location.search.split(name + '=')[1];
return half !== undefined ? decodeURIComponent(half.split('&')[0]) : null;
}
});
// FAQ
$(".open").click(function() {
var container = $(this).parents(".faq-box");
var answer = container.find(".answer");
var trigger = container.find(".faq-t");
answer.slideToggle(200);
if (trigger.hasClass("faq-o")) {
trigger.removeClass("faq-o");
} else {
trigger.addClass("faq-o");
}
if (container.hasClass("expanded")) {
container.removeClass("expanded");
} else {
container.addClass("expanded");
}
});
jQuery(document).ready(function($) {
$('.question').each(function() {
$(this).attr('data-search-term', $(this).text().toLowerCase() + $(this).find("ptag").text().toLowerCase());
});
$('.live-search-box').on('keyup', function() {
var searchTerm = $(this).val().toLowerCase();
$('.question').each(function() {
if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
$(this).parent().parent().show();
} else {
$(this).parent().parent().hide();
}
});
});
});
$(function(){
var $refreshButton = $('#refresh');
var $results = $('#css_result');
function refresh(){
var css = $('style.cp-pen-styles').text();
$results.html(css);
}
refresh();
$refreshButton.click(refresh);
// Select all the contents when clicked
$results.click(function(){
$(this).select();
});
});
})(jQuery);
(function($){
$('.banner-animation .slider').slick({
dots: false,
infinite: false,
speed: 2500,
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
swipe: false,
swipeToScroll: false,
autoplay:false,
autoplaySpeed: 2500,
responsive: [
{
breakpoint: 992,
settings: {
swipe: true,
swipeToScroll: true,
infinite: true
}
},
]
});
$('.nav-text .change').hover(function(){
var hoveredElement = $(this);
var parentElement = hoveredElement.closest('.banner-animation');
//get data attribute to tell us which bottom bar to set active
var type = hoveredElement.data('change');
//get the offset for the clicked element to know how far from the edge the element is so we can set additional bars correctly
var offsetLeft = hoveredElement.offset().left;
//calculate right offset
var windowWidth = $(window).outerWidth();
var barWidth = hoveredElement.outerWidth();
var offsetRight = ((windowWidth - barWidth) - offsetLeft);
//get how many bars are before and after the selected element
var beforeBars = parentElement.children('.nav-bottom').children('li.change-'+type).prevAll();
var afterBars = parentElement.children('.nav-bottom').children('li.change-'+type).nextAll();
var beforeBarsCount = beforeBars.length;
var afterBarsCount = afterBars.length;
var beforeBarWidth = (offsetLeft / beforeBarsCount);
var afterBarWidth = (offsetRight / afterBarsCount);
beforeBars.each(function(){
$(this).css({'width':beforeBarWidth+'px'});
});
afterBars.each(function(){
$(this).css({'width':afterBarWidth+'px'});
});
$('.nav-bottom li.change-'+type).stop().css('width',barWidth+'px').delay(100).queue(function(){
$(this).css('height', '20px');
hoveredElement.css('margin-top','-20px');
});
parentElement.children('.slider').children('.slick-list').children('.slick-track').children('.slick-slide').css('opacity', 0).removeClass('slick-active');
parentElement.children('.slider').children('.slick-list').children('.slick-track').children('.slick-slide[data-slick-index="'+(type - 1)+'"]').css('opacity', 1).addClass('slick-active');;
}, function(){
var hoveredElement = $(this);
var parentElement = hoveredElement.closest('.banner-animation');
parentElement.children('.nav-bottom').children('li').stop().css({'height':'8px', 'width':'100%'});
$('.nav-text .change').stop().css({'margin-top':'0'});
parentElement.children('.slider').children('.slick-list').children('.slick-track').children('.slick-slide').css('opacity', 0).removeClass('slick-active');
parentElement.children('.slider').children('.slick-list').children('.slick-track').children('.slick-slide[data-slick-index="0"]').css('opacity', 1).addClass('slick-active');
});
})(jQuery);