Download script.js from litox/profusion-digital-solutions: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/litox/profusion-digital-solutions/resolve/main/script.js
- Command line
-
hf download hf://spaces/litox/profusion-digital-solutions/script.js
-
curl -L -o script.js https://huggingface.co/spaces/litox/profusion-digital-solutions/resolve/main/script.js
1.23 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // 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 | |
| const contactForm = document.querySelector('form'); | |
| if (contactForm) { | |
| contactForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Here you would normally send the form data to a server | |
| alert('Thank you for your inquiry! We will contact you soon.'); | |
| this.reset(); | |
| }); | |
| } | |
| // Add fade-in animation to sections | |
| const sections = document.querySelectorAll('section'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('fade-in'); | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| sections.forEach(section => { | |
| observer.observe(section); | |
| }); | |
| }); |