Spaces:
Running
Running
Download script.js from Babluram/zentralift-engineering: direct link, hf CLI and curl.
- Browser
- Download file 4.91 kB
-
https://huggingface.co/spaces/Babluram/zentralift-engineering/resolve/main/script.js
- Command line
-
hf download hf://spaces/Babluram/zentralift-engineering/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Babluram/zentralift-engineering/resolve/main/script.js
4.91 kB
| // Form submission handler | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const contactForm = document.querySelector('form'); | |
| if (contactForm) { | |
| contactForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| alert('Thank you for your inquiry! Our team will contact you shortly.'); | |
| this.reset(); | |
| }); | |
| } | |
| // Mobile menu toggle | |
| const mobileMenuBtn = document.querySelector('.mobile-menu-btn'); | |
| if (mobileMenuBtn) { | |
| mobileMenuBtn.addEventListener('click', function() { | |
| const navLinks = document.querySelector('.nav-links'); | |
| navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex'; | |
| }); | |
| } | |
| // Highlight active nav link | |
| const currentPage = location.pathname.split('/').pop() || 'index.html'; | |
| document.querySelectorAll('.nav-link').forEach(link => { | |
| const linkPage = link.getAttribute('href').split('/').pop(); | |
| if (currentPage === linkPage || (currentPage === '' && linkPage === 'index.html')) { | |
| link.classList.add('active'); | |
| } else { | |
| link.classList.remove('active'); | |
| } | |
| }); | |
| }); | |
| // Tippmann-based product data | |
| async function fetchProducts() { | |
| return { | |
| dockEquipment: [ | |
| { | |
| id: "dl-4500", | |
| title: "Dock Leveler 4500", | |
| description: "Heavy-duty hydraulic dock leveler with 45,000 lb capacity", | |
| image: "http://static.photos/industry/1024x576/20", | |
| features: ["45,000 lb capacity", "10' x 8' platform", "Durable steel construction"] | |
| }, | |
| { | |
| id: "dl-3000", | |
| title: "Dock Leveler 3000", | |
| description: "Mechanical dock leveler for standard applications", | |
| image: "http://static.photos/industry/1024x576/21", | |
| features: ["30,000 lb capacity", "Manual operation", "Low maintenance"] | |
| } | |
| ], | |
| lifts: [ | |
| { | |
| id: "tl-5000", | |
| title: "Tail Lift 5000", | |
| description: "Heavy-duty tail lift for truck loading", | |
| image: "http://static.photos/automotive/1024x576/22", | |
| features: ["5,000 lb capacity", "30' lift height", "Hydraulic operation"] | |
| }, | |
| { | |
| id: "sl-6000", | |
| title: "Scissor Lift 6000", | |
| description: "Industrial scissor lift platform", | |
| image: "http://static.photos/construction/1024x576/23", | |
| features: ["6,000 lb capacity", "42' platform height", "Electric/hydraulic"] | |
| } | |
| ], | |
| safety: [ | |
| { | |
| id: "db-1000", | |
| title: "Dock Bumper System", | |
| description: "Rubber dock bumpers for protection", | |
| image: "http://static.photos/industry/1024x576/24", | |
| features: ["Shock absorption", "UV resistant", "Easy installation"] | |
| } | |
| ] | |
| }; | |
| } | |
| // Initialize product pages | |
| document.addEventListener('DOMContentLoaded', async function() { | |
| const products = await fetchProducts(); | |
| // Load products into their respective sections | |
| if (products) { | |
| if (document.getElementById('dock-equipment')) { | |
| products.dockEquipment.forEach(product => { | |
| const card = document.createElement('product-card'); | |
| card.setAttribute('product-id', product.id); | |
| card.setAttribute('title', product.title); | |
| card.setAttribute('description', product.description); | |
| card.setAttribute('image', product.image); | |
| document.getElementById('dock-equipment').appendChild(card); | |
| }); | |
| } | |
| if (document.getElementById('lift-equipment')) { | |
| products.lifts.forEach(product => { | |
| const card = document.createElement('product-card'); | |
| card.setAttribute('product-id', product.id); | |
| card.setAttribute('title', product.title); | |
| card.setAttribute('description', product.description); | |
| card.setAttribute('image', product.image); | |
| document.getElementById('lift-equipment').appendChild(card); | |
| }); | |
| } | |
| if (document.getElementById('safety-equipment')) { | |
| products.safety.forEach(product => { | |
| const card = document.createElement('product-card'); | |
| card.setAttribute('product-id', product.id); | |
| card.setAttribute('title', product.title); | |
| card.setAttribute('description', product.description); | |
| card.setAttribute('image', product.image); | |
| document.getElementById('safety-equipment').appendChild(card); | |
| }); | |
| } | |
| } | |
| }); | |