mirror of
https://github.com/open-webui/open-webui
synced 2025-05-29 01:32:27 +00:00
refac
This commit is contained in:
parent
b6e56c0e5a
commit
d8eade736f
@ -66,12 +66,12 @@
|
|||||||
|
|
||||||
if (containerElement) {
|
if (containerElement) {
|
||||||
try {
|
try {
|
||||||
const isDarkMode = $theme.includes('dark'); // Check theme mode
|
const isDarkMode = document.documentElement.classList.contains('dark');
|
||||||
|
|
||||||
|
console.log('isDarkMode', isDarkMode);
|
||||||
|
|
||||||
// Define a fixed virtual screen size
|
// Define a fixed virtual screen size
|
||||||
const virtualWidth = 1024; // Fixed width (adjust as needed)
|
const virtualWidth = 800; // Fixed width (adjust as needed)
|
||||||
const virtualHeight = 1400; // Fixed height (adjust as needed)
|
|
||||||
|
|
||||||
// Clone the container to avoid layout shifts
|
// Clone the container to avoid layout shifts
|
||||||
const clonedElement = containerElement.cloneNode(true);
|
const clonedElement = containerElement.cloneNode(true);
|
||||||
clonedElement.style.width = `${virtualWidth}px`; // Apply fixed width
|
clonedElement.style.width = `${virtualWidth}px`; // Apply fixed width
|
||||||
@ -85,8 +85,7 @@
|
|||||||
useCORS: true,
|
useCORS: true,
|
||||||
scale: 2, // Keep at 1x to avoid unexpected enlargements
|
scale: 2, // Keep at 1x to avoid unexpected enlargements
|
||||||
width: virtualWidth, // Set fixed virtual screen width
|
width: virtualWidth, // Set fixed virtual screen width
|
||||||
windowWidth: virtualWidth, // Ensure consistent rendering
|
windowWidth: virtualWidth // Ensure consistent rendering
|
||||||
windowHeight: virtualHeight
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.body.removeChild(clonedElement); // Clean up temp element
|
document.body.removeChild(clonedElement); // Clean up temp element
|
||||||
|
Loading…
Reference in New Issue
Block a user