// JavaScript Document
$(function (){
	$('btnmenu').on('click',function(){
		$('header menus').slideToggle();		
	});
    if ($('.slick_carousel').length){
        $('.slick_carousel').slick({
          responsive: [
          {
            breakpoint: 8000,
            settings: {
              arrows: false,
              autoplay:false,
              dots: false,
              slidesToShow: 3,
              slidesToScroll: 1,
              adaptiveGeught:true,
              speed: 1000,
            }
          },	
          {
            breakpoint: 1024,
            settings: {
              arrows: true,
              autoplay:true,
              dots: true,
              slidesToShow: 3,
              slidesToScroll: 1,
              adaptiveGeught:true,
              centerMode: true,
              speed: 1000,
            }
          },	
          {
            breakpoint: 767,
            settings: {
              arrows: true,
              autoplay:true,
              dots: true,
              slidesToShow: 2,
              slidesToScroll: 1,
              adaptiveGeught:true,
              centerMode: true,
              speed: 1000,
            }
          },	
          {
            breakpoint: 767,
              settings: {
              arrows: true,
              autoplay:true,
              dots: true,
              slidesToShow: 1,
              slidesToScroll: 1,
              adaptiveGeught:true,
              centerPadding: "20%",
              centerMode: true,
              speed: 1000,
            }
          },
          ]
        });
    }
    if ($('.slick_slide').length){
        $('.slick_slide').slick({
          responsive: [
              {
            breakpoint: 8000,
            settings: {
              arrows: true,
              autoplay:true,
              dots: true,
              adaptiveGeught:true,
              centerPadding: "20%",
              centerMode: true,
              speed: 1000,
            }
          },	
          {
            breakpoint: 767,
            settings: {
                autoplay:true,
                arrows: true, // 前・次のボタンを表示する
                dots: true, // ドットナビゲーションを表示する
                speed: 1000, // スライドさせるスピード（ミリ秒）
                slidesToShow: 1, // 表示させるスライド数
            }
          },
          ]
        });
    }
	if ($('.slick_fade').length){
        $('.slick_fade').slick({
			autoplay:true,
			arrows: false, // 前・次のボタンを表示する
			dots: false, // ドットナビゲーションを表示する
			speed: 3000, // スライドさせるスピード（ミリ秒）
			slidesToShow: 1, // 表示させるスライド数
			fade:true,
			pauseOnFocus:false,
			pauseOnHover:false,
			pauseOnDotsHover:false,
			swipe:false,
        });
    }
    $(window).on('load scroll resize',function (){
		var scroll = $(window).scrollTop(); //スクロール量を取得
		var height = $(window).height(); //ウィンドウの高さを取得
			//ターゲットまでスクロールするとフェードインする
		if( scroll > 60){
			$('header').addClass('scrolls');
            $('#headlogo').attr("src", "/assets/images/logo_white.svg");
            $('btnmenu').css("color","white");
		}else{
			$('header').removeClass('scrolls');
            $('#headlogo').attr("src", "/assets/images/logo_blue.svg");
            $('btnmenu').css("color","#525252");
		}
		if( scroll > 350){
			$('footer_btn').addClass('show');
		}else{
			$('footer_btn').removeClass('show');
		}
		if(window.outerWidth > 768){
			$('header submenus').hide();
		}else{
			$('header submenus').show();
			$('header').removeClass('scrolls');
            $('btnmenu').css("color","#525252");
			$('#headlogo').attr("src", "/assets/images/logo_blue.svg");
		}
		$('.fadescroll').each(function(){
			//ターゲットの位置を取得
			var target = $(this).offset().top;
			if (scroll > (target - height + 100)){
				//クラスを付与
				$(this).addClass('fadeacrive');
			}
		});
		$('.fadelist').each(function(){
              //ターゲットの位置を取得
              var target = $(this).offset().top;
              if (scroll > (target - height)){
                  //クラスを付与
                  $(this).addClass('fadeacrive');
              }
          });
      });
});