$(function(){
//fullslide
$('#fullpage').fullpage({
navigation: true,
slidesToSections: true,
scrollingSpeed: 1200,
//responsiveWidth: 767,
//scrollOverflow: true,
css3:false,
// **
afterLoad : function(anchorLink, index){
//header 색상변경
if(index == 2 || index == 3 || index == 4 ){
$('header').addClass('fix_style');
}else{
$('header').removeClass('fix_style');
}
if(index == 1 || index == 5 || index == 7){
$('body').addClass('bullet_change');
}else{
$('body').removeClass('bullet_change');
}
//scroll
if(index == 1){
$('#scroll .scrl').removeClass('none');
$('#top_btn .top').addClass('none');
}else{
$('#scroll .scrl').addClass('none');
$('#top_btn .top').removeClass('none');
}
//top
if(index == 2 || index == 3 || index == 4 || index == 5){
$('#top_btn .top').addClass('black');
}else{
$('#top_btn .top').removeClass('black');
}
//motion
if(index == 2){
$(".sec3").addClass("on");
}else if(index == 3){
$(".sec4").addClass("on");
}else if(index == 4){
$(".sec6").addClass("on");
}else if(index == 5){
$(".sec7").addClass("on");
}else if(index == 6){
$('#top_btn').css("display", "none");
}else{
$('#top_btn').css("display", "block");
}
},
// **
onLeave : function(anchorLink, destination, direction, index){
},
});
//section1 slide
const swiper1 = new Swiper('.main_slider', {
effect: 'fade',
autoplay : true,
slidesPerView: 1,
speed: 1600,
loop: true,
navigation: {
nextEl: '.next',
prevEl: '.prev',
},
pagination: {
el: '.paging',
clickable: true,
},
});
//section3 tm_view
var swiper = new Swiper(".platfrom_tm", {
slidesPerView: '1',
speed: 1000,
spaceBetween: 20,
pagination: {
el: ".platform-slide-pagination.swiper-pagination",
type: "progressbar",
},
breakpoints: {
1000: {
slidesPerView: '2',
speed: 1000,
},
},
});
//section4 slide pc
var bullet = ['KINE-101', 'KINE-201', 'KINE-301', 'KINE-401', 'KINE-501'];
var ImgSliderSwiper = new Swiper('.img_slider', {
slidesPerView:'auto',
speed:800,
allowTouchMove:false,
paginationClickable: true,
parallax: true,
loop: false,
});
var TextSliderSwiper = new Swiper('.text_slider', {
loop: false,
effect:"fade",
pagination: {
el: '.swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '
' + (bullet[index]) + '
';
}
},
navigation: {
nextEl: ".sec4 .next.swiper-button-next",
prevEl: ".sec4 .prev.swiper-button-prev",
},
thumbs: {
swiper: ImgSliderSwiper,
},
on: {
transitionStart: function(){
var idx = this.activeIndex;
//aboutImgSwiper.slideTo(idx,800);
ImgSliderSwiper.slideTo(idx, 800, false); // 이미지 슬라이더와 텍스트 슬라이더를 동기화합니다.
},
},
});
// 이미지 슬라이더의 전환 이벤트에 대한 이벤트 리스너를 추가하여 텍스트 슬라이더와 동기화합니다.
ImgSliderSwiper.on('transitionStart', function () {
var idx = this.activeIndex;
TextSliderSwiper.slideTo(idx, 800, false); // 텍스트 슬라이더와 이미지 슬라이더를 동기화합니다.
});
//slide4 tm_slide
var swiper = new Swiper('.pipeline-tm-slide.swiper-container', {
loop: false,
pagination: {
el: '.pipeline-tm-pagination.swiper-pagination',
clickable: true
},
autoplay: {
delay: 3000,
disableOnInteraction: false
},
watchSlidesProgress: false,
});
/*
document.addEventListener('mouseenter', event => {
const el = event.target;
if (el && el.matches && el.matches('.swiper-container')) {
el.swiper.autoplay.stop();
el.classList.add('swiper-paused');
const activeNavItem = el.querySelector('.swiper-pagination-bullet-active');
activeNavItem.style.animationPlayState="paused";
}
}, true);
document.addEventListener('mouseleave', event => {
const el = event.target;
if (el && el.matches && el.matches('.swiper-container')) {
el.swiper.autoplay.start();
el.classList.remove('swiper-paused');
const activeNavItem = el.querySelector('.swiper-pagination-bullet-active');
activeNavItem.classList.remove('swiper-pagination-bullet-active');
setTimeout(() => {
activeNavItem.classList.add('swiper-pagination-bullet-active');
}, 10);
}
}, true);
*/
//news notice slide
const NNSlideswiper = new Swiper(".nnslide", {
grabCursor: false,
slidesPerView: 'auto',
spaceBetween: 30,
loop:false,
pagination: {
el: ".nn-pagination.swiper-pagination",
type: "progressbar",
},
scrollbar: {
el: '.nn-pagination.swiper-pagination-progressbar .swiper-pagination-progressbar-fill',
hide: false,
draggable: false,
},
draggable:true,
mousewheel: false,
//speed: 500,
navigation: {
nextEl: ".nn-next.swiper-button-next",
prevEl: ".nn-prev.swiper-button-prev",
},
breakpoints: {
768: {
slidesPerView: 1,
spaceBetween: 30,
},
1279: {
slidesPerView: 2,
spaceBetween: 50,
},
1500: {
slidesPerView: 3,
spaceBetween: 40,
},
},
});
$(document).on('click', '#top_btn', function(){
$.fn.fullpage.moveTo(1, 1);
});
var mswiper = new Swiper(".mpipe", {
slidesPerView: '1',
speed: 1000,
spaceBetween: 20,
pagination: {
el: ".pp-pagination.swiper-pagination",
type: "progressbar",
},
scrollbar: {
el: '.pp-pagination.swiper-pagination-progressbar .swiper-pagination-progressbar-fill',
hide: false,
draggable: false,
},
});
});