Spaces:
Running
Running
| // SRT Master JavaScript functionality | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize Feather Icons | |
| feather.replace(); | |
| // Add animation to feature cards on scroll | |
| const featureCards = document.querySelectorAll('.feature-card'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate-fade-in-up'); | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| featureCards.forEach(card => { | |
| observer.observe(card); | |
| }); | |
| // Terminal animation | |
| const terminalLines = document.querySelectorAll('.terminal-line'); | |
| if (terminalLines.length > 0) { | |
| terminalLines.forEach((line, index) => { | |
| setTimeout(() => { | |
| line.classList.add('opacity-100'); | |
| }, 300 * index); | |
| }); | |
| } | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| document.querySelector(this.getAttribute('href')).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); | |
| // Form submission handling (if any forms exist) | |
| const forms = document.querySelectorAll('form'); | |
| forms.forEach(form => { | |
| form.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Add form handling logic here | |
| console.log('Form submitted'); | |
| }); | |
| }); | |
| }); | |
| // Animation utility functions | |
| function fadeInUp(element) { | |
| element.style.opacity = '0'; | |
| element.style.transform = 'translateY(20px)'; | |
| setTimeout(() => { | |
| element.style.transition = 'opacity 0.6s ease, transform 0.6s ease'; | |
| element.style.opacity = '1'; | |
| element.style.transform = 'translateY(0)'; | |
| }, 100); | |
| } | |
| // Add to top button | |
| window.addEventListener('scroll', function() { | |
| const backToTop = document.getElementById('backToTop'); | |
| if (backToTop) { | |
| if (window.pageYOffset > 300) { | |
| backToTop.classList.remove('opacity-0', 'invisible'); | |
| backToTop.classList.add('opacity-100', 'visible'); | |
| } else { | |
| backToTop.classList.add('opacity-0', 'invisible'); | |
| backToTop.classList.remove('opacity-100', 'visible'); | |
| } | |
| } | |
| }); | |
| // Add back to top button dynamically | |
| function addBackToTopButton() { | |
| const backToTop = document.createElement('button'); | |
| backToTop.id = 'backToTop'; | |
| backToTop.innerHTML = '<i data-feather="arrow-up"></i>'; | |
| backToTop.className = 'fixed bottom-6 right-6 bg-indigo-600 text-white p-3 rounded-full shadow-lg opacity-0 invisible transition-all duration-300 hover:bg-indigo-700'; | |
| document.body.appendChild(backToTop); | |
| backToTop.addEventListener('click', () => { | |
| window.scrollTo({ | |
| top: 0, | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| feather.replace(); | |
| } | |
| // Initialize back to top button | |
| document.addEventListener('DOMContentLoaded', addBackToTopButton); |