$('.aos').children('*:not(div)').attr('aos', 'fade-top')
$('.aos').children('*:not(div)').attr('aos-delay', '150')
$('.fixed_delivery').css('display', 'flex');
var disable = false;
// if (document.documentelement.clientwidth < 1024) {
// disable = true;
// }
aos.init({
easing: 'ease-out-back',
disable: disable ? 'mobile' : false,
duration: 2000
});
var all_mobile = 768;
if (document.queryselector('#my-scrollbar')) {
var scrollbar = window.scrollbar;
scrollbar.initall({ damping: 0.08 })
var scrollbar = scrollbar.get(document.queryselector('#my-scrollbar'))
scrollbar.addlistener((status) => {
aos.refresh();
window.pageyoffset = scrollbar.scrolltop;
let scroll = window.pageyoffset;
if (document.queryselector('.public_banner')) {
var parallax = document.queryselectorall('.parallax')
var speed = scroll * +0.8
for (let i = 0; i < parallax.length; i++) {
parallax[i].style.transform = 'translate3d(0px, ' + speed + 'px, 0px)'
}
if (scroll >= document.queryselector('.public_banner').clientheight - (document.queryselector('.header').clientheight / 2)) {
$('.header').addclass('on')
}else {
$('.header').removeclass('on')
}
}
});
}
$(document).ready(function () {
if (document.body.clientwidth > all_mobile) {
$('.header .l').addclass('animated fadeindown')
$('.header .r').addclass('animated fadeindown').css('animation-delay','200ms')
// $('.header .nav a').each(function (i,e) {
// var delay = i * 80 + 80
// $(this).css('animation-delay', delay + 'ms')
// })
// $('.header .keep_right').addclass('animated fadeindown').css('animation-delay','660ms')
// $('.header .flex_r .click_menu').addclass('animated fadeindown').css('animation-delay','810ms')
// $('.header .flex_r .click').addclass('animated fadeindown').css('animation-delay','810ms')
}
})
// if($(window).width()<1024){
// $('#fullpage').attr('id','')
// }
if (document.queryselector('#fullpage')&&$(window).width()>1024) {
$('*[aos]').addclass('aos-init')
settimeout(function () {
$('.section').eq(0).find('.aos-init').each(function () {
$(this).addclass('aos-animate');
})
},20)
var length = $('#fullpage .section').length;
var anchor = [];
for (let i = 1; i <= length; i++) {
anchor.push('page'+i)
}
$('#fullpage').fullpage({
scrollingspeed: 1600,
anchors: anchor,
easingcss3: 'cubic-bezier(0.42,0,0,0.99)',
navigationposition: 'right',
// responsivewidth: 900,
responsivewidth: 1025,
responsiveslides: true,
menu: "#menu",
onleave: function (section, origin, destination, direction) {
if (screen.width > all_mobile) {
settimeout(() => {
$('.aos-init').removeclass('aos-animate');
$('.section').eq(origin.index).find('.aos-init').each(function () {
$(this).addclass('aos-animate');
})
}, 200)
}
var length = $('#fullpage .section').length - 1
if (origin.index === length) {
settimeout(function () {
$('.aos-init').addclass('aos-animate');
},210)
}
if ($('#fullpage .section').eq(origin.index).is('.add')) {
settimeout(function () {
$('.header').addclass('on')
},600)
}else {
$('.header').removeclass('on')
}
if ($('#fullpage .section').eq(origin.index).is('.add_on')) {
$('.header').addclass('half_on')
}else {
$('.header').removeclass('half_on')
}
},
});
}
var banner = new swiper('.banner .swiper', {
speed: 1000,
effect: 'fade',
allowtouchmove: false,
init:false,
autoplay: {
delay: 4000,
disableoninteraction: false,
},
on: {
init() {
settimeout(function () {
$('.banner .swiper .swiper-slide:first-child').addclass('on')
},10)
if (document.documentelement.clientwidth > 1024) {
var this_swiper = this
, video = this.slides[0].queryselector('video');
!!video && this.autoplay.stop();
video.play();
document.queryselector('.banner .swiper').queryselectorall('video').foreach(e => e.addeventlistener('ended', function () {
this_swiper.slidenext()
}))
}
},
slidechange() {
$('.banner .swiper .swiper-slide').removeclass('on').eq(this.activeindex).addclass('on')
$('.banner .swiper .swiper-slide').eq(this.activeindex).removeclass('unset').siblings().addclass('unset')
if (document.documentelement.clientwidth > 1024) {
var video = this.slides[this.realindex].queryselector('video');
var prev_video = this.slides[this.previousindex].queryselector('video');
!!video ? this.autoplay.stop() : this.autoplay.start();
!!prev_video && prev_video.pause();
settimeout(function () {
!!prev_video && (prev_video.currenttime = 0);
!!video && (video.currenttime = 0);
}, 500)
!!video && video.play();
}
}
}
})
$('.banner .swiper .button .iconfont:nth-child(1)').click(function () {
var length = banner.slides.length - 1;
if (banner.realindex === length) {
banner.slideto(0)
} else {
banner.slidenext()
}
})
$('.banner .swiper .button .iconfont:nth-child(2)').click(function () {
var length = banner.slides.length
if (banner.realindex === 0) {
banner.slideto(length)
}else {
banner.slideprev()
}
})
$('.banner .content .text p, .banner .content .pick p').each(function (index, ele) {
if($('html[lang="en"]').length>0){
return
}
var $span = $(ele).find('span');
var text = $(ele).html();
if ($span.length === 0) {
var textarray = text.split('');
var html = '';
for (var i in textarray) {
html += '
' + textarray[i] + '
';
}
$(ele).html(html);
} else {
var spantext = $span.html();
var spantextarray = spantext.split('');
var spanhtml = '';
for (var i in spantextarray) {
spanhtml += '' + spantextarray[i] + '
';
}
$span.html(spanhtml);
}
$(ele).contents().filter(function() {
return this.nodetype === 3;
}).each(function() {
var text = $(this).text();
var textarray = text.split('');
var html = '';
for (var i in textarray) {
html += '' + textarray[i] + '
';
}
$(this).replacewith(html);
});
$(ele).find('div').each(function (index, ele) {
let delay = index * 0.08 + 0.3;
// if($('html[lang="en"]').length>0){
// if($(ele).text()==' '){
// $(ele).css({
// 'transition-delay': delay + 's',
// 'opacity': '0',
// 'transform': 'translatex(10px)',
// 'min-width': '10px'
// });
// }else{
// $(ele).css({
// 'transition-delay': delay + 's',
// 'opacity': '0',
// 'transform': 'translatex(10px)',
// });
// }
// }else{
$(ele).css({
'transition-delay': delay + 's',
'opacity': '0',
'transform': 'translatex(10px)',
'min-width': '10px'
});
// }
});
});
if (document.queryselector('.public_banner')) {
obj2 = new splittext($('.public_banner .wrap .content .text'), {type: "chars"});
var tl = new timelinemax();
tl.add("start");
var speed = 1.6 / obj2.chars.length
tl.staggerfrom(obj2.chars, 1, {
opacity: 0,
x: 30,
// transformorigin: "0% 50%",
// ease: back.easeout
}, speed,"start");
$('.public_banner .wrap .position a').addclass('animated fadeinup_')
$('.public_banner .wrap .position a').each(function (index, ele) {
$(ele).css({
'animation-delay': index * 200 + 'ms'
})
})
}
$('.fixed_delivery .wrap .clone,.fixed_delivery .mask').click(function () {
$('.fixed_delivery .wrap').removeclass('on').addclass('hide')
settimeout(function () {
$('.fixed_delivery').removeclass('on')
settimeout(function () {
$('.fixed_delivery .wrap').removeclass('on hide')
},200)
},500)
})
settimeout(function () {
$('.menu_background').css('display', 'flex')
var wrap = $('.menu_background .wrap.pc')
var height = $(wrap).height();
$(wrap).css('height', height + 'px')
$('.menu_background .wrap.pc .item .leve').each(function (t, e) {
$(e).css('display', 'none')
$(e).find('a').addclass('animated fadeinup')
$(e).find('a').each(function (t, e) {
var delay = t * 0.1 + 0.05;
$(e).css('animation-delay', delay + 's')
})
})
if($(window).width()>1024){
$('.menu_background .wrap.pc .item').hover(function () {
$(this).addclass('on').siblings().removeclass('on')
})
}
$('.header .r .menu .show').click(function () {
$('.menu_background').addclass('on')
$('.header').addclass('click_on')
if (document.queryselector('#fullpage')) {
if($(window).width()<=1024){
$('body').addclass('active')
}else{
$.fn.fullpage.setallowscrolling(false);
}
}
gsap.delayedcall(.1, (() => {
var e;
(gsap.to(".overlay-nav", {autoalpha: 1}), (e = gsap.timeline()).to(".overlay-nav_path", {
duration: .8,
ease: "power4.in",
attr: {d: "m 0 0 v 50 q 50 100 100 50 v 0 z"}
}, 0), e.to(".overlay-nav_path", {
duration: .3,
ease: "power2",
attr: {d: "m 0 0 v 100 q 50 100 100 100 v 0 z"}
}))
}))
})
$('.header .r .head_clone').click(function () {
if($(window).width()<=1024){
$('body').removeclass('active')
}
$('.menu_background').removeclass('on')
settimeout(function () {
$('.header').removeclass('click_on')
},800)
if (document.queryselector('#fullpage')) {
if($(window).width()<=1024){
$('body').removeclass('active')
}else{
$.fn.fullpage.setallowscrolling(true);
}
}
gsap.delayedcall(.1, (() => {
var e;
((e = gsap.timeline()).to("body", {}), e.to(".overlay-nav_path", {
duration: .8,
ease: "power4.in",
attr: {d: "m 0 0 v 50 q 50 0 100 50 v 0 z"}
}, "-=0.6"), e.to(".overlay-nav_path", {
duration: .3,
ease: "power2",
attr: {d: "m 0 0 v 0 q 50 0 100 0 v 0 z"},
oncomplete: () => {
gsap.to(".overlay-nav", {autoalpha: 0})
}
}))
}))
})
},10)
var footer_swiper = new swiper('footer .swiper', {
speed: 1000,
pagination: {
el: 'footer .swiper-pagination',
clickable: true,
},
})
var matter_swiper = new swiper('.matter_swiper', {
speed: 1000,
loop: true,
spacebetween:0,
slidesperview:1,
parallax: true,
initialslide: 1,
centeredslides: true,
navigation: {
nextel: '.responsibility .wrap .content .content .button .iconfont:nth-child(2)',
prevel: '.responsibility .wrap .content .content .button .iconfont:nth-child(1)',
},
breakpoints:{
541:{
slidesperview: 3,
spacebetween: -250,
}
}
})
var solve_swiper = new swiper('.solve_swiper', {
speed: 1200,
slidesperview: 3,
spacebetween: 387,
initialslide: 0,
centeredslides: true,
slidetoclickedslide: true,
navigation: {
nextel: '.section2 .wrap .button .iconfont:nth-child(1)',
prevel: '.section2 .wrap .button .iconfont:nth-child(2)',
},
})
var back_swiper = new swiper('.back_swiper', {
speed: 1000,
effect: 'fade',
initialslide: 0,
})
solve_swiper.controller.control = back_swiper;
back_swiper.controller.control = solve_swiper;
var index_news_swiper = new swiper('.index_news_swiper', {
speed: 1000,
spacebetween: 30,
loop: true,
navigation: {
nextel: '.section3 .wrap .left .joke .content .button .iconfont:nth-child(2)',
prevel: '.section3 .wrap .left .joke .content .button .iconfont:nth-child(1)',
},
})
$('.public_banner .solution .choose .hide .l a').hover(function () {
$('.public_banner .solution .choose .hide .r .img').removeclass('on').eq($(this).index()).addclass('on')
})
$('.menu_background .wrap .item .head').click(function(){
$(this).toggleclass('active')
$(this).parent().siblings().children('.item').removeclass('active')
$(this).parent().siblings().children('.leve').hide(500)
$(this).siblings('.leve').stop().toggle(500)
})
$('footer .top .wrap .l .list.pe .item .head').click(function(){
$(this).parent().siblings('.item').children('.head').removeclass('active')
$(this).parent().siblings('.item').children('.leve').stop().hide(500)
$(this).toggleclass('active')
$(this).siblings('.leve').stop().toggle(500)
})
$('.menu_background .wrap .item .head a').click(function(e){
e.stoppropagation()
})
$('footer .top .wrap .l .list.pe .item .head a').click(function(e){
e.stoppropagation()
})