1$(function(){ 2 3var $window = $(window), 4 breakPoint = 820, //ãã¬ã¤ã¯ãã¤ã³ãã®è¨å® 5 winW = $window.width(), //ç»é¢ã®æ¨ªå¹ 6 winH = $window.height(), //ç»é¢ã®ç¸¦å¹ 7 // anchorSpeed = 400, //ã¢ã³ã«ã¼ãªã³ã¯ã®ã¹ã ã¼ãºã¹ã¯ãã¼ã«ã®ã¹ãã¼ã 8 resizeTimer = false, 9 menuOpenFlag = false; 10 11/* change Img 12*********************************************/ 13function changeImgSp(){ 14 $('.change-img').each(function(){ 15 $(this).attr("src",$(this).attr("src").replace(/_pc\./, '_sp.')); 16 }); 17} 18function changeImgPc(){ 19 $('.change-img').each(function(){ 20 $(this).attr("src",$(this).attr("src").replace(/_sp\./, '_pc.')); 21 }); 22} 23 24/* menu 25*********************************************/ 26// 1ã¤ã®ãã¿ã³ã§ééããå ´å 27$(document).on('click', '.menu-btn', function(){ 28 let expanded = $(this).attr('aria-expanded') === 'true', 29 controls = $(this).attr('aria-controls'); 30 $(this).attr('aria-expanded', !expanded).toggleClass('is-open'); 31 32 if($(this).hasClass('is-open')) { //éãã¦ããã¨ãï¼éããåä½ï¼ 33 // .menu-btn ã® ç´å¾ã« #naviããªãå ´å 34 // setTimeout(function() { 35 // $($('#navi').find('a').eq(0)).focus(); 36 // }, 400); 37 $('#' + controls).fadeIn().attr('aria-hidden', 'false'); 38 $(this).attr({ 39 'aria-label': 'ãµã¤ãã¡ãã¥ã¼ãéãã', 40 'aria-expanded': 'true' 41 }); 42 } else { //éãã¦ããï¼éãåä½ï¼ 43 menuClose(); 44 } 45 menuOpenFlag = !expanded; 46}); 47 48// ã¡ãã¥ã¼å ã«ã¢ã³ã«ã¼ãªã³ã¯ãããå ´å 49$('#navi a[href^="#"]').click(function () { 50 menuClose(); 51}); 52 53// ã¡ã¬ã¡ãã¥ã¼å ã®ãªã³ã¯ãã¯ãªãã¯ããå ´åã¯ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ãéãã 54$(document).on('click', '.gnavi__contents a', function () { 55 menuClose(); 56}); 57 58// ã¡ãã¥ã¼ãéãã 59function menuClose() { 60 $('.menu-btn').removeClass('is-open').attr({ 61 'aria-label': 'ãµã¤ãã¡ãã¥ã¼ãéã', 62 'aria-expanded': 'false' 63 }); 64 $('#navi').fadeOut().attr('aria-hidden', 'true'); 65 menuOpenFlag = false; 66} 67 68$('.js-lang-btn').each(function(){ 69 var $trigger = $(this); 70 var $target = $trigger.next('.js-lang-content'); 71 72 $trigger.add($target) 73 .on('mouseenter focusin', function() { 74 $target.addClass('is-open'); 75 }) 76 .on('mouseleave focusout', function() { 77 $target.removeClass('is-open'); 78 }); 79}); 80 81 82/* mega menu 83*********************************************/ 84$(document).on("click", ".gnavi__trg", function () { 85 let $this = $(this); 86 let expanded = $(this).attr("aria-expanded") === "true", 87 controls = $(this).attr("aria-controls"); 88 89 // ä»ã«éãã¦ããã¡ã¬ã¡ãã¥ã¼ãããã°éãã 90 if (!$this.hasClass("is-opened") && breakPoint < winW) { 91 megaMenuClose(); 92 } 93 94 $this.toggleClass("is-opened").attr("aria-expanded", !expanded); 95 $("#" + controls) 96 // .slideToggle(300) 97 // .toggle(0) 98 // .toggleClass('is-opend') 99 .attr("aria-hidden", expanded); 100 if( breakPoint < winW ) { 101 $("#" + controls).slideToggle(300); 102 } else { 103 $("#" + controls).toggle(0).toggleClass('is-opend'); 104 } 105 106 if (!$(".l-body").hasClass("is-menu-opend")) { 107 menuOpenFlag = !expanded; 108 } 109 110 // if (breakPoint < winW) { 111 //pc 112 // $(".l-body").toggleClass("is-no-action"); 113 // } 114 115 // is-megamenu-opend ã¯ã©ã¹å¶å¾¡ 116 if ($(".gnavi__trg.is-opened").length) { 117 $(".l-body").addClass("is-megamenu-opend"); 118 } else { 119 $(".l-body").removeClass("is-megamenu-opend"); 120 } 121 console.log(menuOpenFlag); 122}); 123 124function megaMenuClose() { 125 $this = $(".gnavi__trg.is-opened"); 126 if ($this.length > 0) { 127 let expanded = $this.attr("aria-expanded") === "true", 128 controls = $this.attr("aria-controls"); 129 $this.removeClass("is-opened").attr("aria-expanded", "false"); 130 // $('#' + controls).slideToggle(400,"easeOutQuart").attr('aria-hidden', 'true'); 131 $("#" + controls).attr("aria-hidden", expanded); 132 if( breakPoint < winW ) { 133 $("#" + controls).slideToggle(300); 134 } else { 135 $("#" + controls).toggleClass('is-opend'); 136 $("#" + controls).delay(300).toggle(0); 137 } 138 // if (breakPoint < winW) { 139 //pc 140 // $(".l-body").toggleClass("is-no-action"); 141 // scrollBlocker(false); 142 // } 143 $(".l-body").removeClass("is-megamenu-opend"); 144 } 145} 146$(document).on( 147 "click",
148 ".l-body.is-megamenu-opend, .l-navi a, .modal-gnavi__close", 149 function () { 150 menuOpenFlag = false; 151 megaMenuClose(); 152 } 153); 154 155/* modalç³»OPENæã®focuså¶å¾¡ 156*********************************************/ 157$( document ).keydown( function( event ) { // ãã¼ã¤ãã³ã 158 // modalç³»OPENæã®focuså¶å¾¡ 159 if ( menuOpenFlag ) { // ã¢ã¼ãã«ã¡ãã¥ã¼ãéããã¦ããå ´å 160 var modalMenuElements = $( '[aria-hidden="false"]:not(.js-accordion-content)' ).find( 'a, button' ); 161 // ããã¡ãã¥ã¼ã .l-header ã®ä¸ã«å ¥ã£ã¦ããªãã¨ãã¯âã®åå²ã¯ã³ã¡ã³ãã¢ã¦ããã¦ãã ãã 162 if( $('.menu-btn.is-open').length > 0 ) { 163 modalMenuElements = $( '.l-header' ).find( 'a, button' ); 164 } 165 // ãã©ã¼ã«ã¹ãå½ãã£ã¦ããè¦ç´ 166 var activeEl = document.activeElement; 167 // ã¢ã¼ãã«ã¡ãã¥ã¼å ã§ãã©ã¼ã«ã¹ãå½ã¦ããæåã®è¦ç´ 168 var firstEl = modalMenuElements[0]; 169 // ã¢ã¼ãã«ã¡ãã¥ã¼å ã§ãã©ã¼ã«ã¹ãå½ã¦ããæå¾ã®è¦ç´ 170 var lastEl = modalMenuElements[ modalMenuElements.length - 1 ]; 171 // ã¿ããã¼ãæ¼ããããã©ãã 172 var tabKey = ( 9 === event.keyCode ); 173 // Shiftãã¼ãæ¼ããã¦ãããã©ãã 174 var shiftKey = event.shiftKey; 175 // escãã¼ãæ¼ããããã©ãã 176 var escKey = ( 27 === event.keyCode ); 177 // æå¾ã®è¦ç´ ã§ã¿ããã¼ãæ¼ãããå ´åã¯ãæåã®è¦ç´ ã«ãã©ã¼ã«ã¹ãå½ã¦ã 178 if ( ! shiftKey && tabKey && lastEl === activeEl ) { 179 event.preventDefault(); 180 firstEl.focus(); 181 } 182 // æåã®è¦ç´ ã§ã¿ããã¼+Shiftãã¼ãæ¼ãããå ´åã¯ãæå¾ã®è¦ç´ ã«ãã©ã¼ã«ã¹ãå½ã¦ã 183 if ( shiftKey && tabKey && firstEl === activeEl ) { 184 event.preventDefault(); 185 lastEl.focus(); 186 } 187 if( escKey ) { 188 menuClose(); 189 } 190 } 191}); 192 193/* swiper 194*********************************************/ 195// area guide 196$('.areaguide-slide').each(function(){ 197 var itemLength = $(this).find('.areaguide-slide__item').length; 198 let areaguideLoopOptions; 199 if (winW <= 820 && itemLength === 1) { 200 areaguideLoopOptions = false; 201 } else if (winW >= 821 && itemLength <= 3) { 202 areaguideLoopOptions = false; 203 } else { 204 areaguideLoopOptions = true; 205 } 206 new Swiper(this, { 207 loop: areaguideLoopOptions, 208 // slidesPerView: 1.71, 209 slidesPerView: 'auto', 210 spaceBetween: 28, 211 centeredSlides: true, 212 navigation: { 213 nextEl: '.swiper-button-next', 214 prevEl: '.swiper-button-prev', 215 }, 216 pagination: { 217 el: '.swiper-pagination', 218 clickable: true, 219 }, 220 breakpoints: { 221 821: { //821pxä»¥ä¸ 222 slidesPerView: 3, 223 spaceBetween: 14, 224 centeredSlides: false, 225 } 226 } 227 }); 228}); 229 230// post-list 231var postListSwiper = new Swiper('.post-list-slide', { 232 // loop: true, 233 slidesPerView: 1.06, 234 spaceBetween: 10, 235 navigation: { 236 nextEl: '.swiper-button-next', 237 prevEl: '.swiper-button-prev', 238 }, 239 pagination: { 240 el: '.swiper-pagination', 241 clickable: true, 242 }, 243 breakpoints: { 244 821: { //821pxä»¥ä¸ 245 slidesPerView: 3, 246 spaceBetween: 50, 247 } 248 } 249}); 250 251// 詳細ãã¼ã¸ç»åã¹ã©ã¤ãã¼ 252var editorSwiper = new Swiper('.js-swiper', { 253 slidesPerView: 1, 254 spaceBetween: 30, 255 navigation: { 256 nextEl: '.swiper-button-next', 257 prevEl: '.swiper-button-prev', 258 }, 259 pagination: { 260 el: '.js-pgn', 261 clickable: true, 262 }, 263}); 264 265//things to do 266$('.todo-item-slide').each(function() { 267 var loopSet = true; 268 var $childNum = $($(this).find('.post-item')).length; 269 if(winW >= 821 && winW < 1260) { 270 if($childNum<=2) { 271 loopSet = false; 272 } 273 } else if(winW >= 1260) { 274 if($childNum<=3) { 275 loopSet = false; 276 } 277 } 278 var todoSwiper = new Swiper(this, { 279 loop: loopSet, 280 // slidesPerView: 3.85, 281 spaceBetween: '2.8%', 282 navigation: { 283 nextEl: '.swiper-button-next', 284 prevEl: '.swiper-button-prev', 285 }, 286 pagination: { 287 el: '.swiper-pagination', 288 clickable: true, 289 }, 290 breakpoints: { 291 821: { //821pxä»¥ä¸ 292 slidesPerView: 2.5, 293 }, 294 1260: { //1260pxä»¥ä¸ 295 slidesPerView: 3.85, 296 } 297 } 298 }); 299}) 300 301//gallery01 302var gallery01Swiper = new Swiper('.gallery-1', { 303 loop: true, 304 slidesPerView: 1.63, 305 spaceBetween: 10, 306 navigation: { 307 nextEl: '.swiper-button-next', 308 prevEl: '.swiper-button-prev', 309 }, 310 pagination: { 311 el: '.swiper-pagination', 312 clickable: true, 313 }, 314 breakpoints: { 315 821: { //821pxä»¥ä¸ 316 slidesPerView: 2.56, 317 spaceBetween: '3.1%', 318 }, 319 } 320}) 321 322//gallery02 323var gallery02Swiper = new Swiper('.gallery-2', { 324 loop: true, 325 slidesPerView: 2, 326 spaceBetween: 10, 327 centeredSlides: true,
328 navigation: { 329 nextEl: '.swiper-button-next', 330 prevEl: '.swiper-button-prev', 331 }, 332 pagination: { 333 el: '.swiper-pagination', 334 clickable: true, 335 }, 336 breakpoints: { 337 821: { //821pxä»¥ä¸ 338 slidesPerView: 4.57, 339 spaceBetween: '1.05%', 340 }, 341 } 342}) 343 344/* Season Backgroundå¦ç 345*********************************************/ 346let running = false; 347let queuedSeason = null; 348let currentSeason = null; 349 350const $bg = $('.seasonal-highlights__bg'); 351 352function runFade(season) { 353 if (season === currentSeason) return; 354 if (running) { 355 queuedSeason = season; 356 return; 357 } 358 359 running = true; 360 361 $bg.stop(true, false).fadeTo(200, 0, function () { 362 $bg.css('background-image', `url("../img/common/bg_season_${season}.jpg")`); 363 currentSeason = season; 364 365 $bg.fadeTo(200, 1, function () { 366 running = false; 367 368 if (queuedSeason && queuedSeason !== season) { 369 const next = queuedSeason; 370 queuedSeason = null; 371 runFade(next); 372 } 373 }); 374 }); 375} 376 377$('.seasonal-highlights__season').hover( 378 function () { 379 const season = this.className.match(/--(spring|summer|autumn|winter)/)[1]; 380 runFade(season); 381 }, 382 function () {} 383); 384 385$('.seasonal-highlights__seasons').mouseleave(function () { 386 queuedSeason = null; 387 388 if (!running && currentSeason !== null) { 389 $bg.stop(true, false).fadeTo(200, 0, function () { 390 currentSeason = null; 391 }); 392 } 393}); 394 395 396/* micromodal 397*********************************************/ 398// MicroModal.init({ 399// disableScroll: true, 400// awaitOpenAnimation: true, 401// awaitCloseAnimation: true, 402// disableFocus: true, 403// }); 404 405 406/* page-top 407*********************************************/ 408var topBtn = $('.page-top'); 409topBtn.hide(); 410//æ¶ãã 411$(window).scroll(function () { 412 if ($(this).scrollTop() > 10) { 413 topBtn.fadeIn(); 414 } else { 415 topBtn.fadeOut(); 416 } 417}); 418//ã¹ã¯ãã¼ã«ãã¦ããã 419topBtn.click(function () { 420 $('body, html').animate({ 421 scrollTop: 0 422 }, 500); 423 return false; 424}); 425 426/* scroll ã¢ãã¡ã¼ã·ã§ã³ 427*********************************************/ 428// var $visibleArea = winH / 4 * 3; 429// var startPos = 0; 430 431// $(window).on('resize scroll', function(){ 432// var scroll = $(window).scrollTop(); 433 434// // ç»é¢ã«å ¥ã£ããä¸ãããµãã£ã¨è¡¨ç¤º 435// // $('.scrollin').each(function(){ 436// // var elemPos = $(this).offset().top; 437// // if (scroll > elemPos - $visibleArea){ 438// // $(this).addClass('is-visible'); 439// // } 440// // }); 441 442// // ãããã¼ä¸ã«ã¹ã¯ãã¼ã«ä¸ã¯é表示ã«ãã 443// // if(scroll > 60 && scroll > startPos ){ 444// // $('.l-header').addClass('l-header--minimum'); 445// // }else{ 446// // $('.l-header').removeClass('l-header--minimum') 447// // } 448// // startPos = scroll; 449 450// }); 451 452/* accordion 453*********************************************/ 454$('.js-accordion-btn').on('click', function() { 455 // ariaã®æ¸ãæã 456 let expanded = $(this).attr('aria-expanded') === 'true', 457 controls = $(this).attr('aria-controls'); 458 $(this).attr('aria-expanded', !expanded); 459 $('#' + controls).attr('aria-hidden', expanded); 460 461 // buttonã«ééç¶æ ã®ã¯ã©ã¹ä»ä¸ 462 $(this).toggleClass('is-open'); 463 464 // contentéé 465 $('#' + controls).slideToggle(200); 466 467 // ããªã¬ã¼ãã¿ã³ã«ããç¢å°ã¢ã¤ã³ã³ã®altã®å¤æ´ 468 var tglIon = $(this).find('.js-accordion-icon'); 469 if( $(tglIon).length>0 ) { 470 if( $(this).attr('aria-expanded') == 'false' ) { 471 tglIon.attr('alt', 'Open'); 472 } else { 473 tglIon.attr('alt', 'Close'); 474 } 475 } 476}); 477 478$('.js-accordion-btn').each(function() { 479 if($(this).hasClass('is-open')) { 480 let controls = $(this).attr('aria-controls'); 481 $(this).attr('aria-expanded', 'true'); 482 $('#' + controls).attr('aria-hidden', 'false'); 483 484 // contentéé 485 $('#' + controls).show(); 486 487 // ããªã¬ã¼ãã¿ã³ã«ããç¢å°ã¢ã¤ã³ã³ã®altã®å¤æ´ 488 var tglIon = $(this).find('.js-accordion-icon'); 489 if( $(tglIon).length>0 ) { 490 tglIon.attr('alt', 'Close'); 491 } 492 } 493}); 494 495/* tab 496*********************************************/ 497$('.js-tab').each(function () { 498 const $tab = $(this); 499 const $tabListItem = $tab.children().find('> .js-tablist .js-tablist__item'); 500 const $tabContent = $tab.find('>
500 .gnavi__contents > [role="tabpanel"], > .areaguide__detail > [role="tabpanel"]'); 501 let tabFocus = 0; 502 503 // åæè¨å® 504 $tabListItem.attr('tabindex', '-1'); 505 const $defaultActive = $tabListItem.filter('[aria-selected="true"]'); 506 $defaultActive.removeAttr('tabindex'); 507 508 const defaultControls = $defaultActive.attr('aria-controls'); 509 $tab.find('#' + defaultControls).removeClass('is-hidden'); 510 511 // ------- 颿°: ã¿ãåãæ¿ã ------- 512 function tabFunc($this) { 513 const controls = $this.attr('aria-controls'); 514 515 // reset 516 $tabListItem.attr({ 517 'aria-selected': 'false', 518 'tabindex': '-1' 519 }); 520 $tabContent.addClass('is-hidden'); 521 522 // 鏿ãããã¿ã 523 $this.attr('aria-selected', 'true').removeAttr('tabindex'); 524 525 // ããã«è¡¨ç¤º 526 $tab.find('#' + controls).removeClass('is-hidden'); 527 } 528 529 // ------- ã¯ãªãã¯ã¤ãã³ã ------- 530 $tabListItem.on('click', function () { 531 tabFunc($(this)); 532 tabFocus = $tabListItem.index(this); // ç¾å¨ã®ä½ç½®ãæ´æ° 533 }); 534 535 // ------- ãã¼ãã¼ãæä½ï¼å·¦å³ãã¼ï¼ ------- 536 $tabListItem.on('keydown', function (e) { 537 538 if (e.keyCode === 39 || e.keyCode === 37) { 539 540 if (e.keyCode === 39) { // â 541 tabFocus++; 542 if (tabFocus >= $tabListItem.length) tabFocus = 0; 543 544 } else if (e.keyCode === 37) { // â 545 tabFocus--; 546 if (tabFocus < 0) tabFocus = $tabListItem.length - 1; 547 } 548 549 $tabListItem.eq(tabFocus).focus(); 550 tabFunc($tabListItem.eq(tabFocus)); 551 } 552 }); 553}); 554 555/* smooth scroll ï¼åºæ¬çã«ã¯ä½¿ããªãâcssã®scroll-behavior: smooth;ã«ã¦å¯¾å¿ï¼ 556*********************************************/ 557// var headerHeight = 0; 558// // var headerHeight = $('.l-header').outerHeight(); //headerã常æè¿½å¾ã®å ´åã¯ãããã¢ã³ã³ã¡ã³ã 559// var urlHash = location.hash; 560 561// if(urlHash) { 562// $('body,html').stop().scrollTop(0); 563// setTimeout(function(){ 564// var target = $(urlHash); 565// smoothScroll(target); 566// }, 100); 567// } 568// $('.anchor').click(function() { 569// var href= $(this).attr("href"); 570// var target = $(href); 571// smoothScroll(target); 572// return false; 573// }); 574 575// function smoothScroll(target) { 576// var position = target.offset().top - headerHeight; 577// $("html, body").animate({scrollTop:position}, anchorSpeed, "swing"); 578// } 579 580/******************************************** 581 [PC ONLY] 582*********************************************/ 583function pcSizeOnly(){ 584 585 /* ç»åPC/SPåãæ¿ã 586 *******************************************/ 587 changeImgPc(); 588 589 /* ã¡ãã¥ã¼ã®resetï¼SPã®ã¿ããã³ãã¼ã¬ã¼ãã¿ã³ã®å ´åï¼ 590 *******************************************/ 591 $('#navi').removeAttr('style').removeAttr('aria-hidden'); 592 593} 594// PCã¡ãã¥ã¼ãµã¤ãºç¨åå² 595// function pcMenuSizeOnly(){ 596 597// } 598 599/******************************************** 600 [SP ONLY] 601*********************************************/ 602function spSizeOnly(){ 603 604 /* ç»åPC/SPåãæ¿ã 605 *******************************************/ 606 changeImgSp(); 607 608 /* ã¡ãã¥ã¼ã®resetï¼SPã®ã¿ããã³ãã¼ã¬ã¼ãã¿ã³ã®å ´åï¼ 609 *******************************************/ 610 $('#navi').attr('aria-hidden', 'true'); 611 $('.menu-btn').removeClass('is-open').attr({ 612 'aria-label': 'ãµã¤ãã¡ãã¥ã¼ãéã', 613 'aria-expanded': 'false' 614 }); 615 616} 617// SPã¡ãã¥ã¼ãµã¤ãºç¨åå² 618// function spMenuSizeOnly(){ 619 620// } 621 622/******************************************** 623 [PC/SPåãæ¿ã] 以ä¸ç·¨éä¸å¯ 624*********************************************/ 625function descriminateBp(){ 626 winW = $window.width(); 627 if(winW <= breakPoint){ 628 spSizeOnly(); 629 }else if(winW > breakPoint){ 630 pcSizeOnly(); 631 } 632 // ãã¬ã¤ã¯ãã¤ã³ããå¢ããå ´å 633 // if(winW <= 1000){ 634 // spMenuSizeOnly(); 635 // }else if(winW > 1000){ 636 // pcMenuSizeOnly(); 637 // } 638} 639descriminateBp(); 640$window.resize(function() { 641 if(winW > $window.width() || winW < $window.width()){ 642 if (resizeTimer !== false) { 643 clearTimeout(resizeTimer); 644 } 645 resizeTimer = setTimeout(descriminateBp, 200); 646 } 647}); 648 649}); 650 651 652/******************************************** 653ãã¼ã¸å é·ç§»ãç»åé å»¶èªã¿è¾¼ã¿å¯¾ç 654*********************************************/ 655 656$(window).on('load', function () { 657 var hash = window.location.hash; 658 if (!hash) return; 659 660 // Chromeå¤å® 661 var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); 662
663 var delay = isChrome ? 500 : 0; // Chromeã ãé ããã 664 665 setTimeout(function () { 666 var $target = $(hash); 667 if (!$target.length) return; 668 669 var offset = 100; 670 var position = $target.offset().top - offset; 671 672 $('html, body').scrollTop(position); 673 }, delay); 674});
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.