// animation document.addEventListener("DOMContentLoaded", () => { const targets = document.querySelectorAll(".anime"); setTimeout(() => { const observer = new IntersectionObserver((entries, observer) => { entries.forEach((entry, index) => { if (entry.isIntersecting) { const el = entry.target; el.style.transitionDelay = `${index * 0.1 + 0.2}s`; el.classList.add("anime-on"); observer.unobserve(el); } }); }, { threshold: 0.1 }); targets.forEach(target => { observer.observe(target); }); }, 1000); }); document.querySelectorAll('.accordion-header').forEach(button => { button.addEventListener('click', () => { const item = button.parentElement; const content = button.nextElementSibling; // 他の項目を閉じたい場合は以下4行を有効にする // document.querySelectorAll('.accordion-item').forEach(otherItem => { // if (otherItem !== item) otherItem.classList.remove('is-open'); // if (otherItem !== item) otherItem.querySelector('.accordion-content').style.maxHeight = null; // }); // 自分の開閉 item.classList.toggle('is-open'); if (item.classList.contains('is-open')) { content.style.maxHeight = content.scrollHeight + "px"; } else { content.style.maxHeight = null; } }); });