PageSourceSearch

https://www.smbc-gp.co.jp/stera/tap/assets/js/common.js?ver=2606

js smbc-gp.co.jp collected 2026-09-24 17:20:32 UTC 13,785 bytes, 532 lines download raw bytes

1//デバイス判定
2//----------------------------------------------
3function isRangeSP() {
4  var $window = $(window);
5  var winW = $window.width();
6  var clientW = document.documentElement.clientWidth,
7    winW = window.innerWidth ? window.innerWidth : (winW ? winW : clientW);
8  return (winW <= 767) ? true : false;
9}
10
11
12//スクロールアニメ
13//----------------------------------------------
14function registScroll(){
15
16  //汎用処理
17  ScrollTrigger.batch('.js-scroll-in', {
18    start: 'top 70%',
19    markers: false,
20    onEnter: batch => $(batch).addClass('is-show'),
21    once: true
22  });
23  
24  var $wrapper = $("body");
25  ScrollTrigger.create({
26    trigger: ".p-about",
27    start: '0 0%',
28    end: '95% 100%',
29    markers: false,
30    onEnter: () => {
31      $wrapper.addClass('is-contents');
32    },
33    onLeaveBack : () => {
34      $wrapper.removeClass('is-contents');
35    },
36  });
37}
38
39
40//グロナビ
41//----------------------------------------------
42function gnav() {
43  var $body = $("body");
44  var $elm = $("#js-gnav-switch");
45  var $nav = $(".l-gnav");
46  var openClass = "is-gnav-open";
47  if(!$elm.length) {return false;}
48
49  $elm.click(function(eo){
50    eo.preventDefault();
51    $body.toggleClass(openClass);
52    if($body.hasClass(openClass)) {
53      $nav.stop().fadeIn();
54    }else {
55      $nav.stop().fadeOut();
56    }
57  });
58
59  $(".js-gnav-close").add($nav.find('a[href^="#anc"]')).click(function(){
60    $body.removeClass(openClass);
61    $nav.stop().fadeOut();
62  });
63
64}
65
66//高さ揃え
67//----------------------------------------------
68function heightline(){
69  $('.js-heightline').each(function(){
70    $(this).find('.js-heightline__item').matchHeight();
71  })
72}
73
74
75//モーダル
76//----------------------------------------------
77function modal(){
78  var $modal = $(".js-modal");
79  $('.js-privacy_modal').click(function(){
80    $modal.fadeIn();
81  });
82  $('.js-modal-close').click(function(){
83    $modal.fadeOut();
84  });
85}
86
87
88
89//動画用モーダル
90//----------------------------------------------
91function movie_modal() {
92  var $switch = $('.js-modal-youtube');
93  if(!$switch.length) {return false;}
94
95  $switch.on('click', function () {
96    //scroll_stop();
97    set_movie($(this));
98    return false;
99  });
100
101  function close_movie() {
102    //scroll_restart();
103    var $modal = $('.js-movie-modal');
104    $modal.remove();
105  }
106
107  function set_movie($switch) {
108    var source = '<div class="js-movie-modal">';
109    source += '<div class="js-movie-bg"></div>';
110    source += '<div id="movie-content" class="js-movie-content movie-content">';
111    source += '<div id="api-box">';
112    source += '</div>';
113    source += '<div class="js-movie-close"></div>';
114    source += '</div>';
115    source += '</div>';
116    $('.l-wrapper').append(source);
117    var ytid = $switch.attr('data-youtube');
118    setTimeout(function () {
119      var $modal = $('.js-movie-modal');
120      $modal.find('.js-movie-bg').css({
121        'opacity': 0.9
122      });
123      $modal.find('.js-movie-close').on('click', function () {
124        close_movie();
125        return false;
126      });
127      $modal.find('.js-movie-bg').on('click', function () {
128        close_movie();
129        return false;
130      });
131      setTimeout(function () {
132        $modal.find('#api-box').append('<iframe src="' + 'https://www.youtube.com/embed/' + ytid + '?autoplay=1&playsinline=1&rel=0' + '" frameborder="0" allow="aaccelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"></iframe>');
133        $modal.find('.movie-content').css({
134          'opacity': 1
135        });
136      }, 300);
137    });
138  }
139
140};
141
142//スムーススクロール
143//----------------------------------------------
144function smooth_scroll(){
145  var $elm = $('.js-smoothscroll');
146  var $header = $(".l-header__wrap");
147  $elm.on("click.scroll",function(){
148    var $this = $(this);
149    var href = $this.attr("href");
150    var target = $(href);
151    var header_H = $header.outerHeight(true);
152
153
154    //アコーディオンを開く
155    if(href.indexOf("#faq-item") > -1) {
156      $(href).addClass("is-open");
157      $(".js-accordion__contents",href).show();
158    }
159
160    if(target) {
161      var position = target.offset().top;
162      $("html, body").animate({
163        scrollTop: position - header_H
164      },500,function(){
165        $(window).trigger("scroll");
166      });
167      return false;
168    }
169
170  });
171
172}
173
174//汎用アコーディオン
175//----------------------------------------------
176function accordion() {
177  var $root = $(".js-accordion");
178  $root.each(function(){
179    var $this = $(this);
180    var $switch = $(".js-accordion__switch",$this);
181    var $contents = $(".js-accordion__contents",$this);
182    $switch.click(function(eo){
183      $this.toggleClass("is-open");
184      var $toggle_text = $(this).find("[data-toggletext]");
185      if($toggle_text.length) {
186        var new_text = $toggle_text.attr("data-toggletext");
187        var old_text = $toggle_text.text();
188        $toggle_text.text(new_text).attr("data-toggletext",old_text);
189      }
190      $contents.stop().slideToggle(function(){
191        var $slider = $contents.find(".slick-initialized");
192        if($slider.length) {
193          $slider.slick('setPosition');
194        }
195      });
196    });
197  });
198}
199
200
201
202//useスライダー
203//----------------------------------------------
204function useSlider() {
205
206  //使い方スライダー
207  if($('.js-use-slider').length) {
208    new Swiper('.js-use-slider', {
209      loop: false,
210      speed: 500,
211      slidesPerView: 1,
212      spaceBetween:10,
213      centeredSlides:true,
214      breakpoints: {
215        768: {//PC体裁のとき
216          spaceBetween:80,
217          slidesPerView: 2
218        }
219      },
220      navigation: {
221        nextEl: '.use-button-next',
222        prevEl: '.use-button-prev'
223      }
224    });
225  }
226
227
228  //使い方スライダー iphone
229  if($('.js-iphone-use-slider').length) {
230    new Swiper('.js-iphone-use-slider', {
231      loop: false,
232      speed: 500,
233      slidesPerView: 1,
234      spaceBetween:10,
235      centeredSlides:true,
236      breakpoints: {
237        768: {//PC体裁のとき
238          spaceBetween:0,
239          slidesPerView: 1
240        }
241      },
242      navigation: {
243        nextEl: '.p-iphone-use-button-next',
244        prevEl: '.p-iphone-use-button-prev'
245      }
246    });
247  }
248
249}
250
251//事例スライダー
252//----------------------------------------------
253function caseSlider() {
254
255  if($('.js-case-slider').length) {
256    new Swiper('.js-case-slider', {
257      loop: false,
258      speed: 500,
259      slidesPerView: 1,
260      spaceBetween:10,
261      centeredSlides:true,
262      breakpoints: {
263        768: {//PC体裁のとき
264          centeredSlides:false,
265          spaceBetween:25,
266          slidesPerView: 3
267        }
268      },
269      navigation: {
270        nextEl: '.p-case-button-next',
271        prevEl: '.p-case-button-prev'
272      }
273    });
274  }
275
276}
277
278//MV
279//----------------------------------------------
280function mv_init() {
281
282  if(!$(".p-mv").length) {return false;}
283
284  var activeClass = "is-show";
285  var dulation = 300;
286  var basetime = 250;
287  $(".p-mv__text_sub").addClass(activeClass);
288  $(".p-mv__text_main").addClass(activeClass);
289  
290  setTimeout(function(){
291    $(".p-mv__logo").addClass(activeClass);
292  },dulation);
293  
294  setTimeout(function(){
295    $(".p-mv__picture.is-item04").addClass(activeClass);
296  },dulation+=basetime);
297  
298  setTimeout(function(){
299    $(".p-mv__picture.is-item02").addClass(activeClass);
300    $(".p-mv__picture.is-item03").addClass(activeClass);
301  },dulation+=basetime);
302  
303  
304  setTimeout(function(){
305    $(".p-mv__picture.is-item05").addClass(activeClass);
306    $(".p-mv__picture.is-item01").addClass(activeClass);
307  },dulation+=basetime);
308  
309
310  setTimeout(function(){
311    $(".p-mv__badge").addClass(activeClass);
312  },dulation+=basetime + basetime);
313
314
315
316  gsap.to('.p-mv__picture.is-item01 img', {
317    y:"-10%",
318    scrollTrigger: {
319      start: '0% 0%',
320      trigger: '.p-mv__layout',
321      markers: false,
322      scrub: 4,
323    }
324  });
325
326  gsap.to('.p-mv__picture.is-item02 img', {
327    y:"-5%",
328    scrollTrigger: {
329      start: '0% 0%',
330      trigger: '.p-mv__layout',
331      markers: false,
332      scrub: 4,
333    }
334  });
335
336  gsap.to('.p-mv__picture.is-item03 img', {
337    y:"-40%",
338    scrollTrigger: {
339      start: '0% 0%',
340      trigger: '.p-mv__layout',
341      markers: false,
342      scrub: 3,
343    }
344  });
345
346  gsap.to('.p-mv__picture.is-item04 img', {
347    y:"-2%",
348    scrollTrigger: {
349      start: '0% 0%',
350      trigger: '.p-mv__layout',
351      markers: false,
352      scrub: 2,
353    }
354  });
355
356  gsap.to('.p-mv__picture.is-item05 img', {
357    y:"-20%",
358    scrollTrigger: {
359      start: '0% 0%',
360      trigger: '.p-mv__layout',
361      markers: false,
362      scrub: 4,
363    }
364  });
365
366}
367
368
369//クエリ付与が確認できた場合に要素を非表示にする関数
370//----------------------------------------------
371function query_hidden() {
372  const $elm = $(".js-query-hidden");
373  if(!$elm.length) {return false;}
374
375  const referralCode_obj = GET_REFERRALCODE();
376
377  //オブジェクトのすべての値を取得し、全てがnullか確認
378  function areAllPropertiesNull(obj) {
379    return Object.values(obj).every(value => value === null);
380  }
381
382  //クエリ付与が確認出来たら対象要素を非表示
383  if(!areAllPropertiesNull(referralCode_obj)) {
384    $elm.hide();
385  }
386
387}
388
389
390
391//entrymodule
392//エントリーモーダル一式
393//----------------------------------------------
394function entry_module() {
395
396  //モーダル
397  function init_modal() {
398    const $modalWrap = $(".js-entry-modal");
399    const $modalSwitch = $(".js-entry-modal-switch");
400    const $modalClose = $(".js-entry-modal-close");
401    const $modalOverlay = $(".js-entry-modal-overlay");
402    const fixclass = "is-entrymodal-open";
403    const referralCode_obj = GET_REFERRALCODE();
404    const currentUrl = window.location.pathname;
405
406    //旧クエリ何れかが存在する場合は、モーダルモードを継続
407    // nullまたは空文字列の場合にtrueを返す関数
408    function isNullOrEmpty(val) {
409      return val === null || val === "";
410    }
411
412    if(
413      isNullOrEmpty(referralCode_obj["referralCode"]) &&
414      isNullOrEmpty(referralCode_obj["smeCode"]) &&
415      isNullOrEmpty(referralCode_obj["smeCode_iphone"]) &&
416      isNullOrEmpty(referralCode_obj["referralCode_iphone"]) &&
417      isNullOrEmpty(referralCode_obj["referralCode_jadd"]) &&
418      isNullOrEmpty(referralCode_obj["smeCode_jadd"]) &&
419      !currentUrl.includes('/entry/')
420    ) {
421      //それ以外はref3モード
422      //refCode3を取得し、有無によって条件分岐 存在しない場合はデフォルト値を利用
423      const refCode3 = referralCode_obj["referralCode3"] ? referralCode_obj["referralCode3"] : "";
424      const refCode3_button = $(".js-entry-refcode3"); //refCode3用のボタン
425      const refCode3_legacytarget = $(".js-entry-refcode3--to-hidden"); //暫定 非表示化したい要素に付与する
426      const ref3url = `https://steraweb.smbc-gp.co.jp/account-register?${refCode3}`;
427      if(refCode3 !== "") {
428        refCode3_button.attr("href", ref3url);
429      }
430      refCode3_button.removeClass("is-hidden");
431      refCode3_legacytarget.hide();
432      return;
433
434    }
435
436
437    //モーダル発火ボタン
438    $modalSwitch.click(function(){
439      $("body").addClass(fixclass);
440      $modalWrap.fadeIn();
441    });
442
443    //バブリング対策
444    $(".p-global-entry-modal__inner").click(function(eo){
445      eo.stopPropagation();
446    });
447
448    function modal_close() {
449      $modalWrap.fadeOut(function(){
450        $(".js-entry-check").prop("checked",false);
451        $(".js-entry-btn").addClass("is-disabled");
452      });
453      $("body").removeClass(fixclass);
454    }
455
456    //オーバーレイ閉じるボタン
457    $modalOverlay.click(function(){
458      modal_close();
459    });
460
461    //閉じるボタン
462    $modalClose.click(function(){
463      modal_close();
464    });
465
466
467    //大阪LP
468    function flowchange(){
469      const $default_modal = $("#entry_default");
470      const $ref_modal = $("#entry_ref");
471      const $sme_modal = $("#entry_sme");
472      const $ref_modal_switch = $(".js-entry_ref_switch");
473      const $sme_modal_switch = $(".js-entry_sme_switch");
474      const $return_modal_switch = $(".js-entry_return_switch");
475
476      $ref_modal_switch.click(function(){
477        $default_modal.hide();
478        $ref_modal.fadeIn();
479      });
480
481      $sme_modal_switch.click(function(){
482        $default_modal.hide();
483        $sme_modal.fadeIn();
484      });
485    
486      $return_modal_switch.click(function(){
487        $ref_modal.hide();
488        $sme_modal.hide();
489        $default_modal.fadeIn();
490      });
491    }
492    flowchange();
493
494  }
495  init_modal();
496
497  //smeボタンの活性化処理
498  function toggle_check() {
499    const $entry_check = $(".js-entry-check");
500    const $entry_btn = $(".js-entry-btn");
501    $entry_check.change(function(){
502      if($entry_check.prop("checked") === true) {
503        $entry_btn.removeClass("is-disabled");
504      }else {
505        $entry_btn.addClass("is-disabled");
506      }
507    });
508  }
509  toggle_check();
510}
511
512
513//init
514//----------------------------------------------
515$(function(){
516  registScroll();
517  smooth_scroll();
518  gnav();
519  accordion();
520  modal();
521  useSlider();
522  caseSlider();
523  mv_init();
524  movie_modal();
525  query_hidden();
526  entry_module();
527});
528
529//高さ揃え
530$(window).on("load",function(){
531  heightline();
532});

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.