-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtchat.html
More file actions
460 lines (391 loc) · 13.4 KB
/
tchat.html
File metadata and controls
460 lines (391 loc) · 13.4 KB
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
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<meta name=application-name content="tChat – Chat overlay for Twitch">
<meta name=author content=crazysmc>
<meta name=description
content="Twitch chat overlay with all emotes and pronouns support">
<meta name=keywords
content=twitch,shared,chat,stream,overlay,7tv,bttv,ffz,betterttv,frankerfacez,pronouns,alejo,emotes,effects,badges,paints
>
<meta name=viewport content="width=device-width">
<meta name=robots content=index>
<title>crazysmc – tChat – Chat overlay for Twitch</title>
<base target=_blank>
<link rel=stylesheet href=tchat/style.css>
<link rel=stylesheet href=tchat.css>
<script src=tchat.js></script>
<h1>tChat – Twitch chat overlay for OBS or browser</h1>
<aside style=margin-bottom:1em>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[broadcaster/1]
src=https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1
><!--
--><img alt=[ghlf-pledge/1]
src=https://static-cdn.jtvnw.net/badges/v1/3158e758-3cb4-43c5-94b3-7639810451c5/1
><!--
--><span class=pronouns>He/Him</span>
</span>
<span class=nick style=color:springgreen>crazysmc</span>
<span class=message>this is a chat message</span>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[broadcaster/1]
src=https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1
><!--
--><img alt=[ghlf-pledge/1]
src=https://static-cdn.jtvnw.net/badges/v1/3158e758-3cb4-43c5-94b3-7639810451c5/1
><!--
--><span class=pronouns>He/Him</span>
</span>
<span class=nick style=color:springgreen>crazysmc</span>
<span class=message>
this is a longer message containing emotes like
<img alt=:3
class="7tv room"
src=https://cdn.7tv.app/emote/01FT7DPW68000C2JH1E2C62PK2/1x.avif>
and
<img alt=meow
class="7tv room"
src=https://cdn.7tv.app/emote/01F6NCKMP000052X5637DW2XDY/1x.avif>
which will make these bots answer as well
</span>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[moderator/1]
class=api-bot
src=https://static-cdn.jtvnw.net/badges/v1/3267646d-33f0-4b17-b3df-f923a41db1d0/1
><!--
--><img alt=[ffz/4]
src=https://cdn.frankerfacez.com/badge/4/1/rounded>
</span>
<span class=nick style=color:#1976d2>Fossabot</span>
<span class=message>
<img alt=meow
class="7tv room"
src=https://cdn.7tv.app/emote/01F6NCKMP000052X5637DW2XDY/1x.avif>
</span>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[moderator/1]
class=api-bot
src=https://static-cdn.jtvnw.net/badges/v1/3267646d-33f0-4b17-b3df-f923a41db1d0/1
><!--
--><img alt=[ffz/4]
src=https://cdn.frankerfacez.com/badge/4/1/rounded>
</span>
<span class=nick style=color:#7c7ce1>Nightbot</span>
<span class=message>
<img alt=meow
class="7tv room"
src=https://cdn.7tv.app/emote/01F6NCKMP000052X5637DW2XDY/1x.avif>
</span>
<p class="chat-line USERNOTICE">
<span class=badges>
<img alt=[broadcaster/1]
src=https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1
><!--
--><img alt=[ghlf-pledge/1]
src=https://static-cdn.jtvnw.net/badges/v1/3158e758-3cb4-43c5-94b3-7639810451c5/1
><!--
--><span class=pronouns>He/Him</span>
</span>
<span class=nick style=color:springgreen>crazysmc</span>
<span class=message>this is an announcement</span>
<p class="chat-line emote-notice">
<span class=nick>crazysmc</span>
<span class=message>added emote otag.</span>
<p class="chat-line PRIVMSG" data-first-msg=1>
<span class=nick>FirstTimeChatter</span>
<span class=message>
yo bro kinda different question but can you please explain me how do
people fill a chest with shulker boxes and when they put a hopper to the
chest it starts filling the shulkers that are inside
</span>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[broadcaster/1]
src=https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1
><!--
--><img alt=[ghlf-pledge/1]
src=https://static-cdn.jtvnw.net/badges/v1/3158e758-3cb4-43c5-94b3-7639810451c5/1
><!--
--><span class=pronouns>He/Him</span>
</span>
<span class=nick style=color:springgreen>crazysmc</span>
<span class=reply>
<i>
this is a longer message containing emotes like :3 and meow which will
make these bots answer as well
</i>
<span class=message>
<span class="nick at" style=color:springgreen>@crazysmc</span>
this is a reply to myself
</span>
</span>
</aside>
<p>Highly customisable chat reader with support for
<ul>
<li><a href=https://pr.alejo.io/><strong>Pronouns</strong>.Alejo.io</a>;
<li><a href=https://betterttv.com/>BetterTTV</a>
emotes, badges, glow and live updates;
<li><a href=https://www.frankerfacez.com/>FrankerFaceZ</a>
emotes and badges;
as well as
<li><a href=https://7tv.app/>7TV</a>
emotes, badges, name paints and live updates.
</ul>
<p>This also includes <strong>emote effects</strong> like
<q>w! meow →
<img alt=meow
style=height:32px;width:64px
src=https://cdn.7tv.app/emote/01F6NCKMP000052X5637DW2XDY/1x.avif></q>
or
<q>meow ffzX →
<img alt=meow
class=flip-x
src=https://cdn.7tv.app/emote/01F6NCKMP000052X5637DW2XDY/1x.avif></q>.
<p>Mod actions like deleting a message or clearing the chat are actioned as
soon as possible.
<strong>Announcements and sub messages</strong> are highlighted by default.
<p>First time chats are also highlighted as this information is publicly
available and many chat extensions and clients will show this.
(see Options below if you want to disable this)
<p><strong>Shared chat</strong> uses the badges and emotes from the respective
source channel of each message.
The source channel is indicated by default via channel avatar icons, using
animated ones if enabled in 7TV.
You can also join several channels simultaneously and get a combined view.
<p>Moderators can force reload the channel emotes by sending
<q>!tchat reload</q> followed by <q>bttv</q>, <q>ffz</q> and/or <q>7tv</q>,
just in case the live updates failed.
<p>Thanks to <a href=https://github.com/jdecked/twemoji>Twemoji</a> for the
text emoji to image conversion (emoji are treated like emotes now with regards
to effects).
<p>tChat runs without a backend, fully in Javascript.
<a href=https://github.com/crazysmc/crazysmc.github.io/tree/master/tchat
>Open source</a>.
<hr>
<h2>Options</h2>
<form name=tchat>
<fieldset id=main-params>
<legend>Main Parameters</legend>
<p>
<input id=join name=join size=40 placeholder=twitch_user>
<label for=join>Channel(s) to join</label>
<p>
<input id=time name=time type=number min=0 value=120 style=width:5em>
<label for=time>
Seconds to display each message (infinite if unset)
</label>
</fieldset>
<fieldset>
<legend>Image Options</legend>
<p>
<select id=scale name=scale>
<option value=1>1x (1.0)</option>
<option value=2>2x (2.0)</option>
<option value=3>4x (3.0)</option>
</select>
<label for=scale>
Size of the emotes and badges to load (the font size scales accordingly)
</label>
<p>
<input id=static name=static type=checkbox>
<label for=static>
Replace animated emotes, badges and paints with static ones
</label>
</fieldset>
<fieldset>
<legend>Optional Predefined Styles</legend>
<aside id=test>
<p class="chat-line emote-notice">
<span class=nick>style options</span>
<span class=message>preview</span>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[broadcaster/1]
src=https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1
><!--
--><img alt=[ghlf-pledge/1]
src=https://static-cdn.jtvnw.net/badges/v1/3158e758-3cb4-43c5-94b3-7639810451c5/1
><!--
--><span class=pronouns>He/Him</span>
</span>
<span class=nick style=color:springgreen>crazysmc</span>
<span class=reply>
<i>
this is a longer message containing emotes like :3 and meow which
will make these bots answer as well
</i>
<span class=message>
<span class="nick at" style=color:springgreen>@crazysmc</span>
this is a reply to myself
</span>
</span>
<p class="chat-line PRIVMSG">
<span class=badges>
<img alt=[moderator/1]
class=api-bot
src=https://static-cdn.jtvnw.net/badges/v1/3267646d-33f0-4b17-b3df-f923a41db1d0/1
><!--
--><img alt=[ffz/4]
src=https://cdn.frankerfacez.com/badge/4/1/rounded>
</span>
<span class=nick style=color:#7c7ce1>Nightbot</span>
<span class=message>
<img alt=meow
class="7tv room"
src=https://cdn.7tv.app/emote/01F6NCKMP000052X5637DW2XDY/1x.avif>
</span>
<p class="chat-line PRIVMSG" data-first-msg=1>
<span class=nick>FirstTimeChatter</span>
<span class=message>
yo bro kinda different question but can you please explain me how do
people fill a chest with shulker boxes
</span>
</aside>
<p>
<input id=colon name=colon type=checkbox checked>
<label for=colon>
Add a colon after regular chat messages that are not a /me action
</label>
<p>
<input id=first name=first type=checkbox checked>
<label for=first>
Highlight first time chats
</label>
<p>
<input id=bots name=bots type=checkbox>
<label for=bots>
Hide messages from bots
(according to the bot badge from FrankerFaceZ and Twitch chatbot badge)
</label>
<p>
<input id=wrap name=wrap type=checkbox checked>
<label for=wrap>
Force the message to wrap all the way, even in wide viewports.
(Removes the hanging indent from long messages, especially useful with long
user names in narrow spaces.)
</label>
<p>
<input id=bold name=bold type=checkbox>
<label for=bold>
Higher font weights (regular → semibold, bold → heavy)
</label>
</fieldset>
<fieldset>
<legend>Extra Features …</legend>
<p>
<input id=bans name=bans type=checkbox>
<label for=bans>
Show a notice when someone was banned/timed out (messages are still deleted
from the chat)
</label>
<p>
<input id=chatters name=chatters type=checkbox>
<label for=chatters>
Show chatters joining and parting from chat (not received in chats with more
than 1,000 chatters)
</label>
<p>
<input id=rm name=rm type=checkbox>
<label for=rm>
Load recent messages and keep the chat history.
This is not useful as an overlay but a nice way to scroll chat history in
browser using
<a href=https://recent-messages.robotty.de/>recent-messages.robotty.de</a>.
</label>
</fieldset>
<fieldset>
<legend>Disable Cool Features?</legend>
<p>
<input id=noPronouns name=noPronouns type=checkbox>
<label for=noPronouns>
Disable Pronouns.Alejo.io
</label>
<p>
<input id=noBttv name=noBttv type=checkbox>
<label for=noBttv>
Disable BetterTTV
</label>
<p>
<input id=noFfz name=noFfz type=checkbox>
<label for=noFfz>
Disable FrankerFaceZ
</label>
<p>
<input id=no7tv name=no7tv type=checkbox>
<label for=no7tv>
Disable 7TV
</label>
</fieldset>
<p>
<input name=copy type=submit value="Copy to clipboard">
<output name=url></output>
</form>
<p>When adding the browser source to OBS, make sure to use the width and
height values in the properties to resize the source.
Dragging the edges of the box will distort the browser content.
<hr>
<h2>Custom Styles</h2>
<p>The structure of the document generated by the chat overlay should allow
for great customisability using added CSS snippets.
<p>Adding a new browser source in OBS will give you a <strong>default</strong>
CSS that looks like this:
<blockquote><code>
body {
background-color: rgba(0, 0, 0, 0);
margin: 0px auto;
overflow: hidden; }
</code></blockquote>
<p>This will make the overlay transparent and make sure it has no scrollbars.
<p>You can <strong>add</strong> more CSS rules to this; here are some
examples.
Just pick the one you want and append them in the Custom CSS option.
(To make the textbox bigger, you can drag the divider below the preview at the
top upwards.)
<ol>
<li>Change the font of the page, for example to a system local font
<blockquote><code>
body { font-family: 'Comic Sans MS', cursive; }
</code></blockquote>
or to a monospace one
(@import rules have to be at the top, others can be arranged freely)
<blockquote><code>
@import
url('https://fonts.googleapis.com/css2?<!--
-->family=Roboto+Mono:ital,wght@0,100..700;1,100..700&<!--
-->display=swap');<br>
<br>
body { font-family: 'Roboto Mono', monospace; }
</code></blockquote>
<li>Hide messages by their text content, for example hide commands starting
with an exclamation mark
<blockquote><code>
.chat-line[data-text^="!"] { display: none; }
</code></blockquote>
<aside>
<img alt=[vip/1]
src=https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/1
>
<img alt=[purple-pixel-heart---together-for-good-24/1]
src=https://static-cdn.jtvnw.net/badges/v1/1afb4b76-8c34-4b7b-8beb-75f7e5d2a1ab/1
>
<span>→</span>
<img alt=[vip/1]
src=https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/1
>
<img alt=[purple-pixel-heart---together-for-good-24/1]
style=filter:grayscale(.3)
src=https://static-cdn.jtvnw.net/badges/v1/1afb4b76-8c34-4b7b-8beb-75f7e5d2a1ab/1
>
</aside>
<li>Make the Purple Pixel Heart badge less similar to a VIP badge
<blockquote><code>
img[alt="[purple-pixel-heart---together-for-good-24/1]"]
{ filter: grayscale(.3); }
</code></blockquote>
<hr>
</ol>