PageSourceSearch

https://centplanet.jp/static/original/fanclub/js/home.js

js centplanet.jp collected 2026-10-06 02:18:08 UTC 4,043 bytes, 171 lines download raw bytes

1function parallax() {
2  var parallaxBkImg = function(){
3    $(window).on('load resize', function() {
4      $(window).on('load scroll', function(){
5        var $winTop = $(window).scrollTop();
6        var $target = $('.block--ph');
7        var $winWidth = $(window).width();
8        if($winWidth < 960) {
9          $target.each(function(index){
10            var $position = $winTop - $target.eq(index).offset().top;
11            if($winTop > $target.eq(index).offset().top - 500) {
12              $target.eq(index).css({
13                'background-position-y': $position * .2
14              });
15            }
16          });
17        }
18      });
19    });
20  }();
21}
22
23// slider_banner
24function sliderBanner(){
25  $(window).on('load', function(){
26
27    var $wrapper = $(".section--banner .swiper-wrapper");
28    var bnrImg = $wrapper.find("li").length;
29    if(bnrImg >= 2){
30      var mySwiper1 = new Swiper('.swiper1', {
31        loop: true,
32        speed: 800,
33        slidesPerView: 1.25,
34        spaceBetween: 16,
35        centeredSlides: true,
36        autoplay: {
37          delay: 3000,
38          disableOnInteraction: false,
39        },
40        navigation: {
41          nextEl: '.swiper-button-next',
42          prevEl: '.swiper-button-prev',
43        },
44        watchOverflow: false,
45        breakpoints: {
46          961: {
47            slidesPerView: 3.15,
48            spaceBetween: 28,
49          },
50        },
51      });
52      imagesLoaded('.swiper1', function() {
53        mySwiper1.update();
54        mySwiper1.autoplay.start();
55      });
56      $('.swiper-button-next, .swiper-button-prev').removeClass('swiper-button-disabled');
57    } else if(bnrImg == 1){
58      $('.section--banner').addClass('one-swiper');
59      var mySwiper1 = new Swiper('.swiper1', {
60        loop: false,
61        autoplay: false,
62      });
63    } else {
64      $('.section--banner').addClass('no-swiper');
65    }
66  });
67}
68
69
70
71
72// slider info Sp only
73function sliderInfo(){
74  if (window.matchMedia( "(max-width: 960px)" ).matches){
75    var tab = new Swiper('.tab-content', {
76      //タブコンテンツ
77      slidesPerView: 1,
78      autoHeight: true, 
79      
80      //タブメニュー
81      thumbs: {
82          swiper: {
83              el: '.tab-menu',
84              slidesPerView: 3,
85          }
86      },
87    });
88  }
89}
90
91// slider_video
92function sliderVideo(){
93  $(window).on('load', function(){
94    var bnrImg = $(".section--video .swiper-wrapper li").length;
95    if(bnrImg > 1){
96      var mySwiper2 = new Swiper('.swiper2', {
97        slidesPerView: 1,
98        speed: 800,
99        centeredSlides : true,
100        navigation: {
101          nextEl: '.swiper-button-next',
102          prevEl: '.swiper-button-prev'
103        },
104      });
105    }else{
106      $('.section--video').addClass('no-swiper');
107    }
108  });
109}
110
111
112// slider_blog info Sp only
113function sliderBlog(){
114  if (window.matchMedia( "(max-width: 960px)" ).matches){
115    var bnrImg = $(".blog .swiper-wrapper li").length;
116    if(bnrImg > 1){
117      var mySwiper3 = new Swiper('.swiper3', {
118        slidesPerView: 1,
119        spaceBetween: 10,
120        width: 283,
121        breakpoints: {
122          755: {
123            width: 580,
124          },
125        },
126      });
127    }else if(bnrImg == 1){ 
128      $('.list--topcontents__blog').addClass('one-swiper');
129    }else{
130      $('.list--topcontents__blog').addClass('no-swiper');
131    }
132  }
133}
134
135
136//support
137function supportList(){
138  $('.list--support-tit').on('click', function () {
139    $(this).toggleClass('open');
140    $(this).next().slideToggle();
141  });
142}
143
144// popup
145function popup(){
146var popup = document.getElementById("popup");
147if (popup) {
148    document.body.classList.add("popup-is-visible");
149
150    var closeBtn = popup.querySelector(".popup__close");
151    if (closeBtn) {
152        closeBtn.addEventListener("click", function () {
153            popup.style.display = "none";
154            document.body.classList.remove("popup-is-visible");
155        });
156    }
157}
158}
159
160$(function(){
161  // loading();
162  parallax();
163  sliderBanner();
164  sliderInfo();
165  sliderVideo();
166  sliderBlog();
167  supportList();
168  popup();
169});
170
171

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.