Add files via upload
Horizontal Chat Glitch Fix
This commit is contained in:
11
css/app.css
11
css/app.css
@@ -462,11 +462,14 @@ body {
|
|||||||
|
|
||||||
|
|
||||||
#chat.horizontal {
|
#chat.horizontal {
|
||||||
display: flex;
|
position: absolute;
|
||||||
align-items: flex-end;
|
|
||||||
width: max-content;
|
|
||||||
right: 0;
|
right: 0;
|
||||||
gap: 15px;
|
bottom: 0;
|
||||||
|
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
align-items: flex-end;
|
||||||
|
gap: 10px;
|
||||||
|
width: max-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ const mockData = {
|
|||||||
"This game brings back memories",
|
"This game brings back memories",
|
||||||
"Why is this so intense omg",
|
"Why is this so intense omg",
|
||||||
|
|
||||||
"Chat, what’s your favorite snack?",
|
"Chat, what's your favorite snack?",
|
||||||
"That edit was slick",
|
"That edit was slick",
|
||||||
"Mobile gang where you at?",
|
"Mobile gang where you at?",
|
||||||
"Sheeesh 🥶",
|
"Sheeesh 🥶",
|
||||||
@@ -208,6 +208,10 @@ function generateMockEvent() {
|
|||||||
'youtube-chat', 'youtube-chat', 'youtube-chat', 'youtube-chat', 'youtube-chat',
|
'youtube-chat', 'youtube-chat', 'youtube-chat', 'youtube-chat', 'youtube-chat',
|
||||||
'youtube-superchat', 'youtube-supersticker', 'youtube-newsponsor', 'youtube-membermilestone', 'youtube-membergift',
|
'youtube-superchat', 'youtube-supersticker', 'youtube-newsponsor', 'youtube-membermilestone', 'youtube-membergift',
|
||||||
|
|
||||||
|
'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone', 'youtube-membermilestone',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat',
|
'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat',
|
||||||
'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat',
|
'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat', 'tiktok-chat',
|
||||||
'tiktok-follow', 'tiktok-sub', 'tiktok-gift',
|
'tiktok-follow', 'tiktok-sub', 'tiktok-gift',
|
||||||
@@ -471,8 +475,6 @@ function generateMockEvent() {
|
|||||||
message : messagetext
|
message : messagetext
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('superchat', data.amount);
|
|
||||||
|
|
||||||
youTubeSuperChatMessage(data);
|
youTubeSuperChatMessage(data);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@@ -263,7 +263,7 @@ async function twitchAnnouncementMessage(data) {
|
|||||||
|
|
||||||
|
|
||||||
data.message = {
|
data.message = {
|
||||||
message: await getTwitchEmotesOnParts(data)
|
message: await getTwitchAnnouncementEmotes(data)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ async function getTwitchEmotes(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*async function getTwitchAnnouncementEmotes(data) {
|
async function getTwitchAnnouncementEmotes(data) {
|
||||||
const message = data.text;
|
const message = data.text;
|
||||||
const emotes = data.parts;
|
const emotes = data.parts;
|
||||||
const words = message.split(" ");
|
const words = message.split(" ");
|
||||||
@@ -560,18 +560,19 @@ async function getTwitchEmotes(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return words.join(" ");
|
return words.join(" ");
|
||||||
}*/
|
}
|
||||||
|
|
||||||
async function getTwitchEmotesOnParts(data) {
|
async function getTwitchEmotesOnParts(data) {
|
||||||
const parts = data?.parts;
|
const parts = data?.parts;
|
||||||
|
const message = data.text;
|
||||||
|
|
||||||
if (!Array.isArray(parts)) {
|
if (!Array.isArray(parts)) {
|
||||||
return data.text;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
return parts.map(part => {
|
return parts.map(part => {
|
||||||
if (part.type === 'text') {
|
if (part.type === 'text') {
|
||||||
return part.text;
|
return message;
|
||||||
} else if (part.type === 'emote') {
|
} else if (part.type === 'emote') {
|
||||||
return `<img src="${part.imageUrl}" alt="${part.text}" class="emote">`;
|
return `<img src="${part.imageUrl}" alt="${part.text}" class="emote">`;
|
||||||
}
|
}
|
||||||
|
@@ -224,7 +224,11 @@ async function youTubeNewSponsorMessage(data) {
|
|||||||
message: messagetext,
|
message: messagetext,
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
var messagewithemotes = await getYouTubeEmotes(messagetext);
|
var messagewithemotes = '';
|
||||||
|
|
||||||
|
if (messagetext) {
|
||||||
|
messagewithemotes = await getYouTubeEmotes(messagetext);
|
||||||
|
}
|
||||||
|
|
||||||
const [avatar, message] = await Promise.all([
|
const [avatar, message] = await Promise.all([
|
||||||
``,
|
``,
|
||||||
|
Reference in New Issue
Block a user