top of page
bottom of page
(function(){
// Fade body in after load
document.addEventListener("DOMContentLoaded", () => {
document.body.style.opacity = "1";
});
// Intersection Observer for fade sections
const faders = document.querySelectorAll(".fade-section");
const appearOnScroll = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if(entry.isIntersecting){
entry.target.classList.add("visible");
observer.unobserve(entry.target);
}
});
}, { threshold: 0.2 });
faders.forEach(fader => {
appearOnScroll.observe(fader);
});
// Pulse animation for CTA buttons
const ctas = document.querySelectorAll(".btn.cta, .cta-button");
ctas.forEach(btn => {
btn.style.animation = "pulse 2.5s infinite";
});
// Add pulse keyframes dynamically
const style = document.createElement("style");
style.innerHTML = `
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.07); }
}
`;
document.head.appendChild(style);
console.log("✨ Smooth page effects active across all pages.");
})();