File size: 32,548 Bytes
f6c0ace
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Billboard Digitalization Dashboard</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=visualization"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .map-container {
            height: 600px;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .sidebar {
            transition: all 0.3s ease;
        }
        .progress-bar {
            height: 8px;
            border-radius: 4px;
        }
        .chart-container {
            height: 250px;
        }
        .heatmap-legend {
            background: linear-gradient(to right, rgba(0, 0, 255, 0.2), rgba(0, 255, 0, 0.2), rgba(255, 255, 0, 0.2), rgba(255, 165, 0, 0.2), rgba(255, 0, 0, 0.2));
        }
        .billboard-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="flex h-screen overflow-hidden">
        <!-- Sidebar -->
        <div class="sidebar bg-indigo-800 text-white w-64 flex-shrink-0">
            <div class="p-4 flex items-center space-x-2">
                <i class="fas fa-ad text-2xl text-yellow-300"></i>
                <h1 class="text-xl font-bold">Billboard Digitalization</h1>
            </div>
            <nav class="mt-8">
                <div class="px-4 py-2 text-indigo-200 uppercase text-xs font-semibold">Main</div>
                <a href="#" class="block px-4 py-3 text-white bg-indigo-900">
                    <i class="fas fa-map-marker-alt mr-2"></i> Map View
                </a>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-list-ul mr-2"></i> Inventory
                </a>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-chart-line mr-2"></i> Analytics
                </a>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-exchange-alt mr-2"></i> Conversion
                </a>
                
                <div class="px-4 py-2 text-indigo-200 uppercase text-xs font-semibold mt-6">Reports</div>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-eye mr-2"></i> Viewability
                </a>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-car mr-2"></i> Traffic
                </a>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-dollar-sign mr-2"></i> Revenue
                </a>
                
                <div class="px-4 py-2 text-indigo-200 uppercase text-xs font-semibold mt-6">Settings</div>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-cog mr-2"></i> Preferences
                </a>
                <a href="#" class="block px-4 py-3 text-indigo-200 hover:text-white hover:bg-indigo-700">
                    <i class="fas fa-users mr-2"></i> Users
                </a>
            </nav>
        </div>

        <!-- Main Content -->
        <div class="flex-1 overflow-auto">
            <!-- Top Navigation -->
            <header class="bg-white shadow-sm">
                <div class="flex justify-between items-center px-6 py-4">
                    <div class="flex items-center space-x-4">
                        <button class="text-gray-500 focus:outline-none">
                            <i class="fas fa-bars"></i>
                        </button>
                        <h2 class="text-xl font-semibold text-gray-800">Billboard Digitalization Dashboard</h2>
                    </div>
                    <div class="flex items-center space-x-4">
                        <div class="relative">
                            <input type="text" placeholder="Search billboards..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
                            <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
                        </div>
                        <button class="p-2 text-gray-500 hover:text-gray-700">
                            <i class="fas fa-bell"></i>
                        </button>
                        <div class="flex items-center space-x-2">
                            <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-8 h-8 rounded-full">
                            <span class="text-sm font-medium">John Doe</span>
                        </div>
                    </div>
                </div>
            </header>

            <!-- Dashboard Content -->
            <main class="p-6">
                <!-- Stats Cards -->
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
                    <div class="bg-white rounded-lg shadow p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">Total Billboards</p>
                                <h3 class="text-2xl font-bold mt-1">1,247</h3>
                                <p class="text-green-500 text-sm mt-2"><i class="fas fa-arrow-up mr-1"></i> 12% from last month</p>
                            </div>
                            <div class="bg-indigo-100 p-3 rounded-full">
                                <i class="fas fa-ad text-indigo-600 text-xl"></i>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-lg shadow p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">Avg. Viewability</p>
                                <h3 class="text-2xl font-bold mt-1">78%</h3>
                                <div class="w-full bg-gray-200 rounded-full h-2 mt-3">
                                    <div class="bg-yellow-500 h-2 rounded-full" style="width: 78%"></div>
                                </div>
                            </div>
                            <div class="bg-yellow-100 p-3 rounded-full">
                                <i class="fas fa-eye text-yellow-600 text-xl"></i>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-lg shadow p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">Daily Traffic</p>
                                <h3 class="text-2xl font-bold mt-1">42,589</h3>
                                <p class="text-green-500 text-sm mt-2"><i class="fas fa-arrow-up mr-1"></i> 8% from last week</p>
                            </div>
                            <div class="bg-green-100 p-3 rounded-full">
                                <i class="fas fa-car text-green-600 text-xl"></i>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-lg shadow p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">Conversion Rate</p>
                                <h3 class="text-2xl font-bold mt-1">24%</h3>
                                <div class="w-full bg-gray-200 rounded-full h-2 mt-3">
                                    <div class="bg-red-500 h-2 rounded-full" style="width: 24%"></div>
                                </div>
                            </div>
                            <div class="bg-red-100 p-3 rounded-full">
                                <i class="fas fa-exchange-alt text-red-600 text-xl"></i>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Map and Analytics -->
                <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
                    <!-- Map Container -->
                    <div class="lg:col-span-2 bg-white rounded-lg shadow p-4">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="font-semibold text-lg">Billboard Locations</h3>
                            <div class="flex space-x-2">
                                <button class="px-3 py-1 bg-indigo-600 text-white rounded-md text-sm flex items-center">
                                    <i class="fas fa-layer-group mr-1"></i> Layers
                                </button>
                                <button class="px-3 py-1 bg-white border border-gray-300 rounded-md text-sm flex items-center">
                                    <i class="fas fa-filter mr-1"></i> Filter
                                </button>
                            </div>
                        </div>
                        <div id="map" class="map-container"></div>
                        <div class="mt-3 flex justify-between items-center">
                            <div class="flex space-x-2">
                                <div class="flex items-center">
                                    <div class="w-3 h-3 bg-red-500 rounded-full mr-1"></div>
                                    <span class="text-xs">Low Viewability (<50%)</span>
                                </div>
                                <div class="flex items-center">
                                    <div class="w-3 h-3 bg-yellow-500 rounded-full mr-1"></div>
                                    <span class="text-xs">Medium (50-80%)</span>
                                </div>
                                <div class="flex items-center">
                                    <div class="w-3 h-3 bg-green-500 rounded-full mr-1"></div>
                                    <span class="text-xs">High (>80%)</span>
                                </div>
                            </div>
                            <button class="text-indigo-600 text-sm font-medium">
                                <i class="fas fa-expand mr-1"></i> Fullscreen
                            </button>
                        </div>
                    </div>

                    <!-- Billboard Details -->
                    <div class="bg-white rounded-lg shadow p-4 overflow-y-auto" style="max-height: 600px;">
                        <h3 class="font-semibold text-lg mb-4">Selected Billboard</h3>
                        
                        <div class="bg-gray-100 rounded-lg p-4 mb-4">
                            <div class="flex justify-between items-start">
                                <div>
                                    <h4 class="font-medium">Times Square Mega Billboard</h4>
                                    <p class="text-gray-500 text-sm">ID: BBD-4872</p>
                                </div>
                                <span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded">Active</span>
                            </div>
                            <div class="mt-3 flex items-center text-sm">
                                <i class="fas fa-map-marker-alt text-gray-400 mr-1"></i>
                                <span>40.7577° N, 73.9857° W</span>
                            </div>
                        </div>
                        
                        <div class="space-y-4">
                            <div>
                                <h4 class="text-sm font-medium text-gray-500 mb-1">Owner</h4>
                                <p class="text-sm">Lamar Advertising Co.</p>
                            </div>
                            
                            <div>
                                <h4 class="text-sm font-medium text-gray-500 mb-1">Specifications</h4>
                                <div class="grid grid-cols-2 gap-2 text-sm">
                                    <div>
                                        <p class="text-gray-500">Type</p>
                                        <p>Digital Billboard</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-500">Size</p>
                                        <p>14.6m x 6.1m</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-500">Ratio</p>
                                        <p>16:9</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-500">Illumination</p>
                                        <p>LED Backlit</p>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="text-sm font-medium text-gray-500 mb-1">Performance Metrics</h4>
                                <div class="space-y-2">
                                    <div>
                                        <div class="flex justify-between text-sm mb-1">
                                            <span>Viewability</span>
                                            <span>92%</span>
                                        </div>
                                        <div class="w-full bg-gray-200 rounded-full h-2">
                                            <div class="bg-green-500 h-2 rounded-full" style="width: 92%"></div>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="flex justify-between text-sm mb-1">
                                            <span>Daily Impressions</span>
                                            <span>1.2M</span>
                                        </div>
                                        <div class="w-full bg-gray-200 rounded-full h-2">
                                            <div class="bg-blue-500 h-2 rounded-full" style="width: 85%"></div>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="flex justify-between text-sm mb-1">
                                            <span>Conversion Potential</span>
                                            <span>High</span>
                                        </div>
                                        <div class="w-full bg-gray-200 rounded-full h-2">
                                            <div class="bg-purple-500 h-2 rounded-full" style="width: 76%"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="text-sm font-medium text-gray-500 mb-1">Traffic Data</h4>
                                <div class="grid grid-cols-3 gap-2 text-sm">
                                    <div class="bg-gray-100 p-2 rounded text-center">
                                        <p class="text-gray-500">Vehicles</p>
                                        <p class="font-medium">42,589</p>
                                    </div>
                                    <div class="bg-gray-100 p-2 rounded text-center">
                                        <p class="text-gray-500">Pedestrians</p>
                                        <p class="font-medium">136,742</p>
                                    </div>
                                    <div class="bg-gray-100 p-2 rounded text-center">
                                        <p class="text-gray-500">Avg. Speed</p>
                                        <p class="font-medium">12 mph</p>
                                    </div>
                                </div>
                            </div>
                            
                            <button class="w-full bg-indigo-600 text-white py-2 rounded-md text-sm font-medium mt-4">
                                <i class="fas fa-exchange-alt mr-1"></i> Initiate Digital Conversion
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Billboard List and Charts -->
                <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                    <!-- Billboard List -->
                    <div class="bg-white rounded-lg shadow p-4">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="font-semibold text-lg">Top Billboards</h3>
                            <button class="text-indigo-600 text-sm font-medium">View All</button>
                        </div>
                        <div class="space-y-4">
                            <div class="billboard-card bg-white border border-gray-200 rounded-lg p-4 transition-all duration-300 cursor-pointer hover:shadow-md">
                                <div class="flex justify-between items-start">
                                    <div>
                                        <h4 class="font-medium">Sunset Strip Billboard</h4>
                                        <p class="text-gray-500 text-sm">Los Angeles, CA</p>
                                    </div>
                                    <span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded">96%</span>
                                </div>
                                <div class="mt-3 flex justify-between text-sm">
                                    <div>
                                        <p class="text-gray-500">Daily Traffic</p>
                                        <p class="font-medium">38,742</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-500">Size</p>
                                        <p class="font-medium">10.6m x 5.2m</p>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="billboard-card bg-white border border-gray-200 rounded-lg p-4 transition-all duration-300 cursor-pointer hover:shadow-md">
                                <div class="flex justify-between items-start">
                                    <div>
                                        <h4 class="font-medium">Michigan Ave Tower</h4>
                                        <p class="text-gray-500 text-sm">Chicago, IL</p>
                                    </div>
                                    <span class="bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded">72%</span>
                                </div>
                                <div class="mt-3 flex justify-between text-sm">
                                    <div>
                                        <p class="text-gray-500">Daily Traffic</p>
                                        <p class="font-medium">29,156</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-500">Size</p>
                                        <p class="font-medium">8.4m x 3.8m</p>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="billboard-card bg-white border border-gray-200 rounded-lg p-4 transition-all duration-300 cursor-pointer hover:shadow-md">
                                <div class="flex justify-between items-start">
                                    <div>
                                        <h4 class="font-medium">Bay Bridge Signage</h4>
                                        <p class="text-gray-500 text-sm">San Francisco, CA</p>
                                    </div>
                                    <span class="bg-red-100 text-red-800 text-xs px-2 py-1 rounded">43%</span>
                                </div>
                                <div class="mt-3 flex justify-between text-sm">
                                    <div>
                                        <p class="text-gray-500">Daily Traffic</p>
                                        <p class="font-medium">52,891</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-500">Size</p>
                                        <p class="font-medium">12.1m x 4.5m</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Viewability Chart -->
                    <div class="bg-white rounded-lg shadow p-4">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="font-semibold text-lg">Viewability by Type</h3>
                            <div class="flex space-x-2">
                                <button class="px-2 py-1 bg-white border border-gray-300 rounded-md text-xs">Week</button>
                                <button class="px-2 py-1 bg-indigo-600 text-white rounded-md text-xs">Month</button>
                                <button class="px-2 py-1 bg-white border border-gray-300 rounded-md text-xs">Year</button>
                            </div>
                        </div>
                        <div class="chart-container">
                            <canvas id="viewabilityChart"></canvas>
                        </div>
                    </div>
                    
                    <!-- Traffic Heatmap -->
                    <div class="bg-white rounded-lg shadow p-4">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="font-semibold text-lg">Traffic Heatmap</h3>
                            <button class="text-indigo-600 text-sm font-medium">View Details</button>
                        </div>
                        <div class="chart-container">
                            <canvas id="trafficHeatmap"></canvas>
                        </div>
                        <div class="mt-3">
                            <div class="heatmap-legend h-4 rounded-md mb-2"></div>
                            <div class="flex justify-between text-xs text-gray-500">
                                <span>Low Traffic</span>
                                <span>Medium</span>
                                <span>High Traffic</span>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script>
        // Initialize Google Map
        function initMap() {
            const map = new google.maps.Map(document.getElementById("map"), {
                center: { lat: 40.7128, lng: -74.0060 },
                zoom: 12,
                styles: [
                    {
                        featureType: "poi.business",
                        stylers: [{ visibility: "off" }]
                    },
                    {
                        featureType: "transit",
                        elementType: "labels.icon",
                        stylers: [{ visibility: "off" }]
                    }
                ]
            });

            // Add sample billboard markers with different colors based on viewability
            const billboards = [
                { lat: 40.7577, lng: -73.9857, viewability: 92, title: "Times Square Billboard", id: "BBD-4872" },
                { lat: 40.7580, lng: -73.9785, viewability: 85, title: "Broadway Tower", id: "BBD-5123" },
                { lat: 40.7510, lng: -73.9875, viewability: 78, title: "Madison Square", id: "BBD-4981" },
                { lat: 40.7400, lng: -73.9900, viewability: 65, title: "Flatiron District", id: "BBD-5234" },
                { lat: 40.7300, lng: -73.9950, viewability: 45, title: "Union Square", id: "BBD-5092" },
                { lat: 40.7150, lng: -74.0050, viewability: 92, title: "Wall Street", id: "BBD-5345" },
                { lat: 40.7050, lng: -74.0150, viewability: 72, title: "Battery Park", id: "BBD-5213" }
            ];

            billboards.forEach(billboard => {
                let color;
                if (billboard.viewability >= 80) color = "green";
                else if (billboard.viewability >= 50) color = "yellow";
                else color = "red";

                const marker = new google.maps.Marker({
                    position: { lat: billboard.lat, lng: billboard.lng },
                    map: map,
                    title: billboard.title,
                    icon: {
                        path: google.maps.SymbolPath.CIRCLE,
                        fillColor: color,
                        fillOpacity: 0.8,
                        strokeWeight: 0,
                        scale: 10
                    }
                });

                // Add click event to show info window
                const infowindow = new google.maps.InfoWindow({
                    content: `
                        <div class="p-2">
                            <h4 class="font-medium">${billboard.title}</h4>
                            <p class="text-sm">ID: ${billboard.id}</p>
                            <p class="text-sm">Viewability: ${billboard.viewability}%</p>
                            <p class="text-sm">Lat: ${billboard.lat.toFixed(4)}, Lng: ${billboard.lng.toFixed(4)}</p>
                        </div>
                    `
                });

                marker.addListener("click", () => {
                    infowindow.open(map, marker);
                });
            });

            // Add heatmap layer for traffic density
            const heatmapData = [
                { location: new google.maps.LatLng(40.7577, -73.9857), weight: 0.9 },
                { location: new google.maps.LatLng(40.7580, -73.9785), weight: 0.7 },
                { location: new google.maps.LatLng(40.7510, -73.9875), weight: 0.6 },
                { location: new google.maps.LatLng(40.7400, -73.9900), weight: 0.5 },
                { location: new google.maps.LatLng(40.7300, -73.9950), weight: 0.4 },
                { location: new google.maps.LatLng(40.7150, -74.0050), weight: 0.8 },
                { location: new google.maps.LatLng(40.7050, -74.0150), weight: 0.6 }
            ];

            const heatmap = new google.maps.visualization.HeatmapLayer({
                data: heatmapData,
                map: map,
                radius: 30
            });
        }

        // Initialize charts when DOM is loaded
        document.addEventListener('DOMContentLoaded', function() {
            // Viewability by Type Chart
            const viewabilityCtx = document.getElementById('viewabilityChart').getContext('2d');
            const viewabilityChart = new Chart(viewabilityCtx, {
                type: 'bar',
                data: {
                    labels: ['Digital', 'Bulletin', 'Poster', 'Wallscape', 'Transit'],
                    datasets: [{
                        label: 'Viewability %',
                        data: [85, 72, 65, 78, 68],
                        backgroundColor: [
                            'rgba(79, 70, 229, 0.7)',
                            'rgba(234, 88, 12, 0.7)',
                            'rgba(16, 185, 129, 0.7)',
                            'rgba(220, 38, 38, 0.7)',
                            'rgba(245, 158, 11, 0.7)'
                        ],
                        borderColor: [
                            'rgba(79, 70, 229, 1)',
                            'rgba(234, 88, 12, 1)',
                            'rgba(16, 185, 129, 1)',
                            'rgba(220, 38, 38, 1)',
                            'rgba(245, 158, 11, 1)'
                        ],
                        borderWidth: 1
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        y: {
                            beginAtZero: true,
                            max: 100,
                            ticks: {
                                callback: function(value) {
                                    return value + '%';
                                }
                            }
                        }
                    },
                    plugins: {
                        legend: {
                            display: false
                        }
                    }
                }
            });

            // Traffic Heatmap Chart
            const trafficCtx = document.getElementById('trafficHeatmap').getContext('2d');
            const trafficChart = new Chart(trafficCtx, {
                type: 'line',
                data: {
                    labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                    datasets: [
                        {
                            label: 'Vehicles',
                            data: [32000, 35000, 38000, 42000, 45000, 28000, 22000],
                            borderColor: 'rgba(79, 70, 229, 1)',
                            backgroundColor: 'rgba(79, 70, 229, 0.1)',
                            tension: 0.3,
                            fill: true
                        },
                        {
                            label: 'Pedestrians',
                            data: [45000, 48000, 52000, 55000, 58000, 90000, 85000],
                            borderColor: 'rgba(16, 185, 129, 1)',
                            backgroundColor: 'rgba(16, 185, 129, 0.1)',
                            tension: 0.3,
                            fill: true
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'top',
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: true
                        }
                    }
                }
            });

            // Initialize Google Maps
            initMap();
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=FPRZ/billboard-analytics" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>