File size: 27,356 Bytes
3bea609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3bea609
 
 
 
 
0a0f63c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3bea609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
3bea609
 
 
 
 
 
 
0a0f63c
 
 
 
 
3bea609
0a0f63c
 
 
3bea609
0a0f63c
 
 
3bea609
0a0f63c
 
 
3bea609
0a0f63c
 
 
3bea609
0a0f63c
 
 
3bea609
0a0f63c
 
 
3bea609
0a0f63c
 
 
3bea609
 
 
 
0a0f63c
 
 
 
 
 
3bea609
0a0f63c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3bea609
 
 
 
 
 
 
 
0a0f63c
3bea609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
 
 
 
 
 
 
 
3bea609
 
 
 
 
 
 
 
 
 
0a0f63c
3bea609
0a0f63c
 
3bea609
 
 
 
 
0a0f63c
 
 
3bea609
0a0f63c
 
3bea609
 
0a0f63c
 
 
3bea609
 
0a0f63c
 
3bea609
0a0f63c
 
 
 
 
 
 
 
 
3bea609
0a0f63c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3bea609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
3bea609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
3bea609
 
 
0a0f63c
3bea609
 
 
0a0f63c
3bea609
 
 
 
 
0a0f63c
3bea609
 
 
 
 
0a0f63c
3bea609
 
0a0f63c
 
3bea609
 
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
 
3bea609
 
 
 
 
 
 
 
 
 
 
 
0a0f63c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3bea609
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Aquapod - Bell Economy</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');
        
        body {
            font-family: 'Inter', sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        
        .bell-animation {
            animation: ring 2s ease-in-out infinite;
            transform-origin: top center;
        }
        
        @keyframes ring {
            0% { transform: rotate(0deg); }
            25% { transform: rotate(5deg); }
            50% { transform: rotate(-5deg); }
            75% { transform: rotate(2deg); }
            100% { transform: rotate(0deg); }
        }
        
        .floating-panel {
            transition: all 0.3s ease;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        
        .floating-panel.closed {
            transform: translateY(100%);
            opacity: 0;
            pointer-events: none;
        }
        
        .bell-tone {
            position: absolute;
            width: 0;
            height: 0;
            opacity: 0;
        }
        
        .bell-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background-color: #ef4444;
            color: white;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
        }
        
        .recording {
            animation: pulse 1.5s infinite;
        }
        
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
            100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
        }
    </style>
</head>
<body class="min-h-screen">
    <!-- Floating Action Buttons -->
    <div class="fixed bottom-6 right-6 space-y-3 z-50">
        <div class="relative">
            <button id="services-btn" class="w-14 h-14 bg-blue-600 text-white rounded-full flex items-center justify-center shadow-lg hover:bg-blue-700 transition">
                <i class="fas fa-bell text-xl"></i>
            </button>
            <div id="bell-badge" class="bell-badge">1</div>
        </div>
        
        <div class="relative">
            <button id="defi-btn" class="w-14 h-14 bg-green-600 text-white rounded-full flex items-center justify-center shadow-lg hover:bg-green-700 transition">
                <i class="fas fa-coins text-xl"></i>
            </button>
            <div class="bell-badge" style="background-color: #f59e0b;">1:4</div>
        </div>
        
        <button id="broadcast-btn" class="w-14 h-14 bg-purple-600 text-white rounded-full flex items-center justify-center shadow-lg hover:bg-purple-700 transition">
            <i class="fas fa-microphone text-xl"></i>
        </button>
    </div>
    
    <!-- Current Time Bell Display -->
    <div class="container mx-auto px-4 py-8">
        <div class="flex flex-col items-center justify-center min-h-[60vh]">
            <div class="relative mb-8">
                <div id="current-bell" class="bg-blue-100 rounded-full p-8 shadow-lg">
                    <i class="fas fa-bell text-blue-600 text-6xl bell-animation"></i>
                </div>
                <div id="bell-count" class="absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-12 h-12 flex items-center justify-center font-bold text-xl">1</div>
            </div>
            
            <h1 id="bell-time" class="text-4xl font-bold text-center mb-2">12:30 PM</h1>
            <p id="bell-duration" class="text-xl text-gray-600 mb-6">1 Bell (1:30 Hours)</p>
            
            <div class="bg-white rounded-lg shadow-md p-6 max-w-md w-full text-center">
                <h3 class="text-xl font-semibold mb-2">Current Service Cost</h3>
                <p class="text-gray-700 mb-4">Based on the current bell time</p>
                <div class="p-3 bg-blue-50 rounded-lg">
                    <p class="text-blue-700 font-medium text-lg">10 <span class="text-blue-900">AQUAPOD</span></p>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Floating Panels -->
    <div id="services-panel" class="fixed bottom-0 left-0 right-0 bg-white rounded-t-3xl p-6 floating-panel closed transition-all duration-300 z-40" style="height: 70vh;">
        <div class="flex justify-between items-center mb-6">
            <h2 class="text-2xl font-bold">Bell Schedule</h2>
            <button id="close-services" class="text-gray-500 hover:text-gray-700">
                <i class="fas fa-times text-xl"></i>
            </button>
        </div>
        
        <div class="overflow-y-auto h-[calc(70vh-80px)] space-y-4">
            <div class="bg-gray-50 p-4 rounded-lg">
                <h3 class="font-semibold mb-3 text-center">Current Bell Periods</h3>
                <div class="grid grid-cols-2 gap-3">
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">1 Bell</div>
                        <div class="text-sm text-blue-600">1:30 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">2 Bells</div>
                        <div class="text-sm text-blue-600">2:00 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">3 Bells</div>
                        <div class="text-sm text-blue-600">2:30 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">4 Bells</div>
                        <div class="text-sm text-blue-600">3:00 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">5 Bells</div>
                        <div class="text-sm text-blue-600">3:30 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">6 Bells</div>
                        <div class="text-sm text-blue-600">4:00 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">7 Bells</div>
                        <div class="text-sm text-blue-600">4:30 Hours</div>
                    </div>
                    <div class="bg-blue-100 p-3 rounded-lg text-center">
                        <div class="text-blue-800 font-bold">8 Bells</div>
                        <div class="text-sm text-blue-600">5:00 Hours</div>
                    </div>
                </div>
            </div>
            
            <div class="bg-white border border-gray-200 rounded-lg p-4">
                <h3 class="font-semibold mb-2">Current Bell Costs</h3>
                <div class="space-y-2">
                    <div class="flex justify-between">
                        <span class="text-gray-600">1 Bell:</span>
                        <span class="font-medium">10 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">2 Bells:</span>
                        <span class="font-medium">15 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">3 Bells:</span>
                        <span class="font-medium">20 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">4 Bells:</span>
                        <span class="font-medium">25 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">5 Bells:</span>
                        <span class="font-medium">30 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">6 Bells:</span>
                        <span class="font-medium">35 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">7 Bells:</span>
                        <span class="font-medium">40 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">8 Bells:</span>
                        <span class="font-medium">45 AQUAPOD</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <div id="defi-panel" class="fixed bottom-0 left-0 right-0 bg-white rounded-t-3xl p-6 floating-panel closed transition-all duration-300 z-40" style="height: 70vh;">
        <div class="flex justify-between items-center mb-6">
            <h2 class="text-2xl font-bold">DeFi Exchange Rates</h2>
            <button id="close-defi" class="text-gray-500 hover:text-gray-700">
                <i class="fas fa-times text-xl"></i>
            </button>
        </div>
        
        <div class="overflow-y-auto h-[calc(70vh-80px)] space-y-6">
            <div class="bg-white border border-gray-200 rounded-lg shadow-sm p-6">
                <div class="mb-4">
                    <label class="block text-gray-700 mb-2">From</label>
                    <div class="flex border border-gray-300 rounded-lg overflow-hidden">
                        <input type="number" class="flex-grow p-3 outline-none" placeholder="Amount" value="100">
                        <select class="bg-gray-100 p-3 border-l">
                            <option>AQUAPOD</option>
                        </select>
                    </div>
                </div>
                
                <div class="flex justify-center my-4">
                    <button class="bg-gray-200 p-2 rounded-full text-gray-700">
                        <i class="fas fa-exchange-alt"></i>
                    </button>
                </div>
                
                <div class="mb-4">
                    <label class="block text-gray-700 mb-2">To</label>
                    <div class="flex border border-gray-300 rounded-lg overflow-hidden">
                        <input type="number" class="flex-grow p-3 outline-none" placeholder="Amount" value="25">
                        <select class="bg-gray-100 p-3 border-l">
                            <option>XLM</option>
                            <option>BCH</option>
                        </select>
                    </div>
                </div>
                
                <button class="w-full bg-green-600 text-white py-3 rounded-lg font-semibold hover:bg-green-700 transition">
                    Exchange Now
                </button>
            </div>
            
            <div class="bg-gray-50 p-4 rounded-lg">
                <h3 class="font-semibold mb-2">Current Rates</h3>
                <div class="space-y-2">
                    <div class="flex justify-between">
                        <span class="text-gray-600">1 AQUAPOD =</span>
                        <span class="font-medium">0.25 XLM</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">1 AQUAPOD =</span>
                        <span class="font-medium">0.00015 BCH</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">1 XLM =</span>
                        <span class="font-medium">4 AQUAPOD</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-600">1 BCH =</span>
                        <span class="font-medium">6666.67 AQUAPOD</span>
                    </div>
                </div>
            </div>
            
            <div class="bg-blue-50 p-4 rounded-lg">
                <h3 class="font-semibold mb-2 text-blue-800">Pegged Stability</h3>
                <p class="text-blue-700 text-sm">AQUAPOD is pegged to XLM and BCH for stable exchange rates and liquidity.</p>
            </div>
        </div>
    </div>
    
    <div id="broadcast-panel" class="fixed bottom-0 left-0 right-0 bg-white rounded-t-3xl p-6 floating-panel closed transition-all duration-300 z-40" style="height: 70vh;">
        <div class="flex justify-between items-center mb-6">
            <h2 class="text-2xl font-bold">Community Broadcast</h2>
            <button id="close-broadcast" class="text-gray-500 hover:text-gray-700">
                <i class="fas fa-times text-xl"></i>
            </button>
        </div>
        
        <div class="overflow-y-auto h-[calc(70vh-80px)] space-y-4">
            <div class="bg-gray-50 p-4 rounded-lg text-center">
                <p class="text-gray-600 mb-4">Record a message that will be transmitted to the community support line:</p>
                <p class="font-semibold text-blue-600 mb-2"><i class="fas fa-phone-alt mr-2"></i>+1 (555) 123-4567</p>
                
                <div id="recording-status" class="hidden bg-red-100 text-red-800 p-2 rounded-lg mb-4">
                    <i class="fas fa-circle mr-2"></i> Recording in progress...
                </div>
                
                <div id="transcription-result" class="hidden bg-blue-50 p-4 rounded-lg mb-4 text-left">
                    <h4 class="font-semibold mb-2">Your message:</h4>
                    <p id="transcription-text" class="text-gray-700"></p>
                </div>
                
                <button id="record-btn" class="w-20 h-20 bg-red-500 text-white rounded-full flex items-center justify-center shadow-lg mx-auto mb-4 hover:bg-red-600 transition">
                    <i class="fas fa-microphone text-2xl"></i>
                </button>
                
                <p class="text-sm text-gray-500">Press and hold to record your message</p>
                
                <div class="mt-6">
                    <button id="send-btn" class="w-full bg-purple-600 text-white py-3 rounded-lg font-semibold hover:bg-purple-700 transition disabled:opacity-50" disabled>
                        Send Broadcast Message
                    </button>
                </div>
            </div>
            
            <div class="bg-white border border-gray-200 rounded-lg p-4">
                <h3 class="font-semibold mb-2">Recent Broadcasts</h3>
                <div class="space-y-3">
                    <div class="border-b border-gray-100 pb-3">
                        <div class="flex justify-between text-sm text-gray-500 mb-1">
                            <span>Yesterday, 3:42 PM</span>
                            <span>Sent to +1 (555) 123-4567</span>
                        </div>
                        <p class="text-gray-700">"Need assistance with water filtration system on pod #42"</p>
                    </div>
                    <div class="border-b border-gray-100 pb-3">
                        <div class="flex justify-between text-sm text-gray-500 mb-1">
                            <span>Today, 10:15 AM</span>
                            <span>Sent to +1 (555) 123-4567</span>
                        </div>
                        <p class="text-gray-700">"Reporting a leak in the communal area near docking station 3"</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Bell sound (hidden) -->
    <audio id="bell-sound" class="bell-tone" src="https://assets.mixkit.co/sfx/preview/mixkit-bell-notification-933.mp3" preload="auto"></audio>
    
    <script>
        // Bell system data
        const bellSchedule = [
            { time: "00:00", bells: 8, duration: "5:00 Hours" },
            { time: "04:00", bells: 8, duration: "5:00 Hours" },
            { time: "08:00", bells: 8, duration: "5:00 Hours" },
            { time: "12:30", bells: 1, duration: "1:30 Hours" },
            { time: "13:00", bells: 2, duration: "2:00 Hours" },
            { time: "13:30", bells: 3, duration: "2:30 Hours" },
            { time: "14:00", bells: 4, duration: "3:00 Hours" },
            { time: "14:30", bells: 5, duration: "3:30 Hours" },
            { time: "15:00", bells: 6, duration: "4:00 Hours" },
            { time: "15:30", bells: 7, duration: "4:30 Hours" },
            { time: "16:00", bells: 8, duration: "5:00 Hours" },
            { time: "16:30", bells: 1, duration: "1:30 Hours" },
            { time: "17:00", bells: 2, duration: "2:00 Hours" },
            { time: "17:30", bells: 3, duration: "2:30 Hours" },
            { time: "18:00", bells: 4, duration: "3:00 Hours" },
            { time: "18:30", bells: 5, duration: "3:30 Hours" },
            { time: "19:00", bells: 6, duration: "4:00 Hours" },
            { time: "19:30", bells: 7, duration: "4:30 Hours" },
            { time: "20:00", bells: 8, duration: "5:00 Hours" },
            { time: "20:30", bells: 1, duration: "1:30 Hours" },
            { time: "21:00", bells: 2, duration: "2:00 Hours" },
            { time: "21:30", bells: 3, duration: "2:30 Hours" },
            { time: "22:00", bells: 4, duration: "3:00 Hours" },
            { time: "22:30", bells: 5, duration: "3:30 Hours" },
            { time: "23:00", bells: 6, duration: "4:00 Hours" },
            { time: "23:30", bells: 7, duration: "4:30 Hours" }
        ];
        
        const bellCosts = {
            1: 10,
            2: 15,
            3: 20,
            4: 25,
            5: 30,
            6: 35,
            7: 40,
            8: 45
        };
        
        // Update bell display based on current time
        function updateBellDisplay() {
            const now = new Date();
            const hours = String(now.getHours()).padStart(2, '0');
            const minutes = String(now.getMinutes()).padStart(2, '0');
            const currentTime = `${hours}:${minutes}`;
            
            // Find the current or next bell period
            let currentBell = bellSchedule[0];
            for (const bell of bellSchedule) {
                if (bell.time <= currentTime) {
                    currentBell = bell;
                } else {
                    break;
                }
            }
            
            // Update UI
            document.getElementById('bell-count').textContent = currentBell.bells;
            document.getElementById('bell-badge').textContent = currentBell.bells;
            document.getElementById('bell-time').textContent = formatTime(currentBell.time);
            document.getElementById('bell-duration').textContent = `${currentBell.bells} Bell${currentBell.bells > 1 ? 's' : ''} (${currentBell.duration})`;
            
            // Calculate cost
            const cost = bellCosts[currentBell.bells];
            document.querySelector('#current-bell + div + div + div .text-blue-900').textContent = `${cost} AQUAPOD`;
            
            // Add animation class if it's exactly a bell time
            const bellElement = document.getElementById('current-bell');
            const bellSound = document.getElementById('bell-sound');
            
            if (currentTime === currentBell.time) {
                bellElement.classList.add('bell-animation');
                bellSound.play();
                
                // Remove animation after 2 seconds
                setTimeout(() => {
                    bellElement.classList.remove('bell-animation');
                }, 2000);
            }
        }
        
        // Format time as 12-hour with AM/PM
        function formatTime(time24) {
            const [hours, minutes] = time24.split(':');
            const period = hours >= 12 ? 'PM' : 'AM';
            const hours12 = hours % 12 || 12;
            return `${hours12}:${minutes} ${period}`;
        }
        
        // Initialize bell display
        updateBellDisplay();
        
        // Update every minute
        setInterval(updateBellDisplay, 60000);
        
        // Floating panel controls
        const servicesBtn = document.getElementById('services-btn');
        const defiBtn = document.getElementById('defi-btn');
        const broadcastBtn = document.getElementById('broadcast-btn');
        
        const servicesPanel = document.getElementById('services-panel');
        const defiPanel = document.getElementById('defi-panel');
        const broadcastPanel = document.getElementById('broadcast-panel');
        
        const closeServices = document.getElementById('close-services');
        const closeDefi = document.getElementById('close-defi');
        const closeBroadcast = document.getElementById('close-broadcast');
        
        // Toggle panels
        servicesBtn.addEventListener('click', () => {
            servicesPanel.classList.remove('closed');
            defiPanel.classList.add('closed');
            broadcastPanel.classList.add('closed');
        });
        
        defiBtn.addEventListener('click', () => {
            defiPanel.classList.remove('closed');
            servicesPanel.classList.add('closed');
            broadcastPanel.classList.add('closed');
        });
        
        broadcastBtn.addEventListener('click', () => {
            broadcastPanel.classList.remove('closed');
            servicesPanel.classList.add('closed');
            defiPanel.classList.add('closed');
        });
        
        // Close panels
        closeServices.addEventListener('click', () => {
            servicesPanel.classList.add('closed');
        });
        
        closeDefi.addEventListener('click', () => {
            defiPanel.classList.add('closed');
        });
        
        closeBroadcast.addEventListener('click', () => {
            broadcastPanel.classList.add('closed');
        });
        
        // Close panels when clicking outside
        document.addEventListener('click', (e) => {
            if (!servicesPanel.contains(e.target) && e.target !== servicesBtn) {
                servicesPanel.classList.add('closed');
            }
            
            if (!defiPanel.contains(e.target) && e.target !== defiBtn) {
                defiPanel.classList.add('closed');
            }
            
            if (!broadcastPanel.contains(e.target) && e.target !== broadcastBtn) {
                broadcastPanel.classList.add('closed');
            }
        });
        
        // Broadcast recording functionality
        const recordBtn = document.getElementById('record-btn');
        const recordingStatus = document.getElementById('recording-status');
        const transcriptionResult = document.getElementById('transcription-result');
        const transcriptionText = document.getElementById('transcription-text');
        const sendBtn = document.getElementById('send-btn');
        
        let isRecording = false;
        let recordingTimeout;
        let recordedMessage = "";
        
        recordBtn.addEventListener('mousedown', startRecording);
        recordBtn.addEventListener('touchstart', startRecording);
        
        recordBtn.addEventListener('mouseup', stopRecording);
        recordBtn.addEventListener('touchend', stopRecording);
        recordBtn.addEventListener('mouseleave', stopRecording);
        
        function startRecording(e) {
            e.preventDefault();
            if (!isRecording) {
                isRecording = true;
                recordBtn.classList.add('recording');
                recordingStatus.classList.remove('hidden');
                transcriptionResult.classList.add('hidden');
                sendBtn.disabled = true;
                
                // Simulate recording for 3 seconds
                recordingTimeout = setTimeout(() => {
                    stopRecording(e);
                    
                    // Simulate transcription result
                    recordedMessage = "This is a simulated transcription of your recorded message about the Aquapod community.";
                    transcriptionText.textContent = recordedMessage;
                    transcriptionResult.classList.remove('hidden');
                    sendBtn.disabled = false;
                }, 3000);
            }
        }
        
        function stopRecording(e) {
            e.preventDefault();
            if (isRecording) {
                isRecording = false;
                clearTimeout(recordingTimeout);
                recordBtn.classList.remove('recording');
                recordingStatus.classList.add('hidden');
            }
        }
        
        sendBtn.addEventListener('click', () => {
            if (recordedMessage) {
                alert(`Message sent to community support: "${recordedMessage}"`);
                sendBtn.disabled = true;
                
                // Add to recent broadcasts
                const now = new Date();
                const timeString = now.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});
                
                const recentBroadcasts = document.querySelector('#broadcast-panel .bg-white.border');
                const newBroadcast = document.createElement('div');
                newBroadcast.className = 'border-b border-gray-100 pb-3';
                newBroadcast.innerHTML = `
                    <div class="flex justify-between text-sm text-gray-500 mb-1">
                        <span>Just now</span>
                        <span>Sent to +1 (555) 123-4567</span>
                    </div>
                    <p class="text-gray-700">"${recordedMessage}"</p>
                `;
                
                recentBroadcasts.insertBefore(newBroadcast, recentBroadcasts.firstChild);
            }
        });
    </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=privateuserh/aqu-bells" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>