feat: implement Phase 1-3 (Schema JSON-LD, sitemap, robots, FAQ accordion, relief timeline, prayer briefing modal, high-contrast banner)

This commit is contained in:
2026-09-02 14:15:25 -07:00
parent 05a5f7ef63
commit c9432c0079
6 changed files with 851 additions and 24 deletions
+64
View File
@@ -187,6 +187,70 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
// FAQ Accordion Interaction
const faqItems = document.querySelectorAll('.faq-item');
faqItems.forEach(item => {
const questionBtn = item.querySelector('.faq-question');
if (questionBtn) {
questionBtn.addEventListener('click', () => {
const isOpen = item.classList.contains('open');
faqItems.forEach(other => {
if (other !== item) {
other.classList.remove('open');
const btn = other.querySelector('.faq-question');
if (btn) btn.setAttribute('aria-expanded', 'false');
}
});
item.classList.toggle('open', !isOpen);
questionBtn.setAttribute('aria-expanded', String(!isOpen));
});
}
});
// Prayer Guide Modal Logic
const prayerModal = document.getElementById('prayer-modal');
const btnOpenPrayer = document.getElementById('btn-open-prayer-guide');
const prayerModalClose = document.getElementById('prayer-modal-close');
const prayerModalCloseBtn = document.getElementById('prayer-modal-close-btn');
function openPrayerModal() {
if (prayerModal) {
prayerModal.classList.add('active');
document.body.style.overflow = 'hidden';
}
}
function closePrayerModal() {
if (prayerModal) {
prayerModal.classList.remove('active');
document.body.style.overflow = '';
}
}
if (btnOpenPrayer) {
btnOpenPrayer.addEventListener('click', (e) => {
e.preventDefault();
openPrayerModal();
});
}
if (prayerModalClose) {
prayerModalClose.addEventListener('click', closePrayerModal);
}
if (prayerModalCloseBtn) {
prayerModalCloseBtn.addEventListener('click', closePrayerModal);
}
if (prayerModal) {
prayerModal.addEventListener('click', (e) => {
if (e.target === prayerModal) {
closePrayerModal();
}
});
}
// Initial Language Load
setLanguage(currentLang);
});