Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const menuToggle = document.querySelector('.menu-toggle');
+ const navLinks = document.querySelector('.nav-links');
+
+ menuToggle.addEventListener('click', function() {
+ navLinks.classList.toggle('active');
+ });
+
+ const widgets = document.querySelectorAll('.widget');
+ widgets.forEach(widget => {
+ widget.addEventListener('dragstart', function(e) {
+ e.dataTransfer.setData('text/plain', e.target.id);
+ setTimeout(() => {
+ e.target.classList.add('dragging');
+ }, 0);
+ });
+
+ widget.addEventListener('dragend', function(e) {
+ e.target.classList.remove('dragging');
+ });
+ });
+
+ const dropZones = document.querySelectorAll('.glass-panel');
+ dropZones.forEach(zone => {
+ zone.addEventListener('dragover', function(e) {
+ e.preventDefault();
+ zone.classList.add('dragover');
+ });
+
+ zone.addEventListener('dragleave', function() {
+ zone.classList.remove('dragover');
+ });
+
+ zone.addEventListener('drop', function(e) {
+ e.preventDefault();
+ const id = e.dataTransfer.getData('text/plain');
+ const draggable = document.getElementById(id);
+ zone.appendChild(draggable);
+ zone.classList.remove('dragover');
+ });
+ });
+
+ const themeSelect = document.getElementById('theme');
+ themeSelect.addEventListener('change', function() {
+ document.body.classList.toggle('light-theme', themeSelect.value === 'light');
+ });
+
+ const ctx = document.getElementById('lineChart').getContext('2d');
+ new Chart(ctx, {
+ type: 'line',
+ data: {
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
+ datasets: [{
+ label: 'Active Users',
+ data: [1000, 1200, 1300, 1400, 1500, 1600],
+ borderColor: var(--primary-color),
+ borderWidth: 2,
+ fill: false
+ }]
+ },
+ options: {
+ responsive: true,
+ maintainAspectRatio: false,
+ scales: {
+ y: {
+ beginAtZero: true
+ }
+ }
+ }
+ });
+ });