Download script.js from ivaan2003/techpulse-chronicles-clone: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/ivaan2003/techpulse-chronicles-clone/resolve/main/script.js
- Command line
-
hf download hf://spaces/ivaan2003/techpulse-chronicles-clone/script.js
-
curl -L -o script.js https://huggingface.co/spaces/ivaan2003/techpulse-chronicles-clone/resolve/main/script.js
1.1 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize animations | |
| const cards = document.querySelectorAll('custom-news-card'); | |
| cards.forEach((card, index) => { | |
| card.classList.add('animate-fade-in'); | |
| card.classList.add(`delay-${(index % 3) * 100}`); | |
| }); | |
| // Add clone indicator | |
| 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); | |
| } | |
| }); | |
| // Intersection Observer for lazy loading and animations | |
| 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); | |
| }); |