var _ready=function(){ Array.prototype.forEach.call(document.querySelectorAll('[data-lib="52292"]'),function(element){ const accordion = element.getElementsByClassName('-w-accordion'); const accordionMenu = element.getElementsByClassName('-w-accordion_menu'); const accordionSubmenu = element.getElementsByClassName('-w-accordion_submenu'); let isOpen = []; //サブメニューがある時は左に余白をつける if(accordionSubmenu.length > 0){ for(let h=0; h= 0; j--){ lists[j].style.transitionDelay = (lists.length - j)*0.12+"s"; } accordionSubmenu[index].classList.add('-w-heightzero'); accordionSubmenu[index].classList.remove('-w-transition_zero'); isOpen[index] = false; } }, false); } //ウインドウリサイズでサブメニューの高さをE計箁E window.addEventListener('resize', function() { for(i = 0; i400){ target.classList.add("fixed"); } else { target.classList.remove("fixed"); } });*/ //ここから //サブメニュー高さ計箁E function calcHeight(index){ const lists = accordionSubmenu[index].getElementsByTagName('li'); let listheights = 0; for(let j = 0; j { const accordionIcon = el.parentElement.querySelector('.-w-accordion'); let submenuChildren = el.children.length; if (submenuChildren === 0) { accordionIcon.style.display = 'none'; } }); });Array.prototype.forEach.call(document.querySelectorAll('[data-lib="51755"]'),function(element){ "use strict"; (() => { if ("scrollRestoration" in history) { history.scrollRestoration = "manual"; } const scrollModal = document.querySelector(".-w-modal_scroll"); const scrollCloseBtn = scrollModal?.querySelector(".-w-close"); // スクロール用モーダルの状態管琁E const SCROLL_STATE = { shown: false, manualClose: false, initY: window.scrollY, winH: window.innerHeight, scrollYBefore: 0, fired: false, }; const scrollModalCtrl = { open() { if (SCROLL_STATE.shown) return; SCROLL_STATE.scrollYBefore = window.scrollY; SCROLL_STATE.shown = true; scrollModal.classList.add("-w-show"); scrollModal.showModal(); requestAnimationFrame(() => scrollModal.classList.remove("-w-show")); }, close(manual = true) { if (manual) SCROLL_STATE.manualClose = true; scrollModal.close(); SCROLL_STATE.shown = false; window.scrollTo(0, SCROLL_STATE.scrollYBefore); // ☁E既存E state に上書ぁE const state = { ...(history.state || {}) }; state.modalScroll = false; history.replaceState(state, "", location.pathname + location.search); }, pushState() { if (SCROLL_STATE.shown) return; // ☁EmodalScroll = true にしてハッシュめE#scroll-modal に const state = { ...(history.state || {}) }; state.modalScroll = true; history.replaceState(state, "", "#scroll-modal"); this.open(); history.pushState(state, "", location.pathname + location.search + "#scroll-modal"); }, }; // スクロールして一定量趁EたらモーダルをEぁE function onScroll() { const dist = window.scrollY - SCROLL_STATE.initY; if ( dist > SCROLL_STATE.winH && !SCROLL_STATE.shown && !SCROLL_STATE.fired ) { SCROLL_STATE.fired = true; scrollModalCtrl.pushState(); } } // popstate イベントでモーダルの開閉を反映 function scrollPop(e) { const st = e.state; // ☁EmodalScroll を見て判断 if (st && st.modalScroll) { if (!SCROLL_STATE.shown) { scrollModalCtrl.open(); } } else { if (SCROLL_STATE.shown) { scrollModalCtrl.close(false); } } } // 初期匁E function scrollInit() { const y = window.scrollY; const initState = { ...(history.state || {}) }; // ☁E初期状態では modalScroll = false initState.modalScroll = false; initState.scrollY = y; history.replaceState(initState, "", location.href); SCROLL_STATE.scrollYBefore = y; window.addEventListener("scroll", onScroll); window.addEventListener("popstate", scrollPop); scrollCloseBtn?.addEventListener("click", () => scrollModalCtrl.close()); } window.addEventListener("load", scrollInit); })(); });Array.prototype.forEach.call(document.querySelectorAll('[data-lib="32440"]'),function(element){ var lists = element.querySelectorAll('.-w-side-blog-list li'); var more = element.querySelectorAll('.-w-btn_more'); var arrow = element.querySelectorAll('.-w-arrow'); var display_count = 4; var visible = display_count; const thumb = element.querySelector(".thumbnail"); if(lists.length > display_count){ more[0].classList.remove('-w-none'); } for(var i = 0; i < lists.length; i++){ if(i < 4){ lists[i].classList.remove('-w-invisible'); lists[i].classList.add('-w-visible'); } } more[0].addEventListener('click', function(e) { visible >= lists.length ? remove_view_lists() : add_view_lists(); }, false); function add_view_lists(){ if(visible >= lists.length){return;} var count = 0; for(var i = visible; i < visible + display_count; i++){ if(i >= lists.length){break;} lists[i].style.transitionDelay = count * 0.15 + "s"; lists[i].classList.remove('-w-invisible'); lists[i].classList.add('-w-visible'); count++; } if(visible + display_count < lists.length){ visible = visible + display_count; } else{ visible = lists.length; arrow[0].style.transitionDelay = (lists.length - display_count + 1) * 0.07 + "s"; arrow[0].classList.add('-w-rotate'); } } function remove_view_lists(){ var count = 0; for(var i = lists.length-1; i >= display_count; i--){ lists[i].style.transitionDelay = count * 0.07 + "s"; lists[i].classList.remove('-w-visible'); lists[i].classList.add('-w-invisible'); count++; } //arrow[0].style.transitionDelay = (lists.length - display_count + 1) * 0.07 + "s"; arrow[0].classList.remove('-w-rotate'); visible = display_count; } function tagSearch() { let cate = element.querySelector('.-w-cate'); if (cate.childElementCount == 0) { cate.classList.add('-w-empty'); } } tagSearch(); // サムネイル if(thumb){ const sliderThumbnail = new Swiper(thumb, { slidesPerView: 5, // サムネイルの枚数 // 前後E矢印 navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); // スライダー const slider = new Swiper(element.querySelector(".main"), { thumbs: { swiper: sliderThumbnail, }, }); } });Array.prototype.forEach.call(document.querySelectorAll('[data-lib="52405"]'),function(element){ const sns = element.getElementsByClassName('-w-sns-container'); const mailSub = element.querySelector('.-w-mail-sub'); const mail = element.getElementsByClassName('-w-mail-container'); const mailsuba = element.querySelectorAll('.-w-mail-sub a'); const totalSnsMax = element.getElementsByClassName('-w-snsbtn'); const snsSub = element.getElementsByClassName('-w-sns-sub'); const close = element.getElementsByClassName('-w-close-container'); const top = element.getElementsByClassName('-w-top'); let setTimeoutId; const container = element.getElementsByClassName('-w-container'); const underbtn = element.getElementsByClassName('-w-underbtn'); let count = underbtn.length; // SNSぁEつの晁E if (totalSnsMax.length == 1 && sns.length) { sns[0].classList.add('-w-sns-none'); count--; } element.style.setProperty('--count',count); if(mailSub){ if(mailsuba.length > 1){ mail[0].classList.add('-w-pointer_none'); }else if(mailSub){ mailSub.classList.add('-w-d_none'); } } // SNSサブメニュー表示非表示 if (sns.length) { sns[0].addEventListener('click', function() { snsSub[0].classList.toggle('-w-sns-sub-active'); mailSub.classList.remove('-w-mail-sub-active'); }); close[0].addEventListener('click', function(event) { event.stopPropagation(); snsSub[0].classList.remove('-w-sns-sub-active'); }); } if(mail.length > 1){ mail[0].addEventListener('click', function() { mailSub.classList.toggle('-w-mail-sub-active'); snsSub[0].classList.remove('-w-sns-sub-active'); }); } // ペEジ読み込み時とスクロール時Eフッター追従E表示 function addFooterAppearance() { container[0].classList.add('-w-appear'); if (sns.length > 0) { snsSub[0].classList.add('-w-appear'); } if (mailSub) { mailSub.classList.add('-w-appear'); } } function removeFooterAppearance() { container[0].classList.remove('-w-appear'); if (sns.length > 0) { snsSub[0].classList.remove('-w-appear'); snsSub[0].classList.remove('-w-sns-sub-active'); } if (mailSub) { mailSub.classList.remove('-w-appear'); } } window.addEventListener("load", function() { addFooterAppearance(); // ペEジ読み込み時にフッターを表示 }); window.addEventListener("scroll", function() { clearTimeout(setTimeoutId); removeFooterAppearance(); setTimeoutId = setTimeout(function() { addFooterAppearance(); }, 500); }); });Array.prototype.forEach.call(document.querySelectorAll('[data-lib="51743"]'),function(element){ const origin = window.location.origin; const url = window.location.href; const dirname = url.replace(origin,''); let statePushedCount = 0; let isShown = false; // ↁE1回だけEす用の制御フラグ const dialog = document.querySelector('.-w-modal-alert'); // ☁Eここで -w-modal-dialog が存在しなぁE合E処琁E止 if (!dialog || !dialog.querySelector('.-w-modal-dialog')) return; const LINK_STATE = { externalLink: { lastClicked: null, clickCount: 0 } }; document.body.click(); // 履歴スタチEを積EE戻るでモーダルをEすためEEdocument.addEventListener("click", () => { if (!isShown) { history.pushState(null, null, null); statePushedCount += 1; } }); document.addEventListener("touchstart", () => { if (!isShown && statePushedCount < 2) { history.pushState(null, null, null); statePushedCount += 1; } }); // モーダルを閉じるEE通関数EEfunction hideModal() { dialog.classList.add('-w-d_none'); dialog.classList.remove('show-up'); isShown = true; if (statePushedCount > 0) { history.back(); statePushedCount--; } } // Esc キーでモーダルを閉じる document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !dialog.classList.contains('-w-d_none')) { e.preventDefault(); hideModal(); } }, { passive: false }); // 戻るEタンでモーダルを表示EE回だけ!Ewindow.addEventListener("popstate", () => { const h = location.hash; if (h || isShown) return; dialog.classList.remove('-w-d_none'); dialog.classList.add('show-up'); isShown = true; }); //
の直下要素かどぁE判宁Efunction isInMainChild(link) { const main = document.querySelector('main'); if (!main) return false; let parent = link.parentElement; while (parent && parent !== document.body) { if (parent.parentElement === main) return true; parent = parent.parentElement; } return false; } // モーダルを閉じるボタン処琁Efunction manipulateModal(){ const closebtn = dialog.querySelector('.close'); if (closebtn) { closebtn.addEventListener('click', hideModal); } } // モーダル対象リンクかを判宁Efunction shouldHandleLink(link, currentUrl, linkScope) { try { const linkUrl = new URL(link.href, location.href); const isSamePage = ( linkUrl.origin + linkUrl.pathname + linkUrl.search === currentUrl.origin + currentUrl.pathname + currentUrl.search ); const isInternal = linkUrl.origin === currentUrl.origin; const isExternal = !isInternal; const inMainChild = isInMainChild(link); if (inMainChild) return false; if (linkScope === 'off') return false; if (linkScope === 'internal') return isInternal && !isSamePage; if (linkScope === 'external') return isExternal; if (linkScope === 'both') return !isSamePage && (isInternal || isExternal); return false; } catch { return false; } } // リンクごとのモーダル制御EE回目クリチEでモーダル、E回目で遷移EEfunction clickAnchorEvent() { const links = document.querySelectorAll('a'); const currentUrl = new URL(location.href); const scopeElement = document.querySelector('[data-link-scope]'); const linkScope = scopeElement?.dataset.linkScope || 'both'; links.forEach(link => { if (!(link instanceof HTMLAnchorElement)) return; if (link.href.startsWith('tel:')) return; if (link.closest('.-w-modal')) return; if (!shouldHandleLink(link, currentUrl, linkScope)) return; const handleClick = function(event) { if (event.target.classList && event.target.classList.contains('-w-modal_image_anchor')) return; const alreadyClicked = LINK_STATE.externalLink.lastClicked === link && LINK_STATE.externalLink.clickCount > 0; const openInNewTab = link.target === '_blank'; if (!alreadyClicked) { event.preventDefault(); event.stopPropagation(); dialog.classList.remove('-w-d_none'); dialog.classList.add('show-up'); LINK_STATE.externalLink.lastClicked = link; LINK_STATE.externalLink.clickCount = 1; } else { LINK_STATE.externalLink.lastClicked = null; LINK_STATE.externalLink.clickCount = 0; if (openInNewTab) { window.open(link.href, '_blank'); } else { window.location.href = link.href; } } }; link.addEventListener('click', handleClick, { passive: false }); }); } manipulateModal(); clickAnchorEvent(); });/*layout:25*/ let header = document.getElementsByTagName("header"); let headerHeight = 0; if (header[0]) { headerHeight = header[0].offsetHeight; if (headerHeight === 0) { headerHeight = header[0].children[0].offsetHeight; } } const scrollElm = (function () { if ("scrollingElement" in document) return document.scrollingElement; if (navigator.userAgent.indexOf("WebKit") != -1) return document.body; return document.documentElement; })(); (function () { const duration = 800; const ignore = ".noscroll"; const easing = function (t, b, c, d) { return c * (0.5 - Math.cos((t / d) * Math.PI) / 2) + b; }; //jswing const smoothScrollElm = document.querySelectorAll( 'a[href^="#"]:not(' + ignore + ")" ); Array.prototype.forEach.call(smoothScrollElm, function (elm) { elm.addEventListener("click", function (e) { e.preventDefault(); const targetElm = document.querySelector(elm.getAttribute("href")); if (!targetElm) return; const targetPos = targetElm.getBoundingClientRect().top - headerHeight - 20; const startTime = Date.now(); const scrollFrom = scrollElm.scrollTop; (function loop() { const currentTime = Date.now() - startTime; if (currentTime < duration) { scrollTo(0, easing(currentTime, scrollFrom, targetPos, duration)); window.requestAnimationFrame(loop); } else { scrollTo(0, targetPos + scrollFrom); } })(); }); }); })(); if (header[0] && location.hash) { setTimeout(function () { window.scrollBy(0, -(header[0].offsetHeight + 80)); }, 0); } function multiLang(header){ if(!header[0]){ return; } let userLang = (navigator.language) ? navigator.language : navigator.userLanguage; const dict = new Set(["is","ay","ga","az","as","af","am","ar","sq","hy","it","yi","ig","ilo","id","ug","cy","uk","uz","ur","ee","et","eo","nl","or","om","kk","ca","gl","kn","rw","el","ky","gn","gu","km","kri","ku","ckb","hr","qu","xh","co","gom","sm","sa","jw","ka","sn","sd","si","sv","zu","gd","es","sk","sl","sw","su","ceb","nso","sr","st","so","th","tl","tg","tt","ta","cs","ny","ts","ti","dv","te","da","de","ak","doi","tk","tr","ne","no","ht","ha","ps","eu","haw","hu","pa","bm","hi","fi","fr","fy","bg","vi","iw","be","fa","bn","bho","pl","bs","pt","mai","mi","mk","mr","mg","ml","mt","ms","lus","my","mni-Mtei","mn","hmn","yo","lo","la","lv","lt","ln","ro","lg","lb","ru","en","ko","zh-CN","zh-TW"]); if(userLang === undefined){ userLang = 'ja'; } //zh-TWの時Ezh-TW,それ以外E中国語Ezh-CH else if(userLang.indexOf('zh') > -1){ if(userLang != 'zh-TW'){ userLang = 'zh-CN' } }else if(userLang == "mni-Mtei"){ userLang = "mni-Mtei"; //メイチE語(EニEリ語!E }else if(userLang.indexOf('he') == 0){ userLang = "iw"; //ヘブライ誁E }else if(userLang.indexOf('jv') == 0){ userLang = "jw"; //ジャワ誁E }else if(userLang.indexOf('tw') == 0){ userLang = "ak"; //トゥイ誁E }else if(userLang.indexOf('nn') == 0 || userLang.indexOf('nb') == 0){ userLang = "no"; //ノルウェー誁E }else if(userLang.indexOf('mo') == 0){ userLang = "ro"; //ルーマニア誁Eモルドバ) }else if(userLang.indexOf('kok') == 0){ userLang = "gom"; //コンカニ誁E }else{ userLang = userLang.split('-')[0].toLowerCase(); } if(!dict.has(userLang)){ userLang = "ja"; } let select = document.querySelector('header .goog-te-combo'); // iframe追加の監視を開姁E if(userLang != "ja"){ changeTranslationLanguage(userLang); } //読み込み時に端末の言語設定にGoogle翻訳をEり替ぁE function changeTranslationLanguage(languageCode) { if(languageCode == 'ja'){return;} const MAX_RETRIES = 10; let success = false; for(let i=0;i