Spaces:
Running
Running
'β¬', 'βΊ', '%', 'β', 'β', 'β«', 'β', 'β']; function createElement() { const element = document.createElement('div'); element.className = 'bg-element'; // Randomly decide if it's a formula or number if (Math.random() > 0.5) { element.textContent = formulas[Math.floor(Math.random() * formulas.length)]; element.classList.add('formula'); } else { element.textContent = numbers[Math.floor(Math.random() * numbers.length)]; } // Random position and size element.style.left = Math.random() * 100 + 'vw'; element.style.top = Math.random() * 100 + 'vh'; element.style.fontSize = (Math.random() * 1 + 0.5) + 'rem'; // Random animation duration and delay const duration = Math.random() * 20 + 10; const delay = Math.random() * 5; element.style.animation = `float ${duration}s ${delay}s infinite linear`; bgElements.appendChild(element); } // Create initial elements for (let i = 0; i < 30; i++) { createElement(); } // Add new elements periodically setInterval(createElement, 3000); // Highlight active navigation link const sections = document.querySelectorAll('section'); const navLinks = document.querySelectorAll('.nav-link'); window.addEventListener('scroll', () => { let current = ''; sections.forEach(section => { const sectionTop = section.offsetTop; const sectionHeight = section.clientHeight; if (pageYOffset >= (sectionTop - 300)) { current = section.getAttribute('id'); } }); navLinks.forEach(link => { link.classList.remove('active-nav'); if (link.getAttribute('href') === `#${current}`) { link.classList.add('active-nav'); } }); }); // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href'); const targetElement = document.querySelector(targetId); window.scrollTo({ top: targetElement.offsetTop - 100, behavior: 'smooth' }); }); }); - Initial Deployment
372261a
verified