'use strict'; /*============================================================ スライドショー ============================================================ */ let mySwiper01 = new Swiper ('.swiper01', { loop: false, //trueなら最後に達したら先頭に戻る slidesPerView:1.1, //ページネーション表示の設定 pagination: { el: '.swiper-pagination', //ページネーションの要素 type: "fraction", // 枚数表示 clickable: true, //クリックに反応させる }, //ナビゲーションボタン(矢印)表示の設定 navigation: { nextEl: '.swiper-button-next', //「次へボタン」要素の指定 prevEl: '.swiper-button-prev', //「前へボタン」要素の指定 }, //スクロールバー表示の設定 scrollbar: { el: '.swiper-scrollbar', //要素の指定 draggable: true, }, spaceBetween: 15, // スライド間の余白(px) }); let mySwiper02 = new Swiper ('.swiper-youtube', { loop: true, //trueなら最後に達したら先頭に戻る //ページネーション表示の設定 pagination: { el: '.swiper-pagination', //ページネーションの要素 type: "fraction", // 枚数表示 clickable: true, //クリックに反応させる }, //ナビゲーションボタン(矢印)表示の設定 navigation: { nextEl: '.swiper-button-next', //「次へボタン」要素の指定 prevEl: '.swiper-button-prev', //「前へボタン」要素の指定 }, centeredSlides : true, spaceBetween: 15, // スライド間の余白(px) slidesPerView:1.2, breakpoints: { 767: { slidesPerView: 2.5, } }, }); let mySwiper03 = new Swiper ('.swiper-liveimage', { loop: true, //trueなら最後に達したら先頭に戻る //ページネーション表示の設定 pagination: { el: '.swiper-pagination', //ページネーションの要素 type: "fraction", // 枚数表示 clickable: true, //クリックに反応させる }, //ナビゲーションボタン(矢印)表示の設定 navigation: { nextEl: '.swiper-button-next', //「次へボタン」要素の指定 prevEl: '.swiper-button-prev', //「前へボタン」要素の指定 }, centeredSlides : true, spaceBetween: 15, // スライド間の余白(px) slidesPerView:1.2, breakpoints: { 767: { slidesPerView: 1.2, } }, }); let worldDetailSwiper = new Swiper('.world-detail-content', { loop: true, //trueなら最後に達したら先頭に戻る centeredSlides : true, spaceBetween: 15, // スライド間の余白(px) slidesPerView:1, breakpoints: { 767: { slidesPerView: 1, } }, }); let artistInfoSwiper = new Swiper('.swiper-artist', { loop: true, //ページネーション表示の設定 pagination: { el: '.swiper-pagination', //ページネーションの要素 type: "fraction", // 枚数表示 clickable: true, //クリックに反応させる }, //ナビゲーションボタン(矢印)表示の設定 navigation: { nextEl: '.swiper-button-next', //「次へボタン」要素の指定 prevEl: '.swiper-button-prev', //「前へボタン」要素の指定 }, centeredSlides : true, spaceBetween: 15, // スライド間の余白(px) slidesPerView:1.2, breakpoints: { 767: { slidesPerView: 1.2, } }, }); $(function () { $('.world-detail .modal-open').click(function() { const index = $('.world-detail .modal-open').index(this) + 1; worldDetailSwiper.slideTo(index) }) }) /*============================================================ ハンバーガーメニュー ============================================================ */ $(function () { var ham = $('#js-hamburger'); var nav = $('#js-nav'); var wrap = $('.contents-wrapper'); //モーダルウィンドウを出現させるクリックイベント $(document).on('click', '#js-hamburger', function(){ //キーボード操作などにより、オーバーレイが多重起動するのを防止する $(this).blur(); //ボタンからフォーカスを外す if ($("#modal-overlay-nav")[0]) return false; //新しくモーダルウィンドウを起動しない (防止策1) var dElm = document.documentElement; //オーバーレイを出現させる $("body").append(''); $("#modal-overlay-nav").fadeIn("slow"); ham.addClass('active'); nav.addClass('active'); wrap.addClass('active'); //コンテンツをセンタリングする centeringModalSyncer(); //[#modal-overlay-nav]、または[#js-hamburger]をクリックしたら… $("#modal-overlay-nav, #js-hamburger").unbind().click(function () { ham.removeClass('active'); nav.removeClass('active'); //[#modal-overlay-nav]をフェードアウトした後に… $("#modal-overlay-nav").fadeOut("slow", function () { //[#modal-overlay-nav]を削除する $('#modal-overlay-nav').remove(); wrap.removeClass('active'); }); }); //もしメインコンテンツのタブをクリックしたら $('a[href^="#"]').on('click', function() { ham.removeClass('active'); nav.removeClass('active'); //[#modal-overlay-nav]をフェードアウトした後に… $("#modal-overlay-nav").fadeOut("slow", function () { //[#modal-overlay-nav]を削除する $('#modal-overlay-nav').remove(); wrap.removeClass('active'); }); return false; //a要素のリンク先移動防ぐ }); }); //リサイズされたら、センタリングをする関数[centeringModalSyncer()]を実行する $(window).resize(centeringModalSyncer); //センタリングを実行する関数 function centeringModalSyncer() { //画面(ウィンドウ)の幅、高さを取得 var w = $(window).width(); var h = $(window).height(); // コンテンツ(.modal-content)の幅、高さを取得 var cw = $(".modal-content").outerWidth(); var ch = $(".modal-content").outerHeight(); //センタリングを実行する $( ".modal-content" ).css( {"left": ((w - cw)/2) + "px","top": ((h - ch)/2) + "px"} ) ; } return false; }); /*============================================================ パララックス ============================================================ */ $(function() { var rellax = new Rellax('.js-rellax'); }); /*============================================================ アーティスト切り替え ============================================================ */ $(function() { $('.artist-tab').click(function(){ const $root = $(this).parents('.artist-box'); $root.find('.artist-tab.active').removeClass('active'); $(this).addClass('active'); $root.find('.artist-contents.show').removeClass('show'); const index = $(this).index(); $root.find(".artist-contents").eq(index).addClass('show'); return false; }); }); /*============================================================ チケットインフォメーション ============================================================ */ $(function() { $('.ticket-tab').click(function(){ $('.ticket-tab.active').removeClass('active'); $(this).addClass('active'); $('.ticket-contents.show').removeClass('show'); const index = $(this).index(); $('.ticket-contents').eq(index).addClass('show'); }); }); /*============================================================ スムーズscroll ============================================================ */ $(document).ready(function () { $('a[href^="#"]').click(function () { var speed = 800; var href = $(this).attr("href"); var target = $(href === "#" || href === "" ? 'html' : href); var position = target.offset().top; $("html, body").animate({ scrollTop: position }, speed, "swing"); return false; }); }); /*============================== object fit ==============================*/ $(function () { objectFitImages(); }); /*============================== アコーディオン ==============================*/ $(function () { var flg = 0; $(".campaign-acd-ctt:not(.is-open)").hide(); $(".campaign-acd-ttl").on("click", function (e) { e.preventDefault(); //aタグのリンク無効化 if (flg == 0) { flg = 1; var trigger = $(this); var parent = trigger.closest(".campaign-acd"); var target = parent.children(".campaign-acd-ctt"); if (trigger.hasClass("is-open")) { closeAccordion(trigger, parent, target); } else { openAccordion(trigger, parent, target); } setTimeout(function () { flg = 0; }, 300); } }); function openAccordion(trigger, parent, target) { var overlay = parent.parent().children(".overlay"); overlay.animate({ opacity: 0, 'z-index': -1 }, 100 ); trigger.addClass("is-open"); trigger.children(".campaign-acd-icon").addClass("is-open"); target.addClass("is-open"); parent.addClass("is-open"); target.slideDown(300); } function closeAccordion(trigger, parent, target) { var overlay = parent.parent().children(".overlay"); overlay.animate({ opacity: 1, 'z-index': 1 }, 100 ); trigger.removeClass("is-open"); trigger.children(".campaign-acd-icon").removeClass("is-open"); target.removeClass("is-open"); parent.removeClass("is-open"); target.slideUp(300); } }); /*============================== アコーディオン ==============================*/ $(function(){ var pagetop = $('.scroll-top'); pagetop.hide(); $(window).scroll(function () { if ($(this).scrollTop() > 100) { pagetop.fadeIn(); } else { pagetop.fadeOut(); } }); pagetop.click(function () { $('body, html').animate({ scrollTop: 0 }, 500); return false; }); });