-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
1832 lines (1562 loc) · 78 KB
/
index.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
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" prefix="og: https://ogp.me/">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ppShow</title>
<script src="tmi.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<meta name="description" content="show most used emotes from any twitch channel">
<meta name="keywords" content="bttv%20emotes,emotes,top%20emote,most%20used%20emote,twitch%20chat%20most%20used%20emotes">
<!-- older version available in /archive/ppShow<version>.html, example: .../archive/ppShow100.html -->
<meta name="version" content="1.0.1e">
<meta name='theme-color' content='#616161'>
<!-- open graph tags -->
<meta property="og:title" content="ppShow">
<meta property="og:description" content="show most used emotes from any twitch channel">
<meta property="og:site_name" content="ppShow">
<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:url" content="https://pp-show.vercel.app">
<meta property="og:image" content="https://pp-show.vercel.app/icon.png">
<link rel="manifest" href="/manifest.json">
<!-- font Source Sand pro -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap" rel="stylesheet">
<!-- BASE64 IMAGE AHEAD -->
<link
rel="shortcut icon"
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAAD8CAYAAABTq8lnAAAKMElEQVR4Xu3dMY5mWRFE4SqxK8AeHwmJWcgsAxbS0qwAGzUGe6IQHsLJG5rQ1euX39gxWTdPxtFTW//nh/8QQGANgc81m1oUAQQ+CK8ECCwiQPhFx7YqAoTXAQQWESD8omNbFQHC6wACiwgQftGxrYoA4XUAgUUECL/o2FZFgPA6gMAiAoRfdGyrIkB4HUBgEQHCLzq2VREgvA4gsIgA4Rcd26oIEF4HEFhEgPCLjm1VBAivAwgsIkD4Rce2KgKE1wEEFhEg/KJjWxUBwusAAosIEH7Rsa2KAOF1AIFFBAi/6NhWRYDwOoDAIgKEX3RsqyJAeB1AYBEBwi86tlURILwOILCIAOEXHduqCBBeB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B8FyjhuzxNKxMgfBco4bs8TSsTIHwXKOG7PE0rEyB8FyjhuzxNKxMgfBco4bs8TSsTIHwXKOG7PE0rEyB8FyjhuzxNKxMgfBco4bs8TSsTIHwXKOG7PE0rEyB8FyjhuzxN+8EJ3P5xx9u4CH+buL/3aAKEf/R5PA6BLgHCd3mahsCjCRD+0efxOAS6BAjf5WkaAo8mQPhHn8fjEOgSIHyXp2kIPJoA4R99Ho9DoEuA8F2epiHwaAKEf/R5PA6BLgHCd3mahsCjCRD+0efxOAS6BAjf5WkaAo8mQPhHn8fjEOgSIHyXp2kIPJoA4R99Ho9DoEuA8F2epiHwaAKEf/R5PA6BLgHCd3mahsCjCRD+0efxOAS6BAjf5WkaAo8mQPhHn8fjEOgSIHyXp2kIPJoA4R99Ho9DoEuA8F2epiHwaAKEf/R5PA6BLgHCd3mahsCjCbxe+N/99O+vR1/gNz7uzz/98TdOePb//uvf//HsB/5gr3t7Xz4J/4M18v+eS/ju/Qjf5Xl92tsPSPhupd7eF1/4bl+uTyN8FznhuzyvT3v7AQnfrdTb++IL3+3L9WmE7yInfJfn9WlvPyDhu5V6e1984bt9uT6N8F3khO/yvD7t7QckfLdSb++LL3y3L9enEb6LnPBdntenvf2AhO9W6u198YXv9uX6NMJ3kRO+y/P6tLcfkPDdSr29L77w3b5cn0b4LnLCd3len/b2AxK+W6m398UXvtuX69MI30VO+C7P69PefkDCdyv19r74wnf7cn0a4bvICd/leX3a2w9I+G6l3t4XX/huX65PI3wXOeG7PK9Pe/sBCd+t1Nv74gvf7cv1aYTvIid8l+f1aW8/IOG7lXp7X3zhu325Po3wXeSE7/K8Pu3tByR8t1Jv74svfLcv16cRvouc8F2e16e9/YCE71bq7X3xhe/25fo0wneRv134/wBX04ZprxiM1AAAAABJRU5ErkJggg=="
type="image/png"
>
<!-- base64 transparent image, emote placeholder -->
<script>
const nothing = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAQSURBVHgBAQUA+v8AAAAAAAAFAAFkeJU4AAAAAElFTkSuQmCC"
</script>
<script>
var debug = false;
/**
* @description wraps console.log() to show only if debug = true
*
* @param {*} args anything yu would use in console.log()
* @example dbug("hi") -> prints "hi" in browser devTools console
*/
function dbug(...args){
if(debug) console.log(`[debug] `, ...args);
}
</script>
<style>
/* themes */
@media all {
.dark{
--bg-main: #000;
--text-light: #f1f1f1;
--text-dark: #222222;
/* --text-medium:#616161; its just a coincidence, really. */
--text-medium: hsl(0deg 0% 50%); /* but devTools complains about cotrast :/. */
--bg-input: #212121;
--bg-input-border: #616161;
--bg-dark: #212121;
--bg-light: #f1f1f1;
--bg-popup: #151515;
--err: #ff5f5f;
--warn: #ffd95f;
--info: #5faaff;
--succ: #67f369;
--err-half: #ff5f5f1f;
--warn-half: #ffd95f1f;
--info-half: #5faaff1f;
--succ-half: #67f3691f;
}
.light{
--bg-main: #FFF;
--text-light: #222222;
--text-dark: #616161;
/* --text-medium:#616161; */
--text-medium:hsl(0deg 0% 16%); /* at least this one is ok :) */
--bg-input: #f1f1f1;
--bg-input-border: #e4e4e4;
--bg-light: #F1F1F1;
--bg-dark: #616161;
--bg-popup: #CECECE;
--err: #ff3f3f;
--warn: #eaa908;
--info: #2b69ae;
--succ: #119648;
--err-half: #ff3f3f1f;
--warn-half: #eaa9081f;
--info-half: #2b69ae1f;
--succ-half: #1196481f;
}
}
*{
font-family: 'Source Sans Pro', sans-serif;
transition: all 400ms ease-in-out;
}
body{
background-color: var(--bg-main);
color: var(--text-light);
}
.err-text{
padding: 3px 6px;
border-radius: 3px;
margin-top: 3px;
display: block;
width: fit-content;
width: -moz-fit-content;
}
/* general - input, buttons, labels... */
@media all {
input[type="text"], .inputt{
font-family: 'Source Sans Pro', sans-serif;
background: var(--bg-input);
color: var(--text-light);
border: none;
padding: 4px 5px;
border-radius: 3px;
font-size: 85%;
outline: none;
}
input[type="text"]:focus, .inputt:focus{
border-radius: 3px 3px 0px 0px;
/* border-bottom: solid 1px #f1f1f1; */
border-bottom: solid 2px var(--bg-input-border);
}
label{
color: var(--text-light);
}
button{
border: none;
border-radius: 3px;
padding: 3px 6px;
background-color: var(--bg-light);
color: var(--text-medium);
cursor: pointer;
}
.link{
text-decoration: none;
color: var(--info);
cursor: pointer;
}
.link:hover{
text-decoration: underline;
transform: scale(0.3);
}
}
/* scroll bar */
@media all {
::-webkit-scrollbar {
width: 8px;
background: var(--bg-input);
}
/* Handle */
::-webkit-scrollbar-thumb {
background: var(--bg-input-border);
border-radius: 3px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: var(--text-light);
}
}
/* connection info and last message */
@media all {
.msg-container{
position: absolute;
display: block;
width: fit-content;
width: -moz-fit-content;
min-height: 80px;
bottom: 10px;
}
.last-msg{
max-width: 600px;
}
.stat-connected{
color: var(--succ);
}
.stat-disconnected{
color: var(--err);
}
.stat-connecting{
color: var(--warn);
}
.show-hide-container{
background-color: var(--bg-input);
color: var(--text-light);
height: fit-content;
position: absolute;
text-orientation: sideways;
-webkit-text-orientation: sideways;
writing-mode: vertical-lr;
width: 40px;
height: -webkit-fill-available;
text-align: center;
padding: 2px 10px;
box-sizing: border-box;
letter-spacing: 1px;
/* font-variant: petite-caps; */
transform: scale(-1,-1);
/* max-height: 80px; */
min-height: 80px;
cursor: pointer;
}
.msg-container .sub-cont{
margin-left: 50px;
}
}
/* popup and options */
@media all {
.popup-container{
position: absolute;
width: calc(100% - 17px);
height: calc(100% - 17px);
display: flex;
/* text-align: center; */
}
.popup-sub{
align-self: center;
width: 100%;
text-align: center;
color: var(--text-medium);
}
.options{
max-width: 350px;
/* text-align: left; */
background-color: var(--bg-popup);
padding: 10px;
border-radius: 5px;
margin-left: 32%;
min-width: 300px;
text-align: left;
display: none;
max-height: 550px;
overflow-y: scroll;
}
.op-header{
text-align: left;
}
.op-header a{
color: var(--text-light);
font-size: 110%;
}
.op-header button{
float: right;
padding: 3px 8px;
font-weight: 600;
}
.op-item{
margin: 14px 0px;
}
.op-item input[type="checkbox"]{
width: 14px;
height: 14px;
vertical-align: text-bottom;
}
.op-item i{
font-size: 85%;
}
.op-item input, .op-item select{
min-width: 190px;
}
.op-item select{
padding: 3px 5px;
min-width: 200px;
}
.op-item input[type="checkbox"]{
min-width: 20px;
min-width: fit-content;
/* min-width: -moz-fit-content; */
/* min-width: -webkit-fill-available; */
/* min-width: -webkit-fit-content; */
}
}
/* spinning animation */
@keyframes spinner {
from { transform: rotate(0); }
to { transform: rotate(360deg); }
}
@-moz-keyframes spinner{
from { transform: rotate(0); }
to { transform: rotate(360deg); }
}
@-webkit-keyframes spinner{
from { transform: rotate(0); }
to { transform: rotate(360deg); }
}
.spinning {
animation: spinner 1500ms linear infinite;
-webkit-animation: spinner 1500ms linear infinite;
-moz-animation: spinner 1500ms linear infinite;
}
#canvas-cont{
position: absolute;
top: 0;
left: 0;
height: 98vh;
width: 99vw;
z-index: -1;
}
#dvd-like{
width: 100%;
height: 100%;
}
#img-container{
display: flex;
position: absolute;
top: 0;
height: calc(100% - 18px);
width: calc(100% - 18px);
z-index: -1;
}
#emoteIMG{
margin: auto;
width: auto;
}
.title{
color: var(--text-light);
font-size: 105%;
}
.subtitle{
color: var(--text-light);
font-size: 100%;
}
.combo{
width: min-content;
font-size: 3em;
padding: 5px;
transition: none;
position: relative;
height: 50px;
}
.combo .c-text-cont{
position: absolute;
bottom: 0;
left: 0;
font-size: 110%;
}
#combo-value{
font-size: 100%;
transition: all 40ms ease-out;
}
</style>
</head>
<body class="dark">
<noscript>This page requires JavaScript enabled <br> Using Vue.js framework and tmi.js library</noscript>
<div id="canvas-cont">
<canvas id="dvd-like"></canvas>
</div>
<main id="app">
<!-- popup (options and notice) -->
<div
class="popup-container"
v-if="status == 'disconnected' || showOptions || hasNews"
:style="{
'z-index': status == 'disconnected' && !showOptions && !hasNews ? '-1' : '0'
}"
>
<div class="popup-sub">
<div class="notice" v-if="status == 'disconnected' && !showOptions && !hasNews">
Hi
<br>
this is a simple site/page to show most used emote in a channel from twitch.tv
<br>
credits to twitch.tv/omeiaum for the idea, i just coded it
<br>
<br>
<i>'dvd mode' may now work properly in Firefox, please prefer chromium based browsers (like Chrome)</i>
<br> TY <3
</div>
<!-- options -->
<div class="options" v-if="showOptions" :style="{display: optionsDisplay}">
<div class="op-header">
<a>Options</a>
<button @click="showOptions = !showOptions">X</button>
</div>
<!-- actual options -->
<div class="op-items">
<i>options are saved in browser localStorage</i>
<br>
<i>please read the notice by scrolling down</i>
<br>
<br>
<!-- Min mention amount -->
<div class="op-item">
<label for="miment">Minimal amount of mentions to change </label>
<input
class="inputt"
id="miment"
type="number"
v-model="options.miMentions"
placeholder="10"
min="-1"
@change="saveLocal('miMentions', $event.target.value)"
>
<br>
<i>Only change the displayed emote if have more than X mentions</i>
<br>
<i>-1 to always use top one</i>
</div>
<!-- zero after X messages -->
<div class="op-item">
<label for="miment">Zero the count of each emote after X messages</label>
<input
class="inputt"
id="miment"
type="number"
v-model="options.msgTreshold"
placeholder="100"
min="-1"
@change="saveLocal('msgTreshold', $event.target.value)"
>
<br>
<i>this will help to use only most recent ones</i>
<br>
<i>-1 to not zero</i>
</div>
<!-- theme -->
<div class="op-item">
<label for="theme">Theme</label>
<br>
<select
class="inputt"
id="theme"
v-model="options.theme"
@change="saveLocal('theme', $event.target.value)"
>
<option
v-for="th of enums.themes"
:value="th"
:selected="th == options.theme"
>{{th}}</option>
</select>
<br>
<i v-if="options.theme == 'dark'">Be careful if you are in the dark, this will suddlenly change to white</i>
</div>
<!-- size -->
<div class="op-item">
<label for="esiz">Emote size</label>
<br>
<select
class="inputt"
id="esiz"
v-model="options.size"
@change="saveLocal('size', $event.target.value)"
>
<option
v-for="th of enums.sizes"
:value="th"
:selected="th == options.size"
>{{th}}</option>
</select>
</div>
<!-- Auto connect when page load -->
<div class="op-item">
<input
id="autocon"
type="checkbox"
v-model="options.connectOnLoad"
@change="saveLocal('connectOnLoad', $event.target.checked)"
>
<label for="autocon">Auto connect on open</label>
<br>
<i>channel must be setted once or add #channel_name on URL</i>
</div>
<!-- dvd mode -->
<div class="op-item">
<input
type="checkbox"
id="deb"
v-model="options.dvdStand"
@change="saveLocal('dvdStand', $event.target.checked)"
>
<label for="deb">DVD stand-by bouncing</label>
<br>
<input
type="checkbox"
id="dirtyCanvas"
v-model="options.dirtyCanvas"
@change="saveLocal('dirtyCanvas', $event.target.checked)"
>
<label for="dirtyCanvas">Don't clear canvas</label>
<br>
<i>speeds: X and Y</i>
<br>
<input
type="number"
class="inputt"
style="min-width: 80px; width: 80px"
placeholder="speed X"
v-model="options.dvdspeedX"
min="0"
step="0.1"
@change="saveLocal('dvdspeedX', $event.target.value)"
>
<input
type="number"
class="inputt"
style="min-width: 80px; width: 80px"
placeholder="speed Y"
v-model="options.dvdspeedY"
min="0"
step="0.1"
@change="saveLocal('dvdspeedY', $event.target.value)"
>
<br>
<i>RNG multiplier: Multiplied by a random number to change the direction a bit</i>
<br>
<input
type="number"
class="inputt"
style="min-width: 80px; width: 80px"
placeholder="speed Y"
v-model="options.spRngMultip"
min="0"
step="0.1"
@change="saveLocal('spRngMultip', $event.target.value)"
>
<br>
<i>make it like a good ol' dvd</i>
</div>
<!-- spinner -->
<div class="op-item">
<input
type="checkbox"
id="spn"
v-model="options.spin"
@change="saveLocal('spin', $event.target.checked)"
>
<label for="spn">Spin/rotate emote</label>
<br>
<i>Spin Speed (in millisseconds, 1s = 1000ms)</i>
<br>
<input
type="number"
class="inputt"
style="min-width: 80px; width: 80px"
placeholder="spin duration"
v-model="options.spinnTime"
min="0"
step="100"
@change="saveLocal('spinnTime', $event.target.value)"
>
<br>
<i>make it spin</i>
</div>
<!-- hotkeys -->
<div class="op-item">
<input
type="checkbox"
id="deb"
v-model="options.enableHotkeys"
@change="saveLocal('enableHotkeys', $event.target.checked)"
>
<label for="deb">Hotkeys</label>
<br>
<i>use keyboard to make some things easier!</i>
<br>
<i>Full list at the very bottom, scroll it down...</i>
<br>
<i>only applies if NO INPUT IS FOCUSED (text fields, checkbox...)</i>
</div>
<!-- Combo -->
<div class="op-item">
<input
type="checkbox"
id="deb"
v-model="options.showCombo"
@change="saveLocal('showCombo', $event.target.checked)"
>
<label for="deb">Combo value</label>
<br>
<i>the number of mentions in a sequence (any other emote will cancel it!)</i>
</div>
<!-- toggle debug, showing things on devTools console -->
<div class="op-item">
<input
type="checkbox"
id="deb"
v-model="options.debug"
@change="saveLocal('debug', $event.target.checked)"
>
<label for="deb">Debug</label>
<br>
<i>print messages and useful things on devTools console (press F12 key)</i>
</div>
<i>
<br> <b class="subtitle">IMPORTANT NOTICE:</b>
<br> Both 'zero after messages' and 'min. mentions' affect how often they will
appear on screen keeping low values (ex: -1 and 5) in both will make it
change faster.
This will depend on chat speed, the ammount of messages
<br>
<br>
For most cases 5~ and 20~ will be good for 'emote bursts'
<br>
That is, zero the count every 20 messages and if have more than 5 mentions show it
<br>
</i>
<br>
<br>
<a class="subtitle">Want the code? take a look at the </a> <a rel="noreferrer" target="_blank" href="https://github.com/gnitoon/ppShow" class="link">Github repo!</a>
<br>
<br>
<a class="subtitle">LICENSE:</a> <a href="https://opensource.org/licenses/MIT" target="_blank" class="link">MIT</a>
<br>
<br>
<b class="subtitle">Credits:</b>
<br> <a rel="noreferrer" target="_blank" href="https://twitch.tv/omeiaum" class="link">oMeiaUm</a>
<br> <a rel="noreferrer" target="_blank" href="https://vuejs.org/" class="link">Vue.js</a> framework
<br> <a rel="noreferrer" target="_blank" href="https://tmijs.com/" class="link">tmijs package</a> (to connect with twitch chat)
<br> <a rel="noreferrer" target="_blank" href="https://betterttv.com/" class="link">BetterTTV</a> (emotes and APIs)
<br> <a rel="noreferrer" target="_blank" href="https://www.frankerfacez.com/developers" class="link">FrankerFaceZ</a> (channel info)
<br> <a rel="noreferrer" target="_blank" href="http://developpaper.com/using-canvas-to-make-a-dvd-standby-animation-implementation-code/" class="link">developpaper.com</a>('dvd mode' code base)
<br> <i>Icon (favicon) by me, based on a random emote from "ppS" bttv search, made with random pixelArt online tool</i>
<br>
<br>
<b class="title">BASIC USAGE: </b>
<br>
<b class="subtitle">Connect:</b>
<br>
-> Type the twitch channel name in the top-right input field and click connect.
<br>
<br>
Emotes not changing/appearing or it's too slow/fast? <br>
-> Click on options and change 'minimal aount os mentions' and 'Zero the count...' to lower/higher numbers
<br>
<br>
<b class="subtitle">'DVD Mode'?</b>
<br>
-> Bounce the image on screen sides, just like the dvd logo, but with emotes
<br>
-> Click on options and mark the "DVD Stant-by bouncing" to enable
<br>
-> Mark "Don't clear canvas" to keep the path as the image moves
<br>
<br>
<b class="subtitle">Hotkeys</b>
<br>
-> Esc to close Update messsage card and options
<br>
-> 'o' to show/hide options
<br>
-> 'h' to show/hide connection info and message
<br>
-> 'c' to connect/disconnect
<br>
<i>you will be propted to comfirm disconnect</i>
</div>
</div>
<!-- Good News Everyone -->
<div class="whatsnew options" v-if="hasNews" :style="{display: optionsDisplay, 'z-index': '1'}">
<div class="op-header">
<l>Updated to version {{version.v}}!</l>
<button @click="saveLocal('whatsnewClosed', version.v)">X</button>
</div>
<div class="op-items">
<i>{{version.date}}</i>
<br>
<br>
<l class="title">{{version.title}}</l>
<br>
<br>
<b class="title">Changes</b>
<p v-for="infoLine of version.info">{{infoLine}}</p>
<!-- {{version.info}} -->
<br>
<br>
see more @ <a href="https://github.com/Gnitoon/ppShow/releases/" target="_blank" class="link">releases on github</a>
<br>
found a bug or want to send feedback? reach out and <a href="https://github.com/Gnitoon/ppShow/issues/" target="_blank" class="link">open an issue on github!</a>
</div>
</div>
</div>
</div>
<!-- connection info and last received message -->
<div class="msg-container">
<!-- show/hide button -->
<div class="show-hide-container"
@click="infoHidden = !infoHidden"
title="show/hide messages and connection info"
>
<l class="show-hide-btn">{{infoHidden ? "SHOW" : "HIDE"}}</l>
</div>
<div class="sub-cont" v-if="!infoHidden">
<!-- info -->
<div class="info">
<b :class="'stat-'+status">{{this.status}}</b>
<br>
<l>total: </l> <b>{{messageCount}}</b>
<br>
<l>emotes: </l> <b>{{emotes.keys.length}}</b>,
<!-- <a>top: </a><b>[{{emotes.count[emotes.top.code]}}] {{emotes.top.code}}</b> -->
<l>top: </l><b>{{emotes.top.code}}</b> <a v-show="options.debug">[{{emotes.top.count}}]</a>
</div>
<!-- last message -->
<div class="last-msg" v-if="lastMessage.user != ''" :style="lastMessage.style">
<a class="lm-user" :style="{
color: lastMessage.color,
'font-weight': 600
}"
>{{lastMessage.user}}</a>: <a>{{lastMessage.msg}}</a>
</div>
</div>
</div>
<!-- channel input, buttons and error message -->
<div>
<input
type="text"
v-model="options.channel"
@keypress.enter="connector"
@change="saveLocal('channel', $event.target.value)"
placeholder="channel"
:style="err.paintBorder ? {
'border-bottom': 'solid 2px ' + err.style.color,
'background-color': err.style['background-color']
} : {}"
>
<button @click="connector">{{status == 'connected' ? 'Disconnect' : 'Connect'}}</button>
<button @click="showOptions = !showOptions">options</button>
<br>
<a class="not-link err-text" v-if="err.type == 'user_err'" :style="err.style">{{err.msg}}</a>
<br>
<div class="combo" v-show="options.showCombo">
<div class="c-text-cont">
<b id="combo-value" :style="{
'font-size': '100%'
}">{{comboValue}}</b>
</div>
</div>
</div>
<!-- actual image, centered -->
<div id="img-container">
<img
v-if="!options.dvdStand"
:src="emoteImgSrc"
id="emoteIMG"
:alt="emotes.top.code || 'emote'"
:class="options.spin ? 'spinning' : ''"
:style="{
transform: 'scale('+ (+options.size.slice(0,1) + 1) +')',
'animation-duration': options.spinnTime + 'ms',
'-moz-animation-duration': options.spinnTime + 'ms',
'-webkit-animation-duration': options.spinnTime + 'ms',
}"
>
</div>
<!--
<br> tag is not the best to space i know,
but when you are tired or don't want to mess with css
is a pretty good way i guess
-->
</main>
<!-- <script src="index.js"></script> -->
<script>
app = new Vue({
// the element where Vue will do its job
el: '#app',
data:{
options: {
// you can set the channel here if dont want to use #<channel> in url or type
// when use the input box it will ask you if want to save on localStorage
// then also doesn't need to type again
channel: "",
// minimum amount of mentions to change emote image
// DOES NOT affect the actual emotes.top (most mentioned)
// -1 to always use top one
miMentions: -1,
// zero count for the emote if pass the specified amount of messages
// -1 to unlimited
msgTreshold: 10,
// ! IMPORTANT:
// both msgTheshold and miMentions affect how often they will appear on screen
// keeping low values (ex: -1 and 5) in both will make it change faster
// this will depend on chat speed, the ammount of messages and amount of
// messages that contain an emote (like 8 messages with emotes out of 10 total)
//
// for most cases a good number might be msgTheshold = 20 and miMentions = 5
// That is, zero the count every 20 messages and if have more than 5 mentions
// show it
// emote size (1, 2 or 3)
size: "2",
// make it bounce like dvd stand-by animation
dvdStand: false,
dvdspeedX:"0.7",
dvdspeedY:"0.7",
// multiplied by Math.rando() to add to speed,
// getting a less previsible path
spRngMultip: 0.4,
// do not clear canvas before redraw image, leaving the path
dirtyCanvas: false,
// auto connect afer page load
connectOnLoad: false,
// color theme (dark or light)
theme: "dark",
// save the last seen version number
whatsnewClosed: '1.0.0',
// the last time you changed a option
lastUpdated: Date.now(),
// enable keyboard shortcuts
enableHotkeys: true,
// show/hide combo
showCombo: false,
// spin
spin: false,
// spin duration (in ms/millisseconds)
spinnTime: 1000,
},
messageCount: 0,
messageCountTrs: 0,
showOptions: false,
infoHidden: false,
optionsDisplay: "none",
status: "disconnected",
comboValue: 0,
// emoteImgSrc: nothing,
// new version stuff
hasNews: false,
version: {
v: '1.0.1e',
date: '2022/Apr/28',
// just for the meme idk.
title: 'Quick, hide this before they arrive.',
// changes list/description
info: [
`+ Now you can hide this changelog popup and the little info thingie using URL Parameters`,
"____ Add '?hide=news,info#channel' to hide both without having to click anywhere! (PS. hiding news does not mark as viewed)",
"____ example: https://pp-show.vercel.app?hide=news#channel",
"+ Now is also possible to toggle autoConnect from URL!",
"____ to use just add ?autoConnect=true (or autoConnect=false) to URL to enable/disable",
"____ use autoConnect=true to enable",
"____ use autoConnect=false to disable",
"____ IMPORTANT: reload the page to take effect, then you don't need to have 'autoConnect=true' always",
"To use both do it like this: https://pp-show.vercel.app?hide=news&autoConnect=true#channel"
],
},
// enumerators
enums: {
themes: [
"dark",
"light"
],
sizes: [
"1",
"2",
"3",
"random"
],
},
// error messages
err:{
type: "",
msg: "",
paintBorder: "",
style:{
color: "",
}
},
blankErr: {},
// URLs used to get data about channel, emotes and image
apisURL:{
// @see FFZ-API-documentation https://www.frankerfacez.com/developers
ffz:{
// user to get badge data
user: "https://api.frankerfacez.com/v1/user/{channel}",
// user to get only channel data