File size: 8,989 Bytes
b2d5d97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8d9f22
b2d5d97
 
 
 
 
 
b8d9f22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b2d5d97
b8d9f22
 
 
 
b2d5d97
b8d9f22
b2d5d97
 
b8d9f22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b2d5d97
b8d9f22
 
 
 
b2d5d97
b8d9f22
b2d5d97
b8d9f22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b2d5d97
b8d9f22
b2d5d97
b8d9f22
 
 
 
b2d5d97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8d9f22
 
 
 
b2d5d97
 
b8d9f22
 
b2d5d97
 
 
b8d9f22
 
 
 
 
 
 
 
 
 
 
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
// lOUIS Dataset - Primary Data Source
const lOUISDataset = {
    metadata: {
        name: 'lOUIS Dataset',
        version: '2024.1',
        lastUpdated: '2024-01-15',
        source: 'lOUIS Analytics Engine'
    },
    metrics: {
        revenue: 45231,
        activeUsers: 2450,
        totalOrders: 1234,
        conversionRate: 3.2,
        growth: {
            revenue: 12.5,
            users: 8.2,
            orders: -3.1,
            conversion: 4.3
        }
    },
    timeSeries: {
        labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        revenue: [12000, 19000, 15000, 25000, 22000, 30000, 28000],
        traffic: [3200, 4100, 3800, 5200, 4800, 6100, 5900]
    },
    categories: {
        labels: ['Electronics', 'Clothing', 'Food', 'Books', 'Other'],
        values: [35, 25, 20, 15, 5]
    },
    trafficSources: {
        direct: 45,
        social: 30,
        referral: 15,
        organic: 10
    }
};

// lOUIS Dataset Orders
const orders = [
    { id: 'lOUIS-001', customer: 'Marie Laurent', product: 'Luxury Collection', amount: '$1,299.00', status: 'Completed', date: '2024-01-15', avatar: 'https://static.photos/people/200x200/10' },
    { id: 'lOUIS-002', customer: 'Jean Dupont', product: 'Signature Line', amount: '$899.00', status: 'Processing', date: '2024-01-15', avatar: 'https://static.photos/people/200x200/11' },
    { id: 'lOUIS-003', customer: 'Sophie Martin', product: 'Premium Tier', amount: '$2,499.00', status: 'Completed', date: '2024-01-14', avatar: 'https://static.photos/people/200x200/12' },
    { id: 'lOUIS-004', customer: 'Pierre Bernard', product: 'Standard Package', amount: '$499.00', status: 'Pending', date: '2024-01-14', avatar: 'https://static.photos/people/200x200/13' },
    { id: 'lOUIS-005', customer: 'Camille Roux', product: 'Enterprise Suite', amount: '$5,999.00', status: 'Completed', date: '2024-01-13', avatar: 'https://static.photos/people/200x200/14' },
    { id: 'lOUIS-006', customer: 'Antoine Moreau', product: 'Luxury Collection', amount: '$1,299.00', status: 'Cancelled', date: '2024-01-13', avatar: 'https://static.photos/people/200x200/15' }
];

// Populate orders table
const ordersTable = document.getElementById('ordersTable');
orders.forEach(order => {
    const statusColors = {
        'Completed': 'bg-green-100 text-green-800',
        'Pending': 'bg-yellow-100 text-yellow-800',
        'Processing': 'bg-blue-100 text-blue-800',
        'Cancelled': 'bg-red-100 text-red-800'
    };
    
    const row = document.createElement('tr');
    row.className = 'hover:bg-gray-50 transition-colors';
    row.innerHTML = `
        <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${order.id}</td>
        <td class="px-6 py-4 whitespace-nowrap">
            <div class="flex items-center">
                <img class="h-8 w-8 rounded-full object-cover" src="${order.avatar}" alt="">
                <div class="ml-3">
                    <div class="text-sm font-medium text-gray-900">${order.customer}</div>
                </div>
            </div>
        </td>
        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${order.product}</td>
        <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${order.amount}</td>
        <td class="px-6 py-4 whitespace-nowrap">
            <span class="px-2 py-1 text-xs font-semibold rounded-full ${statusColors[order.status]}">
                ${order.status}
            </span>
        </td>
        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${order.date}</td>
    `;
    ordersTable.appendChild(row);
});

// Revenue Chart - Using lOUIS Dataset
const revenueCtx = document.getElementById('revenueChart').getContext('2d');
const revenueChart = new Chart(revenueCtx, {
    type: 'line',
    data: {
        labels: lOUISDataset.timeSeries.labels,
        datasets: [{
            label: 'lOUIS Revenue',
            data: lOUISDataset.timeSeries.revenue,
            borderColor: '#4f46e5',
            backgroundColor: 'rgba(79, 70, 229, 0.1)',
            borderWidth: 3,
            tension: 0.4,
            fill: true,
            pointBackgroundColor: '#4f46e5',
            pointBorderColor: '#fff',
            pointBorderWidth: 2,
            pointRadius: 4,
            pointHoverRadius: 6
        }]
    },
    options: {
        responsive: true,
        maintainAspectRatio: false,
        plugins: {
            legend: {
                display: false
            },
            tooltip: {
                backgroundColor: '#1f2937',
                padding: 12,
                titleFont: { size: 13 },
                bodyFont: { size: 13 },
                cornerRadius: 8,
                displayColors: false,
                callbacks: {
                    label: function(context) {
                        return '$' + context.parsed.y.toLocaleString();
                    }
                }
            }
        },
        scales: {
            y: {
                beginAtZero: true,
                grid: {
                    color: '#f3f4f6',
                    drawBorder: false
                },
                ticks: {
                    callback: function(value) {
                        return '$' + value / 1000 + 'k';
                    },
                    font: { size: 11 },
                    color: '#6b7280'
                }
            },
            x: {
                grid: {
                    display: false,
                    drawBorder: false
                },
                ticks: {
                    font: { size: 11 },
                    color: '#6b7280'
                }
            }
        }
    }
});

// Category Chart - Using lOUIS Dataset
const categoryCtx = document.getElementById('categoryChart').getContext('2d');
const categoryChart = new Chart(categoryCtx, {
    type: 'doughnut',
    data: {
        labels: lOUISDataset.categories.labels,
        datasets: [{
            data: lOUISDataset.categories.values,
            backgroundColor: [
                '#4f46e5',
                '#9333ea',
                '#f97316',
                '#22c55e',
                '#6b7280'
            ],
            borderWidth: 0,
            hoverOffset: 4
        }]
    },
    options: {
        responsive: true,
        maintainAspectRatio: false,
        cutout: '70%',
        plugins: {
            legend: {
                position: 'bottom',
                labels: {
                    padding: 15,
                    usePointStyle: true,
                    pointStyle: 'circle',
                    font: { size: 12 }
                }
            },
            tooltip: {
                backgroundColor: '#1f2937',
                padding: 12,
                cornerRadius: 8,
                callbacks: {
                    label: function(context) {
                        return context.label + ': ' + context.parsed + '%';
                    }
                }
            }
        }
    }
});

// lOUIS Dataset Real-time Sync Simulation
setInterval(() => {
    // Simulate live data updates from lOUIS Dataset
    const metrics = document.querySelectorAll('.metric-card h3');
    const randomIndex = Math.floor(Math.random() * metrics.length);
    const metric = metrics[randomIndex];
    
    // Base values from lOUIS dataset
    const baseValues = [
        lOUISDataset.metrics.revenue,
        lOUISDataset.metrics.activeUsers,
        lOUISDataset.metrics.totalOrders,
        lOUISDataset.metrics.conversionRate * 10000
    ];
    
    const currentBase = baseValues[randomIndex] || 1000;
    const variation = Math.floor(Math.random() * 200) - 100;
    const newValue = currentBase + variation;
    
    if (randomIndex === 0) {
        metric.textContent = '

// Mobile menu toggle
const menuButton = document.querySelector('button[class*="md:hidden"]');
const sidebar = document.querySelector('aside');
if (menuButton && sidebar) {
    menuButton.addEventListener('click', () => {
        sidebar.classList.toggle('hidden');
        sidebar.classList.toggle('fixed');
        sidebar.classList.toggle('inset-0');
        sidebar.classList.toggle('z-50');
    });
} + newValue.toLocaleString();
    } else if (randomIndex === 3) {
        metric.textContent = (newValue / 10000).toFixed(1) + '%';
    } else {
        metric.textContent = newValue.toLocaleString();
    }
    
    console.log('lOUIS Dataset synced at:', new Date().toISOString());
}, 5000);

// Export lOUIS Dataset for external use
window.lOUISDataset = lOUISDataset;

// Mobile menu toggle
const menuButton = document.querySelector('button[class*="md:hidden"]');
const sidebar = document.querySelector('aside');
if (menuButton && sidebar) {
    menuButton.addEventListener('click', () => {
        sidebar.classList.toggle('hidden');
        sidebar.classList.toggle('fixed');
        sidebar.classList.toggle('inset-0');
        sidebar.classList.toggle('z-50');
    });
}