Spaces:
Running
Running
Download script.js from Djackis/Santebienetre: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/spaces/Djackis/Santebienetre/resolve/main/script.js
- Command line
-
hf download hf://spaces/Djackis/Santebienetre/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Djackis/Santebienetre/resolve/main/script.js
1.85 kB
| // 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' | |
| }); | |
| }); | |
| }); | |
| // Facebook SDK integration | |
| window.fbAsyncInit = function() { | |
| FB.init({ | |
| appId : 'your-app-id', | |
| autoLogAppEvents : true, | |
| xfbml : true, | |
| version : 'v12.0' | |
| }); | |
| }; | |
| // Load Facebook SDK | |
| (function(d, s, id) { | |
| var js, fjs = d.getElementsByTagName(s)[0]; | |
| if (d.getElementById(id)) return; | |
| js = d.createElement(s); js.id = id; | |
| js.src = "https://connect.facebook.net/fr_FR/sdk.js"; | |
| fjs.parentNode.insertBefore(js, fjs); | |
| }(document, 'script', 'facebook-jssdk')); | |
| // Product tracking | |
| document.querySelectorAll('[data-product]').forEach(btn => { | |
| btn.addEventListener('click', function() { | |
| const productName = this.getAttribute('data-product'); | |
| gtag('event', 'product_click', { | |
| 'product_name': productName, | |
| 'currency': 'XOF', | |
| 'value': this.getAttribute('data-price') | |
| }); | |
| }); | |
| }); | |
| // WhatsApp CTA tracking | |
| document.querySelectorAll('.whatsapp-cta').forEach(btn => { | |
| btn.addEventListener('click', function() { | |
| gtag('event', 'whatsapp_click', { | |
| 'event_category': 'CTA', | |
| 'event_label': this.getAttribute('data-cta-type') | |
| }); | |
| }); | |
| }); | |
| // Facebook pixel tracking | |
| fbq('track', 'PageView'); | |
| // Form submission handling | |
| document.getElementById('contactForm')?.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Handle form submission here | |
| alert('Merci pour votre message! Nous vous contacterons bientôt.'); | |
| this.reset(); | |
| }); |