| |
|
| | document.addEventListener('DOMContentLoaded', function() { |
| | |
| | const cards = document.querySelectorAll('custom-news-card'); |
| | cards.forEach((card, index) => { |
| | card.classList.add('animate-fade-in'); |
| | card.classList.add(`delay-${(index % 3) * 100}`); |
| | }); |
| |
|
| | |
| | const hero = document.querySelector('.bg-gradient-to-r'); |
| | if (hero) { |
| | const cloneBadge = document.createElement('div'); |
| | cloneBadge.className = 'absolute top-4 right-4 bg-yellow-500 text-white px-3 py-1 rounded-full text-xs font-bold'; |
| | cloneBadge.textContent = 'CLONE'; |
| | hero.appendChild(cloneBadge); |
| | } |
| | }); |
| | |
| | const observer = new IntersectionObserver((entries) => { |
| | entries.forEach(entry => { |
| | if (entry.isIntersecting) { |
| | entry.target.classList.add('animate-fade-in'); |
| | observer.unobserve(entry.target); |
| | } |
| | }); |
| | }, { |
| | threshold: 0.1 |
| | }); |
| |
|
| | document.querySelectorAll('.observe-me').forEach(el => { |
| | observer.observe(el); |
| | }); |