peerpigeon 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1187 -0
  3. package/examples/browser/app-dht-disabled.js +42 -0
  4. package/examples/browser/app.js +51 -0
  5. package/examples/browser/assets/images/favicon.png +0 -0
  6. package/examples/browser/assets/images/pigeon.png +0 -0
  7. package/examples/browser/index-dht-disabled.html +123 -0
  8. package/examples/browser/index.html +340 -0
  9. package/examples/browser/styles.css +1288 -0
  10. package/examples/browser/ui-clean.js +0 -0
  11. package/examples/browser/ui.js +1930 -0
  12. package/index.js +8 -0
  13. package/package.json +70 -0
  14. package/server/index.js +515 -0
  15. package/src/CleanupManager.js +181 -0
  16. package/src/ConnectionManager.js +841 -0
  17. package/src/EventEmitter.js +27 -0
  18. package/src/EvictionManager.js +257 -0
  19. package/src/GossipManager.js +416 -0
  20. package/src/MediaManager.js +225 -0
  21. package/src/MeshOptimizer.js +181 -0
  22. package/src/PeerConnection.js +831 -0
  23. package/src/PeerDiscovery.js +297 -0
  24. package/src/PeerPigeonMesh.js +703 -0
  25. package/src/SignalingClient.js +536 -0
  26. package/src/SignalingHandler.js +325 -0
  27. package/src/StorageManager.js +88 -0
  28. package/src/TimerUtils.js +46 -0
  29. package/src/WebDHT.js +1099 -0
  30. package/websocket-server/README.md +257 -0
  31. package/websocket-server/memory-leak-test.js +193 -0
  32. package/websocket-server/node_modules/.package-lock.json +29 -0
  33. package/websocket-server/node_modules/ws/LICENSE +20 -0
  34. package/websocket-server/node_modules/ws/README.md +548 -0
  35. package/websocket-server/node_modules/ws/browser.js +8 -0
  36. package/websocket-server/node_modules/ws/index.js +13 -0
  37. package/websocket-server/node_modules/ws/lib/buffer-util.js +131 -0
  38. package/websocket-server/node_modules/ws/lib/constants.js +18 -0
  39. package/websocket-server/node_modules/ws/lib/event-target.js +292 -0
  40. package/websocket-server/node_modules/ws/lib/extension.js +203 -0
  41. package/websocket-server/node_modules/ws/lib/limiter.js +55 -0
  42. package/websocket-server/node_modules/ws/lib/permessage-deflate.js +528 -0
  43. package/websocket-server/node_modules/ws/lib/receiver.js +706 -0
  44. package/websocket-server/node_modules/ws/lib/sender.js +602 -0
  45. package/websocket-server/node_modules/ws/lib/stream.js +161 -0
  46. package/websocket-server/node_modules/ws/lib/subprotocol.js +62 -0
  47. package/websocket-server/node_modules/ws/lib/validation.js +152 -0
  48. package/websocket-server/node_modules/ws/lib/websocket-server.js +550 -0
  49. package/websocket-server/node_modules/ws/lib/websocket.js +1388 -0
  50. package/websocket-server/node_modules/ws/package.json +69 -0
  51. package/websocket-server/node_modules/ws/wrapper.mjs +8 -0
  52. package/websocket-server/package-lock.json +39 -0
  53. package/websocket-server/server.js +298 -0
  54. package/websocket-server/test.js +133 -0
@@ -0,0 +1,1288 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ body {
8
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
9
+ line-height: 1.6;
10
+ color: #333;
11
+ background-color: #f5f5f5;
12
+ }
13
+
14
+ .container {
15
+ max-width: 1200px;
16
+ margin: 0 auto;
17
+ padding: 20px;
18
+ }
19
+
20
+ header {
21
+ text-align: center;
22
+ margin-bottom: 40px;
23
+ padding: 20px;
24
+ background: white;
25
+ border-radius: 8px;
26
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
27
+ }
28
+
29
+ header h1 {
30
+ font-size: 2.5em;
31
+ margin-bottom: 10px;
32
+ color: #2c3e50;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ gap: 10px;
37
+ }
38
+
39
+ header h1 img {
40
+ height: 1em;
41
+ width: auto;
42
+ }
43
+
44
+ header p {
45
+ color: #7f8c8d;
46
+ font-size: 1.1em;
47
+ margin-bottom: 15px;
48
+ }
49
+
50
+ .usage-hint {
51
+ background-color: #e8f4fd;
52
+ border: 1px solid #bee5eb;
53
+ border-radius: 4px;
54
+ padding: 10px;
55
+ font-size: 0.9em;
56
+ text-align: left;
57
+ max-width: 600px;
58
+ margin: 0 auto;
59
+ }
60
+
61
+ .usage-hint code {
62
+ background-color: #f8f9fa;
63
+ padding: 2px 4px;
64
+ border-radius: 2px;
65
+ font-family: 'Courier New', monospace;
66
+ font-size: 0.85em;
67
+ }
68
+
69
+ main {
70
+ display: grid;
71
+ grid-template-columns: 1fr 1fr;
72
+ gap: 20px;
73
+ }
74
+
75
+ .peer-info,
76
+ .settings,
77
+ .manual-connection,
78
+ .messages {
79
+ background: white;
80
+ padding: 20px;
81
+ border-radius: 8px;
82
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
83
+ }
84
+
85
+ .connected-peers {
86
+ background: white;
87
+ padding: 20px;
88
+ border-radius: 8px;
89
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
90
+ display: flex;
91
+ flex-direction: column;
92
+ min-height: 300px;
93
+ }
94
+
95
+ h2 {
96
+ margin-bottom: 15px;
97
+ color: #2c3e50;
98
+ border-bottom: 2px solid #ecf0f1;
99
+ padding-bottom: 5px;
100
+ }
101
+
102
+ .info-group,
103
+ .input-group {
104
+ margin-bottom: 15px;
105
+ }
106
+
107
+ label {
108
+ display: block;
109
+ margin-bottom: 5px;
110
+ font-weight: 600;
111
+ color: #555;
112
+ }
113
+
114
+ input[type="text"],
115
+ input[type="url"] {
116
+ width: 100%;
117
+ padding: 10px;
118
+ border: 2px solid #ecf0f1;
119
+ border-radius: 4px;
120
+ font-size: 14px;
121
+ color: #333;
122
+ transition: border-color 0.3s;
123
+ }
124
+
125
+ input[type="text"]:focus,
126
+ input[type="url"]:focus {
127
+ outline: none;
128
+ border-color: #3498db;
129
+ }
130
+
131
+ .btn {
132
+ padding: 10px 20px;
133
+ border: none;
134
+ border-radius: 4px;
135
+ font-size: 14px;
136
+ font-weight: 600;
137
+ cursor: pointer;
138
+ transition: all 0.3s;
139
+ text-transform: uppercase;
140
+ letter-spacing: 0.5px;
141
+ }
142
+
143
+ .btn:disabled {
144
+ opacity: 0.6;
145
+ cursor: not-allowed;
146
+ }
147
+
148
+ .btn.primary {
149
+ background-color: #3498db;
150
+ color: white;
151
+ }
152
+
153
+ .btn.primary:hover:not(:disabled) {
154
+ background-color: #2980b9;
155
+ }
156
+
157
+ .btn.secondary {
158
+ background-color: #95a5a6;
159
+ color: white;
160
+ }
161
+
162
+ .btn.secondary:hover:not(:disabled) {
163
+ background-color: #7f8c8d;
164
+ }
165
+
166
+ .btn.tertiary {
167
+ background-color: #f39c12;
168
+ color: white;
169
+ }
170
+
171
+ .btn.tertiary:hover:not(:disabled) {
172
+ background-color: #e67e22;
173
+ }
174
+
175
+ .btn.quaternary {
176
+ background-color: #9b59b6;
177
+ color: white;
178
+ }
179
+
180
+ .btn.quaternary:hover:not(:disabled) {
181
+ background-color: #8e44ad;
182
+ }
183
+
184
+ .btn.warning {
185
+ background-color: #f39c12;
186
+ color: white;
187
+ }
188
+
189
+ .btn.warning:hover:not(:disabled) {
190
+ background-color: #e67e22;
191
+ }
192
+
193
+ .button-group {
194
+ display: flex;
195
+ gap: 10px;
196
+ }
197
+
198
+ .system-messages-container {
199
+ margin-top: 15px;
200
+ }
201
+
202
+ .system-messages {
203
+ max-height: 200px;
204
+ overflow-y: auto;
205
+ border: 1px solid #ecf0f1;
206
+ border-radius: 4px;
207
+ padding: 10px;
208
+ background-color: #f8f9fa;
209
+ min-height: 60px;
210
+ }
211
+
212
+ .system-message {
213
+ margin-bottom: 8px;
214
+ padding: 6px 10px;
215
+ border-radius: 4px;
216
+ font-size: 13px;
217
+ line-height: 1.4;
218
+ border-left: 3px solid #6c757d;
219
+ }
220
+
221
+ .system-message:last-child {
222
+ margin-bottom: 0;
223
+ }
224
+
225
+ .system-message.info {
226
+ background-color: #d1ecf1;
227
+ border-left-color: #17a2b8;
228
+ color: #0c5460;
229
+ }
230
+
231
+ .system-message.error {
232
+ background-color: #f8d7da;
233
+ border-left-color: #dc3545;
234
+ color: #721c24;
235
+ }
236
+
237
+ .system-message.warning {
238
+ background-color: #fff3cd;
239
+ border-left-color: #ffc107;
240
+ color: #856404;
241
+ }
242
+
243
+ .system-message.success {
244
+ background-color: #d4edda;
245
+ border-left-color: #28a745;
246
+ color: #155724;
247
+ }
248
+
249
+ .system-message-header {
250
+ font-size: 11px;
251
+ color: #6c757d;
252
+ margin-bottom: 2px;
253
+ font-weight: 600;
254
+ display: flex;
255
+ justify-content: space-between;
256
+ align-items: center;
257
+ }
258
+
259
+ .system-message-time {
260
+ font-size: 11px;
261
+ color: #6c757d;
262
+ font-weight: 600;
263
+ }
264
+
265
+ .system-message-type {
266
+ font-size: 10px;
267
+ font-weight: bold;
268
+ padding: 2px 6px;
269
+ border-radius: 3px;
270
+ background: #6c757d;
271
+ color: white;
272
+ }
273
+
274
+ .system-message.info .system-message-type {
275
+ background: #17a2b8;
276
+ }
277
+
278
+ .system-message.error .system-message-type {
279
+ background: #dc3545;
280
+ }
281
+
282
+ .system-message.warning .system-message-type {
283
+ background: #ffc107;
284
+ color: #856404;
285
+ }
286
+
287
+ .system-message.success .system-message-type {
288
+ background: #28a745;
289
+ }
290
+
291
+ .system-message-content {
292
+ font-weight: 500;
293
+ }
294
+
295
+ .system-time {
296
+ font-size: 11px;
297
+ color: #6c757d;
298
+ margin-right: 8px;
299
+ font-weight: 600;
300
+ }
301
+
302
+ .system-content {
303
+ font-weight: 500;
304
+ }
305
+
306
+ .input-group {
307
+ display: flex;
308
+ flex-direction: column;
309
+ gap: 5px;
310
+ }
311
+
312
+ .input-group.horizontal {
313
+ flex-direction: row;
314
+ align-items: end;
315
+ gap: 10px;
316
+ }
317
+
318
+ .input-group.horizontal input {
319
+ flex: 1;
320
+ }
321
+
322
+ .input-help {
323
+ font-size: 0.8em;
324
+ color: #6c757d;
325
+ margin-top: 4px;
326
+ font-style: italic;
327
+ }
328
+
329
+ #peer-id {
330
+ background-color: #ecf0f1;
331
+ padding: 8px 12px;
332
+ border-radius: 4px;
333
+ font-family: 'Courier New', monospace;
334
+ font-size: 12px;
335
+ word-break: break-all;
336
+ display: block;
337
+ }
338
+
339
+ .status {
340
+ padding: 4px 8px;
341
+ border-radius: 4px;
342
+ font-weight: 500;
343
+ }
344
+
345
+ .status.connected {
346
+ background-color: #d4edda;
347
+ color: #155724;
348
+ }
349
+
350
+ .status.connecting {
351
+ background-color: #fff3cd;
352
+ color: #856404;
353
+ }
354
+
355
+ .status.disconnected {
356
+ background-color: #f8d7da;
357
+ color: #721c24;
358
+ }
359
+
360
+ /* Connection Health Styles */
361
+ .connection-stats {
362
+ font-size: 0.9em;
363
+ line-height: 1.4;
364
+ }
365
+
366
+ .connection-health {
367
+ padding: 8px 12px;
368
+ border-radius: 4px;
369
+ margin: 4px 0;
370
+ font-weight: 500;
371
+ }
372
+
373
+ .connection-health.healthy {
374
+ background-color: #d4edda;
375
+ color: #155724;
376
+ border: 1px solid #c3e6cb;
377
+ }
378
+
379
+ .connection-health.unhealthy {
380
+ background-color: #f8d7da;
381
+ color: #721c24;
382
+ border: 1px solid #f1b0b7;
383
+ }
384
+
385
+ .connection-health.unknown {
386
+ background-color: #e2e3e5;
387
+ color: #383d41;
388
+ border: 1px solid #d1d3d4;
389
+ }
390
+
391
+ .peer-info {
392
+ display: flex;
393
+ flex-direction: column;
394
+ flex: 1;
395
+ }
396
+
397
+ .peer-time {
398
+ font-size: 10px;
399
+ color: #6c757d;
400
+ margin-top: 2px;
401
+ font-family: 'Courier New', monospace;
402
+ }
403
+
404
+ .peer-actions {
405
+ display: flex;
406
+ align-items: center;
407
+ gap: 8px;
408
+ }
409
+
410
+ .btn-small {
411
+ padding: 4px 8px;
412
+ font-size: 12px;
413
+ border: none;
414
+ border-radius: 3px;
415
+ background-color: #007bff;
416
+ color: white;
417
+ cursor: pointer;
418
+ transition: background-color 0.3s;
419
+ }
420
+
421
+ .btn-small:hover {
422
+ background-color: #0056b3;
423
+ }
424
+
425
+ .btn-remove {
426
+ background-color: #dc3545 !important;
427
+ padding: 2px 6px !important;
428
+ font-weight: bold;
429
+ font-size: 14px !important;
430
+ }
431
+
432
+ .btn-remove:hover {
433
+ background-color: #c82333 !important;
434
+ }
435
+
436
+ .manual-connection {
437
+ background: white;
438
+ padding: 20px;
439
+ border-radius: 8px;
440
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
441
+ border-left: 4px solid #e74c3c;
442
+ }
443
+
444
+ .manual-connection h2 {
445
+ color: #e74c3c;
446
+ }
447
+
448
+ /* Make collapsed sections compact line items */
449
+ .discovered-peers[aria-expanded="false"],
450
+ .settings[aria-expanded="false"],
451
+ .manual-connection[aria-expanded="false"],
452
+ .connected-peers[aria-expanded="false"],
453
+ .dht[aria-expanded="false"],
454
+ .media[aria-expanded="false"] {
455
+ background: none !important;
456
+ border: none !important;
457
+ box-shadow: none !important;
458
+ padding: 4px 0 !important;
459
+ margin: 4px 0 !important;
460
+ min-height: auto !important;
461
+ border-radius: 0 !important;
462
+ }
463
+
464
+ .discovered-peers[aria-expanded="false"] .section-header,
465
+ .settings[aria-expanded="false"] .section-header,
466
+ .manual-connection[aria-expanded="false"] .section-header,
467
+ .connected-peers[aria-expanded="false"] .section-header,
468
+ .dht[aria-expanded="false"] .section-header,
469
+ .media[aria-expanded="false"] .section-header {
470
+ margin: 0;
471
+ padding: 0;
472
+ }
473
+
474
+ .discovered-peers[aria-expanded="false"] h2,
475
+ .settings[aria-expanded="false"] h2,
476
+ .manual-connection[aria-expanded="false"] h2,
477
+ .connected-peers[aria-expanded="false"] h2,
478
+ .dht[aria-expanded="false"] h2,
479
+ .media[aria-expanded="false"] h2 {
480
+ border-bottom: none !important;
481
+ margin: 0 !important;
482
+ padding: 2px 0 !important;
483
+ font-size: 0.9em !important;
484
+ color: #666 !important;
485
+ }
486
+
487
+ /* Toggle functionality styles */
488
+ .section-header {
489
+ position: relative;
490
+ margin: 10px 0 5px 0;
491
+ }
492
+
493
+ .section-header h2 {
494
+ display: flex;
495
+ align-items: center;
496
+ gap: 8px;
497
+ margin: 0;
498
+ font-size: 1.1em;
499
+ font-weight: 600;
500
+ }
501
+
502
+ .toggle-btn {
503
+ background: none;
504
+ border: none;
505
+ font-size: 0.9em;
506
+ font-weight: 600;
507
+ color: #2c3e50;
508
+ cursor: pointer;
509
+ padding: 4px 8px;
510
+ text-align: left;
511
+ transition: all 0.2s ease;
512
+ display: flex;
513
+ align-items: center;
514
+ gap: 4px;
515
+ border-radius: 4px;
516
+ line-height: 1.2;
517
+ }
518
+
519
+ .toggle-btn:hover {
520
+ color: #3498db;
521
+ background-color: #f8f9fa;
522
+ }
523
+
524
+ .toggle-btn:focus {
525
+ outline: 2px solid #3498db;
526
+ outline-offset: 2px;
527
+ border-radius: 4px;
528
+ }
529
+
530
+ .count-badge {
531
+ background-color: #3498db;
532
+ color: white;
533
+ font-size: 0.7em;
534
+ font-weight: 600;
535
+ padding: 2px 6px;
536
+ border-radius: 10px;
537
+ min-width: 16px;
538
+ text-align: center;
539
+ line-height: 1;
540
+ }
541
+
542
+ .collapsible-content {
543
+ display: block;
544
+ max-height: 1000px;
545
+ opacity: 1;
546
+ transform: translateY(0);
547
+ overflow: visible;
548
+ transition: all 0.3s ease;
549
+ }
550
+
551
+ .collapsible-content[style*="display: none"] {
552
+ display: none !important;
553
+ }
554
+
555
+ .collapsible-content.collapsed {
556
+ max-height: 0;
557
+ opacity: 0;
558
+ transform: translateY(-10px);
559
+ display: none;
560
+ overflow: hidden;
561
+ }
562
+
563
+ .messages-log {
564
+ max-height: 300px;
565
+ overflow-y: auto;
566
+ padding: 10px;
567
+ background: #f8f9fa;
568
+ border-radius: 6px;
569
+ border: 1px solid #ecf0f1;
570
+ margin-top: 10px;
571
+ min-height: 80px;
572
+ display: flex;
573
+ flex-direction: column;
574
+ gap: 8px;
575
+ }
576
+
577
+ .message-item {
578
+ display: flex;
579
+ align-items: flex-start;
580
+ gap: 10px;
581
+ background: #fff;
582
+ border-radius: 16px 16px 16px 4px;
583
+ box-shadow: 0 1px 3px rgba(44,62,80,0.06);
584
+ padding: 10px 14px;
585
+ font-size: 14px;
586
+ position: relative;
587
+ min-width: 0;
588
+ word-break: break-word;
589
+ border-left: 4px solid #3498db;
590
+ animation: fadeIn 0.3s;
591
+ }
592
+
593
+ .message-item.own {
594
+ background: #eaf6ff;
595
+ border-left-color: #2980b9;
596
+ align-self: flex-end;
597
+ border-radius: 16px 16px 4px 16px;
598
+ }
599
+
600
+ .message-item .avatar {
601
+ width: 28px;
602
+ height: 28px;
603
+ border-radius: 50%;
604
+ background: #3498db;
605
+ color: #fff;
606
+ display: flex;
607
+ align-items: center;
608
+ justify-content: center;
609
+ font-weight: bold;
610
+ font-size: 1em;
611
+ flex-shrink: 0;
612
+ margin-right: 4px;
613
+ }
614
+
615
+ .message-header {
616
+ font-size: 11px;
617
+ color: #6c757d;
618
+ margin-bottom: 2px;
619
+ font-weight: 600;
620
+ }
621
+
622
+ .message-content {
623
+ font-weight: 500;
624
+ color: #2c3e50;
625
+ }
626
+
627
+ .message-body {
628
+ flex: 1;
629
+ min-width: 0;
630
+ }
631
+
632
+ /* Message type styles */
633
+ .message-item.error {
634
+ background: #fef2f2;
635
+ border-left-color: #ef4444;
636
+ }
637
+
638
+ .message-item.error .avatar {
639
+ background: #ef4444;
640
+ }
641
+
642
+ .message-item.warning {
643
+ background: #fffbeb;
644
+ border-left-color: #f59e0b;
645
+ }
646
+
647
+ .message-item.warning .avatar {
648
+ background: #f59e0b;
649
+ }
650
+
651
+ .message-item.dm {
652
+ background: #f3e8ff;
653
+ border-left-color: #8b5cf6;
654
+ }
655
+
656
+ .message-item.dm .avatar {
657
+ background: #8b5cf6;
658
+ }
659
+
660
+ .message-item.info {
661
+ background: #eff6ff;
662
+ border-left-color: #3b82f6;
663
+ }
664
+
665
+ .message-item.info .avatar {
666
+ background: #3b82f6;
667
+ }
668
+
669
+ /* Connected Peers & Discovered Peers Modern UI */
670
+ .connected-peers, .discovered-peers {
671
+ background: #fff;
672
+ border-radius: 10px;
673
+ box-shadow: 0 2px 8px rgba(44,62,80,0.07);
674
+ padding: 18px 18px 10px 18px;
675
+ margin-bottom: 20px;
676
+ }
677
+
678
+ .peers-list, .discovered-peers-list {
679
+ display: flex;
680
+ flex-direction: column;
681
+ gap: 12px;
682
+ margin-top: 10px;
683
+ }
684
+
685
+ .peer-item, .discovered-peer-item {
686
+ display: flex;
687
+ align-items: center;
688
+ gap: 14px;
689
+ background: #f8fafd;
690
+ border-radius: 8px;
691
+ padding: 12px 16px;
692
+ box-shadow: 0 1px 2px rgba(44,62,80,0.04);
693
+ transition: box-shadow 0.2s, background 0.2s;
694
+ border: 1px solid #ecf0f1;
695
+ position: relative;
696
+ }
697
+ .peer-item:hover, .discovered-peer-item:hover {
698
+ background: #eaf6ff;
699
+ box-shadow: 0 2px 8px rgba(44,62,80,0.10);
700
+ }
701
+
702
+ .peer-avatar {
703
+ width: 32px;
704
+ height: 32px;
705
+ border-radius: 50%;
706
+ background: #3498db;
707
+ color: #fff;
708
+ display: flex;
709
+ align-items: center;
710
+ justify-content: center;
711
+ font-weight: bold;
712
+ font-size: 1.1em;
713
+ flex-shrink: 0;
714
+ box-shadow: 0 1px 2px rgba(44,62,80,0.08);
715
+ }
716
+
717
+ .peer-details {
718
+ flex: 1;
719
+ min-width: 0;
720
+ }
721
+ .peer-id {
722
+ font-family: 'Courier New', monospace;
723
+ font-size: 13px;
724
+ color: #2c3e50;
725
+ font-weight: 600;
726
+ word-break: break-all;
727
+ }
728
+ .peer-meta {
729
+ font-size: 11px;
730
+ color: #7f8c8d;
731
+ margin-top: 2px;
732
+ display: block;
733
+ }
734
+
735
+ .peer-status {
736
+ font-size: 12px;
737
+ font-weight: 600;
738
+ padding: 4px 10px;
739
+ border-radius: 12px;
740
+ background: #eaf6ff;
741
+ color: #2980b9;
742
+ margin-left: 8px;
743
+ text-transform: capitalize;
744
+ }
745
+ .status-connected {
746
+ background: #d4edda;
747
+ color: #155724;
748
+ }
749
+ .status-connecting {
750
+ background: #fff3cd;
751
+ color: #856404;
752
+ }
753
+ .status-other {
754
+ background: #f8d7da;
755
+ color: #721c24;
756
+ }
757
+
758
+ .peer-actions {
759
+ display: flex;
760
+ gap: 8px;
761
+ margin-left: 10px;
762
+ }
763
+
764
+ .btn-small, .btn-remove {
765
+ font-size: 12px;
766
+ padding: 4px 10px;
767
+ border-radius: 4px;
768
+ border: none;
769
+ cursor: pointer;
770
+ background: #f1f1f1;
771
+ color: #333;
772
+ transition: background 0.2s, color 0.2s;
773
+ }
774
+ .btn-small:hover {
775
+ background: #3498db;
776
+ color: #fff;
777
+ }
778
+ .btn-remove {
779
+ background: #dc3545;
780
+ color: #fff;
781
+ }
782
+ .btn-remove:hover {
783
+ background: #b71c1c;
784
+ }
785
+
786
+ .empty-state {
787
+ color: #aaa;
788
+ font-style: italic;
789
+ text-align: center;
790
+ padding: 16px 0;
791
+ }
792
+
793
+ @keyframes fadeIn {
794
+ from { opacity: 0; transform: translateY(10px); }
795
+ to { opacity: 1; transform: translateY(0); }
796
+ }
797
+
798
+ /* Media Controls Styles */
799
+ .media {
800
+ background: white;
801
+ padding: 20px;
802
+ border-radius: 8px;
803
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
804
+ margin-bottom: 20px;
805
+ border-left: 4px solid #f39c12;
806
+ }
807
+
808
+ .media h2 {
809
+ color: #f39c12;
810
+ }
811
+
812
+ .media-controls {
813
+ background: white;
814
+ border-radius: 8px;
815
+ padding: 20px;
816
+ margin-bottom: 20px;
817
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
818
+ }
819
+
820
+ .media-settings {
821
+ margin-bottom: 20px;
822
+ }
823
+
824
+ .video-container {
825
+ display: grid;
826
+ grid-template-columns: 1fr 1fr;
827
+ gap: 20px;
828
+ margin-top: 20px;
829
+ }
830
+
831
+ .local-video-container, .remote-videos-container {
832
+ background: #f8f9fa;
833
+ border-radius: 8px;
834
+ padding: 15px;
835
+ }
836
+
837
+ .local-video-container h3, .remote-videos-container h3 {
838
+ margin-bottom: 10px;
839
+ color: #2c3e50;
840
+ font-size: 1.1em;
841
+ }
842
+
843
+ #local-video {
844
+ width: 100%;
845
+ max-width: 320px;
846
+ height: auto;
847
+ border-radius: 8px;
848
+ background: #000;
849
+ display: block;
850
+ }
851
+
852
+ .video-status {
853
+ text-align: center;
854
+ margin-top: 8px;
855
+ font-size: 0.9em;
856
+ color: #6c757d;
857
+ }
858
+
859
+ .remote-videos-grid {
860
+ display: grid;
861
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
862
+ gap: 15px;
863
+ }
864
+
865
+ .remote-video-item {
866
+ background: white;
867
+ border-radius: 8px;
868
+ padding: 10px;
869
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
870
+ }
871
+
872
+ .remote-video-item h4 {
873
+ margin-bottom: 8px;
874
+ font-size: 0.9em;
875
+ color: #495057;
876
+ }
877
+
878
+ .remote-video-item video {
879
+ width: 100%;
880
+ height: auto;
881
+ border-radius: 4px;
882
+ background: #000;
883
+ }
884
+
885
+ .remote-video-item .video-status {
886
+ margin-top: 5px;
887
+ font-size: 0.8em;
888
+ }
889
+
890
+ /* Responsive adjustments for media */
891
+ @media (max-width: 768px) {
892
+ .video-container {
893
+ grid-template-columns: 1fr;
894
+ }
895
+
896
+ .remote-videos-grid {
897
+ grid-template-columns: 1fr;
898
+ }
899
+
900
+ #local-video {
901
+ max-width: 100%;
902
+ }
903
+ }
904
+
905
+ /* Media Controls */
906
+ .media-controls {
907
+ display: flex;
908
+ flex-direction: column;
909
+ gap: 20px;
910
+ }
911
+
912
+ .checkbox-group {
913
+ display: flex;
914
+ gap: 15px;
915
+ flex-wrap: wrap;
916
+ }
917
+
918
+ .checkbox-group .checkbox-label {
919
+ margin: 0;
920
+ }
921
+
922
+ .video-container {
923
+ background: #f8f9fa;
924
+ border: 2px dashed #dee2e6;
925
+ border-radius: 8px;
926
+ padding: 20px;
927
+ text-align: center;
928
+ min-height: 200px;
929
+ display: flex;
930
+ align-items: center;
931
+ justify-content: center;
932
+ }
933
+
934
+ .video-container video {
935
+ max-width: 100%;
936
+ max-height: 300px;
937
+ border-radius: 8px;
938
+ background: #000;
939
+ }
940
+
941
+ .video-placeholder {
942
+ color: #6c757d;
943
+ font-style: italic;
944
+ }
945
+
946
+ .videos-grid {
947
+ display: grid;
948
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
949
+ gap: 20px;
950
+ margin-top: 10px;
951
+ }
952
+
953
+ .remote-video-item {
954
+ background: white;
955
+ border-radius: 8px;
956
+ padding: 15px;
957
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
958
+ }
959
+
960
+ .video-title {
961
+ font-weight: 600;
962
+ margin-bottom: 10px;
963
+ color: #495057;
964
+ }
965
+
966
+ .video-status {
967
+ margin-top: 8px;
968
+ font-size: 0.85em;
969
+ font-weight: 500;
970
+ }
971
+
972
+ .local-video h4,
973
+ .remote-videos h4 {
974
+ margin-bottom: 10px;
975
+ color: #495057;
976
+ font-size: 1.1em;
977
+ }
978
+
979
+ /* Media button styles */
980
+ .media .button-group {
981
+ display: flex;
982
+ gap: 10px;
983
+ flex-wrap: wrap;
984
+ margin-top: 15px;
985
+ }
986
+
987
+ .media .button-group .btn {
988
+ flex: 1;
989
+ min-width: 120px;
990
+ }
991
+
992
+ /* Device selection styles */
993
+ .media select {
994
+ width: 100%;
995
+ padding: 10px;
996
+ border: 1px solid #ddd;
997
+ border-radius: 4px;
998
+ font-size: 14px;
999
+ background: white;
1000
+ }
1001
+
1002
+ /* DHT Styles */
1003
+ .dht {
1004
+ background: white;
1005
+ padding: 20px;
1006
+ border-radius: 8px;
1007
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
1008
+ margin-bottom: 20px;
1009
+ border-left: 4px solid #9b59b6;
1010
+ }
1011
+
1012
+ .dht h2 {
1013
+ color: #9b59b6;
1014
+ }
1015
+
1016
+ .dht-actions {
1017
+ margin-bottom: 20px;
1018
+ padding: 15px;
1019
+ border: 1px solid #eee;
1020
+ border-radius: 6px;
1021
+ background: #fafafa;
1022
+ }
1023
+
1024
+ .dht-actions h3 {
1025
+ margin-bottom: 15px;
1026
+ color: #2c3e50;
1027
+ font-size: 1.1em;
1028
+ }
1029
+
1030
+ .dht-actions .button-group {
1031
+ display: flex;
1032
+ gap: 10px;
1033
+ margin-top: 15px;
1034
+ flex-wrap: wrap;
1035
+ }
1036
+
1037
+ .dht-actions .input-group.horizontal {
1038
+ display: flex;
1039
+ gap: 10px;
1040
+ align-items: flex-end;
1041
+ }
1042
+
1043
+ .dht-actions .input-group.horizontal input {
1044
+ flex: 1;
1045
+ margin-bottom: 0;
1046
+ }
1047
+
1048
+ .dht-actions .input-group.horizontal button {
1049
+ white-space: nowrap;
1050
+ }
1051
+
1052
+ .dht-actions .input-group.horizontal .button-group {
1053
+ display: flex;
1054
+ gap: 8px;
1055
+ margin: 0;
1056
+ }
1057
+
1058
+ .dht-log {
1059
+ background: #f8f9fa;
1060
+ border: 1px solid #dee2e6;
1061
+ border-radius: 6px;
1062
+ padding: 12px;
1063
+ max-height: 300px !important;
1064
+ min-height: 100px;
1065
+ height: 300px;
1066
+ overflow-y: auto !important;
1067
+ overflow-x: hidden;
1068
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
1069
+ font-size: 12px;
1070
+ line-height: 1.5;
1071
+ box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
1072
+ position: relative;
1073
+ scrollbar-width: thin;
1074
+ scrollbar-color: #6c757d #f8f9fa;
1075
+ }
1076
+
1077
+ /* Webkit scrollbar styling for better visibility */
1078
+ .dht-log::-webkit-scrollbar {
1079
+ width: 8px;
1080
+ }
1081
+
1082
+ .dht-log::-webkit-scrollbar-track {
1083
+ background: #f8f9fa;
1084
+ border-radius: 4px;
1085
+ }
1086
+
1087
+ .dht-log::-webkit-scrollbar-thumb {
1088
+ background: #6c757d;
1089
+ border-radius: 4px;
1090
+ }
1091
+
1092
+ .dht-log::-webkit-scrollbar-thumb:hover {
1093
+ background: #495057;
1094
+ }
1095
+
1096
+ .dht-log-entry {
1097
+ margin-bottom: 6px;
1098
+ padding: 4px 0;
1099
+ border-bottom: 1px solid #e9ecef;
1100
+ word-wrap: break-word;
1101
+ }
1102
+
1103
+ .dht-log-entry:last-child {
1104
+ border-bottom: none;
1105
+ margin-bottom: 0;
1106
+ }
1107
+
1108
+ .dht-log-time {
1109
+ color: #6c757d;
1110
+ font-weight: bold;
1111
+ margin-right: 8px;
1112
+ font-size: 11px;
1113
+ }
1114
+
1115
+ .dht-log-message {
1116
+ color: #2c3e50;
1117
+ }
1118
+
1119
+ .dht-time {
1120
+ color: #6c757d;
1121
+ font-weight: bold;
1122
+ margin-right: 8px;
1123
+ font-size: 11px;
1124
+ }
1125
+
1126
+ .dht-subscriptions {
1127
+ margin-top: 15px;
1128
+ }
1129
+
1130
+ .dht-subscriptions h4 {
1131
+ margin-bottom: 10px;
1132
+ color: #2c3e50;
1133
+ font-size: 1em;
1134
+ font-weight: 600;
1135
+ }
1136
+
1137
+ .subscriptions-list {
1138
+ background: white;
1139
+ border: 1px solid #dee2e6;
1140
+ border-radius: 4px;
1141
+ padding: 10px;
1142
+ min-height: 60px;
1143
+ }
1144
+
1145
+ .subscription-item {
1146
+ display: flex;
1147
+ justify-content: space-between;
1148
+ align-items: center;
1149
+ padding: 8px 12px;
1150
+ background: #f8f9fa;
1151
+ border: 1px solid #e9ecef;
1152
+ border-radius: 6px;
1153
+ margin-bottom: 8px;
1154
+ transition: background-color 0.2s ease;
1155
+ }
1156
+
1157
+ .subscription-item:hover {
1158
+ background: #e9ecef;
1159
+ }
1160
+
1161
+ .subscription-item:last-child {
1162
+ margin-bottom: 0;
1163
+ }
1164
+
1165
+ .subscription-key {
1166
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
1167
+ font-size: 12px;
1168
+ color: #495057;
1169
+ flex: 1;
1170
+ margin-right: 10px;
1171
+ word-break: break-all;
1172
+ background: #ffffff;
1173
+ padding: 4px 8px;
1174
+ border-radius: 3px;
1175
+ border: 1px solid #dee2e6;
1176
+ }
1177
+
1178
+ .subscription-item .btn.small {
1179
+ padding: 4px 8px;
1180
+ font-size: 11px;
1181
+ min-width: auto;
1182
+ }
1183
+
1184
+ .dht-results {
1185
+ margin-top: 20px;
1186
+ padding: 15px;
1187
+ background: #f8f9fa;
1188
+ border-radius: 6px;
1189
+ border: 1px solid #e9ecef;
1190
+ }
1191
+
1192
+ .dht-results h3 {
1193
+ margin-bottom: 12px;
1194
+ color: #2c3e50;
1195
+ font-size: 1.1em;
1196
+ font-weight: 600;
1197
+ border-bottom: 1px solid #dee2e6;
1198
+ padding-bottom: 8px;
1199
+ }
1200
+
1201
+ /* DHT Button Colors */
1202
+ .btn.primary {
1203
+ background: #007bff;
1204
+ color: white;
1205
+ }
1206
+
1207
+ .btn.primary:hover:not(:disabled) {
1208
+ background: #0056b3;
1209
+ }
1210
+
1211
+ .btn.secondary {
1212
+ background: #6c757d;
1213
+ color: white;
1214
+ }
1215
+
1216
+ .btn.secondary:hover:not(:disabled) {
1217
+ background: #545b62;
1218
+ }
1219
+
1220
+ .btn.tertiary {
1221
+ background: #28a745;
1222
+ color: white;
1223
+ }
1224
+
1225
+ .btn.tertiary:hover:not(:disabled) {
1226
+ background: #1e7e34;
1227
+ }
1228
+
1229
+ .btn.quaternary {
1230
+ background: #dc3545;
1231
+ color: white;
1232
+ }
1233
+
1234
+ .btn.quaternary:hover:not(:disabled) {
1235
+ background: #bd2130;
1236
+ }
1237
+
1238
+ /* DHT TTL Group Animation */
1239
+ #dht-ttl-group {
1240
+ transition: opacity 0.3s ease, height 0.3s ease;
1241
+ }
1242
+
1243
+ #dht-ttl-group[style*="display: none"] {
1244
+ opacity: 0;
1245
+ }
1246
+
1247
+ #dht-ttl-group[style*="display: block"] {
1248
+ opacity: 1;
1249
+ }
1250
+
1251
+ /* DHT Button Group Enhancements */
1252
+ .dht .button-group {
1253
+ display: flex;
1254
+ gap: 10px;
1255
+ margin-top: 15px;
1256
+ flex-wrap: wrap;
1257
+ }
1258
+
1259
+ .dht .button-group .btn {
1260
+ flex: 1;
1261
+ min-width: 120px;
1262
+ }
1263
+
1264
+ /* Ensure small buttons in lists have proper styling */
1265
+ .btn.small {
1266
+ background: #6c757d;
1267
+ color: white;
1268
+ border: none;
1269
+ transition: background 0.2s ease;
1270
+ }
1271
+
1272
+ .btn.small:hover:not(:disabled) {
1273
+ background: #545b62;
1274
+ }
1275
+
1276
+ /* WebDHT Status Indicator */
1277
+ .auto-discovery-control[title*="disabled"] {
1278
+ opacity: 0.6 !important;
1279
+ }
1280
+
1281
+ .auto-discovery-control[title*="disabled"] label {
1282
+ color: #6c757d;
1283
+ }
1284
+
1285
+ .auto-discovery-control[title*="disabled"] .input-help {
1286
+ color: #dc3545;
1287
+ font-style: italic;
1288
+ }