FIX_CHAT_BG_IMG

This commit is contained in:
velz 2025-08-16 18:54:10 +05:30
parent b58b9d420c
commit 880a04a3cf

View File

@ -210,13 +210,20 @@ function setupMessageObserver() {
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" preserveAspectRatio="none"><rect width="1" height="1" fill="#ffffff"/></svg>`;
const uri = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
// ✅ Change iframe body background here
doc.body.style.background = `url("${uri}") repeat center center fixed`;
// doc.body.style.background = "url('https://venbait.in/nhance/app/dev/assets/chat-bg.jpg')";
// doc.body.style.background = "cover";
doc.body.style.backgroundSize = "auto";
doc.documentElement.style.backgroundColor = '#ffffff';
// doc.body.style.background = `url("${uri}") repeat center center fixed`;
// // doc.body.style.background = "url('https://venbait.in/nhance/app/dev/assets/chat-bg.jpg')";
// // doc.body.style.background = "cover";
// doc.body.style.backgroundSize = "auto";
// doc.documentElement.style.backgroundColor = '#ffffff';
// doc.body.style.margin = "0"; // optional
doc.documentElement.style.backgroundImage = "none";
doc.body.style.backgroundImage = "none";
// Optionally set plain white background
doc.documentElement.style.backgroundColor = "#ffffff";
doc.body.style.backgroundColor = "transparent";
// Wait for the document to be ready
const waitForElement = () => {
@ -255,9 +262,9 @@ function setupMessageObserver() {
const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat");
chatElements.forEach(element => {
if (element) {
element.style.setProperty("height", 85 + "vh", "important");
element.style.setProperty("max-height", 85 + "vh", "important");
element.style.setProperty("min-height", 85 + "vh", "important");
element.style.setProperty("height", 95 + "vh", "important");
element.style.setProperty("max-height", 95 + "vh", "important");
element.style.setProperty("min-height", 95 + "vh", "important");
element.style.setProperty("transition", "height 0.3s ease", "important");
console.log('Direct style applied to:', element);
}
@ -410,9 +417,9 @@ function setupMessageObserver() {
const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat");
chatElements.forEach(element => {
if (element) {
element.style.setProperty("height", 85 + "vh", "important");
element.style.setProperty("max-height", 85 + "vh", "important");
element.style.setProperty("min-height", 85 + "vh", "important");
element.style.setProperty("height", 95 + "vh", "important");
element.style.setProperty("max-height", 95 + "vh", "important");
element.style.setProperty("min-height", 95 + "vh", "important");
}
});