Download script.js from flycodedagent/deepsite-project-w1k0u: direct link, hf CLI and curl.
- Browser
- Download file 5.75 kB
-
https://huggingface.co/spaces/flycodedagent/deepsite-project-w1k0u/resolve/main/script.js
- Command line
-
hf download hf://spaces/flycodedagent/deepsite-project-w1k0u/script.js
-
curl -L -o script.js https://huggingface.co/spaces/flycodedagent/deepsite-project-w1k0u/resolve/main/script.js
5.75 kB
| // Initialize Lucide Icons | |
| lucide.createIcons(); | |
| // DOM Elements | |
| const navbar = document.getElementById('navbar'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| const mobileMenuBtn = document.getElementById('mobile-menu-btn'); | |
| const countdownDays = document.getElementById('days'); | |
| const countdownHours = document.getElementById('hours'); | |
| const countdownMinutes = document.getElementById('minutes'); | |
| const countdownSeconds = document.getElementById('seconds'); | |
| // Event Date - April 2026 (setting to April 15, 2026 for demo) | |
| const eventDate = new Date('April 15, 2026 07:00:00').getTime(); | |
| // Countdown Timer Function | |
| function updateCountdown() { | |
| const now = new Date().getTime(); | |
| const distance = eventDate - now; | |
| if (distance < 0) { | |
| countdownDays.innerHTML = "00"; | |
| countdownHours.innerHTML = "00"; | |
| countdownMinutes.innerHTML = "00"; | |
| countdownSeconds.innerHTML = "00"; | |
| return; | |
| } | |
| const days = Math.floor(distance / (1000 * 60 * 60 * 24)); | |
| const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | |
| const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | |
| const seconds = Math.floor((distance % (1000 * 60)) / 1000); | |
| countdownDays.innerHTML = days.toString().padStart(2, '0'); | |
| countdownHours.innerHTML = hours.toString().padStart(2, '0'); | |
| countdownMinutes.innerHTML = minutes.toString().padStart(2, '0'); | |
| countdownSeconds.innerHTML = seconds.toString().padStart(2, '0'); | |
| } | |
| // Update countdown immediately and then every second | |
| updateCountdown(); | |
| setInterval(updateCountdown, 1000); | |
| // Navbar Scroll Effect | |
| let lastScroll = 0; | |
| window.addEventListener('scroll', () => { | |
| const currentScroll = window.pageYOffset; | |
| // Add background when scrolled | |
| if (currentScroll > 100) { | |
| navbar.classList.add('shadow-md'); | |
| } else { | |
| navbar.classList.remove('shadow-md'); | |
| } | |
| lastScroll = currentScroll; | |
| }); | |
| // Mobile Menu Toggle | |
| let isMenuOpen = false; | |
| mobileMenuBtn.addEventListener('click', () => { | |
| isMenuOpen = !isMenuOpen; | |
| if (isMenuOpen) { | |
| mobileMenu.classList.remove('hidden'); | |
| mobileMenu.classList.add('mobile-menu-enter'); | |
| mobileMenuBtn.innerHTML = '<i data-lucide="x" class="w-6 h-6"></i>'; | |
| } else { | |
| mobileMenu.classList.add('hidden'); | |
| mobileMenu.classList.remove('mobile-menu-enter'); | |
| mobileMenuBtn.innerHTML = '<i data-lucide="menu" class="w-6 h-6"></i>'; | |
| } | |
| // Re-initialize icons after changing HTML | |
| lucide.createIcons(); | |
| }); | |
| // Close mobile menu when clicking a link | |
| document.querySelectorAll('#mobile-menu a').forEach(link => { | |
| link.addEventListener('click', () => { | |
| isMenuOpen = false; | |
| mobileMenu.classList.add('hidden'); | |
| mobileMenuBtn.innerHTML = '<i data-lucide="menu" class="w-6 h-6"></i>'; | |
| lucide.createIcons(); | |
| }); | |
| }); | |
| // Smooth scroll for navigation links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| const target = document.querySelector(this.getAttribute('href')); | |
| if (target) { | |
| target.scrollIntoView({ | |
| behavior: 'smooth', | |
| block: 'start' | |
| }); | |
| } | |
| }); | |
| }); | |
| // Intersection Observer for Fade-in Animations | |
| const observerOptions = { | |
| root: null, | |
| rootMargin: '0px', | |
| threshold: 0.1 | |
| }; | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate-fade-in'); | |
| observer.unobserve(entry.target); | |
| } | |
| }); | |
| }, observerOptions); | |
| // Observe all sections | |
| document.querySelectorAll('section h2, section h3, .group').forEach((el) => { | |
| el.style.opacity = '0'; | |
| el.style.transform = 'translateY(20px)'; | |
| el.style.transition = 'opacity 0.6s ease-out, transform 0.6s ease-out'; | |
| observer.observe(el); | |
| }); | |
| // Dynamic year in footer | |
| const yearSpan = document.querySelector('footer p'); | |
| if (yearSpan) { | |
| yearSpan.innerHTML = yearSpan.innerHTML.replace('2026', new Date().getFullYear()); | |
| } | |
| // Registration Button Interaction | |
| const registerBtn = document.querySelector('button', '#register button'); | |
| if (registerBtn) { | |
| registerBtn.addEventListener('click', () => { | |
| // Simulate registration modal or redirect | |
| alert('Registration portal opening soon! Check back on March 1st, 2026 for early bird access.'); | |
| }); | |
| } | |
| // Add parallax effect to hero section | |
| window.addEventListener('scroll', () => { | |
| const scrolled = window.pageYOffset; | |
| const heroSection = document.getElementById('hero'); | |
| if (heroSection && scrolled < window.innerHeight) { | |
| const heroImage = heroSection.querySelector('img'); | |
| if (heroImage) { | |
| heroImage.style.transform = `translateY(${scrolled * 0.5}px)`; | |
| } | |
| } | |
| }); | |
| // Performance: Lazy load images | |
| if ('IntersectionObserver' in window) { | |
| const imageObserver = new IntersectionObserver((entries, observer) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| const img = entry.target; | |
| img.src = img.dataset.src || img.src; | |
| img.classList.remove('lazy'); | |
| imageObserver.unobserve(img); | |
| } | |
| }); | |
| }); | |
| document.querySelectorAll('img').forEach(img => imageObserver.observe(img)); | |
| } | |
| // Console greeting | |
| console.log('%c🏔️ Mount Patti Championships 2026', 'font-size: 24px; font-weight: bold; color: #008751;'); | |
| console.log('%cElevating Athletic Excellence in Kogi State', 'font-size: 14px; color: #666;'); |