Changed around line 1
+ // Sample vehicle data
+ const vehicles = [
+ { id: 1, name: 'Truck 101', status: 'Moving', location: 'New York' },
+ { id: 2, name: 'Van 202', status: 'Idle', location: 'Los Angeles' },
+ { id: 3, name: 'Car 303', status: 'Moving', location: 'Chicago' }
+ ];
+
+ // Update vehicle list
+ function updateVehicleList() {
+ const vehicleList = document.getElementById('vehicle-list');
+ vehicleList.innerHTML = vehicles.map(vehicle => `
+
+ ${vehicle.name}
+ Status: ${vehicle.status}
+ Location: ${vehicle.location}
+
+ `).join('');
+ }
+
+ // Update signal strength
+ function updateSignal() {
+ const signalBar = document.querySelector('.signal-bar');
+ const signalStrength = document.querySelector('.signal-strength');
+
+ // Simulate signal strength changes
+ const strength = Math.random();
+ const width = Math.floor(strength * 100);
+
+ signalBar.style.background = `linear-gradient(90deg, var(--secondary-color) ${width}%, #e0e0e0 ${width}%)`;
+ signalStrength.textContent = strength > 0.7 ? 'Strong' : strength > 0.4 ? 'Moderate' : 'Weak';
+ }
+
+ // Initialize
+ function init() {
+ updateVehicleList();
+ setInterval(updateSignal, 3000);
+ }
+
+ // Run when DOM is loaded
+ document.addEventListener('DOMContentLoaded', init);