1(function () { 2 'use strict'; 3 4 document.documentElement.classList.add('is-fade-ready'); 5 6 // ãã¼ã¸è¡¨ç¤ºæã®ã¤ã³ããã¢ãã¡ã¼ã·ã§ã³ãCSSã®åæç¶æ ãååæç»åã«ç¢ºå®ãããããã 7 // ã¯ã©ã¹ã®ä»ä¸ã¯ãã®ãã¡ã¤ã«ï¼head ã§åæèªã¿è¾¼ã¿ï¼ã®å é ã§è¡ãã 8 var introMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); 9 var introEnabled = !introMotionQuery.matches; 10 11 // åæç¶æ ã¨åçãã¾ã¨ãã¦è§£é¤ããï¼çæ¹ã ãæ®ãã¨ãã¹ã¯ãå¤ãã¦éä¸ã§è¡¨ç¤ºãé£ã¶ï¼ã 12 function clearIntroClasses() { 13 var root = document.documentElement; 14 root.classList.remove('is-intro-ready'); 15 root.classList.remove('is-intro-header'); 16 root.classList.remove('is-intro-playing'); 17 root.classList.remove('is-intro-first'); 18 // ãªã¼ããã³ã°å¾ã ãå»¶ã°ãã¦ããKVã«ã¼ãã³ã®éå§æå»ãæ»ãã 19 root.style.removeProperty('--intro-curtain-delay'); 20 } 21 22 var introFailsafeTimer = null; 23 24 if (introEnabled) { 25 document.documentElement.classList.add('is-intro-ready'); 26 27 // ãããã¼ã®ãªãã¼ã«ã¨TOPã®ãªã¼ããã³ã°ã¯ã»ãã·ã§ã³ååã ãã 28 // sessionStorage ã使ããªãç°å¢ã§ã¯æ¯ååçããã 29 var introSessionKey = 'spik-intro-session'; 30 var introSessionDone = false; 31 32 try { 33 introSessionDone = !!window.sessionStorage.getItem(introSessionKey); 34 if (!introSessionDone) window.sessionStorage.setItem(introSessionKey, '1'); 35 } catch (error) { 36 introSessionDone = false; 37 } 38 39 if (!introSessionDone) { 40 document.documentElement.classList.add('is-intro-header'); 41 // ãªã¼ããã³ã°ã®ãã¼ã¯ã¢ãã㯠front-page.php ã«ãããªããããTOP以å¤ã§ã¯ä½ãèµ·ããªãã 42 document.documentElement.classList.add('is-intro-first'); 43 } 44 45 // å¾ç¶å¦çãæ¢ã¾ã£ã¦ããããã¼ãé ããã¾ã¾ã«ãªããªãããã«ããä¿éºã 46 introFailsafeTimer = window.setTimeout(clearIntroClasses, 4000); 47 } 48 49 // PCã¯ãã¶ã¤ã³å¹ 1360pxãåºæºã«ã1920pxã¾ã§çåã§æ¡å¤§ãããã以ä¸ã¯åºå®ããã 50 var designWidth = 1360; 51 var maxScaleWidth = 1920; 52 53 function updateClientWidth() { 54 var clientWidth = document.documentElement.clientWidth; 55 if (!clientWidth) return; 56 57 var fluidRemSize = window.innerWidth <= 767 58 ? (clientWidth / 375) * 100 59 : (clientWidth / designWidth) * 100; 60 var remSize = window.innerWidth <= 767 61 ? fluidRemSize 62 : Math.min(fluidRemSize, (maxScaleWidth / designWidth) * 100); 63 document.documentElement.style.setProperty('--rem-size', remSize + 'px'); 64 // 1920pxãè¶ ãã¦ãæ¡å¤§ãç¶ãããåçç¨ã®åºæºï¼ä¸éãªãï¼ã 65 // ã¬ã¤ã¢ã¦ãå ¨ä½ã¯ --rem-sizeï¼1920pxã§é æã¡ï¼ã®ã¾ã¾ã§ã 66 // 使ãã®ã¯ã両ãµã¤ãã«ä¸å°ãè¦ãã¦ãã¾ãåçãã ãã 67 document.documentElement.style.setProperty('--rem-fluid', fluidRemSize + 'px'); 68 } 69 70 updateClientWidth(); 71 requestAnimationFrame(updateClientWidth); 72 window.addEventListener('load', updateClientWidth); 73 window.addEventListener('resize', updateClientWidth); 74 75 document.addEventListener('DOMContentLoaded', function () { 76 // ã¤ã³ããã®ã«ã¼ãã³ãçµã¿ç«ã¦ããFVã®ã·ã«ã¨ããï¼å·¦å³ã®å¸¯ï¼ãããä»ãã®ç»åæ ï¼ã« 77 // åããããããä¸å±¤FVã¯3ãã¼ã¹ãTOPã®KVã¯1ãã¼ã¹ã§ä½ãã 78 if (introEnabled) { 79 var introCurtains = []; 80 81 document.querySelectorAll('.c-subpage-hero, #index.root .animation').forEach(function (host) { 82 var curtain = document.createElement('div'); 83 curtain.className = 'c-intro-curtain'; 84 curtain.setAttribute('aria-hidden', 'true'); 85 86 if (host.classList.contains('c-subpage-hero')) { 87 ['left', 'right'].forEach(function (side) { 88 var rail = document.createElement('span'); 89 rail.className = 'c-intro-curtain__rail c-intro-curtain__rail--' + side; 90 curtain.appendChild(rail); 91 }); 92 } 93 94 var shape = document.createElement('span'); 95 shape.className = 'c-intro-curtain__shape'; 96 curtain.appendChild(shape); 97 98 host.appendChild(curtain); 99 introCurtains.push(curtain); 100 }); 101 102 var introStarted = false;
103 104 // CSSã®é å»¶ï¼åçæéã®åè¨ï¼760ms + 640msï¼ããå¾ã«å¾å§æ«ããã 105 // ãªã¼ããã³ã°å¾ã¯KVã«ã¼ãã³ã®çµããï¼ä¸è¨ï¼ã«åããã¦å»¶ã°ãã 106 var startIntro = function (cleanupDelay) { 107 if (introStarted) return; 108 introStarted = true; 109 document.documentElement.classList.add('is-intro-playing'); 110 111 window.setTimeout(function () { 112 clearIntroClasses(); 113 introCurtains.forEach(function (curtain) { 114 if (curtain.parentNode) curtain.parentNode.removeChild(curtain); 115 }); 116 }, typeof cleanupDelay === 'number' ? cleanupDelay : 1500); 117 }; 118 119 var firstIntro = document.querySelector('.c-first-intro'); 120 var firstIntroPlaying = !!firstIntro && document.documentElement.classList.contains('is-intro-first'); 121 122 // åçããªãèªã¿è¾¼ã¿ï¼2ãã¼ã¸ç®ä»¥éï¼ã§ã¯CSSã§é表示ã ããDOMãæ®ããªãã 123 if (firstIntro && !firstIntroPlaying) { 124 firstIntro.parentNode.removeChild(firstIntro); 125 firstIntro = null; 126 } 127 128 // å¹ãéããå ã§åçãæªèªã¿è¾¼ã¿ã ã¨ç©ºç½ãè¦ãããããèªã¿è¾¼ã¿å®äºã 129 // ä¸å®æéã®çµéã¾ã§éå§ãå¾ ã¤ã 130 // COMPANYã¯æ ï¼div.c-subpage-hero__imageï¼ã®ä¸ã« img ãããï¼æ¨ªã¹ã¯ãã¼ã«å¯¾å¿ï¼ãããimg ãç´æ¥æ¢ãã 131 var introImage = document.querySelector('.c-subpage-hero img'); 132 133 if (firstIntroPlaying) { 134 // ãªã¼ããã³ã°ä¸ã¯ã¹ã¯ãã¼ã«ãããªãã 135 document.body.style.overflow = 'hidden'; 136 137 // ãªã¼ããã³ã°ã®åã ãä¿éºãå¾ãã¸ãããã 138 window.clearTimeout(introFailsafeTimer); 139 introFailsafeTimer = window.setTimeout(clearIntroClasses, 8000); 140 141 // éãç®±ã¯74%å°ç¹ï¼4000msä¸2960msï¼ããä¸ã¸æãã¯ããã4000msã§ç»é¢å¤ã¸åºãï¼å¶ä½ä¼ç¤¾ã®èª¿æ´å¾ã®å¤ï¼ã 142 // ãããã¼ã¨æåã®ãªãã¼ã«ã¯éå§ãã760msé ãã¦å§ã¾ããããä¸ç«¯ãé²åºãã 143 // 2960msã«ãªãã¼ã«ãéãªãããããã®760msåã®2200msã«ãã¼ã¸å´ã®ã¤ã³ãããå§ããã 144 // KVã®ã«ã¼ãã³ï¼éï¼ã¯ç®±ã®è£ã§åãçµãã¦ããï¼2280ã2880msï¼ãç®±ãKVããæãã 145 // 4000msããä¸ã¸æããããï¼ç®±ã®è£ã§æãã¦ãã¾ãã¨ã·ã£ãã¿ã¼ãè¦ããªãï¼ã 146 // å¾å§æ«ã¯ã«ã¼ãã³ã®çµããï¼4000 + 720msï¼ããå¾ã«è¡ãã 147 var openingIntroStart = 2200; 148 var openingCurtainStart = 4000; 149 var openingCurtainDuration = 720; 150 document.documentElement.style.setProperty('--intro-curtain-delay', (openingCurtainStart - openingIntroStart) + 'ms'); 151 window.setTimeout(function () { 152 startIntro(openingCurtainStart + openingCurtainDuration - openingIntroStart + 200); 153 }, openingIntroStart); 154 155 // åçå¾ã¯è¦ç´ ãã¨åãé¤ãã 156 window.setTimeout(function () { 157 document.documentElement.classList.remove('is-intro-first'); 158 document.body.style.overflow = ''; 159 if (firstIntro.parentNode) firstIntro.parentNode.removeChild(firstIntro); 160 }, 4100); 161 } else if (introImage && !introImage.complete) { 162 introImage.addEventListener('load', startIntro); 163 introImage.addEventListener('error', startIntro); 164 window.setTimeout(startIntro, 1200); 165 } else { 166 startIntro(); 167 } 168 } 169 170 var fadeTargets = document.querySelectorAll('.js-fade-in'); 171 var reduceMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); 172 173 fadeTargets.forEach(function (target) { 174 var delay = parseInt(target.getAttribute('data-fade-delay'), 10); 175 var duration = parseInt(target.getAttribute('data-fade-duration'), 10); 176 if (Number.isFinite(delay)) target.style.setProperty('--fade-delay', delay + 'ms'); 177 if (Number.isFinite(duration)) target.style.setProperty('--fade-duration', duration + 'ms'); 178 }); 179 180 // ãã§ã¼ãã¤ã³å®äºå¾ã¯ is-fade-done ãä»ããé常ã®è¦ç´ ã¨åãçããã©ã³ã¸ã·ã§ã³ã«æ»ã 181 // ï¼ãªã³ã¯ã® a:hover ã®ééã .is-visible ã® opacity: 1 ã«è² ããªãããã«ãããããCSSå´åç §ï¼ã 182 function markFadeDone(target) { 183 target.classList.add('is-fade-done'); 184 } 185 186 if (reduceMotionQuery.matches || !('IntersectionObserver' in window)) {
187 fadeTargets.forEach(function (target) { 188 target.classList.add('is-visible'); 189 markFadeDone(target); 190 }); 191 } else { 192 var fadeObserver = new IntersectionObserver(function (entries, observer) { 193 entries.forEach(function (entry) { 194 if (!entry.isIntersecting) return; 195 var target = entry.target; 196 target.classList.add('is-visible'); 197 observer.unobserve(target); 198 199 // transitionend ãæ¥ãªãç°å¢ï¼transition ç¡å¹ãªã©ï¼ã®ããã®ä¿éºãå ¼ãã¦ã 200 // é å»¶ï¼åçæéã®çµéå¾ã«ãä»ããã 201 var delay = parseFloat(target.style.getPropertyValue('--fade-delay')) || 0; 202 var duration = parseFloat(target.style.getPropertyValue('--fade-duration')) || 800; 203 var fadeDoneTimer = window.setTimeout(function () { markFadeDone(target); }, delay + duration + 50); 204 target.addEventListener('transitionend', function onEnd(event) { 205 if (event.target !== target || event.propertyName !== 'opacity') return; 206 target.removeEventListener('transitionend', onEnd); 207 window.clearTimeout(fadeDoneTimer); 208 markFadeDone(target); 209 }); 210 }); 211 }, { 212 rootMargin: '0px 0px -10% 0px', 213 threshold: 0.08 214 }); 215 216 fadeTargets.forEach(function (target) { 217 fadeObserver.observe(target); 218 }); 219 } 220 221 // èæ¯åç»ï¼.js-autoplay-video ã®ä¸ã® videoï¼ã¯ããã®ç¯å²ãç»é¢ã«å ¥ã£ã¦ããéã ãåçããã 222 // Chrome ã¯ç»é¢å¤ã® muted åç»ã®èªååçãå§ããªããã¨ããããããè¦ããã¿ã¤ãã³ã°ã§ play() ãå¼ã¶ã 223 // ç»é¢å¤ã§ã¯æ¢ãã¦è² è·ãæããã 224 var autoplayVideoHosts = document.querySelectorAll('.js-autoplay-video'); 225 if (autoplayVideoHosts.length && 'IntersectionObserver' in window) { 226 var autoplayVideoObserver = new IntersectionObserver(function (entries) { 227 entries.forEach(function (entry) { 228 var video = entry.target.querySelector('video'); 229 if (!video) return; 230 if (entry.isIntersecting) { 231 var playPromise = video.play(); 232 if (playPromise && playPromise.catch) playPromise.catch(function () {}); 233 } else { 234 video.pause(); 235 } 236 }); 237 }, { threshold: 0 });
238 autoplayVideoHosts.forEach(function (host) { 239 autoplayVideoObserver.observe(host); 240 }); 241 } 242 243 var mobileQuery = window.matchMedia('(max-width: 767px)'); 244 var focusableSelector = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'; 245 var header = document.querySelector('.c-site-header'); 246 var menuButton = header && header.querySelector('.c-site-header__hamburger'); 247 var menuPanel = header && header.querySelector('.c-site-header__menu-panel'); 248 var lastModalTrigger = null; 249 250 function setExpanded(button, expanded) { 251 button.setAttribute('aria-expanded', expanded ? 'true' : 'false'); 252 } 253 254 function setAccordionExpanded(button, expanded) { 255 setExpanded(button, expanded); 256 var contentId = button.getAttribute('aria-controls'); 257 var content = contentId && document.getElementById(contentId); 258 if (!content) return; 259 content.inert = !expanded; 260 content.setAttribute('aria-hidden', expanded ? 'false' : 'true'); 261 } 262 263 function closeMenu(restoreFocus) { 264 if (!header || !menuButton) return; 265 header.classList.remove('is-menu-open'); 266 setExpanded(menuButton, false); 267 menuButton.setAttribute('aria-label', 'ã¡ãã¥ã¼ãéã'); 268 document.body.classList.remove('is-menu-open'); 269 header.querySelectorAll('.c-site-header__accordion-button').forEach(function (button) { 270 setAccordionExpanded(button, false); 271 }); 272 if (restoreFocus) menuButton.focus(); 273 } 274 275 function openMenu() { 276 if (!header || !menuButton || !menuPanel) return; 277 header.classList.add('is-menu-open'); 278 setExpanded(menuButton, true); 279 menuButton.setAttribute('aria-label', 'ã¡ãã¥ã¼ãéãã'); 280 document.body.classList.add('is-menu-open'); 281 } 282 283 if (menuButton) { 284 menuButton.addEventListener('click', function () { 285 if (header.classList.contains('is-menu-open')) closeMenu(true); 286 else openMenu(); 287 }); 288 } 289 290 document.querySelectorAll('.c-site-header__accordion-button').forEach(function (button) { 291 button.addEventListener('click', function () { 292 if (!mobileQuery.matches) return; 293 setAccordionExpanded(button, button.getAttribute('aria-expanded') !== 'true'); 294 }); 295 }); 296 297 if (menuPanel) { 298 menuPanel.querySelectorAll('a[href]').forEach(function (link) { 299 link.addEventListener('click', function () { 300 if (mobileQuery.matches) closeMenu(false); 301 }); 302 }); 303 } 304 305 var footerButtons = document.querySelectorAll('.c-site-footer__accordion-button'); 306 function syncFooterAccordions() { 307 footerButtons.forEach(function (button) { 308 button.disabled = !mobileQuery.matches; 309 setAccordionExpanded(button, !mobileQuery.matches); 310 }); 311 } 312 footerButtons.forEach(function (button) { 313 button.addEventListener('click', function () { 314 if (!mobileQuery.matches) return; 315 setAccordionExpanded(button, button.getAttribute('aria-expanded') !== 'true'); 316 }); 317 }); 318 syncFooterAccordions(); 319 320 function syncResponsiveState() { 321 if (!mobileQuery.matches) closeMenu(false); 322 syncFooterAccordions(); 323 } 324 if (mobileQuery.addEventListener) mobileQuery.addEventListener('change', syncResponsiveState); 325 else mobileQuery.addListener(syncResponsiveState); 326 327 var modalSelector = '.officer-modal, .c-modal'; 328 var modalDialogSelector = '.officer-modal__dialog, .c-modal__dialog'; 329 var modalDismissSelector = '.officer-modal__close, .officer-modal__overlay, .c-modal__close, .c-modal__overlay'; 330 331 document.querySelectorAll('.officer-card, .c-modal-trigger').forEach(function (trigger) { 332 trigger.addEventListener('click', function () { 333 lastModalTrigger = trigger; 334 }); 335 }); 336 337 function activeModal() { 338 if (!/^#[\w-]+$/.test(window.location.hash)) return null; 339 var target = document.querySelector(window.location.hash); 340 return target && target.matches(modalSelector) ? target : null; 341 } 342 343 function syncModal() { 344 document.querySelectorAll(modalSelector).forEach(function (modal) { 345 if (modal.getAttribute('aria-hidden') === 'false') modal.setAttribute('aria-hidden', 'true'); 346 }); 347 var modal = activeModal(); 348 document.body.classList.toggle('is-modal-open', Boolean(modal)); 349 if (modal) { 350 modal.setAttribute('aria-hidden', 'false'); 351 var dialog = modal.querySelector(modalDialogSelector); 352 if (dialog) requestAnimationFrame(function () { dialog.focus(); }); 353 } else if (lastModalTrigger) { 354 lastModalTrigger.focus(); 355 } 356 } 357 358 function closeModal() { 359 if (!activeModal()) return; 360 window.location.hash = 'modal-closed'; 361 } 362 363 document.querySelectorAll(modalDismissSelector).forEach(function (button) { 364 button.addEventListener('click', function (event) { 365 event.preventDefault(); 366 closeModal(); 367 }); 368 }); 369 window.addEventListener('hashchange', syncModal); 370 syncModal(); 371 372 document.addEventListener('keydown', function (event) { 373 var modal = activeModal(); 374 if (event.key === 'Escape') { 375 if (modal) { 376 event.preventDefault(); 377 closeModal(); 378 } else if (header && header.classList.contains('is-menu-open')) { 379 event.preventDefault(); 380 closeMenu(true); 381 } 382 return; 383 } 384 385 if (event.key !== 'Tab') return; 386 var container = modal || (header && header.classList.contains('is-menu-open') ? header : null); 387 if (!container) return; 388 var items = Array.prototype.filter.call(container.querySelectorAll(focusableSelector), function (item) { 389 var style = window.getComputedStyle(item); 390 return item.tabIndex >= 0 391 && !item.hasAttribute('disabled') 392 && item.getAttribute('aria-hidden') !== 'true' 393 && style.display !== 'none' 394 && style.visibility !== 'hidden' 395 && item.getClientRects().length > 0; 396 }); 397 if (!items.length) return; 398 var first = items[0]; 399 var last = items[items.length - 1]; 400 if (event.shiftKey && document.activeElement === first) { 401 event.preventDefault(); 402 last.focus(); 403 } else if (!event.shiftKey && document.activeElement === last) { 404 event.preventDefault(); 405 first.focus(); 406 } 407 }); 408 }); 409})();
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.