Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ // Mobile menu toggle
+ const mobileMenu = document.querySelector('.mobile-menu');
+ const navLinks = document.querySelector('.nav-links');
+
+ mobileMenu.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ });
+
+ // Calendar functionality
+ const calendarGrid = document.getElementById('calendarGrid');
+ const currentMonthElement = document.getElementById('currentMonth');
+ const prevMonth = document.getElementById('prevMonth');
+ const nextMonth = document.getElementById('nextMonth');
+
+ let currentDate = new Date();
+
+ function renderCalendar(date) {
+ const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
+ const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
+
+ currentMonthElement.textContent = date.toLocaleString('default', {
+ month: 'long',
+ year: 'numeric'
+ });
+
+ calendarGrid.innerHTML = '';
+
+ // Add day headers
+ const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+ days.forEach(day => {
+ const dayHeader = document.createElement('div');
+ dayHeader.className = 'calendar-day-header';
+ dayHeader.textContent = day;
+ calendarGrid.appendChild(dayHeader);
+ });
+
+ // Add empty cells for days before first day of month
+ for (let i = 0; i < firstDay.getDay(); i++) {
+ const emptyDay = document.createElement('div');
+ emptyDay.className = 'calendar-day empty';
+ calendarGrid.appendChild(emptyDay);
+ }
+
+ // Add days of month
+ for (let i = 1; i <= lastDay.getDate(); i++) {
+ const dayElement = document.createElement('div');
+ dayElement.className = 'calendar-day';
+ dayElement.textContent = i;
+ calendarGrid.appendChild(dayElement);
+ }
+ }
+
+ renderCalendar(currentDate);
+
+ prevMonth.addEventListener('click', () => {
+ currentDate.setMonth(currentDate.getMonth() - 1);
+ renderCalendar(currentDate);
+ });
+
+ nextMonth.addEventListener('click', () => {
+ currentDate.setMonth(currentDate.getMonth() + 1);
+ renderCalendar(currentDate);
+ });
+
+ // Progress bar animation
+ const progressBars = document.querySelectorAll('.progress');
+ progressBars.forEach(bar => {
+ const width = bar.style.width;
+ bar.style.width = '0';
+ setTimeout(() => {
+ bar.style.width = width;
+ }, 100);
+ });
+ });