From d8eade736f3d0fbe7e3caa9e932f3917851cb270 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 15 Mar 2025 18:23:40 +0000 Subject: [PATCH] refac --- src/lib/components/layout/Navbar/Menu.svelte | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/components/layout/Navbar/Menu.svelte b/src/lib/components/layout/Navbar/Menu.svelte index 322419159..1f0c612a6 100644 --- a/src/lib/components/layout/Navbar/Menu.svelte +++ b/src/lib/components/layout/Navbar/Menu.svelte @@ -66,12 +66,12 @@ if (containerElement) { 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 - const virtualWidth = 1024; // Fixed width (adjust as needed) - const virtualHeight = 1400; // Fixed height (adjust as needed) - + const virtualWidth = 800; // Fixed width (adjust as needed) // Clone the container to avoid layout shifts const clonedElement = containerElement.cloneNode(true); clonedElement.style.width = `${virtualWidth}px`; // Apply fixed width @@ -85,8 +85,7 @@ useCORS: true, scale: 2, // Keep at 1x to avoid unexpected enlargements width: virtualWidth, // Set fixed virtual screen width - windowWidth: virtualWidth, // Ensure consistent rendering - windowHeight: virtualHeight + windowWidth: virtualWidth // Ensure consistent rendering }); document.body.removeChild(clonedElement); // Clean up temp element