Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ // Mobile menu toggle
+ const menuToggle = document.querySelector('.menu-toggle');
+ const navLinks = document.querySelector('.nav-links');
+
+ menuToggle.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ });
+
+ // Simple map initialization
+ initMap();
+
+ // Initialize calendars
+ initCalendars();
+
+ // Check-in button handlers
+ const checkInButtons = document.querySelectorAll('.check-in-btn');
+ checkInButtons.forEach(button => {
+ button.addEventListener('click', handleCheckIn);
+ });
+ });
+
+ function initMap() {
+ // Simplified map implementation
+ const map = document.getElementById('map');
+ // Would normally use a mapping service here
+ // For demo, just show placeholder
+ map.innerHTML = '
Interactive Map Would Display Here
';
+ }
+
+ function initCalendars() {
+ const calendars = document.querySelectorAll('.calendar');
+ calendars.forEach(calendar => {
+ const parkId = calendar.dataset.parkId;
+ renderCalendar(calendar, parkId);
+ });
+ }
+
+ function renderCalendar(container, parkId) {
+ // Simplified calendar view
+ const date = new Date();
+ const month = date.toLocaleString('default', { month: 'long' });
+ container.innerHTML = `
+
+
Calendar view for Park #${parkId}
+
Click Check In to mark your visit
+
+ `;
+ }
+
+ function handleCheckIn(event) {
+ // Would normally handle authentication and API calls
+ const button = event.target;
+ button.textContent = 'Checked In!';
+ button.disabled = true;
+ setTimeout(() => {
+ button.textContent = 'Check In';
+ button.disabled = false;
+ }, 2000);
+ }
+
+ // Geolocation functionality
+ if ("geolocation" in navigator) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ // Would use coordinates to center map and find nearby parks
+ const lat = position.coords.latitude;
+ const lng = position.coords.longitude;
+ console.log(`Location: ${lat}, ${lng}`);
+ });
+ }