const Render=()=> { const NOW = new Date(); if(NOW < new Date(`Jan 1 2026`)) { const layoutBase =(hexColor, ...messages)=>`
The Bible teaching from Truth For Life is funded by your donations!
`; const messageLarge =(message)=> `${message}
`; const mainNav = document.querySelector(".nav-outer-wrapper"); if(mainNav) // if the main nav exists { if(location.pathname.startsWith("/store/")) // if we are on a store page { if(location.pathname === `/store/category/gifts/`) // if we are on the store category for the gifts page, add this tweak css and *keep going* { mainNav.insertAdjacentHTML("afterend", ` `) const mentionDonation =(imageURL)=> { const selector = `.card-inner img[alt="${imageURL}"]`; const matchingProduct = document.querySelector(selector); if(matchingProduct) { matchingProduct.parentElement.insertAdjacentHTML("afterend", `
Your year-end donation will help sustain the global Gospel outreach of Truth For Life. Thank you.
` return; } } if(!location.pathname.startsWith("/donate/")) // if we are not on any donate process page, show the DONATION BANNER and *quit* { // if(localStorage.getItem("ye-2025-donation")) // TODO: don't show donatio messaing if a donation has been madee // { // return; // } mainNav.insertAdjacentHTML("afterend", layoutBase( "#bb8618", messageSmall, messageLarge(`Will you kindly give a year-end gift of any amount? Thank you.`) ) ); return; } if(location.pathname.startsWith("/donate/thank-you/")) // if we are on the donation thank you page, take note { localStorage.setItem("ye-2025-donation", "true"); } } else // we are on a non-standard header page { if(location.pathname == "/donate/") // if we are on the donate page, insert a THIN DONATION BANNER { document.querySelector(".donation-header").insertAdjacentHTML ( "afterend", layoutBase( "#bb8618", messageLarge( `Your year-end donation will help sustain the global Gospel outreach of Truth For Life. Thank you.` ) ) ) } } } } // render and setup subsequent pjax renders Render(); const observer = new MutationObserver(Render); observer.observe(document.querySelector("#site-wrapper"), {subtree: false, childList: true});