1// ----------------------------------------------- 2// ããã¼ãã£ã³ã°ãã¿ã³ 3// ----------------------------------------------- 4document.addEventListener("DOMContentLoaded", function () { 5 var floatingContents = document.querySelector(".floatingContents"); 6 var closeButton = document.querySelector(".close-btn"); 7 8 floatingContents.classList.add("show"); 9 10 closeButton.addEventListener("click", function () { 11 floatingContents.style.opacity = "0"; 12 floatingContents.style.left = "-300px"; 13 }); 14}); 15// ----------------------------------------------- 16// FV - 詳ããè¦ã 17// ----------------------------------------------- 18// const fvScheduleLink = document.querySelector( 19// ".first-view__schedule--detail a" 20// ); 21// const mediaQuery = window.matchMedia("(min-width: 768px)"); 22 23// function checkWindow(windowSize) { 24// if (windowSize.matches) { 25// console.log("PC"); 26// fvScheduleLink.innerText = "詳ããè¦ã"; 27// } else { 28// console.log("sp"); 29// fvScheduleLink.innerText = ""; 30// } 31// } 32// checkWindow(mediaQuery); 33// mediaQuery.addEventListener("change", checkWindow); 34// ----------------------------------------------- 35// ScrollHint 36// ----------------------------------------------- 37new ScrollHint(".js-scrollable", { 38 scrollHintIconAppendClass: "scroll-hint-icon-black", 39 suggestiveShadow: false, 40 i18n: { 41 scrollable: "横ã«ã¹ã¯ãã¼ã«ãã¦ãã ãã", 42 }, 43}); 44// ----------------------------------------------- 45// ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ 46// ----------------------------------------------- 47 48// body 49const body = document.body; 50// ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ãã¿ã³ 51const hamburgerMenu = document.querySelectorAll(".hamburger"); 52// ã¡ãã¥ã¼ã®nav 53const navMenu = document.querySelectorAll(".header__menu--inner"); 54// ã¡ãã¥ã¼ã®ã¢ã¤ãã ã²ã¨ã¤ 55const topHeaderItem = document.querySelectorAll(".header__item"); 56// ãããã¼ 57const headerInner = document.querySelectorAll(".header__inner"); 58 59// ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ãéã 60hamburgerMenu.forEach(function (menu) { 61 menu.addEventListener("click", function () { 62 // ã¯ãªãã¯ããããã¡ãã¥ã¼å 容ã表示ãããããã« 63 navMenu.forEach(function (nav) { 64 nav.classList.toggle("active"); 65 // èæ¯åºå® 66 body.classList.toggle("no-scroll"); 67 // ã¡ãã¥ã¼ã®ãªã³ã¯ãã¯ãªãã¯ãããããããã¿ã³ãåºãããã« 68 menu.classList.toggle("active"); 69 // ãããã¼ã®è§ä¸¸ãèããã 70 headerInner.classList.toggle("aiueo"); 71 }); 72 }); 73}); 74 75// ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ãéãã 76topHeaderItem.forEach(function (item) { 77 item.addEventListener("click", function () { 78 // ã¡ãã¥ã¼ãã¯ãªãã¯ããããéãã 79 navMenu.forEach(function (nav) { 80 nav.classList.remove("active"); 81 // èæ¯åºå®è§£é¤ 82 body.classList.remove("no-scroll"); 83 }); 84 // ãã³ãã¼ã¬ã¼ã¢ã¤ã³ã³ãå ã«æ»ã 85 hamburgerMenu.forEach(function (menu) { 86 menu.classList.remove("active"); 87 }); 88 }); 89}); 90 91// ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ãéãã¦ããéãèæ¯ãã¹ã¯ãã¼ã«ãããªã 92window.addEventListener("resize", function () { 93 if (window.innerWidth >= 1280) { 94 // ç»é¢å¹ ã1280px以ä¸ã«ãªã£ãå ´å 95 navMenu.forEach(function (nav) { 96 nav.classList.remove("active"); 97 }); 98 body.classList.remove("no-scroll"); 99 hamburgerMenu.forEach(function (menu) { 100 menu.classList.remove("active"); 101 }); 102 } 103}); 104 105// ----------------------------------------------- 106// ç»é¢ä¸é¨ã«æ»ããã¿ã³ 107// ----------------------------------------------- 108const pageTopBtn = document.querySelector(".page-top"); 109// 丸ããã¿ã³ãã¯ãªãã¯ãããã 110pageTopBtn.addEventListener("click", scroll_top); 111// TOPã¸ç§»å 112function scroll_top() { 113 window.scroll({ top: 0, behavior: "smooth" }); 114} 115// ã¢ã³ã«ã¼ãªã³ã¯ã»TOPã¸æ»ããã¿ã³ã®ããã®ã¹ã ã¼ãºãªã¹ã¯ãã¼ã« 116const smoothScrollTrigger = document.querySelectorAll('a[href^="#"]'); 117for (let i = 0; i < smoothScrollTrigger.length; i++) { 118 smoothScrollTrigger[i].addEventListener("click", (e) => { 119 e.preventDefault(); 120 let href = smoothScrollTrigger[i].getAttribute("href"); 121 let targetElement = document.getElementById(href.replace("#", "")); 122 const rect = targetElement.getBoundingClientRect().top; 123 const offset = window.pageYOffset; 124 const gap = 100; 125 const target = rect + offset - gap; 126 window.scrollTo({ 127 top: target, 128 behavior: "smooth", 129 }); 130 }); 131} 132 133// ----------------------------------------------- 134// ã¢ã¼ãã« 135// ----------------------------------------------- 136// ãã¤ã¢ãã°è¦ç´ 137const modal = document.querySelector("dialog"); 138// ãã¤ã¢ãã°ãéããã¿ã³ï¼æ°´è²ï¼ 139const dialogOpenButtons = document.querySelectorAll(".js-dialog-open"); 140// ãã¤ã¢ãã°ãéãããã¿ã³ï¼ãã³ã¯ï¼ 141const dialogCloseButtons = document.querySelectorAll(".js-dialog-close"); 142// æ°´è²ã®ãã¿ã³ãæ¼ããããããã¤ã¢ãã°ãéããèæ¯ãã¹ã¯ãã¼ã«ãããªã 143dialogOpenButtons.forEach((button) => { 144 const dialog = document.querySelector(button.dataset.dialog); 145 button.addEventListener("click", () => { 146 dialog.showModal(); 147 body.style.overflow = "hidden"; 148 }); 149}); 150// éãããã¿ã³ã§ãã¤ã¢ãã°ãéãããèæ¯ãã¹ã¯ãã¼ã«ãããããããã«ãã 151dialogCloseButtons.forEach((button) => { 152 const dialog = button.closest("dialog"); 153 button.addEventListener("click", () => { 154 dialog.close(); 155 body.style.overflow = "visible"; 156 }); 157}); 158// ã¢ã¼ãã«ã®å¤ã®é»ãé¨åãæ¼ãããããã¤ã¢ãã°ãéãããèæ¯ãã¹ã¯ãã¼ã«ãããããããã«ãã 159const modals = document.querySelectorAll(".dialog__open--inner");
160modals.forEach((modal) => { 161 modal.addEventListener("click", (event) => { 162 if (!event.target.closest(".dialog_inner")) { 163 modal.close(); 164 body.style.overflow = "visible"; 165 } 166 }); 167}); 168 169// // ã¨ã¹ã±ã¼ããã¼ãæ¼ããããèæ¯ãã¹ã¯ãã¼ã«ãããããããã«ãã 170modals.forEach((modal) => { 171 modal.addEventListener("keydown", function (e) { 172 if (e.key === "Escape") { 173 body.style.overflow = "visible"; 174 } 175 }); 176}); 177// ----------------------------------------------- 178// ã¹ã¯ãã¼ã«ãããæåãå·¦ããå³ã«å ¥ã£ã¦ãã 179// ----------------------------------------------- 180const observerLeft = new IntersectionObserver((entries) => { 181 entries.forEach((left) => { 182 if (left.isIntersecting) { 183 left.target.classList.add("active"); 184 observer.unobserve(left.target); 185 } 186 }); 187}); 188// å·¦ãããã§ã¼ãã¤ã³ããè¦ç´ ãåå¾ 189const fadeInLeft = document.querySelectorAll(".load-slide-left"); 190fadeInLeft.forEach((element) => { 191 observerLeft.observe(element); 192}); 193// ----------------------------------------------- 194// ã¹ã¯ãã¼ã«ãããæåãè·³ãã 195// ----------------------------------------------- 196const observerOptions = { 197 root: null, 198 rootMargin: "0px 0px -100px 0px", 199 threshold: 0, 200}; 201const observer = new IntersectionObserver((entries) => { 202 entries.forEach((entry) => { 203 if (entry.isIntersecting) { 204 // data-animation屿§ãè¨å® 205 entry.target.setAttribute("data-animation", "after"); 206 207 // 対象ã®è¦ç´ å ã®æåã«é å»¶ãè¨å® 208 const chars = entry.target.querySelectorAll(".bounce-title-char"); 209 chars.forEach((char, index) => { 210 const delay = 0.1 + index * 0.03; 211 char.style.animationDelay = `${delay}s`; 212 }); 213 214 // ç£è¦ãè§£é¤ 215 observer.unobserve(entry.target); 216 } 217 }); 218}, observerOptions); 219 220// ç£è¦å¯¾è±¡ãåå¾ãã¦è¨å® 221const bounceTitles = document.querySelectorAll(".bounce-title");
222bounceTitles.forEach((title) => { 223 observer.observe(title); 224}); 225// const observer = new IntersectionObserver((entries) => { 226// entries.forEach((entry) => { 227// if (entry.isIntersecting) { 228// // è¦ç´ ããã¥ã¼ãã¼ãã«å ¥ã£ããdata-animation屿§ã"after"ã«ãã 229// entry.target.setAttribute("data-animation", "after"); 230// observer.unobserve(entry.target); // ã¢ãã¡ã¼ã·ã§ã³ãä¸åº¦ã ãå®è¡ãããããã«ç£è¦ãè§£é¤ 231// } 232// }); 233// }); 234// // ç£è¦ãããè¦ç´ ãåå¾ 235// const bounceTitle = document.querySelectorAll(".bounce-title"); 236// bounceTitle.forEach((title) => { 237// observer.observe(title); // åè¦ç´ ãç£è¦ 238// }); 239 240// // åæåã«å¯¾ãã¦é çªã«ã¢ãã¡ã¼ã·ã§ã³é å»¶ãé©ç¨ 241// const chars = document.querySelectorAll(".bounce-title-char"); 242// chars.forEach((char, index) => { 243// const delay = 0.4 + index * 0.15; // é å»¶ã0.4ç§ããå§ãã¦ã0.15ç§ãã¤å¢å 244// char.style.animationDelay = `${delay}s`; 245// }); 246 247// ----------------------------------------------- 248// ãã§ã¼ãã¤ã³ã¢ãã¡ã¼ã·ã§ã³ï¼ãã¼ã¸ãèªã¿è¾¼ã¾ããããã§ã¼ãã¤ã³ï¼ 249// ----------------------------------------------- 250const loadElements = document.querySelectorAll(".load-fade-in"); 251loadElements.forEach((element) => { 252 element.style.opacity = "0"; 253 element.style.transition = "opacity 1s ease-in-out"; 254}); 255 256window.addEventListener("load", function () { 257 loadElements.forEach((element) => { 258 element.style.opacity = "1"; 259 }); 260}); 261 262// ----------------------------------------------- 263// ãã§ã¼ãã¤ã³ã¢ãã¡ã¼ã·ã§ã³ï¼ã¹ã¯ãã¼ã«ã§ç»é¢å ã«å ¥ã£ãããã§ã¼ãã¤ã³ï¼ 264// ----------------------------------------------- 265let fadeInTarget = document.querySelectorAll(".fade-in"); 266window.addEventListener("scroll", () => { 267 for (let i = 0; i < fadeInTarget.length; i++) { 268 const rect = fadeInTarget[i].getBoundingClientRect().top; 269 const scroll = window.pageYOffset || document.documentElement.scrollTop; 270 const offset = rect + scroll; 271 const windowHeight = window.innerHeight; 272 if (scroll > offset - windowHeight + 150) { 273 fadeInTarget[i].classList.add("scroll-in"); 274 } 275 } 276}); 277 278AOS.init();
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.