PageSourceSearch

https://www.hiiragiya.co.jp/assets/js/common.js?v=20261002

js hiiragiya.co.jp collected 2026-10-03 22:12:07 UTC 10,765 bytes, 379 lines download raw bytes

1"use strict";
2let HIIRAGI = {};
3
4// ==============================================================================================================
5// COMMON
6// ==============================================================================================================
7HIIRAGI.COMMON = {
8  settings: {
9    isSP: true
10//     windowScroll: 0,
11//     windowHeight: 0
12  },
13
14  init: function(){
15    this.SMOOTHSCROLL.init();
16    this.SCROLLTOP.init();
17    this.SPNAV.init();
18    this.PAGEHASH.init();
19  },
20
21  scroll: function(){
22  },
23
24  resize: function(){
25  }
26}
27
28HIIRAGI.COMMON.SMOOTHSCROLL = {
29  init: function(){
30    $('.js-scroll').on('click', function(){
31      var href = $(this).attr('href');
32      var target = $(href == '#' || href == '' ? 'html' : href);
33      var targetPos = (target.offset().top);
34      console.log(targetPos);
35      $('html, body').animate({scrollTop: targetPos}, 500, 'swing');
36      return false;
37    });
38
39    var _t = $(window).scrollTop() + 1;
40    $('html, body').animate({scrollTop: _t}, 100, 'swing');
41  }
42}
43
44HIIRAGI.COMMON.SCROLLTOP = {
45  init: function() {
46    $(window).on('load', function() {
47
48      const _pageTop = $('.l-footer__pagetop');
49      let _1stsectionTop = $('.l-section:first-of-type').offset().top - 60;
50      const _planTop = $(".top-plan").offset().top;
51      $(window).scroll(function () {
52        if ($(this).scrollTop() > 100) {
53          _pageTop.addClass('is-show');
54        } else {
55          _pageTop.removeClass('is-show');
56        }
57        if ($(window).width() < 1023) {
58          _1stsectionTop = _1stsectionTop / 2;
59        }
60        if ($(this).scrollTop() > _1stsectionTop) {
61          $('.l-header__navbtn').addClass('is-black');
62          $('.l-footer__contact').fadeIn();
63          if ($(this).scrollTop() > _planTop) {
64            $('.l-header__navbtn').removeClass('is-black');
65          }
66        } else {
67          $('.l-header__navbtn').removeClass('is-black');
68          $('.l-footer__contact').fadeOut();
69        }
70
71        if(HIIRAGI.COMMON.settings.isSP) {
72          const scrollHeight = $(document).height();
73          let scrollPosition = $(window).height() + $(window).scrollTop();
74          const footHeight = scrollHeight - $(".top-plan").offset().top - 100;
75          if (scrollHeight - scrollPosition <= footHeight) {
76            _pageTop.addClass('is-white');
77          }
78          else {
79            _pageTop.removeClass('is-white');
80          }
81        }
82
83      });
84
85    });
86  }
87}
88
89HIIRAGI.COMMON.SPNAV = {
90  init: function(){
91    $('.l-header__navbtn').on('click', function(){
92      $('.l-header').toggleClass('is-open');
93    });
94    $('.l-wrap').on('click', '.l-header.is-open .js-subnav', function(e){
95      $(this).toggleClass('is-subopen');
96      return false;
97    });
98
99    $('.js-submenu span').on('click', function(e) {
100      if($(window).width() < 1024) {
101        e.preventDefault();
102        $(this).parent().toggleClass('is-open');
103        $(this).parent().next().toggleClass('is-open');
104      }
105    });
106
107    $('.l-header__nav-main a').not('.js-submenu').on('click', function(e) {
108      $('.l-header').removeClass('is-open');
109    });
110  }
111}
112
113HIIRAGI.COMMON.PAGEHASH = {
114  init: function(){
115    const hash = location.hash;
116    if(hash) {
117      $("html, body").stop().scrollTop(0);
118      setTimeout(function(){
119        const target = $(hash),
120        position = target.offset().top;
121        $("html, body").stop().scrollTop(position);
122      });
123    }
124  }
125}
126
127
128// ==============================================================================================================
129// top mv
130// ==============================================================================================================
131HIIRAGI.TOPMV = {
132  init: function(){
133    var mySwiper = new Swiper('.swiper', {
134      loop: true,
135      effect: "fade",
136      pagination: {
137        el: ".swiper-pagination",
138        clickable: true
139      },
140      autoplay: {
141        delay: 4000,
142        disableOnInteraction: false,
143      },
144      speed: 2000,
145    })
146  }
147}
148
149
150// ==============================================================================================================
151// gallery
152// ==============================================================================================================
153HIIRAGI.GALLERY = {
154  init: function(){
155    var sliderWrap = document.querySelectorAll('.gallery-wrap');
156    var sliderThumb = document.querySelectorAll('.swiperThumbnail');
157    var sliderMain = document.querySelectorAll('.swiperMain');
158
159    for (let i = 0; i < sliderWrap.length; i++) {
160      var num = ('00' + (i+1)).slice(-2);
161      sliderWrap[i].className += (num);
162      sliderThumb[i].className += (num);
163      sliderMain[i].className += (num);
164
165      if($('.swiperThumbnail' + (num) + ' .swiper-slide').length > 1) {
166        var swiperThumbnail = new Swiper(".swiperThumbnail" + (num), {
167          slidesPerView: 'auto',
168          spaceBetween: 8,
169          grabCursor: true,
170          freeMode: false,
171          loop: false,
172          centeredSlides: false,
173          slideToClickedSlide: true,
174          breakpoints: {
175            1024: {
176              slidesPerView: 'auto',
177            }
178          }
179        });
180      }
181      else {
182        var swiperThumbnail = new Swiper(".swiperThumbnail" + (num), {
183          slidesPerView: 1,
184          spaceBetween: 8,
185          grabCursor: true,
186          freeMode: false,
187          loop: false,
188          centeredSlides: true,
189          slideToClickedSlide: true,
190          breakpoints: {
191            1024: {
192              slidesPerView: 'auto',
193            }
194          }
195        });
196      }
197
198      if($('.swiperMain' + (num) + ' .swiper-slide').length > 1) {
199        var swiperMain = new Swiper(".swiperMain" + (num), {
200          effect: "fade",
201          fadeEffect: {
202            crossFade: true
203          },
204          speed: 600,
205          loop: true,
206          autoHeight: true,
207          centeredSlides: false,
208          navigation: {
209              nextEl: ".swiper-button-next",
210              prevEl: ".swiper-button-prev",
211            },
212          thumbs: {
213              swiper: swiperThumbnail,
214            },
215        });
216      }
217      else {
218        $('.swiperThumbnail'+ (num)).hide();
219        var swiperMain = new Swiper(".swiperMain" + (num), {
220          effect: "fade",
221          fadeEffect: {
222            crossFade: true
223          },
224          speed: 600,
225          loop: false,
226          autoHeight: true,
227          centeredSlides: false,
228          navigation: {
229              nextEl: ".swiper-button-next",
230              prevEl: ".swiper-button-prev",
231            },
232        });
233      }
234    }
235  }
236}
237
238
239// ==============================================================================================================
240// FAQ
241// ==============================================================================================================
242HIIRAGI.FAQ = {
243  init: function(){
244    $('.c-faq dt').on('click', function() {
245      $(this).toggleClass('is-open');
246      $(this).next().slideToggle();
247    });
248  }
249}
250
251
252// ==============================================================================================================
253// TAB
254// ==============================================================================================================
255HIIRAGI.TAB = {
256  init: function(){
257    $('.c-tab__contents').each(function(num) {
258      $(this).find('.c-tab__content:first').show();
259    });
260
261    $('.c-tab__menu a').on('click', function(e) {
262      e.preventDefault();
263      var _showBlock = $(this).attr('href');
264      $(this).parents('.c-tab__menu').find('a').removeClass('is-current');
265      $(this).addClass('is-current');
266console.log(_showBlock);
267      $(this).parents('.c-tab__menu').next().find('.c-tab__content').hide();
268      $(_showBlock).show();
269      imageMapResize();
270    });
271  }
272}
273
274
275// ==============================================================================================================
276// ACCESS
277// ==============================================================================================================
278HIIRAGI.ACCESS = {
279  init: function(){
280    document.getElementById('group1').addEventListener('click', function() {
281      window.location.href = '#route5';
282console.log('test');
283    });
284    document.getElementById('detail').addEventListener('click', function() {
285      window.location.href = '#route5';
286console.log('test');
287    });
288  }
289}
290
291
292// ==============================================================================================================
293// INQUIRY
294// ==============================================================================================================
295HIIRAGI.INQUIRY = {
296  init: function(){
297    var url = window.location.href;
298
299    if (url.includes('/inquiry/')) {
300      $('.top-mv__contact').remove();
301      $('.l-footer__contact').remove();
302
303      $('.l-footer__copyright').addClass('-mb_none');
304
305      $('.c-reserve__site a').on('click', function(e) {
306        e.preventDefault();
307        $('.c-form-calendarModal').addClass('-open');
308      });
309
310      $('.c-form-calendarModal__close').on('click', function(e) {
311        $('.c-form-calendarModal').removeClass('-open');
312        e.stopPropagation();
313      });
314
315      $('.c-form-calendarModal').on('click', function(e) {
316//        $('.c-form-calendarModal').removeClass('-open');
317//        e.stopPropagation();
318      });
319    }
320  }
321}
322
323// ==============================================================================================================
324// INIT
325// ==============================================================================================================
326$(function(){
327  HIIRAGI.COMMON.init();
328  if($('.l-wrap.top').length){
329    HIIRAGI.BACKIMG.init();
330  }
331  if($('.top-mv').length){
332    HIIRAGI.TOPMV.init();
333  }
334  if($('.swiperMain').length){
335    HIIRAGI.GALLERY.init();
336  }
337  if($('.c-faq').length){
338    HIIRAGI.FAQ.init();
339  }
340  if($('.c-tab__contents').length){
341    HIIRAGI.TAB.init();
342  }
343  if($('.access-route').length){
344    HIIRAGI.ACCESS.init();
345  }
346
347  HIIRAGI.INQUIRY.init();
348
349  $('.js-scrollViewSingle').css('opacity',"0");
350  function inView(){
351    var wHeight = $(window).height();
352    var scrollAmount = $(window).scrollTop();
353
354    $('.js-scrollViewSingle').each(function () {
355      var targetPosition = $(this).offset().top;
356      var _sh = (screen.availHeight / 2) + 100;
357//      console.log(_sh);
358      if(scrollAmount > targetPosition - _sh) {
359        $(this).addClass("js-fadeupIn");
360      }
361    });
362  }
363  //
364  $(window).on( 'scroll load', function () {
365    inView();
366  });
367
368});
369
370Fancybox.bind('[data-fancybox="room"]', {
371  infinite: true,
372  infobar: true,
373  toolbar: false,
374  smallBtn: false,
375  Thumbs: false,
376  template: {
377    closeButton: '<img src="/assets/img/modal-close.svg" alt="">'
378  },
379});

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.