document.getElementById("js-hamburger").addEventListener("click", function () { const nav = document.querySelector(".nav__items"); const hamburger = document.getElementById("js-hamburger"); nav.classList.toggle("active"); hamburger.classList.toggle("open"); // ハンバーガーの変形を適用 }); document.addEventListener('DOMContentLoaded', () => { const fadeInAll = document.querySelector('.fade-in-all'); const handleScroll = () => { const rect = fadeInAll.getBoundingClientRect(); if (rect.top < window.innerHeight && rect.bottom > 0) { fadeInAll.classList.add('visible'); } }; window.addEventListener('scroll', handleScroll); handleScroll(); // ページロード時に初回確認 });