$(function(){ $(window).scroll(function(){ if($(window).scrollTop() > 156){ $('.header02').stop().animate({'top':0}); }else{ $('.header02').stop().animate({'top':-102},1); } }); $('#gHeader .menu').click(function(){ $('#gHeader .dropMenu').addClass('dropMenuShow'); $('#gHeader .dropMenu .lLink').fadeIn(400); $('.cover').animate({'left':0},400,function(){ $('#gHeader .dropMenu .close').fadeIn(300); $('#gHeader .dropMenu .rLink').animate({'right':0,'opacity':1},300); $('#gHeader .dropMenu .topLink').show().animate({'bottom':85,'opacity':1},300); }); }); $('#gHeader .dropMenu .close').click(function(){ $('.cover').animate({'left':'-100%'},500,function(){ $('#gHeader .dropMenu').removeClass('dropMenuShow'); }); $(this).fadeOut(500); $('#gHeader .dropMenu .lLink').fadeOut(500); $('#gHeader .dropMenu .rLink').animate({'right':'-50%','opacity':0},500); $('#gHeader .dropMenu .topLink').animate({'bottom':0,'opacity':0},300,function(){ $(this).hide(); }); return false; }); }); // hamburger window.onload = function () { var nav = document.getElementById('nav-wrapper'); var hamburger = document.getElementById('js-hamburger'); //var blackBg = document.getElementById('js-black-bg'); hamburger.addEventListener('click', function () { nav.classList.toggle('open'); }); /** blackBg.addEventListener('click', function () { nav.classList.remove('open'); }); **/ }; // When it reaches a certain height, a class is assigned. $(function () { $(window).on("scroll", function () { const sliderHeight = $(".mv").height(); if (sliderHeight - 30 < $(this).scrollTop()) { $(".js-header").addClass("headerColorScroll"); } else { $(".js-header").removeClass("headerColorScroll"); } }); }); // This is the source code for the video popup. (function () { if ($(".js-modal-video").length) { $(".js-modal-video").modalVideo({ channel: "youtube", youtube: { controls: 0, }, }); } })(); // When the element is displayed, it animates. $(window).scroll(function (){ $(".anime").each(function(){ var offset = $(this).offset().top; var scroll = $(window).scrollTop(); var wHeight = $(window).height(); var threshold; if (window.matchMedia("(max-width: 768px)").matches) { threshold = wHeight / 4; } else { threshold = wHeight / 3; } if (scroll > offset - wHeight + threshold){ $(this).addClass("show"); } }); $(".fadeIn").each(function(){ var offset = $(this).offset().top; var scroll = $(window).scrollTop(); var wHeight = $(window).height(); var threshold; if (window.matchMedia("(max-width: 768px)").matches) { threshold = wHeight / 4; } else { threshold = wHeight / 3; } if (scroll > offset - wHeight + threshold){ $(this).addClass("show"); } }); }); // Top Mv Anim $(window).on("load", function () { if ( $('#main').length ) { $('#main').addClass('show'); } }); $(function () { if ($('#js-topics-slider').length) { $('#js-topics-slider').slick({ centerMode: true, slidesToShow: 1, speed: 800, arrows: false, dots: false, autoplaySpeed: 4000, autoplay: true, infinite: true, variableWidth: true, pauseOnFocus: false, responsive: [ { breakpoint: 768, arrows: true, settings: { variableWidth: false, slidesToShow: 2, } }, { breakpoint: 420, arrows: true, settings: { variableWidth: false, slidesToShow: 1, } }, ] }); } }); // Special Slider $(function () { if ( $('#js-special-slider').length ) { $('#js-special-slider').slick({ slidesToShow: 2.5, speed: 800, arrows: false, dots: true, autoplaySpeed: 3000, autoplay: true, infinite: false, pauseOnFocus: false, responsive: [ { breakpoint: 959, settings: { slidesToShow: 1.5, } }, { breakpoint: 768, settings: { slidesToShow: 1, } }, ] }); } }); // Video Slider $(function () { if ( $('#js-video-slider').length ) { $('#js-video-slider').slick({ centerMode: true, centerPadding: 0, slidesToShow: 1, speed: 800, arrows: false, dots: true, autoplaySpeed: 5000, autoplay: true, infinite: true, variableWidth: true, pauseOnFocus: false, responsive: [ { breakpoint: 1100, settings: { centerPadding: '40px', variableWidth: false, } }, { breakpoint: 768, settings: { centerPadding: '10px', variableWidth: false, } }, ] }); } });