Spaces:
Running
Running
Download script.js from jayxjay/affiliate-bridge-pro: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/jayxjay/affiliate-bridge-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/jayxjay/affiliate-bridge-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/jayxjay/affiliate-bridge-pro/resolve/main/script.js
1.54 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize Feather Icons | |
| feather.replace(); | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| const targetId = this.getAttribute('href'); | |
| if (targetId === '#') return; | |
| const targetElement = document.querySelector(targetId); | |
| if (targetElement) { | |
| targetElement.scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| } | |
| }); | |
| }); | |
| // Mobile menu toggle functionality will be handled by navbar component | |
| }); | |
| // Function to handle sign up forms | |
| function handleSignUp(formId, successMessage) { | |
| const form = document.getElementById(formId); | |
| if (form) { | |
| form.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Here you would typically send the form data to your server | |
| alert(successMessage || 'Thank you for signing up! We will be in touch soon.'); | |
| form.reset(); | |
| }); | |
| } | |
| } | |
| // Initialize form handlers when DOM is loaded | |
| document.addEventListener('DOMContentLoaded', function() { | |
| handleSignUp('business-signup', 'Thank you for your interest! Our team will contact you shortly.'); | |
| handleSignUp('affiliate-signup', 'Welcome to our affiliate network! Check your email for next steps.'); | |
| }); |