Added furry mode lmao

This commit is contained in:
nuttylmao
2025-03-30 11:02:20 +11:00
parent f8c722a510
commit 2647afd6e5
4 changed files with 116 additions and 2 deletions
+50 -1
View File
@@ -51,6 +51,8 @@ const showKofiDonations = GetBooleanParam("showKofiDonations", true);
const showTipeeeStreamDonations = GetBooleanParam("showTipeeeStreamDonations", true);
const showFourthwallAlerts = GetBooleanParam("showFourthwallAlerts", true);
const furryMode = GetBooleanParam("furryMode", false);
// Set fonts for the widget
document.body.style.fontFamily = font;
document.body.style.fontSize = `${fontSize}px`;
@@ -303,9 +305,13 @@ async function TwitchChatMessage(data) {
}
// Set the message data
const message = data.message.message;
let message = data.message.message;
const messageColor = data.message.color;
// Set furry mode
if (furryMode)
message = TranslateToFurry(message);
// Set message text
if (showMessage) {
messageDiv.innerText = message;
@@ -598,6 +604,10 @@ function YouTubeMessage(data) {
messageDiv.innerText = data.message;
}
// Set furry mode
if (furryMode)
messageDiv.innerText = TranslateToFurry(data.message);
// Render platform
if (showPlatform) {
const platformElements = `<img src="icons/platforms/youtube.png" class="platform"/>`;
@@ -1182,6 +1192,45 @@ function GetWinnersList(gifts) {
}
}
function TranslateToFurry(sentence) {
const words = sentence.toLowerCase().split(/\b/);
const furryWords = words.map(word => {
if (/\w+/.test(word)) {
let newWord = word;
// Common substitutions
newWord = newWord.replace(/l/g, 'w');
newWord = newWord.replace(/r/g, 'w');
newWord = newWord.replace(/th/g, 'f');
newWord = newWord.replace(/you/g, 'yous');
newWord = newWord.replace(/my/g, 'mah');
newWord = newWord.replace(/me/g, 'meh');
newWord = newWord.replace(/am/g, 'am');
newWord = newWord.replace(/is/g, 'is');
newWord = newWord.replace(/are/g, 'are');
newWord = newWord.replace(/very/g, 'vewy');
newWord = newWord.replace(/pretty/g, 'pwetty');
newWord = newWord.replace(/little/g, 'wittle');
newWord = newWord.replace(/nice/g, 'nyce');
// Random additions
if (Math.random() < 0.15) {
newWord += ' nya~';
} else if (Math.random() < 0.1) {
newWord += ' >w<';
} else if (Math.random() < 0.05) {
newWord += ' owo';
}
return newWord;
}
return word;
});
return furryWords.join('');
}
///////////////////////////////////