File size: 4,912 Bytes
b816aef
592192d
 
 
 
 
 
 
 
 
 
b816aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592192d
66beb84
b816aef
66beb84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b816aef
66beb84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

// 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);
            });
        }
    }
});