24 lines
736 B
JavaScript
24 lines
736 B
JavaScript
(() => {
|
|
const revealItems = document.querySelectorAll('.card, .price-card, .panel, .benefits-grid article, .faq-list details');
|
|
|
|
const observer = new IntersectionObserver(
|
|
(entries) => {
|
|
entries.forEach((entry) => {
|
|
if (entry.isIntersecting) {
|
|
entry.target.style.opacity = '1';
|
|
entry.target.style.transform = 'translateY(0)';
|
|
observer.unobserve(entry.target);
|
|
}
|
|
});
|
|
},
|
|
{ threshold: 0.08 }
|
|
);
|
|
|
|
revealItems.forEach((item, index) => {
|
|
item.style.opacity = '0';
|
|
item.style.transform = 'translateY(18px)';
|
|
item.style.transition = `opacity .45s ease ${index * 0.03}s, transform .45s ease ${index * 0.03}s`;
|
|
observer.observe(item);
|
|
});
|
|
})();
|