Timothy Jaeryang Baek 1 月之前
父節點
當前提交
d8eade736f
共有 1 個文件被更改,包括 5 次插入6 次删除
  1. 5 6
      src/lib/components/layout/Navbar/Menu.svelte

+ 5 - 6
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');
 
-				// Define a fixed virtual screen size
-				const virtualWidth = 1024; // Fixed width (adjust as needed)
-				const virtualHeight = 1400; // Fixed height (adjust as needed)
+				console.log('isDarkMode', isDarkMode);
 
+				// Define a fixed virtual screen size
+				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