forked from steveseguin/social_stream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
821 lines (756 loc) · 24 KB
/
popup.html
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
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
<!doctype html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta content="utf-8" http-equiv="encoding" />
<script src="popup.js"></script>
<style>
:root {
--body-background-enabled: #fcfffc;
--body-background-disabled: #fffcfc;
--section-title-color: black;
--button-background: #444;
--button-text: white;
--text-button-text: #222;
--h2-color: black;
--h3-color: #111;
--link-color: black;
--new-version-banner-background: #c8ffc8;
--new-version-banner-text: black;
--new-version-banner-border: 1px solid #7eff7e;
--new-version-link-color: green;
--new-version-installed-color: #3a413a;
--options-group-background-color: #f3f1f1;
--options-group-text-color: black;
--extension-enabled-background-color: rgb(153, 255, 153);
--extension-disabled-background-color: red;
--extension-disabled-text-color: white;
--streaming-chat-color: #dcfff3;
--streaming-chat-text-color: black;
--single-message-color: #fffddc;
--single-message-text-color: black;
}
@media (prefers-color-scheme: dark) {
:root {
--body-background-enabled: #101810;
--body-background-disabled: #1F1212;
--section-title-color: white;
--button-background: #444;
--button-text: white;
--text-button-text: white;
--h2-color: #b2b2b2;
--h3-color: #b2b2b2;
--link-color: white;
--new-version-banner-background: #066536;
--new-version-banner-text: white;
--new-version-banner-border: 1px solid #7eff7e;
--new-version-link-color: #90f190;
--new-version-installed-color: #bebebe;
--options-group-background-color: #292929;
--options-group-text-color: white;
--extension-enabled-background-color: rgb(153, 255, 153);
--extension-disabled-background-color: #781717;
--extension-disabled-text-color: white;
--streaming-chat-color: #064663;
--streaming-chat-text-color: white;
--single-message-color: #5a462b;
--single-message-text-color: white;
}
}
div {
padding: 2px;
}
html {
scroll-padding-top: 2em;
scroll-behavior: smooth;
}
body {
width: 350px;
padding: 0;
margin: 0;
}
body.extension-disabled {
background-color: var(--body-background-disabled);
}
body.extension-enabled {
background-color: var(--body-background-enabled);
}
p {
color: var(--text-button-text);
}
p a {
color: var(--link-color);
}
#newVersion {
padding: 1em;
background: var(--new-version-banner-background);
color: var(--new-version-banner-text);
border-bottom: var(--new-version-banner-border);
text-align: center;
font-weight: bold;
display: none;
}
#newVersion a {
text-decoration: none;
color: var(--new-version-link-color);
}
#newVersion .installed {
color: var(--new-version-installed-color);
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 1rem;
font-weight: 200;
margin-bottom: 0;
}
.pressed {
background-color: #2A2!important;
}
#newVersion.show {
display: block;
}
.container {
padding: 0 0.5em;
}
.options-link {
text-decoration: none;
color: var(--text-button-text);
font-size: 0.6rem;
}
#disableButton {
appearance: none;
position: sticky;
top: 0;
border: none;
display: block;
width: 100%;
padding: 0.5em 0;
font-weight: bold;
cursor: pointer;
z-index: 100;
}
.extension-enabled #disableButton {
background-color: var(--extension-enabled-background-color)
}
.extension-disabled #disableButton{
background-color: var(--extension-disabled-background-color);
color: var(--extension-disabled-text-color)
}
h2 {
color: var(--h2-color);
font-size: 1.1rem;
margin-top: 1.6rem;
margin-bottom: 0.3rem;
}
.link {
margin-bottom: 1em;
margin: 1.5em 0;
}
.link h2 {
margin: 0;
font-size: 1rem;
margin-bottom: 0.4rem;
font-weight: 600;
color: var(--section-title-color);
display: flex;
align-items: center;
justify-content: space-between;
}
.link div,
.options_group {
background-color: var(--options-group-background-color);
color: var(--options-group-text-color);
padding: 1em;
border-radius: 4px;
}
.link div.streaming_chat,
.streaming_chat {
color: var(--streaming-chat-text-color);
background-color: var(--streaming-chat-color);
}
.link div.single_message,
.single_message {
color: var(--single-message-text-color);
background-color: var(--single-message-color)
}
.link div a {
color: var(--link-color);
text-decoration: underline;
}
h3 {
margin-top: 0.8rem;
margin-bottom: 0.5rem;
font-weight: 600;
color: var(--h3-color);
}
.grid {
display: grid;
grid-template-columns: 1fr 1fr;
}
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 30px;
height: 16px;
margin: 2px;
}
.icon {
max-width: 16px;
max-height: 16px;
vertical-align: middle;
margin-left: 5px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 14px;
width: 14px;
left: 1px;
bottom: 1px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked+.slider {
background-color: #2196F3;
}
input {
margin: 2px;
}
input[type="text"] {
width: 50%;
display: block;
margin-bottom: 10px;
}
input:focus+.slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked+.slider:before {
-webkit-transform: translateX(14px);
-ms-transform: translateX(14px);
transform: translateX(14px);
}
/* Rounded sliders */
.slider.round {
border-radius: 16px;
}
.slider.round:before {
border-radius: 50%;
}
button.button {
appearance: none;
display: inline-block;
padding: 5px;
margin: 5px;
background-color: var(--button-background);
border: 1px solid black;
color: var(--button-text);
}
.link {
cursor: help;
}
#disableButtonText{
margin-right:5px;
}
</style>
</head>
<body>
<button id="disableButton">
<span id="disableButtonText">
Toggle On/Off
</span>
<label class="switch">
<input type="checkbox" id="extensionState">
<span class="slider round"></span>
</label>
</button>
<div id="newVersion"></div>
<div class="container">
<div class="link" title="This link will display chat messages as a streaming list; use as an overlay or as a control dock">
<h2>Streaming chat (dockable) <a class="options-link" href="#streaming-chat-options"
title="Jump to dockable streaming chat link options">[options]</a></h2>
<div id="dock" class="streaming_chat"></div>
</div>
<div class="link" title="This link will only show selected messages, one at a time. Requires the dock to select messages.">
<h2>Featured chat overlay <a class="options-link" href="#single-message-options"
title="Jump to single message overlay link options">[options]</a></h2>
<div id="overlay" class="single_message"></div>
</div>
<h3 title="These services require you to manually opt-in, for security purposes">Opt-in additional chat services</h3>
<div class="options_group options">
<div>
<label class="switch">
<input type="checkbox" data-setting="discord">
<span class="slider round"></span>
</label> Capture Discord chat <img class="icon" src="discord.png"></img>
</div>
<div>
<label class="switch">
<input type="checkbox" data-setting="slack">
<span class="slider round"></span>
</label> Capture Slack chat <img class="icon" src="slack.png"></img>
</div>
<div>
<label class="switch">
<input type="checkbox" data-setting="telegram">
<span class="slider round"></span>
</label> Capture Telegram chat <img class="icon" src="telegram.png"></img>
</div>
<div>
<label class="switch">
<input type="checkbox" data-setting="whatsapp">
<span class="slider round"></span>
</label> Capture WhatsApp chat <img class="icon" src="whatsapp.png"></img>
</div>
</div>
<a href="" id="streaming-chat-options"></a>
<h2>Streaming chat (dock) options</h2>
<div class="options">
<h3>Styling options</h3>
<div class="options_group streaming_chat">
<div>
<label class="switch">
<input type="checkbox" data-param1="hidemenu">
<span class="slider round"></span>
</label> Hide menu bar
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="transparent">
<span class="slider round"></span>
</label> Force transparent background
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="hideshadow">
<span class="slider round"></span>
</label> No alternating background shading
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="nooutline">
<span class="slider round"></span>
</label> No text outlining
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="scale=2">
<span class="slider round"></span>
</label> Magnify the view (larger font/images) 🔍
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="emoji">
<span class="slider round"></span>
</label> Make emojis larger 😊
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="compact">
<span class="slider round"></span>
</label> Compact mode (good for video overlaying)
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="hidesource">
<span class="slider round"></span>
</label> Hide source icon <img src="youtube.png" class="icon" /><img src="twitch.png" class="icon" /><img src="facebook.png" class="icon" />
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="nobadges">
<span class="slider round"></span>
</label> Show no badges ✅ ✅
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="noavatar">
<span class="slider round"></span>
</label> Show no avatars <img src="unknown.png" class="icon" />
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="notime">
<span class="slider round"></span>
</label> Hide timestamp 🕘
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="branded">
<span class="slider round"></span>
</label> Show channel icon
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="chroma">
<span class="slider round"></span>
</label> Green page background
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="firstnames">
<span class="slider round"></span>
</label> Show first names only
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="split">
<span class="slider round"></span>
</label> Split mode (messages align relative to center)
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="horizontal">
<span class="slider round"></span>
</label> Horizontal scrolling messages
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="random">
<span class="slider round"></span>
</label> Messages appear randomly on the screen
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="alignbottom">
<span class="slider round"></span>
</label> Messages start at bottom rather than top
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="dropdown">
<span class="slider round"></span>
</label> Messages drop down (reversed order)
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="swipeleft">
<span class="slider round"></span>
</label> Messages slide in from the right
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="fadein">
<span class="slider round"></span>
</label> Messages fade in
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="showtime=20000">
<span class="slider round"></span>
</label> Hide messages after 20s
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="fadeout">
<span class="slider round"></span>
</label> Messages fade out when hiding
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="color">
<span class="slider round"></span>
</label> Add unique color to names if available
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="lightmode">
<span class="slider round"></span>
</label> Light mode (white background)
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="darkmode">
<span class="slider round"></span>
</label> Dark mode (black background)
</div>
</div>
<h3>Behaviour and functions</h3>
<div class="options_group streaming_chat">
<div>
<label class="switch">
<input type="checkbox" data-param1="limit=200">
<span class="slider round"></span>
</label> Increase messages history to 200
</div>
<div>
<label class="switch">
<input type="checkbox" data-setting="sentiment">
<span class="slider round"></span>
</label> Filter out messages with bad karma
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="save">
<span class="slider round"></span>
</label> Save messages to disk 💾
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="savesingle">
<span class="slider round"></span>
</label> Save last message to a file 💾
</div>
<div>
<label class="switch"
title="HTML is removed from messages, donations, and names for this dock only">
<input type="checkbox" data-param1="striphtml">
<span class="slider round"></span>
</label> Strip HTML from messages and donations
</div>
<div>
<label class="switch"
title="tip: You can use &myname=name1,name2 to list names to exclude from TTS">
<input type="checkbox" data-param1="speech=en-US">
<span class="slider round"></span>
</label> Text-to-Speech incoming messages 💬
</div>
<div>
<label class="switch"
title="note: You must first interact with the dock-page for any audio to be audible">
<input type="checkbox" data-param1="beep">
<span class="slider round"></span>
</label> Beep when there is a new message 🔔
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="autoshow">
<span class="slider round"></span>
</label> Auto-select new messages (skipping as needed)
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="autoshowdonos">
<span class="slider round"></span>
</label> When auto-selecting is on, only auto-select donations
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="sync">
<span class="slider round"></span>
</label> Multiple docks will stay in sync as to selected messages
</div>
<div>
<label class="switch">
<input type="checkbox" data-param1="hidebots">
<span class="slider round"></span>
</label> Do not show host or bot messages
</div>
</div>
<h3>Specify host or bot</h3>
<div class="options_group streaming_chat">
<div>
<label class="textinput" style="display:block;padding-top:8px;">
</label> List of names to identify as the host or bot (comma separated):
<input type="text" data-textparam1="myname" style="width:95%;"
placeholder="ie: name1,name 2,Name3" />
</div>
</div>
</div>
<a href="" id="single-message-options"></a>
<h2>Featured chat overlay options</h2>
<div class="options">
<h3>URL-based settings</h3>
<div class="options_group single_message">
<div>
<label class="switch">
<input type="checkbox" data-param2="showtime=20000">
<span class="slider round"></span>
</label> Hide overlay after 20s
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="showsource">
<span class="slider round"></span>
</label> Show source icon <img src="youtube.png" class="icon" /><img src="twitch.png"
class="icon" /><img src="facebook.png" class="icon" />
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="branded">
<span class="slider round"></span>
</label> Show channel icon
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="center">
<span class="slider round"></span>
</label> Center overlay
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="aligntop">
<span class="slider round"></span>
</label> Align comment to top
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="fade">
<span class="slider round"></span>
</label> Fade in/out instead
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="rounded=10">
<span class="slider round"></span>
</label> Round edges ⬛=>⚫
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="noavatar">
<span class="slider round"></span>
</label> Show no avatars <img src="unknown.png" class="icon" />
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="nobadges">
<span class="slider round"></span>
</label> Show no badges ✅
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="speech=en-US">
<span class="slider round"></span>
</label> Enable text-to-speech 💬
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="ttsdonos=en-US">
<span class="slider round"></span>
</label> Enable text-to-speech for Donations only 💬
</div>
<div>
<label class="switch">
<input type="checkbox" title="zoom out of overlay by 2x" data-param2="scale=0.5">
<span class="slider round"></span>
</label> Make overlay smaller 🔎
</div>
<div>
<label class="switch">
<input type="checkbox" title="Raise offset of overlay by 100px" data-param2="offset=100">
<span class="slider round"></span>
</label> Raise overlay higher ⬆
</div>
<div>
<label class="switch">
<input type="checkbox" data-param2="chroma">
<span class="slider round"></span>
</label> Green page background 🟢
</div>
</div>
<h3>Colors</h3>
<div class="options_group single_message">
<div>
<label for="comment_color">Comment Font Color</label>
<input type="text" id="comment_color" data-textsetting="comment_color" placeholder="#HEX value or color name" />
</div>
<div>
<label for="comment_background">Comment Background Color</label>
<input type="text" id="comment_background" data-textsetting="comment_background" placeholder="#HEX value or color name" />
</div>
<div>
<label for="name_color">Name Font Color</label>
<input type="text" id="name_color" data-textsetting="name_color" placeholder="#HEX value or color name" />
</div>
<div>
<label for="name_background">Name Background Color</label>
<input type="text" id="name_background" data-textsetting="name_background" placeholder="#HEX value or color name" />
</div>
</div>
</div>
<h2>Other settings and tools</h2>
<div class="options">
<div class="options_group">
<div>
<label class="switch" title="Just text is captured; no HTML, so no BTTV emotes, etc.">
<input type="checkbox" id="firstsourceonly" data-setting="firstsourceonly">
<span class="slider round"></span>
</label> Filter out duplicate message echos
</div>
<div>
<label class="switch" title="Just text is captured; no HTML, so no BTTV emotes, etc.">
<input type="checkbox" id="textonlymode" data-setting="textonlymode">
<span class="slider round"></span>
</label> Strip HTML from messages
</div>
<div>
<label class="switch">
<input type="checkbox" id="autohi" data-setting="autohi">
<span class="slider round"></span>
</label> Auto-reply to "<b>hi</b>" messages
</div>
<div>
<label class="switch">
<input type="checkbox" id="midi" data-setting="midi">
<span class="slider round"></span>
</label> Enable MIDI hotkeys 🎹
<button id="midiConfig" class="button" data-action="loadmidi" style="cursor:pointer;"> Load Config</button>
</div>
<div>
<label class="switch" title="See documentation on socialstream.ninja for details">
<input type="checkbox" data-setting="socketserver">
<span class="slider round"></span>
</label> Enable <a target='_blank' id='remote_control_url' href='https://socialstream.ninja/sampleapi.html'>remote HTTP/WSS API control options</a>
</div>
<div>
<label class="switch">
<input type="checkbox" id="server" data-both="server">
<span class="slider round"></span>
</label> Send featured chat via server instead of P2P
</div>
<div style="display:inline-block;">
<label class="switch">
<input type="checkbox" id="joke" data-setting="joke">
<span class="slider round"></span>
</label> Tell joke on <b>!joke</b> message
</div>
<button class="button" data-action="tellajoke" style="cursor:pointer;"> Tell a joke now</button>
</div>
<h3>Save the last message to a file</h3>
<div class="options_group">
An alterative method of saving the <b>last</b> message
<div class="grid">
<button class="button" data-action="singlesave" style="cursor:pointer;"> 💾 Choose location</button>
<button class="button" data-action="singlesaveStop" style="cursor:pointer;"> Stop saving (if active)</button>
</div>
</div>
<h3>Save all messages to 📗 <b>Excel</b> file</h3>
<div class="options_group">
An alterative method of saving all messages
<div class="grid">
<button class="button" data-action="excelsave" style="cursor:pointer;"> 💾 Choose location</button>
<button class="button" data-action="excelsaveStop" style="cursor:pointer;"> Stop saving (if active)</button>
</div>
</div>
<h3>Fake a comment for testing</h3>
<div class="options_group">
Issue a random test message that will appear in the dock
<button class="button" data-action="fakemsg" style="cursor:pointer;">Trigger now</button>
</div>
<p>
Visit us at <a href='https://discord.vdo.ninja' target="_blank">discord.vdo.ninja</a>. Made with 💖 for the community.
</p>
</div>
</div> <!-- end container -->
</body>
</html>