1// JavaScript Document 2 3 4// Global ---------------------------------------- 5 6const windowWidth = $(window).width(); // ã¦ã£ã³ãã¦å¹ åå¾ 7const custom_root = document.querySelector(':root'); // ã«ã¹ã¿ã ããããã£åå¾ 8const str_bp = getComputedStyle(custom_root).getPropertyValue('--breakpoint'); // css夿°ãã¬ã¤ã¯ãã¤ã³ã 9const windowSm = str_bp.replace("px", ""); // pxåé¤ 10 11 12// ãã¬ã¤ã¯ãã¤ã³ãã§ãªãã¼ã ---------------------------------------- 13 14const breakpoint = window.matchMedia('(max-width: ' + str_bp + ')'); 15breakpoint.addEventListener("change", () => { 16 window.location.reload(); 17}); 18 19 20// é»è©±çªå· ---------------------------------------- 21 22if (navigator.userAgent.match(/(iPhone|iPad|Android|Mobile)/)) { 23 $('.js-tel').each(function() { 24 let telNumber; 25 if ($(this).children().is('img')) { 26 telNumber = $(this).children().attr('alt').replace(/-/g, ''); 27 } else { 28 telNumber = $(this).text().replace(/-/g, ''); 29 } 30 $(this).wrap('<a href="tel:' + telNumber + '" style="display: inline-block"></a>'); 31 }); 32} 33 34 35// Gãã ---------------------------------------- 36 37$('#nav #sp_menu').on('click', function(){ // SPãã³ãã¼ã¬ã¼ã¢ã¼ãã« 38 $('html, body').toggleClass('spnav_modal'); 39 $(this).toggleClass('close'); 40 $('#nav .gnav_subnav').slideToggle(); 41 return false; 42}); 43$('#nav #menu_close').click(function(){ // ã¨ãããã¿ã³ 44 $('html, body').removeClass('spnav_modal'); 45 $('#nav #sp_menu').removeClass('close'); 46 $('#nav .gnav_subnav').slideUp(); 47 return false; 48}); 49 50 51if(windowWidth < windowSm){ // SPã®å ´å 52 $('#nav a').click(function(){ // æ»ããã¿ã³ã§æ»ã£ãæã«ã¡ãã¥ã¼éãã¦ãããã対ç 53 $('html, body').removeClass('spnav_modal'); 54 $('#nav #sp_menu').removeClass('close'); 55 $('#nav .gnav_subnav').slideUp(); 56 }); 57} 58 59// ãã³ãã¼ã¬ã¼å ãã¹ã¯ãã¼ã«å¦ç 60const setVh = () => { 61 const vh = window.innerHeight * 0.01; 62 document.documentElement.style.setProperty('--vh', `${vh}px`); 63} 64window.addEventListener('load', setVh); 65 66// ãã³ãã¼ã¬ã¼å ããªãµã¤ãºå¦ç 67let vw = window.innerWidth; 68window.addEventListener('resize', () => { 69 if (vw === window.innerWidth) { 70 return; // ç»é¢ã®æ¨ªå¹ ã«ãµã¤ãºå¤åããªãã®ã§å¦çãçµãã 71 } 72 // ç»é¢ã®æ¨ªå¹ ã®ãµã¤ãºå¤åããã£ãæã®ã¿é«ããåè¨ç®ãã 73 vw = window.innerWidth; 74 setVh(); 75}); 76setVh(); // åæå 77 78// 診çå 容ãããããã¦ã³ã¡ãã¥ã¼ 79$('#nav .sub').click(function(){ 80 $(this).toggleClass('close').next('#nav .subbox').slideToggle(); 81 if(windowWidth >= windowSm){ // PCã®å ´å 82 $('#nav .sub').not(this).removeClass('close').next('#nav .subbox').slideUp(); 83 } 84 return false; 85}); 86 87// ã¨ãªã¢å¤ã¯ãªãã¯ã§éãã 88$(document).on('click', function(e){ 89 if(windowWidth < windowSm){ // ã¹ããã®å ´å 90 if($('.spnav_modal').is(':visible')){ 91 if(!$(e.target).closest('#nav .gnav_subnav').length){ 92 $('html, body').removeClass('spnav_modal'); 93 $('#nav #sp_menu, #nav #menu_close').removeClass('close'); 94 $('#nav .gnav_subnav').slideUp(); 95 } 96 } 97 } else { // PCã®å ´å 98 $('html, body').removeClass('spnav_modal'); 99 if($('#nav .subbox').is(':visible')){ 100 if(!$(e.target).closest('#nav').length){ // ã¿ãã¬ããå¯¾å¿ 101 $('#nav .sub').removeClass('close'); 102 $('#nav .subbox').slideUp(); 103 } 104 } 105 } 106}); 107 108// ã«ã¬ã³ãã¡ãã¥ã¼å¦ç ---------------------------------------- 109const currentURL = location.href; 110const currentURLNoHash = currentURL.replace(/#.*$/, ""); 111 112// ãã¹ã¦ã® current ã¯ã©ã¹ã䏿¦åé¤ 113$('#nav .current, .subnav .current').removeClass('current'); 114 115// ããã·ã¥ãªãã¨å®å ¨ä¸è´ 116$('#nav a, .subnav a').filter(function(){ 117 return $(this).prop('href') === currentURL || $(this).prop('href') === currentURLNoHash; 118}).addClass('current'); 119 120// ã¢ã³ã«ã¼ããç¨ 121$('#nav a[href*="#"]').on('click', function(){ 122 $('#nav a, .subnav a').removeClass('current'); 123 $(this).addClass('current'); 124}); 125 126 127// ãããããã¼ãã¸ã¥ã¢ã«ãslick ---------------------------------------- 128 129$('#keyvsl').slick({ 130 cssEase: 'linear', // ä¸å®é度 131 autoplay: true, // Autoplay 132 autoplaySpeed: 5000, // ã¤ã³ã¿ã¼ãã« 133 speed: 700, // åæ¿æé
134 arrows: false, // Prev/Next 135 dots: false, // ã¤ã³ã¸ã±ã¼ã¿ã¼ 136 fade: true 137}); 138$('#keyvsl').delay(50).css('visibility','visible'); 139 140 141// æ°ãç¥ããã¨ãã£ã¿ -------------------------------------------- 142// DOM夿´ãç£è¦ããå ±é颿° 143function watchDOM(selector, callback) { 144 const observer = new MutationObserver(() => { 145 callback(); // æå®ãããå¦çãå®è¡ 146 }); 147 148 const container = $(selector)[0]; 149 150 if (container) { 151 observer.observe(container, { 152 childList: true, // åè¦ç´ ã®è¿½å ã»åé¤ãç£è¦ 153 subtree: true // å«è¦ç´ 以ä¸ã®å¤æ´ãç£è¦ 154 }); 155 } 156} 157 158function initAccordion() { 159 // æåã®3ã¤ãéã 160 $('.accordion-item').each(function(index) { 161 if (index < 3) { 162 $(this).prop('open', true).addClass('open'); 163 } 164 }); 165 166 // ã¯ãªãã¯ã¤ãã³ãè¨å®ï¼éè¤ç»é²ãé²ãï¼ 167 $('.accordion-item').off('toggle.accordion').on('toggle.accordion', function() { 168 $(this).toggleClass('open', this.open); 169 }); 170} 171 172// é©ç¨ 173$(function() { 174 initAccordion(); // ååç¨ 175 watchDOM('[data-styled]', initAccordion); // Vueã§çæãããHTMLã«ãå¯¾å¿ 176}); 177 178// ã«ã«ã¼ã»ã«ï¼ãã©ï¼ ---------------------------------------- 179 180$('#loopslider').on('init', function(){ 181 $('#loopslider .slick-slide').each(function(i){ 182 if(i % 2){ 183 $(this).addClass('is-even'); 184 } 185 }); 186}); 187 188 189$('#loopslider').slick({ 190 arrows: false, 191 dots: false, 192 infinite: true, 193 autoplay: true, 194 autoplaySpeed: 0, 195 speed: 3000, 196 cssEase: 'linear', 197 slidesToScroll: 1, 198 pauseOnHover: false, 199 pauseOnFocus: false, 200 swipe: false, 201 draggable: false, 202 centerMode: true, 203 variableWidth: true, 204}); 205 206 207// ã¯ãªããã¯ç´¹ä»ã®ã£ã©ãªã¼/ã¢ã¯ã»ã¹ã«ã¼ãã®ã£ã©ãªã¼ slick ---------------------------------------- 208 209$(".gallery_slider, .route_slider").each(function(){ // ã¡ã¤ã³ç»å 210 $(this).slick({ 211 cssEase: 'linear', // ä¸å®é度 212 infinite: !$(this).hasClass("route_slider"), 213// autoplay: true, // Autoplay 214// autoplaySpeed: 5000, // ã¤ã³ã¿ã¼ãã« 215 dots: true, // ã¤ã³ã¸ã±ã¼ã¿ã¼ 216 fade: true, 217 speed: 500, // åæ¿æé 218 adaptiveHeight: true, // å 容ã«ãã£ã¦é«ãå¯å¤ 219 asNavFor: "#" + $(this).attr("id") + "_nav", // è¤æ°ã¹ã©ã¤ãå¯¾å¿ 220 responsive: [{ // SPã¢ãã¼ãªãã®å ´å 221 breakpoint: 576, // ã¹ããã®å ´å 222 settings: { 223 arrows: false, 224 },}, 225 ] 226 }); 227}); 228$(".gallery_thum, .route_thum").each(function(){ // ãµã ã 229 $(this).slick({ 230 infinite: !$(this).hasClass("route_thum"), 231 slidesToShow: 7, 232 slidesToScroll: 1, 233 centerMode: true, 234 centerPadding: 0, 235 arrows: false, // Prev/Next 236 cssEase: 'linear', // ä¸å®é度 237 focusOnSelect: true, // ã¯ãªãã¯ã§åãæ¿ã 238 asNavFor: "#" + $(this).attr("id").replace("_nav", ""), // è¤æ°ã¹ã©ã¤ãå¯¾å¿ 239 responsive: [{ 240 breakpoint: 576, // ã¹ããã®å ´å 241 settings: { 242 slidesToShow: 3, 243 },}, 244 ] 245 }); 246}); 247$('.gallery').delay(50).css('visibility','visible'); 248 249 250// ããã¿ã¼åã®æå¾ã®ãï½ãèª¿æ´ ----------------------------------------------- 251// æå¾å°¾ã®liã« .last-in-row ãä»ãã 252 253function LastInRow() { 254const $items = $(".footer ul li:visible"); 255 $items.removeClass("last-in-row"); 256 const rowMap = {}; 257 $items.each(function () { 258 const top = Math.round($(this).offset().top); 259 if (!rowMap[top]) { 260 rowMap[top] = []; 261 } 262 rowMap[top].push(this); 263 }); 264 $.each(rowMap, function (_, row) { 265 const lastItem = row[row.length - 1]; 266 $(lastItem).addClass("last-in-row"); 267 }); 268} 269function runLastInRowWithDelay() { // å°ãå¾ ã¤ 270 setTimeout(() => { 271 requestAnimationFrame(LastInRow); 272 }, 100); 273} 274$(window).on("load resize", runLastInRowWithDelay); 275 276 277// SPããã¿ã¼åºå®ãé»è©±ã»WEbäºç´ã»ãã¼ã¸ã¢ãã ---------------------------------------- 278 279$('#tel_up').hide(); 280$(window).scroll(function(){ 281 if($(this).scrollTop() > 200){ 282 $('#tel_up').fadeIn().css('visibility', 'visible'); 283 } else { 284 $('#tel_up').fadeOut(); 285 } 286}); 287$('#pageup').on('click', function(){ 288 $('html, body').animate({ scrollTop: 0 }, 500, 'swing'); 289 return false; 290}); 291 292 293// ã¢ã¼ãã« ----------------------------------------------- 294 295// éã 296$('[id^="open_modal"]').on('click', function () { 297 const num = this.id.replace('open_modal', ''); 298 const modal = document.getElementById(`modal${num}`); 299 300 modal.showModal(); 301 modal.scrollTop = 0; 302 $('body').addClass('modal_open'); 303}); 304 305// éãã 306$('.close_modal').on('click', function () { 307 const modal = $(this).closest('dialog')[0]; 308 309 modal.close(); 310 $('body').removeClass('modal_open'); 311}); 312 313// èæ¯ã¯ãªãã¯ã§éãã 314$('dialog.modal_box').on('click', function (e) { 315 if (e.target === this) { 316 this.close(); 317 $('body').removeClass('modal_open'); 318 } 319});
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.