[sc name="The Digi Advert"][/sc]
Skip to content
// Scroll reveal
const reveals = document.querySelectorAll('.reveal');
const observer = new IntersectionObserver((entries) => {
entries.forEach(e => {
if (e.isIntersecting) {
e.target.classList.add('visible');
}
});
}, { threshold: 0.15 });
reveals.forEach(el => observer.observe(el));
// Counter animation
function animateCount(el) {
const target = parseInt(el.dataset.count);
let current = 0;
const step = target / 50;
const timer = setInterval(() => {
current += step;
if (current >= target) {
current = target;
clearInterval(timer);
}
el.textContent = Math.floor(current);
}, 30);
}
document.querySelectorAll('[data-count]').forEach(el => {
animateCount(el);
});
// Simple hover effect
document.querySelectorAll('a, button').forEach(el => {
el.addEventListener('mouseenter', () => {
el.style.transform = "scale(1.05)";
});
el.addEventListener('mouseleave', () => {
el.style.transform = "scale(1)";
});
});