1// ã¹ã©ã¤ãã¼é¢é£ãã¾ã¨ãã颿°ãå®ç¾© 2function initializeAllSliders() { 3 /** 4 * ã¹ã©ã¤ãã¼é¢é£ã®æ©è½ã管çãããã¡ã¤ã« 5 * ã¿ã¤ããã¨ã«æ±ç¨çã«ä½¿ããSwiperã®è¨å® 6 */ 7 // ãã¬ã¤ã¯ãã¤ã³ãè¨å® 8 const BREAKPOINT = { 9 MOBILE: 768, 10 TABLET: 1024 11 }; 12 13 // ã¹ã¯ãªã¼ã³ãµã¤ãºã«å¿ãã¦bodyã¯ã©ã¹ãè¨å® 14 function setBodyClass() { 15 const screenWidth = window.innerWidth; 16 const body = document.body; 17 18 body.classList.remove('is-mobile', 'is-tablet', 'is-desktop'); 19 20 if (screenWidth <= BREAKPOINT.MOBILE) { 21 body.classList.add('is-mobile'); 22 } else if (screenWidth <= BREAKPOINT.TABLET) { 23 body.classList.add('is-tablet'); 24 } else { 25 body.classList.add('is-desktop'); 26 } 27 } 28 29 // åæåæã«ä¸åº¦bodyã¯ã©ã¹ãè¨å® 30 setBodyClass(); 31 32 //=========================================== 33 // column3-1 swiper 34 //=========================================== 35 (function() { 36 // è¨å® 37 const DEFAULT_MODE = 'responsive'; // responsive, always, never 38 const swiperInstances = {}; 39 40 // åæå颿° 41 function init() { 42 // ãã¹ã¦ã®column3-1ã³ã³ãããæ¤ç´¢ 43 const columnContainers = document.querySelectorAll('.column3-1'); 44 if (columnContainers.length === 0) return; 45 46 columnContainers.forEach((container, index) => { 47 // ã¹ã¯ã¤ãã¼ã³ã³ãããåå¾ 48 const swiperContainer = container.querySelector('.contents-column__swiper'); 49 if (!swiperContainer) { 50 console.warn('column3-1: .contents-column__swiperè¦ç´ ãè¦ã¤ããã¾ãã'); 51 return; 52 } 53 54 // ã¤ã³ã¹ã¿ã³ã¹IDçæ 55 const section = container.closest('section'); 56 const prefix = section && section.id ? section.id : 'column3'; 57 const uniqueIndex = section && section.id ? index : Math.floor(Math.random() * 10000); 58 const instanceId = `${prefix}-column3-${uniqueIndex}`; 59 60 // swiperModeã®è¨å®ãåå¾ 61 const swiperMode = container.dataset.swiperMode || DEFAULT_MODE; 62 63 // ã¹ã¯ãªã¼ã³å¹ ã«åºã¥ãã¦åæåãããã©ããã夿 64 const screenWidth = window.innerWidth; 65 const isMobile = screenWidth <= BREAKPOINT.MOBILE; 66 67 // æ¢åã®ã¤ã³ã¹ã¿ã³ã¹ãããã°ç ´æ£ 68 if (swiperInstances[instanceId]) { 69 destroySwiper(instanceId); 70 } 71 72 // ã¢ã¼ãã«å¿ãã¦ã¹ã¯ã¤ãã¼ãåæå 73 let shouldInit = false; 74 75 swiperContainer.classList.remove('swiper-always-active', 'swiper-never-active'); 76 77 // contents-column__itemsè¦ç´ ãåå¾ï¼åå¨ããå ´åï¼ 78 const itemsContainer = container.querySelector('.contents-column__items'); 79 80 switch (swiperMode) { 81 case 'responsive': 82 shouldInit = isMobile; 83 // itemsè¦ç´ ããã¯ã©ã¹ãåé¤ 84 if (itemsContainer) { 85 itemsContainer.classList.remove('swiper-never'); 86 } 87 break; 88 case 'always': 89 swiperContainer.classList.add('swiper-always-active'); 90 shouldInit = true; 91 // itemsè¦ç´ ããã¯ã©ã¹ãåé¤ 92 if (itemsContainer) { 93 itemsContainer.classList.remove('swiper-never'); 94 } 95 break; 96 case 'never': 97 swiperContainer.classList.add('swiper-never-active'); 98 shouldInit = false;
99 // itemsè¦ç´ ã«ã¯ã©ã¹ã追å 100 if (itemsContainer) { 101 itemsContainer.classList.add('swiper-never'); 102 } 103 break; 104 default: 105 shouldInit = isMobile; 106 // itemsè¦ç´ ããã¯ã©ã¹ãåé¤ 107 if (itemsContainer) { 108 itemsContainer.classList.remove('swiper-never'); 109 } 110 break; 111 } 112 113 if (shouldInit) { 114 createSwiper(swiperContainer, instanceId); 115 } 116 }); 117 } 118 119 // Swiper使 120 function createSwiper(container, instanceId) { 121 try { 122 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ã®è¦ç´ ãç¢ºèª 123 const pagination = container.querySelector('.contents-column__pagination'); 124 const nextButton = container.querySelector('.contents-column__nav-button--next'); 125 const prevButton = container.querySelector('.contents-column__nav-button--prev'); 126 127 // Swiperãªãã·ã§ã³ 128 const options = { 129 slidesPerView: 'auto', 130 spaceBetween: 15, 131 centeredSlides: true, 132 loop: false, 133 grabCursor: true 134 }; 135 136 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ãè¨å® 137 if (pagination) { 138 options.pagination = { 139 el: pagination, 140 clickable: true 141 }; 142 } 143 144 if (nextButton && prevButton) { 145 options.navigation = { 146 nextEl: nextButton, 147 prevEl: prevButton 148 }; 149 } 150 151 // Swiperã¤ã³ã¹ã¿ã³ã¹ä½æ 152 swiperInstances[instanceId] = new Swiper(container, options); 153 console.log(`column3-1: ${instanceId} ã®Swiperãåæåãã¾ãã`); 154 } catch (error) { 155 console.error(`column3-1: ${instanceId} ã®Swiperåæåã«å¤±æãã¾ãã`, error); 156 swiperInstances[instanceId] = null; 157 } 158 } 159 160 // Swiperç ´æ£ 161 function destroySwiper(instanceId) { 162 if (!swiperInstances[instanceId]) return; 163 164 try { 165 const container = swiperInstances[instanceId].el; 166 167 // Swiperç ´æ£ 168 swiperInstances[instanceId].destroy(true, true); 169 170 // 追å ãããã¹ã¿ã¤ã«ããªã»ãã 171 const wrapper = container.querySelector('.swiper-wrapper'); 172 if (wrapper) { 173 wrapper.style.transform = ''; 174 wrapper.style.width = ''; 175 wrapper.style.display = ''; 176 } 177 178 const slides = container.querySelectorAll('.swiper-slide');
179 slides.forEach(slide => { 180 slide.style.width = ''; 181 slide.style.marginRight = ''; 182 }); 183 184 swiperInstances[instanceId] = null; 185 console.log(`column3-1: ${instanceId} ã®Swiperãç ´æ£ãã¾ãã`); 186 } catch (error) { 187 console.error(`column3-1: Swiperç ´æ£ã«å¤±æãã¾ãã`, error); 188 swiperInstances[instanceId] = null; 189 } 190 } 191 192 // åæåå®è¡ 193 init(); 194 195 // ãªãµã¤ãºã¤ãã³ã 196 let resizeTimer; 197 window.addEventListener('resize', function() { 198 clearTimeout(resizeTimer); 199 resizeTimer = setTimeout(function() { 200 setBodyClass(); 201 init(); 202 }, 250); 203 }); 204 })(); 205 206 //=========================================== 207 // slide3-1 swiper 208 //=========================================== 209 (function() { 210 // è¨å® 211 const DEFAULT_MODE = 'always'; // responsive, always, never 212 const swiperInstances = {}; 213 214 // åæå颿° 215 function init() { 216 // ãã¹ã¦ã®slide3-1ã³ã³ãããæ¤ç´¢ 217 const slideContainers = document.querySelectorAll('.slide3-1'); 218 if (slideContainers.length === 0) return; 219 220 slideContainers.forEach((container, index) => { 221 // ã¹ã¯ã¤ãã¼ã³ã³ãããåå¾ 222 const swiperContainer = container.querySelector('.contents-slide__swiper'); 223 if (!swiperContainer) { 224 console.warn('slide3-1: .contents-slide__swiperè¦ç´ ãè¦ã¤ããã¾ãã'); 225 return; 226 } 227 228 // ã¤ã³ã¹ã¿ã³ã¹IDçæ 229 const section = container.closest('section'); 230 const prefix = section && section.id ? section.id : 'slide3'; 231 const uniqueIndex = section && section.id ? index : Math.floor(Math.random() * 10000); 232 const instanceId = `${prefix}-slide3-${uniqueIndex}`; 233 234 // è¨å®å¤ãåå¾ï¼ã³ã³ããããç´æ¥ï¼ 235 const swiperMode = container.dataset.swiperMode || DEFAULT_MODE; 236 const centeredOption = container.dataset.swiperCentered || 'mobile-only'; // mobile-only, always, never 237 238 // ã¹ã¯ãªã¼ã³å¹ ã«åºã¥ãã¦åæåãããã©ããã夿 239 const screenWidth = window.innerWidth; 240 const isMobile = screenWidth <= BREAKPOINT.MOBILE; 241 242 // æ¢åã®ã¤ã³ã¹ã¿ã³ã¹ãããã°ç ´æ£ 243 if (swiperInstances[instanceId]) { 244 destroySwiper(instanceId); 245 } 246 247 // ã¢ã¼ãã«å¿ãã¦ã¹ã¯ã¤ãã¼ãåæå 248 let shouldInit = false; 249 250 swiperContainer.classList.remove('swiper-always-active', 'swiper-never-active'); 251 252 switch (swiperMode) { 253 case 'responsive': 254 shouldInit = isMobile; 255 break; 256 case 'always': 257 swiperContainer.classList.add('swiper-always-active'); 258 shouldInit = true; 259 break; 260 case 'never': 261 swiperContainer.classList.add('swiper-never-active'); 262 shouldInit = false; 263 break; 264 default: 265 shouldInit = isMobile; 266 break; 267 } 268 269 if (shouldInit) { 270 createSwiper(swiperContainer, instanceId, centeredOption, isMobile); 271 } 272 }); 273 } 274 275 // Swiper使 276 function createSwiper(container, instanceId, centeredOption, isMobile) { 277 try { 278 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ã®è¦ç´ ãç¢ºèª 279 const pagination = container.querySelector('.contents-slide__pagination'); 280 const nextButton = container.querySelector('.contents-slide__nav-button--next'); 281 const prevButton = container.querySelector('.contents-slide__nav-button--prev'); 282 283 // centeredSlidesã®å¤ãæ±ºå® 284 let centeredSlides = false;
285 switch (centeredOption) { 286 case 'mobile-only': 287 centeredSlides = isMobile; 288 break; 289 case 'always': 290 centeredSlides = true; 291 break; 292 case 'never': 293 centeredSlides = false; 294 break; 295 default: 296 centeredSlides = isMobile; 297 break; 298 } 299 300 // Swiperãªãã·ã§ã³ 301 const options = { 302 slidesPerView: 'auto', 303 spaceBetween: 15, 304 centeredSlides: centeredSlides, 305 loop: false, 306 grabCursor: true 307 }; 308 309 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ãè¨å® 310 if (pagination) { 311 options.pagination = { 312 el: pagination, 313 clickable: true 314 }; 315 } 316 317 if (nextButton && prevButton) { 318 options.navigation = { 319 nextEl: nextButton, 320 prevEl: prevButton 321 }; 322 } 323 324 // Swiperã¤ã³ã¹ã¿ã³ã¹ä½æ 325 swiperInstances[instanceId] = new Swiper(container, options); 326 console.log(`slide3-1: ${instanceId} ã®Swiperãåæåãã¾ãã (centered: ${centeredSlides})`); 327 } catch (error) { 328 console.error(`slide3-1: ${instanceId} ã®Swiperåæåã«å¤±æãã¾ãã`, error); 329 swiperInstances[instanceId] = null; 330 } 331 } 332 333 // Swiperç ´æ£ 334 function destroySwiper(instanceId) { 335 if (!swiperInstances[instanceId]) return; 336 337 try { 338 const container = swiperInstances[instanceId].el; 339 340 // Swiperç ´æ£ 341 swiperInstances[instanceId].destroy(true, true); 342 343 // 追å ãããã¹ã¿ã¤ã«ããªã»ãã 344 const wrapper = container.querySelector('.swiper-wrapper'); 345 if (wrapper) { 346 wrapper.style.transform = ''; 347 wrapper.style.width = ''; 348 wrapper.style.display = ''; 349 } 350 351 const slides = container.querySelectorAll('.swiper-slide');
352 slides.forEach(slide => { 353 slide.style.width = ''; 354 slide.style.marginRight = ''; 355 }); 356 357 swiperInstances[instanceId] = null; 358 console.log(`slide3-1: ${instanceId} ã®Swiperãç ´æ£ãã¾ãã`); 359 } catch (error) { 360 console.error(`slide3-1: Swiperç ´æ£ã«å¤±æãã¾ãã`, error); 361 swiperInstances[instanceId] = null; 362 } 363 } 364 365 // åæåå®è¡ 366 init(); 367 368 // ãªãµã¤ãºã¤ãã³ã 369 let resizeTimer; 370 window.addEventListener('resize', function() { 371 clearTimeout(resizeTimer); 372 resizeTimer = setTimeout(function() { 373 setBodyClass(); 374 init(); 375 }, 250); 376 }); 377 })(); 378 379 //=========================================== 380 // slide1-1 swiper (ãã§ã¼ã广) 381 //=========================================== 382 (function() { 383 const swiperInstances = {}; 384 385 // åæå颿° 386 function init() { 387 // ãã¹ã¦ã®slide1-1ã³ã³ãããæ¤ç´¢ 388 const slideContainers = document.querySelectorAll('.slide1-1'); 389 if (slideContainers.length === 0) return; 390 391 slideContainers.forEach((container, index) => { 392 // ã¹ã¯ã¤ãã¼ã³ã³ãããåå¾ 393 const swiperContainer = container.querySelector('.contents-slide__swiper'); 394 if (!swiperContainer) { 395 console.warn('slide1-1: .contents-slide__swiperè¦ç´ ãè¦ã¤ããã¾ãã'); 396 return; 397 } 398 399 // ã¤ã³ã¹ã¿ã³ã¹IDçæ 400 const section = container.closest('section'); 401 const prefix = section && section.id ? section.id : 'slide1'; 402 const uniqueIndex = section && section.id ? index : Math.floor(Math.random() * 10000); 403 const instanceId = `${prefix}-slide1-${uniqueIndex}`; 404 405 // ã«ã¹ã¿ã ãªãã·ã§ã³ã®åå¾ï¼ã³ã³ããããï¼ 406 const delay = container.dataset.swiperDelay ? parseInt(container.dataset.swiperDelay) : 3000; 407 const speed = container.dataset.swiperSpeed ? parseInt(container.dataset.swiperSpeed) : 1000; 408 409 // æ¢åã®ã¤ã³ã¹ã¿ã³ã¹ãããã°ç ´æ£ 410 if (swiperInstances[instanceId]) { 411 try { 412 swiperInstances[instanceId].destroy(true, true); 413 swiperInstances[instanceId] = null; 414 } catch (error) { 415 console.error(`slide1-1: Swiperç ´æ£ã«å¤±æãã¾ãã`, error); 416 } 417 } 418 419 try { 420 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ã®è¦ç´ ãç¢ºèª 421 const pagination = swiperContainer.querySelector('.swiper-pagination'); 422 const nextButton = swiperContainer.querySelector('.swiper-button-next'); 423 const prevButton = swiperContainer.querySelector('.swiper-button-prev'); 424 425 // Swiperãªãã·ã§ã³ 426 const options = { 427 loop: true, 428 speed: speed, 429 autoplay: { 430 delay: delay, 431 disableOnInteraction: false, 432 }, 433 effect: 'fade', 434 fadeEffect: { 435 crossFade: true, 436 } 437 }; 438 439 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ãè¨å® 440 if (pagination) { 441 options.pagination = { 442 el: pagination, 443 clickable: true 444 }; 445 } 446 447 if (nextButton && prevButton) { 448 options.navigation = { 449 nextEl: nextButton, 450 prevEl: prevButton 451 }; 452 } 453 454 // Swiperã¤ã³ã¹ã¿ã³ã¹ä½æ 455 swiperInstances[instanceId] = new Swiper(swiperContainer, options); 456 console.log(`slide1-1: ${instanceId} ã®Swiperãåæåãã¾ãã (delay: ${delay}, speed: ${speed})`); 457 } catch (error) { 458 console.error(`slide1-1: ${instanceId} ã®Swiperåæåã«å¤±æãã¾ãã`, error); 459 swiperInstances[instanceId] = null; 460 } 461 }); 462 } 463 464 // åæåå®è¡ 465 init(); 466 467 // ãªãµã¤ãºã¤ãã³ã 468 let resizeTimer; 469 window.addEventListener('resize', function() { 470 clearTimeout(resizeTimer); 471 resizeTimer = setTimeout(function() { 472 init(); 473 }, 250); 474 }); 475 })(); 476 477 //=========================================== 478 // slide2-1 swiper (ãã§ã¼ã广) 479 //=========================================== 480 (function() { 481 const swiperInstances = {}; 482 483 // åæå颿°
484 function init() { 485 // ãã¹ã¦ã®slide2-1ã³ã³ãããæ¤ç´¢ 486 const slideContainers = document.querySelectorAll('.slide2-1'); 487 if (slideContainers.length === 0) return; 488 489 slideContainers.forEach((container, index) => { 490 // ã¹ã¯ã¤ãã¼ã³ã³ãããåå¾ 491 const swiperContainer = container.querySelector('.contents-slide__swiper'); 492 if (!swiperContainer) { 493 console.warn('slide2-1: .contents-slide__swiperè¦ç´ ãè¦ã¤ããã¾ãã'); 494 return; 495 } 496 497 // ã¤ã³ã¹ã¿ã³ã¹IDçæ 498 const section = container.closest('section'); 499 const prefix = section && section.id ? section.id : 'slide1'; 500 const uniqueIndex = section && section.id ? index : Math.floor(Math.random() * 10000); 501 const instanceId = `${prefix}-slide1-${uniqueIndex}`; 502 503 // ã«ã¹ã¿ã ãªãã·ã§ã³ã®åå¾ï¼ã³ã³ããããï¼ 504 const delay = container.dataset.swiperDelay ? parseInt(container.dataset.swiperDelay) : 3000; 505 const speed = container.dataset.swiperSpeed ? parseInt(container.dataset.swiperSpeed) : 1000; 506 507 // æ¢åã®ã¤ã³ã¹ã¿ã³ã¹ãããã°ç ´æ£ 508 if (swiperInstances[instanceId]) { 509 try { 510 swiperInstances[instanceId].destroy(true, true); 511 swiperInstances[instanceId] = null; 512 } catch (error) { 513 console.error(`slide2-1: Swiperç ´æ£ã«å¤±æãã¾ãã`, error); 514 } 515 } 516 517 try { 518 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ã®è¦ç´ ãç¢ºèª 519 const pagination = swiperContainer.querySelector('.swiper-pagination'); 520 const nextButton = swiperContainer.querySelector('.swiper-button-next'); 521 const prevButton = swiperContainer.querySelector('.swiper-button-prev'); 522 523 // Swiperãªãã·ã§ã³ 524 const options = { 525 loop: true, 526 speed: speed, 527 slidesPerView: 1.2, 528 centeredSlides: true, 529 spaceBetween: 10, 530 autoplay: { 531 delay: delay, 532 disableOnInteraction: false, 533 }, 534 breakpoints: { 535 768: { 536 spaceBetween: 30, 537 slidesPerView: 1.7, 538 } 539 } 540 }; 541 542 // ãã¼ã¸ãã¼ã·ã§ã³ã¨ããã²ã¼ã·ã§ã³ãè¨å® 543 if (pagination) { 544 options.pagination = { 545 el: pagination, 546 clickable: true 547 }; 548 } 549 550 if (nextButton && prevButton) { 551 options.navigation = { 552 nextEl: nextButton, 553 prevEl: prevButton 554 }; 555 } 556 557 // Swiperã¤ã³ã¹ã¿ã³ã¹ä½æ 558 swiperInstances[instanceId] = new Swiper(swiperContainer, options); 559 console.log(`slide2-1: ${instanceId} ã®Swiperãåæåãã¾ãã (delay: ${delay}, speed: ${speed})`); 560 } catch (error) { 561 console.error(`slide2-1: ${instanceId} ã®Swiperåæåã«å¤±æãã¾ãã`, error); 562 swiperInstances[instanceId] = null; 563 } 564 }); 565 } 566 567 // åæåå®è¡ 568 init(); 569 570 // ãªãµã¤ãºã¤ãã³ã 571 let resizeTimer; 572 window.addEventListener('resize', function() { 573 clearTimeout(resizeTimer); 574 resizeTimer = setTimeout(function() { 575 init(); 576 }, 250); 577 }); 578 })(); 579 580 //=========================================== 581 // slide-infinity1 (ç¡éã¹ã©ã¤ãã¼) 582 //=========================================== 583 (function() { 584 const swiperInstances = {}; 585 586 // åæå颿°
587 function init() { 588 // ãã¹ã¦ã®slide-infinity1 swiperã³ã³ãããæ¤ç´¢ 589 const infinityContainers = document.querySelectorAll('.slide-infinity1'); 590 if (infinityContainers.length === 0) return; 591 592 infinityContainers.forEach((container, index) => { 593 // ã¹ã¯ã¤ãã¼ã³ã³ãããåå¾ 594 const swiperContainer = container.querySelector('.swiper'); 595 if (!swiperContainer) { 596 console.warn('slide-infinity1: .swiperè¦ç´ ãè¦ã¤ããã¾ãã'); 597 return; 598 } 599 600 // ã¤ã³ã¹ã¿ã³ã¹IDçæï¼ã»ã¯ã·ã§ã³IDãããã°ããã使ç¨ããªããã°ã¦ãã¼ã¯IDãçæï¼ 601 const section = container.closest('section'); 602 const prefix = section && section.id ? section.id : 'infinity'; 603 const uniqueIndex = section && section.id ? index : Math.floor(Math.random() * 10000); 604 const instanceId = `${prefix}-infinity-${uniqueIndex}`; 605 606 // ã«ã¹ã¿ã ãªãã·ã§ã³ã®åå¾ï¼ã³ã³ããè¦ç´ ããï¼ 607 const pcSpeed = container.dataset.swiperSpeed ? parseInt(container.dataset.swiperSpeed) : 6000; 608 const pcSpace = container.dataset.swiperSpace ? parseInt(container.dataset.swiperSpace) : 20; 609 const mobileSpeed = container.dataset.mobileSpeed ? parseInt(container.dataset.mobileSpeed) : 9000; 610 const mobileSpace = container.dataset.mobileSpace ? parseInt(container.dataset.mobileSpace) : 60; 611 612 // æ¢åã®ã¤ã³ã¹ã¿ã³ã¹ãããã°ç ´æ£ 613 if (swiperInstances[instanceId]) { 614 try { 615 swiperInstances[instanceId].destroy(true, true); 616 swiperInstances[instanceId] = null; 617 } catch (error) { 618 console.error(`slide-infinity1: Swiperç ´æ£ã«å¤±æãã¾ãã`, error); 619 } 620 } 621 622 try { 623 // Swiperã¤ã³ã¹ã¿ã³ã¹ä½æ 624 swiperInstances[instanceId] = new Swiper(swiperContainer, { 625 loop: true, 626 loopedSlides: 15, 627 slidesPerView: 'auto', 628 spaceBetween: pcSpace, 629 speed: pcSpeed, 630 autoplay: { 631 delay: 0, 632 disableOnInteraction: false, 633 }, 634 breakpoints: { 635 767: { 636 spaceBetween: mobileSpace, 637 speed: mobileSpeed, 638 } 639 } 640 }); 641 642 // transitionTimingFunctionãè¨å® 643 const wrapper = swiperContainer.querySelector('.swiper-wrapper'); 644 if (wrapper) { 645 wrapper.style.transitionTimingFunction = 'linear'; 646 } 647 648 console.log(`slide-infinity1: ${instanceId} ã®Swiperãåæåãã¾ãã`); 649 } catch (error) { 650 console.error(`slide-infinity1: ${instanceId} ã®Swiperåæåã«å¤±æãã¾ãã`, error); 651 swiperInstances[instanceId] = null; 652 } 653 }); 654 } 655 656 // åæåå®è¡ 657 init(); 658 659 // ãªãµã¤ãºã¤ãã³ã 660 let resizeTimer; 661 window.addEventListener('resize', function() { 662 clearTimeout(resizeTimer); 663 resizeTimer = setTimeout(function() { 664 init(); 665 }, 250); 666 }); 667 })(); 668 669 670 //=========================================== 671 // slide-infinity2 (ç¡éã¹ã©ã¤ãã¼2) 672 //=========================================== 673 (function() { 674 const swiperInstances = {}; 675 676 // åæå颿°
677 function init() { 678 // ãã¹ã¦ã®slide-infinity2ã³ã³ãããæ¤ç´¢ 679 const infinityContainers = document.querySelectorAll('.slide-infinity2'); 680 if (infinityContainers.length === 0) return; 681 682 infinityContainers.forEach((container, index) => { 683 // ã¹ã¯ã¤ãã¼ã³ã³ãããåå¾ 684 const swiperContainer = container.querySelector('.contents-slider__slider'); 685 if (!swiperContainer) { 686 console.warn('slide-infinity2: .contents-slider__sliderè¦ç´ ãè¦ã¤ããã¾ãã'); 687 return; 688 } 689 690 // ã¤ã³ã¹ã¿ã³ã¹IDçæ 691 const section = container.closest('section'); 692 const prefix = section && section.id ? section.id : 'infinity2'; 693 const uniqueIndex = section && section.id ? index : Math.floor(Math.random() * 10000); 694 const instanceId = `${prefix}-infinity2-${uniqueIndex}`; 695 696 // ã«ã¹ã¿ã ãªãã·ã§ã³ã®åå¾ï¼ã³ã³ããè¦ç´ ããï¼ 697 const pcSpeed = container.dataset.swiperSpeed ? parseInt(container.dataset.swiperSpeed) : 6000; 698 const pcSpace = container.dataset.swiperSpace ? parseInt(container.dataset.swiperSpace) : 20; 699 const mobileSpeed = container.dataset.mobileSpeed ? parseInt(container.dataset.mobileSpeed) : 9000; 700 const mobileSpace = container.dataset.mobileSpace ? parseInt(container.dataset.mobileSpace) : 60; 701 const loopedSlides = container.dataset.loopedSlides ? parseInt(container.dataset.loopedSlides) : 15; 702 703 // æ¢åã®ã¤ã³ã¹ã¿ã³ã¹ãããã°ç ´æ£ 704 if (swiperInstances[instanceId]) { 705 try { 706 swiperInstances[instanceId].destroy(true, true); 707 swiperInstances[instanceId] = null; 708 } catch (error) { 709 console.error(`slide-infinity2: Swiperç ´æ£ã«å¤±æãã¾ãã`, error); 710 } 711 } 712 713 try { 714 // Swiperã¤ã³ã¹ã¿ã³ã¹ä½æ 715 swiperInstances[instanceId] = new Swiper(swiperContainer, { 716 loop: true, 717 loopedSlides: loopedSlides, 718 slidesPerView: 'auto', 719 spaceBetween: pcSpace, 720 speed: pcSpeed, 721 autoplay: { 722 delay: 0, 723 disableOnInteraction: false, 724 }, 725 breakpoints: { 726 767: { 727 spaceBetween: mobileSpace, 728 speed: mobileSpeed, 729 } 730 } 731 }); 732 733 // transitionTimingFunctionãè¨å®ï¼æ»ãããªç¡éã«ã¼ãã®ããï¼ 734 const wrapper = swiperContainer.querySelector('.swiper-wrapper'); 735 if (wrapper) { 736 wrapper.style.transitionTimingFunction = 'linear'; 737 } 738 739 console.log(`slide-infinity2: ${instanceId} ã®Swiperãåæåãã¾ãã`); 740 } catch (error) { 741 console.error(`slide-infinity2: ${instanceId} ã®Swiperåæåã«å¤±æãã¾ãã`, error); 742 swiperInstances[instanceId] = null; 743 } 744 }); 745 } 746 747 // åæåå®è¡ 748 init(); 749 750 // ãªãµã¤ãºã¤ãã³ã 751 let resizeTimer; 752 window.addEventListener('resize', function() { 753 clearTimeout(resizeTimer); 754 resizeTimer = setTimeout(function() { 755 init(); 756 }, 250); 757 }); 758 })(); 759 760 761 762 763 764 console.log('å ¨ã¦ã®ã¹ã©ã¤ãã¼ãåæåããã¾ãã'); 765} 766 767// ã°ãã¼ãã«å¤æ°ã¨ãã¦ãã®é¢æ°ãå©ç¨å¯è½ã«ãã¦ãã 768window.initializeAllSliders = initializeAllSliders; 769 770// â»å ã ãã£ãDOMContentLoadedã®ãªã¹ãã¼ã¯åé¤ï¼ãã¼ãã¢ãã¡ã¼ã·ã§ã³å®äºå¾ã«å¼ã³åºãï¼
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.