mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added furry mode lmao
This commit is contained in:
@@ -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('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////
|
||||
|
||||
@@ -239,6 +239,14 @@
|
||||
"defaultValue": true,
|
||||
"group": "Which donation messages do you want to see?"
|
||||
},
|
||||
{
|
||||
"id": "furryMode",
|
||||
"label": "Furry Mode",
|
||||
"description": "Meow",
|
||||
"type": "checkbox",
|
||||
"defaultValue": false,
|
||||
"group": "Very Important Stuff"
|
||||
},
|
||||
{
|
||||
"id": "address",
|
||||
"label": "Address",
|
||||
|
||||
@@ -50,6 +50,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`;
|
||||
@@ -338,10 +340,14 @@ async function TwitchChatMessage(data) {
|
||||
}
|
||||
|
||||
// Set the message data
|
||||
const message = data.message.message;
|
||||
let message = data.message.message;
|
||||
const messageColor = data.message.color;
|
||||
const role = data.message.role;
|
||||
|
||||
// Set furry mode
|
||||
if (furryMode)
|
||||
message = TranslateToFurry(message);
|
||||
|
||||
// Set message text
|
||||
if (showMessage) {
|
||||
messageDiv.innerText = message;
|
||||
@@ -880,6 +886,10 @@ function YouTubeMessage(data) {
|
||||
messageDiv.innerText = data.message;
|
||||
}
|
||||
|
||||
// Set furry mode
|
||||
if (furryMode)
|
||||
messageDiv.innerText = TranslateToFurry(data.message);
|
||||
|
||||
|
||||
// Render platform
|
||||
if (showPlatform) {
|
||||
@@ -1890,6 +1900,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('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////
|
||||
|
||||
@@ -301,6 +301,14 @@
|
||||
"defaultValue": true,
|
||||
"group": "Which donation messages do you want to see?"
|
||||
},
|
||||
{
|
||||
"id": "furryMode",
|
||||
"label": "Furry Mode",
|
||||
"description": "Meow",
|
||||
"type": "checkbox",
|
||||
"defaultValue": false,
|
||||
"group": "Very Important Stuff"
|
||||
},
|
||||
{
|
||||
"id": "address",
|
||||
"label": "Address",
|
||||
|
||||
Reference in New Issue
Block a user