PageSourceSearch

https://www.manana-salon.com/wp-content/themes/manana-salon_theme/assets/js/main.js?

js manana-salon.com collected 2026-09-30 04:20:42 UTC 13,561 bytes, 445 lines download raw bytes

1$(function() {
2  (function($) {
3    var cName;
4    switch (true) {
5      case (window._ua.Tablet):
6        cName = 'tablet';
7        break;
8      case (window._ua.Mobile):
9        cName = 'mobile';
10        break;
11      default:
12        cName = '';
13    }
14    $('body').addClass(cName);
15    var isTouchDevice = (function(d) {
16      var iframe = d.createElement('iframe');
17      d.body.appendChild(iframe);
18      var result = ('ontouchstart' in iframe.contentWindow);
19      d.body.removeChild(iframe);
20      return result;
21    })(document);
22    if (!isTouchDevice) {
23      $('body').addClass('touch-disabled');
24    }
25  })($)
26
27  var headerHeight = 0;
28  var headerOffset = 0;
29  var footerOffset = 0;
30  $('header').addClass('low');
31  $('footer').addClass('low');
32  $('.pagetop').hide().addClass('hidden');
33
34  var ua = navigator.userAgent;
35  if (ua.indexOf('Android') !== -1) {
36    $('.menu_icon a').addClass('fix');
37  }
38  if (ua.indexOf('iPhone') !== -1 || ua.indexOf('iPad') !== -1) {
39    $('.parallax').addClass('ios');
40  }
41
42  // scrollbar
43  var scrollbarWidth = window.innerWidth - document.body.clientWidth;
44
45  // sp gnav
46  $('.menu_icon a').on('click', function(e) {
47    e.preventDefault();
48    $(this).toggleClass('close').parent().prev()
49    $('body').removeClass('down').addClass('up');
50    $(this).closest('header').toggleClass('menu_open');
51  });
52
53  // gnav
54  var navi_event = 'click';
55  if ($('.global_nav').css('list-style-position') === 'inside') {
56    navi_event =
57      (!$('body.mobile').length && !$('body.tablet').length) ?
58      'mouseenter mouseleave' : 'touchend';
59    $('.has_under').on('click', function(e) {
60      var tagName = e.target.tagName.toLowerCase();
61      if (!tagName === 'a' || $(e.target.parentNode).hasClass('has_under')) {
62        e.preventDefault();
63      }
64    });
65  }
66  $('.has_under').on(navi_event, function(e) {
67    var tagName = e.target.tagName.toLowerCase();
68    if (tagName === 'a' && !$(e.target.parentNode).hasClass('has_under')) {
69      return;
70    }
71    e.preventDefault();
72    var $self = $('>a', $(this));
73    //var $self = $(this);
74    if (!$self.hasClass('menu_under_open') && $('.menu_under_open').length) {
75      $('.menu_under_open')
76        .removeClass('menu_under_open')
77        .next().stop().slideToggle(200);
78    }
79    $self.toggleClass('menu_under_open');
80    $self.next().stop().slideToggle(200);
81  });
82  $('.gnav_search>a').on('click', function(e) {
83    e.preventDefault();
84    //$(this).toggleClass('menu_under_open');
85    $(this).next().slideToggle(200);
86  });
87
88  // pagetop
89  $('.pagetop a').on('click', function(e) {
90    e.preventDefault();
91    $('html, body').animate({
92      scrollTop: 0
93    });
94  });
95
96  // iOS svg tap fix
97  if ($('body.mobile').length || $('body.tablet').length) {
98    $('header .title a').on('touchend', function(e) {
99      e.preventDefault();
100      location.href = this.href;
101    });
102  }
103
104  // swipebox
105  if ($.isFunction($().swipebox)) {
106    var swipebox = $('.swipebox').swipebox();
107    $(document).on('click touchend', '#swipebox-overlay', function(e) {
108      e.preventDefault();
109      if ($(e.target).hasClass('slide')) $.swipebox.close();
110    })
111  }
112
113  // slider
114  if ($.isFunction($().sliderPro)) {
115    var sliderDefaults = {
116      center: {
117        width: 1000,
118        height: 450,
119        slideDistance: 0,
120        visibleSize: '100%',
121        arrows: true,
122        fadeArrows: false,
123        autoScaleLayers: false,
124        breakpoints: {}
125      },
126      wide: {
127        width: '100%',
128        autoHeight: true,
129        slideDistance: 0,
130        arrows: true,
131        fadeArrows: false,
132        fade: true,
133        autoScaleLayers: false,
134        touchSwipe: false,
135        breakpoints: {}
136      },
137      contents: {
138        width: 450,
139        height: 300,
140        aspectRatio: 1.5,
141        slideDistance: 10,
142        visibleSize: '100%',
143        arrows: true,
144        fadeArrows: false,
145        buttons: false,
146        fadeCaption: false,
147        breakpoints: {}
148      }
149    };
150    $('.slider-pro').each(function() {
151      var opt = $(this).data();
152      var number_of_slide = $(this).find('.sp-slide').length;
153      $(this).addClass(opt.type || 'center');
154      if (!this.hasAttribute('data-type')) {
155        return true;
156      }
157      var options = $.extend(true, (sliderDefaults[opt.type] || sliderDefaults.center), {});
158      if (opt.width) {
159        options.width = opt.width
160      }
161      if (opt.height) {
162        options.height = opt.height
163      }
164      if (typeof opt.distance !== 'undefined') {
165        options.slideDistance = opt.distance
166      }
167      if (opt.type == 'contents') {
168        if (opt.width || opt.height) {
169          options.aspectRatio = Math.round(options.width / options.height * 100) / 100;
170        }
171        if (number_of_slide % 2 === 0) {
172          options.visibleSize = options.width * (number_of_slide - 1) + options.slideDistance * (number_of_slide - 2);
173        }
174      }
175      if (typeof opt.autoplay !== 'undefined') {
176        options.autoplay = opt.autoplay
177      }
178      if (typeof opt.arrows !== 'undefined') {
179        switch (opt.arrows) {
180          case false:
181            options.arrows = false;
182            $(this).addClass('disable-arrows');
183            break;
184          case 'pc-only':
185            var bp = 768 - scrollbarWidth - 1;
186            options.breakpoints[bp] = options.breakpoints[bp] || {};
187            options.breakpoints[bp].arrows = false;
188            $(this).addClass('sp-disable-arrows');
189            break;
190        }
191      }
192      if (typeof opt.buttons !== 'undefined') {
193        switch (opt.buttons) {
194          case false:
195            options.buttons = false;
196            break;
197          case 'pc-only':
198            var bp = 768 - scrollbarWidth - 1;
199            options.breakpoints[bp] = options.breakpoints[bp] || {};
200            options.breakpoints[bp].buttons = false;
201            break;
202        }
203      }
204      $(this).sliderPro(options);
205    });
206  }
207
208  $('.slide_scroll').click(function(e) {
209    e.preventDefault();
210    var pos = $(this).closest('section').next().offset().top;
211    $('html, body').animate({
212      scrollTop: pos
213    });
214  });
215
216  // Q&A
217  $('.question').next('.answer').hide();///追加
218  $('.qa:not(.qa-open) .question').click(function() {
219    $(this).toggleClass('open').next('.answer').slideToggle();
220  });
221
222  // responsive scroll table
223  $('table.responsive-scroll').wrap(
224    '<div><div class="responsive-scroll-container"><div class="responsive-scroll-inner"></div></div><p class="sp-only text-center text-small">※横スクロールで全体を表示します。</p></div>'
225  );
226
227  // responsive list table
228  $('table.responsive-list').each(function() {
229    var header = [];
230    $(this).find('thead th').each(function() {
231      header.push($(this).text());
232    });
233    $(this).find('tbody td').each(function() {
234      $(this).attr('data-title', header[$(this).index()]);
235    });
236  });
237
238  // combine table
239  $('table.combine').closest('.col').css('margin-bottom', 0);
240
241  // Fix SP Menu
242  function fixSpMenu() {
243    var win_h = $(window).height();
244    var hdr_h = $('header').height();
245    if ($('.menu_icon').is(':visible') && $('header').css('z-index') != 'auto') { // SP && Fixed
246      $('header .global_nav>ul').css('max-height', win_h - hdr_h);
247    } else {
248      $('header .global_nav>ul').css('max-height', 'none');
249    }
250  }
251
252  function fixPageTop(window) {
253    var currentPos = $(window).scrollTop();
254    var $pagetop = $('.pagetop');
255    if (currentPos > 200) {
256      $pagetop.fadeIn(200, function() {
257        $(this).removeClass('hidden');
258      });
259    } else {
260      $pagetop.fadeOut(200, function() {
261        $(this).addClass('hidden');
262      });
263    }
264  }
265
266  function fixMainSize() {
267    if ($('.main_visual').length) {
268      var mainPadding = +$('.main_visual').css('padding-top').replace('px', '');
269      var mainHeight = $('.main_visual').height();
270      return (mainPadding > mainHeight) ? mainPadding : mainHeight;
271    } else {
272      return false;
273    }
274  }
275
276  // Load Event
277  $(window).load(function() {
278    headerOffset = fixMainSize();
279    footerOffset = $('footer').offset().top;
280    headerHeight = $('header').height();
281    $('body').removeClass('down').addClass('up').css('paddingTop', function() {
282      return $('header').css('position') == 'fixed' ? $('header').height() : 0;
283    });
284    if (typeof WOW !== 'undefined') {
285      new WOW().init();
286    }
287    fixSpMenu();
288    $('.tile').each(function() {
289      $(this).children().tile();
290    });
291  })
292
293  // Scroll Event
294  var scrolltimer = false;
295  var prevPos = 0;
296  $(window).on('scroll touchmove', function() {
297    $('body').addClass('scroll');
298    var currentPos = $(this).scrollTop();
299
300    headerOffset = fixMainSize();
301    footerOffset = $('footer').offset().top;
302
303    if (currentPos > headerOffset) {
304      $('header').removeClass('low').addClass('high');
305    } else {
306      $('header').removeClass('high').addClass('low');
307    }
308
309    if ((currentPos + $(this).height()) > footerOffset) {
310      $('footer').removeClass('low').addClass('high');
311    } else {
312      $('footer').removeClass('high').addClass('low');
313    }
314
315    fixPageTop(this);
316
317    if (currentPos > prevPos && currentPos > 0) { // down
318      $('body').removeClass('up').addClass('down') //.css('paddingTop', 0);
319      if (currentPos > headerHeight) {
320        $('header').addClass('hidden');
321      }
322    } else { // up
323      $('body').removeClass('down').addClass('up').css('paddingTop', function() {
324        return $('header').css('position') == 'fixed' ? headerHeight : 0;
325      });
326      $('header').removeClass('hidden');
327    }
328    if (!currentPos) {
329      $('body').addClass('scrollTop');
330    } else {
331      $('body').removeClass('scrollTop');
332    }
333    prevPos = currentPos;
334
335    if (scrolltimer !== false) {
336      clearTimeout(scrolltimer);
337    }
338    scrolltimer = setTimeout(function() {
339      $('body').removeClass('scroll');
340      $('body').removeClass('down').addClass('up').css('paddingTop', function() {
341        return $('header').css('position') == 'fixed' ? headerHeight : 0;
342      });
343      $('header').removeClass('hidden');
344    }, 500);
345  });
346
347  // Resize Event
348  var resizetimer = false;
349  $(window).resize(function() {
350    if (resizetimer !== false) {
351      clearTimeout(resizetimer);
352    }
353    resizetimer = setTimeout(function() {
354      fixSpMenu();
355      $('.tile').each(function() {
356        $(this).children().tile();
357      });
358      headerHeight = $('header').height();
359      headerOffset = $('header').offset().top;
360      footerOffset = $('footer').offset().top;
361      $('.tile').each(function() {
362        $(this).children().tile();
363      });
364    }, 200);
365  });
366
367  // main_slider
368  if ($.isFunction($().slick)) {
369    (function($) {
370      if ($('.main_visual_slick li').length <= 1) return;
371      if ($('.main_visual').css('transform') !== 'none') {
372        var html = $('.main_visual_slick').html();
373        var $ul = $('<ul class="main_visual_slick_thumb">');
374        $('.main_visual').append($ul.html(html));
375      }
376      var fade = false;
377      var arrows = false;
378      var dots = false;
379      var speed = 500;
380      var appendArrows = $('.main_visual_slick');
381      if ($('.main_visual').css('table-layout') === 'fixed') {
382        fade = true;
383        speed = 1000;
384      }
385      if ($('.main_visual').css('list-style-position') === 'inside') {
386        arrows = true;
387        $('.main_visual').append('<div class="main_visual_arrow"></div>');
388        appendArrows = $('.main_visual_arrow');
389      }
390      if ($('.main_visual').css('list-style-type') === 'circle') {
391        dots = true;
392      }
393      var slick = $('.main_visual_slick').slick({
394        slidesToShow: 1,
395        autoplay: true,
396        fade: fade,
397        arrows: arrows,
398        dots: dots,
399        appendArrows: appendArrows,
400        autoplaySpeed: 5000,
401        speed: speed,
402      }).on('beforeChange', function(e, slick, currentSlide, nextSlide) {
403        if ($('.main_visual_slick_thumb').length) {
404          $('.main_visual_slick_thumb_current').removeClass('main_visual_slick_thumb_current');
405          $('.main_visual_slick_thumb>li').eq(nextSlide).addClass('main_visual_slick_thumb_current');
406        }
407        if ($('.main_visual_copy').css('transform') !== 'none') {
408          var $copy = $('.main_visual_copy li');
409          $copy.eq(currentSlide).removeClass('active');
410          $copy.eq(nextSlide).addClass('active');
411        }
412      });
413      if ($('.main_visual_copy').css('transform') !== 'none') {
414        $('.main_visual_copy li').eq(0).addClass('active').show();
415      }
416      $('.main_visual_slick_thumb>li').on('click', function() {
417        var index = $(this).index();
418        slick.slick('slickGoTo', index);
419      });
420    })($);
421  }
422
423  if (typeof skrollr !== 'undefined' && !$('body').hasClass('tablet') && !$('body').hasClass('mobile')) {
424    skrollr.init();
425  }
426
427  if (typeof objectFitImages !== 'undefined') {
428    objectFitImages('.ofi img');
429  }
430
431  // pc-only等のタグ前後に出てくる改行コードを除去
432  $('br.pc-only, br.sp-only, br.tablet-only, br.pc-hide, br.sp-hide, br.tablet-hide, sup, sub').each(function(){
433    var $parent = $(this).parent();
434    if( !$parent.length ) return true;
435    var html = $parent.html();
436    html = html
437      .replace(/\n/g, '')
438      .replace(/\s*?(<br class="(sp|pc|tablet)-(only|hide)([^>+?])>)\s*/g, '$1')
439      .replace(/(,|\.)(<br class="(sp|pc|tablet)-(only|hide))/g, '$1 $2')
440      .replace(/(\d)(<br class="(sp|pc|tablet)-(only|hide))/g, '$1 $2')
441      .replace(/\s*?<(sup|sub)/g, '<$1');
442    $parent.html( html );
443  });
444
445});

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.