Add files via upload

- Added newer events in new languages
- Added a Background Color Picker
- Added a Background Color Opacity Slider
This commit is contained in:
Rodrigo Emanuel
2025-05-17 16:20:56 -03:00
committed by GitHub
parent 3f2ddde6ee
commit 4b5444c2ee
9 changed files with 192 additions and 7 deletions

View File

@@ -13,6 +13,8 @@ const chatThreshhold = 50;
const chatContainer = document.querySelector('#chat');
const chatFontSize = getURLParam("chatFontSize", 1);
const chatBackground = getURLParam("chatBackground", "#121212");
const chatBackgroundOpacity = getURLParam("chatBackgroundOpacity", 1);
const currentLang = lang[getURLParam("language", 'ptbr')];
const eventsMockup = getURLParam("eventsMockup", true);
@@ -37,6 +39,8 @@ chatContainer.style.zoom = chatFontSize;
/* START */
/* ----------------------- */
document.body.style.backgroundColor = hexToRGBA(chatBackground,chatBackgroundOpacity);
if (showPlatformStatistics == false) { document.querySelector('#statistics').style.display = 'none'; }
if (chatHorizontal == true) { chatContainer.classList.add('horizontal'); }
@@ -349,4 +353,17 @@ async function cleanStringOfHTMLButEmotes(string) {
function stripStringFromHtml(html) {
let doc = new DOMParser().parseFromString(html, 'text/html');
return doc.body.textContent || "";
}
function hexToRGBA(hexadecimal,opacity) {
const hex = hexadecimal;
const alpha = parseFloat(opacity);
// Converter hex para RGB
const r = parseInt(hex.substr(1, 2), 16);
const g = parseInt(hex.substr(3, 2), 16);
const b = parseInt(hex.substr(5, 2), 16);
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}