1function main() { 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') 33 .hide() 34 .addClass('hidden'); 35 36 var ua = navigator.userAgent.toLowerCase(); 37 if (ua.indexOf('android') !== -1) { 38 $('.menu_icon a').addClass('fix'); 39 } 40 if (ua.indexOf('iphone') !== -1 || ua.indexOf('ipad') !== -1) { 41 $('.parallax').addClass('ios'); 42 } 43 if (ua.indexOf('safari') !== -1 && ua.indexOf('iPad') !== -1) { 44 $('.parallax').addClass('ios'); 45 } 46 if (ua.indexOf('iPad') !== -1) { 47 $('.parallax').addClass('ios'); 48 } 49 var ipad = 50 ua.indexOf('ipad') > -1 || 51 (ua.indexOf('macintosh') > -1 && 'ontouchend' in document); 52 if (ipad == true) { 53 $('.parallax').addClass('ios'); 54 } 55 56 // scrollbar 57 var scrollbarWidth = window.innerWidth - document.body.clientWidth; 58 59 // sp gnav 60 $('.menu_icon a').on('click', function (e) { 61 e.preventDefault(); 62 $(this) 63 .toggleClass('close') 64 .parent() 65 .prev(); 66 $('body') 67 .removeClass('down') 68 .addClass('up'); 69 $(this) 70 .closest('header') 71 .toggleClass('menu_open'); 72 }); 73 74 // gnav 75 var navi_event = 'click'; 76 if ($('.global_nav').css('list-style-position') === 'inside') { 77 navi_event = 78 !$('body.mobile').length && !$('body.tablet').length 79 ? 'mouseenter mouseleave' 80 : 'touchend'; 81 $('.has_under').on('click', function (e) { 82 var tagName = e.target.tagName.toLowerCase(); 83 if (!tagName === 'a' || $(e.target.parentNode).hasClass('has_under')) { 84 e.preventDefault(); 85 } 86 }); 87 } 88 $('.has_under').on(navi_event, function (e) { 89 var tagName = e.target.tagName.toLowerCase(); 90 if ($('.global_nav').css('list-style-position') !== 'inside' && (tagName === 'a' && !$(e.target.parentNode).hasClass('has_under'))) { 91 return; 92 } 93 e.preventDefault(); 94 var $self = $('>a', $(this)); 95 //var $self = $(this); 96 if (!$self.hasClass('menu_under_open') && $('.menu_under_open').length) { 97 $('.menu_under_open') 98 .removeClass('menu_under_open') 99 .next() 100 .stop() 101 .slideToggle(200); 102 } 103 $self.toggleClass('menu_under_open'); 104 $self 105 .next() 106 .stop() 107 .slideToggle(200); 108 }); 109 $('.gnav_search>a').on('click', function (e) { 110 e.preventDefault(); 111 //$(this).toggleClass('menu_under_open'); 112 $(this) 113 .next() 114 .slideToggle(200); 115 }); 116 117 // pagetop 118 $('.pagetop a').on('click', function (e) { 119 e.preventDefault(); 120 $('html, body').animate({ 121 scrollTop: 0 122 }); 123 }); 124 125 // iOS svg tap fix 126 if ($('body.mobile').length || $('body.tablet').length) { 127 $('header .title a').on('touchend', function (e) { 128 e.preventDefault(); 129 location.href = this.href; 130 }); 131 } 132 133 // swipebox 134 if ($.isFunction($().swipebox)) { 135 var swipebox = $('.swipebox').swipebox(); 136 $(document).on('click touchend', '#swipebox-overlay', function (e) { 137 e.preventDefault(); 138 if ($(e.target).hasClass('slide')) $.swipebox.close(); 139 }); 140 } 141 142 // slider 143 if ($.isFunction($().sliderPro)) { 144 var sliderDefaults = { 145 center: { 146 width: 1000, 147 height: 450, 148 slideDistance: 0, 149 visibleSize: '100%', 150 arrows: true, 151 fadeArrows: false, 152 autoScaleLayers: false, 153 breakpoints: {} 154 }, 155 wide: { 156 width: '100%', 157 autoHeight: true, 158 slideDistance: 0, 159 arrows: true,
160 fadeArrows: false, 161 fade: true, 162 autoScaleLayers: false, 163 touchSwipe: false, 164 breakpoints: {} 165 }, 166 contents: { 167 width: 450, 168 height: 300, 169 aspectRatio: 1.5, 170 slideDistance: 10, 171 visibleSize: '100%', 172 arrows: true, 173 fadeArrows: false, 174 buttons: false, 175 fadeCaption: false, 176 breakpoints: {} 177 } 178 }; 179 $('.slider-pro').each(function () { 180 var opt = $(this).data(); 181 var number_of_slide = $(this).find('.sp-slide').length; 182 $(this).addClass(opt.type || 'center'); 183 if (!this.hasAttribute('data-type')) { 184 return true; 185 } 186 var options = $.extend( 187 true, 188 sliderDefaults[opt.type] || sliderDefaults.center, 189 {} 190 ); 191 if (opt.width) { 192 options.width = opt.width; 193 } 194 if (opt.height) { 195 options.height = opt.height; 196 } 197 if (typeof opt.distance !== 'undefined') { 198 options.slideDistance = opt.distance; 199 } 200 if (opt.type == 'contents') { 201 if (opt.width || opt.height) { 202 options.aspectRatio = 203 Math.round((options.width / options.height) * 100) / 100; 204 } 205 if (number_of_slide % 2 === 0) { 206 options.visibleSize = 207 options.width * (number_of_slide - 1) + 208 options.slideDistance * (number_of_slide - 2); 209 } 210 } 211 if (typeof opt.autoplay !== 'undefined') { 212 options.autoplay = opt.autoplay; 213 } 214 if (typeof opt.arrows !== 'undefined') { 215 switch (opt.arrows) { 216 case false: 217 options.arrows = false; 218 $(this).addClass('disable-arrows'); 219 break; 220 case 'pc-only': 221 var bp = 768 - scrollbarWidth - 1; 222 options.breakpoints[bp] = options.breakpoints[bp] || {}; 223 options.breakpoints[bp].arrows = false; 224 $(this).addClass('sp-disable-arrows'); 225 break; 226 } 227 } 228 if (typeof opt.buttons !== 'undefined') { 229 switch (opt.buttons) { 230 case false: 231 options.buttons = false; 232 break; 233 case 'pc-only': 234 var bp = 768 - scrollbarWidth - 1; 235 options.breakpoints[bp] = options.breakpoints[bp] || {}; 236 options.breakpoints[bp].buttons = false; 237 break; 238 } 239 } 240 $(this).sliderPro(options); 241 }); 242 } 243 244 $('.slide_scroll').click(function (e) { 245 e.preventDefault(); 246 var pos = $(this) 247 .closest('section') 248 .next() 249 .offset().top; 250 $('html, body').animate({ 251 scrollTop: pos 252 }); 253 }); 254 255 // Q&A 256 // $('.qa:not(.qa-open) .question').click(function() { 257 // $(this).toggleClass('open').next('.answer').slideToggle(); 258 // }); 259 260 // responsive scroll table 261 $('table.responsive-scroll').wrap( 262 '<div><div class="responsive-scroll-container"><div class="responsive-scroll-inner"></div></div><p class="sp-only text-center text-small">â»æ¨ªã¹ã¯ãã¼ã«ã§å ¨ä½ã表示ãã¾ãã</p></div>' 263 ); 264 265 // responsive list table 266 $('table.responsive-list').each(function () { 267 var header = []; 268 $(this) 269 .find('thead th') 270 .each(function () { 271 header.push($(this).text()); 272 }); 273 $(this) 274 .find('tbody td') 275 .each(function () { 276 $(this).attr('data-title', header[$(this).index()]); 277 }); 278 }); 279
280 // combine table 281 $('table.combine') 282 .closest('.col') 283 .css('margin-bottom', 0); 284 285 // Fix SP Menu 286 function fixSpMenu() { 287 var win_h = $(window).height(); 288 var hdr_h = $('header').height(); 289 if ( 290 $('.menu_icon').is(':visible') && 291 $('header').css('z-index') != 'auto' 292 ) { 293 // SP && Fixed 294 $('header .global_nav>ul').css('max-height', win_h - hdr_h); 295 } else { 296 $('header .global_nav>ul').css('max-height', 'none'); 297 } 298 } 299 300 function fixPageTop(window) { 301 var currentPos = $(window).scrollTop(); 302 var $pagetop = $('.pagetop'); 303 if (currentPos > 200) { 304 $pagetop.fadeIn(200, function () { 305 $(this).removeClass('hidden'); 306 }); 307 } else { 308 $pagetop.fadeOut(200, function () { 309 $(this).addClass('hidden'); 310 }); 311 } 312 } 313 314 function fixMainSize() { 315 if ($('.main_visual').length) { 316 var mainPadding = +$('.main_visual') 317 .css('padding-top') 318 .replace('px', ''); 319 var mainHeight = $('.main_visual').height(); 320 return mainPadding > mainHeight ? mainPadding : mainHeight; 321 } else { 322 return false; 323 } 324 } 325 326 // Load Event 327 $(window).on('load', function () { 328 headerOffset = fixMainSize(); 329 footerOffset = $('footer').offset().top; 330 headerHeight = $('header').height(); 331 $('body') 332 .removeClass('down') 333 .addClass('up') 334 .css('paddingTop', function () { 335 return $('header').css('position') == 'fixed' 336 ? $('header').height() 337 : 0; 338 }); 339 if (typeof WOW !== 'undefined') { 340 new WOW().init(); 341 } 342 fixSpMenu(); 343 $('.tile').each(function () { 344 $(this) 345 .children() 346 .tile(); 347 }); 348 }); 349 350 // Scroll Event 351 var scrolltimer = false; 352 var prevPos = 0; 353 $(window).on('scroll touchmove', function () { 354 $('body').addClass('scroll'); 355 var currentPos = $(this).scrollTop(); 356 357 headerOffset = fixMainSize(); 358 footerOffset = $('footer').offset().top; 359 360 if (currentPos > headerOffset) { 361 $('header') 362 .removeClass('low') 363 .addClass('high'); 364 } else { 365 $('header') 366 .removeClass('high') 367 .addClass('low'); 368 } 369 370 if (currentPos + $(this).height() > footerOffset) { 371 $('footer') 372 .removeClass('low') 373 .addClass('high'); 374 } else { 375 $('footer') 376 .removeClass('high') 377 .addClass('low'); 378 } 379 380 fixPageTop(this); 381 382 if (currentPos > prevPos && currentPos > 0) { 383 // down 384 $('body') 385 .removeClass('up') 386 .addClass('down'); //.css('paddingTop', 0); 387 if (currentPos > headerHeight) { 388 $('header').addClass('hidden'); 389 } 390 } else { 391 // up 392 $('body') 393 .removeClass('down') 394 .addClass('up') 395 .css('paddingTop', function () { 396 return $('header').css('position') == 'fixed' ? headerHeight : 0; 397 }); 398 $('header').removeClass('hidden'); 399 } 400 if (!currentPos) { 401 $('body').addClass('scrollTop'); 402 } else { 403 $('body').removeClass('scrollTop'); 404 } 405 prevPos = currentPos; 406 407 if (scrolltimer !== false) { 408 clearTimeout(scrolltimer); 409 } 410 scrolltimer = setTimeout(function () { 411 $('body').removeClass('scroll'); 412 $('body') 413 .removeClass('down') 414 .addClass('up') 415 .css('paddingTop', function () { 416 return $('header').css('position') == 'fixed' ? headerHeight : 0; 417 }); 418 $('header').removeClass('hidden'); 419 }, 500); 420 }); 421 422 // Resize Event 423 var resizetimer = false; 424 $(window).resize(function () { 425 if (resizetimer !== false) { 426 clearTimeout(resizetimer); 427 } 428 resizetimer = setTimeout(function () { 429 fixSpMenu(); 430 $('.tile').each(function () { 431 $(this) 432 .children() 433 .tile(); 434 }); 435 headerHeight = $('header').height(); 436 headerOffset = $('header').offset().top; 437 footerOffset = $('footer').offset().top; 438 $('.tile').each(function () { 439 $(this) 440 .children() 441 .tile(); 442 }); 443 }, 200); 444 }); 445 446 // main_slider 447 if ($.isFunction($().slick)) { 448 (function ($) { 449 if ($('.main_visual_slick li').length <= 1) return; 450 if ($('.main_visual').css('transform') !== 'none') { 451 var html = $('.main_visual_slick').html(); 452 var $ul = $('<ul class="main_visual_slick_thumb">'); 453 $('.main_visual').append($ul.html(html)); 454 } 455 var fade = false;
456 var arrows = false; 457 var dots = false; 458 var speed = 2000; 459 var appendArrows = $('.main_visual_slick'); 460 if ($('.main_visual').css('table-layout') === 'fixed') { 461 fade = true; 462 speed = 2000; 463 } 464 if ($('.main_visual').css('list-style-position') === 'inside') { 465 arrows = true; 466 $('.main_visual').append('<div class="main_visual_arrow"></div>'); 467 appendArrows = $('.main_visual_arrow'); 468 } 469 if ($('.main_visual').css('list-style-type') === 'circle') { 470 dots = true; 471 } 472 var $currentSlick = null; 473 var slick = $('.main_visual_slick') 474 .on('init', function (e, slick) { 475 $(slick.$slides[0]).addClass('slick-visible-content'); 476 $currentSlick = $(slick.$slides[0]); 477 }) 478 .slick({ 479 slidesToShow: 1, 480 autoplay: true, 481 fade: fade, 482 arrows: arrows, 483 dots: dots, 484 appendArrows: appendArrows, 485 autoplaySpeed: 3000, 486 speed: speed 487 }) 488 .on('beforeChange', function (e, slick, currentSlide, nextSlide) { 489 $('[data-slick-index="' + nextSlide + '"]').addClass( 490 'slick-visible-content' 491 ); 492 $currentSlick = $('[data-slick-index="' + currentSlide + '"]'); 493 if ($('.main_visual_slick_thumb').length) { 494 $('.main_visual_slick_thumb_current').removeClass( 495 'main_visual_slick_thumb_current' 496 ); 497 $('.main_visual_slick_thumb>li') 498 .eq(nextSlide) 499 .addClass('main_visual_slick_thumb_current'); 500 } 501 if ($('.main_visual_copy').css('transform') !== 'none') { 502 var $copy = $('.main_visual_copy li'); 503 $copy.eq(currentSlide).removeClass('active'); 504 $copy.eq(nextSlide).addClass('active'); 505 } 506 }) 507 .on('afterChange', function (e, slick, currentSlide) { 508 $currentSlick.removeClass('slick-visible-content'); 509 }); 510 if ($('.main_visual_copy').css('transform') !== 'none') { 511 $('.main_visual_copy li') 512 .eq(0) 513 .addClass('active') 514 .show(); 515 } 516 $('.main_visual_slick_thumb>li').on('click', function () { 517 var index = $(this).index(); 518 slick.slick('slickGoTo', index); 519 }); 520 })($); 521 } 522 523 if ( 524 typeof skrollr !== 'undefined' && 525 !$('body').hasClass('tablet') && 526 !$('body').hasClass('mobile') 527 ) { 528 skrollr.init(); 529 } 530 531 if (typeof objectFitImages !== 'undefined') { 532 objectFitImages('.ofi img'); 533 } 534 535 // pc-onlyçã®ã¿ã°åå¾ã«åºã¦ããæ¹è¡ã³ã¼ããé¤å» 536 $( 537 'br.pc-only, br.sp-only, br.tablet-only, br.pc-hide, br.sp-hide, br.tablet-hide, sup, sub' 538 ).each(function () { 539 var $parent = $(this).parent(); 540 if (!$parent.length) return true; 541 var html = $parent.html(); 542 html = html 543 .replace(/\n/g, '') 544 .replace(/\s*?(<br class="(sp|pc|tablet)-(only|hide)([^>+?])>)\s*/g, '$1') 545 .replace(/(,|\.)(<br class="(sp|pc|tablet)-(only|hide))/g, '$1 $2') 546 .replace(/(\d)(<br class="(sp|pc|tablet)-(only|hide))/g, '$1ã$2') 547 .replace(/\s*?<(sup|sub)/g, '<$1'); 548 $parent.html(html); 549 }); 550 // FromCake 551 $('.sweetswidget').each(function () { 552 var self = this; 553 var dataset = $(self).data(); 554 var shopcode = dataset.widgetcode; 555 if (shopcode === undefined) return true; 556 var count = dataset.widgetcount !== undefined ? dataset.widgetcount : 50; 557 var class_name = 558 dataset.widgetcarousel && dataset.widgetcarousel !== undefined 559 ? 'reservation_widget_carousel_wrap' 560 : ''; 561 var url = 'https://sweetsguide.jp/shop/' + shopcode + '/widget'; 562 var ajaxOption = { 563 method: 'get', 564 url: url, 565 data: { 566 class_name: class_name, 567 count: count 568 }, 569 dataType: 'html' 570 }; 571 $.ajax(ajaxOption).done(function (html) { 572 getWidget(self, html); 573 }); 574 }); 575 576 function getWidget(self, html) { 577 $(self).after(html); 578 var current = $(self).next(); 579 $(self).remove(); 580 var $container = $(current); 581 582 customTile('h3', $container); 583 // Resize Event 584 var resizetimer = false;
585 $(window).resize(function () { 586 if (resizetimer !== false) { 587 clearTimeout(resizetimer); 588 } 589 resizetimer = setTimeout(function () { 590 customTile('h3', $container); 591 }, 200); 592 }); 593 function customTile(selector, $container) { 594 var $selector = $(selector, $container); 595 var h, max; 596 var last = $selector.length - 1; 597 $selector 598 .each(function (i) { 599 $(this).removeAttr('style'); 600 }) 601 .each(function (i) { 602 h = $(this).outerHeight(); 603 if (i === 0 || h > max) max = h; 604 if (i == last) { 605 $selector.each(function (i) { 606 $(this).css('height', max); 607 }); 608 } 609 }); 610 } 611 if (!$container.hasClass('reservation_widget_carousel_wrap')) return true; 612 var length = $('>li', $container).length; 613 if (length <= 4) { 614 $container.removeClass('reservation_widget_carousel_wrap'); 615 return; 616 } 617 $container.removeClass('row_inline'); 618 $('>li', $container).each(function () { 619 $(this)
620 .removeClass('span_3 col') 621 .addClass('reservation_widget_carousel'); 622 }); 623 $container.after('<div class="reservation_widget_arrow"></div>'); 624 appendArrows = $container.next(); 625 var slickOption = { 626 slidesToShow: 4, 627 autoplay: true, 628 arrows: true, 629 dots: true, 630 appendArrows: appendArrows, 631 responsive: [ 632 { 633 breakpoint: 900, 634 settings: { 635 slidesToShow: 3 636 } 637 }, 638 { 639 breakpoint: 768, 640 settings: { 641 slidesToShow: 2 642 } 643 } 644 ] 645 }; 646 $container.slick(slickOption); 647 customTile('h3', $container); 648 } 649 650 // é å»¶èªã¿è¾¼ã¿æã®tileå¼·å¶çºç« 651 if (typeof MutationObserver !== 'undefined') { 652 // IE10- 653 var observer = new MutationObserver(function () { 654 $(window).trigger('resize'); 655 }); 656 657 var config = { 658 attributes: true, 659 childList: true, 660 characterData: true 661 }; 662 663 $('.tile .lazy-hidden').each(function () { 664 observer.observe(this, config); 665 }); 666 } 667} 668 669function loadFunc(callback) { 670 if ( 671 sessionStorage.getItem('access') && 672 wp_theme_options.loader.timming === 'once' 673 ) { 674 $('#loader').css({ 675 display: 'none' 676 }); 677 callback(); 678 } else { 679 setTimeout(function () { 680 callback(); 681 $('#loader').fadeOut(wp_theme_options.loader.fadeout); 682 }, wp_theme_options.loader.delay); 683 } 684 sessionStorage.setItem('access', wp_theme_options.loader.timming); 685} 686 687window.addEventListener('DOMContentLoaded', function () { 688 if ( 689 typeof wp_theme_options !== 'undefined' && 690 wp_theme_options.loader && 691 wp_theme_options.loader.enable && 692 !(wp_theme_options.loader.home_only && !wp_theme_options.is_front) 693 ) { 694 loadFunc(main); 695 } else { 696 main(); 697 } 698});
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.