Skip to content

Commit 33fac43

Browse files
committed
.
1 parent 29243f2 commit 33fac43

File tree

3 files changed

+47
-31
lines changed

3 files changed

+47
-31
lines changed

chat.html

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/simple-notify.min.css">
1414
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css">
1515

16-
<link rel="stylesheet" href="css/chatrd.css?nocache=7">
16+
<link rel="stylesheet" href="css/chatrd.css?nocache=8">
1717
</head>
1818
<body>
1919

@@ -47,7 +47,13 @@
4747

4848
<div class="message">
4949
<div class="first-message">✨ First-time Chatter</div>
50-
<div class="shared-chat"><span class="origin"><i class="fa-solid fa-comments"></i> <strong></strong></span></div>
50+
51+
<div class="shared-chat">
52+
<span class="origin">
53+
<img src="" alt="">
54+
<strong></strong>
55+
</span>
56+
</div>
5157

5258
<div class="header"></div>
5359

@@ -93,38 +99,38 @@
9399
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/purify.min.js"></script>
94100
<script src="https://cdn.jsdelivr.net/npm/@streamerbot/[email protected]/dist/streamerbot-client.min.js"></script>
95101

96-
<script src="js/speakerbot.js?nocache=7"></script>
97-
<script src="js/sb.js?nocache=7"></script>
98-
<script src="js/chatrd.js?nocache=7"></script>
102+
<script src="js/speakerbot.js?nocache=8"></script>
103+
<script src="js/sb.js?nocache=8"></script>
104+
<script src="js/chatrd.js?nocache=8"></script>
99105

100-
<link href="js/modules/twitch/module.css?nocache=7" rel="stylesheet">
101-
<script src="js/modules/twitch/module.js?nocache=7"></script>
106+
<link href="js/modules/twitch/module.css?nocache=8" rel="stylesheet">
107+
<script src="js/modules/twitch/module.js?nocache=8"></script>
102108

103-
<link href="js/modules/youtube/module.css?nocache=7" rel="stylesheet">
104-
<script src="js/modules/youtube/module.js?nocache=7"></script>
109+
<link href="js/modules/youtube/module.css?nocache=8" rel="stylesheet">
110+
<script src="js/modules/youtube/module.js?nocache=8"></script>
105111

106-
<link href="js/modules/tiktok/module.css?nocache=7" rel="stylesheet">
107-
<script src="js/modules/tiktok/module.js?nocache=7"></script>
112+
<link href="js/modules/tiktok/module.css?nocache=8" rel="stylesheet">
113+
<script src="js/modules/tiktok/module.js?nocache=8"></script>
108114

109-
<link href="js/modules/kick/module.css?nocache=7" rel="stylesheet">
110-
<script src="js/modules/kick/module.js?nocache=7"></script>
115+
<link href="js/modules/kick/module.css?nocache=8" rel="stylesheet">
116+
<script src="js/modules/kick/module.js?nocache=8"></script>
111117

112-
<link href="js/modules/streamelements/module.css?nocache=7" rel="stylesheet">
113-
<script src="js/modules/streamelements/module.js?nocache=7"></script>
118+
<link href="js/modules/streamelements/module.css?nocache=8" rel="stylesheet">
119+
<script src="js/modules/streamelements/module.js?nocache=8"></script>
114120

115-
<link href="js/modules/streamlabs/module.css?nocache=7" rel="stylesheet">
116-
<script src="js/modules/streamlabs/module.js?nocache=7"></script>
121+
<link href="js/modules/streamlabs/module.css?nocache=8" rel="stylesheet">
122+
<script src="js/modules/streamlabs/module.js?nocache=8"></script>
117123

118-
<link href="js/modules/patreon/module.css?nocache=7" rel="stylesheet">
119-
<script src="js/modules/patreon/module.js?nocache=7"></script>
124+
<link href="js/modules/patreon/module.css?nocache=8" rel="stylesheet">
125+
<script src="js/modules/patreon/module.js?nocache=8"></script>
120126

121-
<link href="js/modules/tipeeestream/module.css?nocache=7" rel="stylesheet">
122-
<script src="js/modules/tipeeestream/module.js?nocache=7"></script>
127+
<link href="js/modules/tipeeestream/module.css?nocache=8" rel="stylesheet">
128+
<script src="js/modules/tipeeestream/module.js?nocache=8"></script>
123129

124-
<link href="js/modules/kofi/module.css?nocache=7" rel="stylesheet">
125-
<script src="js/modules/kofi/module.js?nocache=7"></script>
130+
<link href="js/modules/kofi/module.css?nocache=8" rel="stylesheet">
131+
<script src="js/modules/kofi/module.js?nocache=8"></script>
126132

127-
<link href="js/modules/fourthwall/module.css?nocache=7" rel="stylesheet">
128-
<script src="js/modules/fourthwall/module.js?nocache=7"></script>
133+
<link href="js/modules/fourthwall/module.css?nocache=8" rel="stylesheet">
134+
<script src="js/modules/fourthwall/module.js?nocache=8"></script>
129135
</body>
130136
</html>

css/chatrd.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,12 @@ body {
173173
margin: 0 5px;
174174
}
175175

176-
#chat .item .shared-chat {
177-
margin-bottom: 5px;
178-
}
179176
#chat .item .shared-chat span.origin {
180177
display: inline-flex;
181178
align-items: center;
182179
background: rgba(255,255,255,0.1);
183-
padding: 0px 10px;
180+
padding: 2px 8px;
181+
margin: 0 3px;
184182
border-radius: 5px;
185183
font-weight: bold;
186184
font-size: 14px;
@@ -332,6 +330,7 @@ body {
332330
margin-bottom: -5px;
333331
}
334332

333+
335334
#chat.horizontal .item .first-message,
336335
#chat.horizontal .item .shared-chat,
337336
#chat.horizontal .item .header,
@@ -341,6 +340,10 @@ body {
341340
transform: translateY(-5px);
342341
}
343342

343+
#chat.horizontal .item .shared-chat {
344+
transform: translateY(-2px);
345+
}
346+
344347
#chat.horizontal .item .reply {
345348
display: inline-block;
346349
max-width: 300px;
@@ -430,6 +433,11 @@ body {
430433
margin-bottom: -5px;
431434
}
432435

436+
437+
#chat.oneline .item .shared-chat {
438+
margin-bottom: -8px;
439+
}
440+
433441
#chat.oneline .item .first-message,
434442
#chat.oneline .item .info,
435443
#chat.oneline .item .actual-message {

js/modules/twitch/module.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ async function twitchChatMessage(data) {
171171

172172
if (data.user.role == 4) { classes.push('streamer'); }
173173

174-
175174
if (data.message.firstMessage) {
176175
classes.push('first-chatter');
177176
}
@@ -214,7 +213,10 @@ async function twitchChatMessage(data) {
214213
classes.push('shared-chat');
215214

216215
if (!data.sharedChat.primarySource) {
217-
sharedChat.querySelector('span.origin').insertAdjacentHTML('beforeend', ` <strong>${escapeHTML(data.sharedChat.sourceRoom.name)}</strong>`);
216+
let sharedStreamer = data.sharedChat.sourceRoom.name;
217+
let sharedStreamerAvatar = await getTwitchAvatar( sharedStreamer.toLowerCase() );
218+
sharedChat.querySelector('span.origin img').src = sharedStreamerAvatar;
219+
sharedChat.querySelector('span.origin strong').textContent = data.sharedChat.sourceRoom.name;
218220
}
219221
}
220222
else if (!data.sharedChat.primarySource && showTwitchSharedChat == false) {

0 commit comments

Comments
 (0)