fix: 黑暗模式的启动页是白色的 #118

close #118
This commit is contained in:
kangfenmao 2024-10-12 13:33:42 +08:00
parent ff5de3625e
commit 9baf0f772e
2 changed files with 42 additions and 35 deletions

View File

@ -16,6 +16,8 @@ export function createMainWindow() {
const theme = appConfig.get('theme') || 'light'
// Create the browser window.
const isMac = process.platform === 'darwin'
const mainWindow = new BrowserWindow({
x: mainWindowState.x,
y: mainWindowState.y,
@ -25,11 +27,12 @@ export function createMainWindow() {
minHeight: 600,
show: true,
autoHideMenuBar: true,
transparent: process.platform === 'darwin',
transparent: isMac,
vibrancy: 'fullscreen-ui',
visualEffectState: 'active',
titleBarStyle: 'hidden',
titleBarOverlay: theme === 'dark' ? titleBarOverlayDark : titleBarOverlayLight,
backgroundColor: isMac ? undefined : theme === 'dark' ? '#181818' : '#FFFFFF',
trafficLightPosition: { x: 8, y: 12 },
...(process.platform === 'linux' ? { icon } : {}),
webPreferences: {

View File

@ -1,16 +1,17 @@
<!doctype html>
<html lang="zh-CN">
<head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<meta
http-equiv="Content-Security-Policy"
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; connect-src *; script-src 'self' *; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' *; font-src 'self' data: *; img-src 'self' data: file: *; frame-src * file:" />
<style>
html,
body {
margin: 0;
}
#spinner {
position: fixed;
width: 100vw;
@ -19,18 +20,21 @@
flex-direction: row;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.5);
}
#spinner img {
width: 100px;
border-radius: 50px;
}
</style>
</head>
<body>
</head>
<body>
<div id="root"></div>
<div id="spinner">
<img src="/src/assets/images/logo/cherry-text.svg" />
<img src="/src/assets/images/logo.png" />
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</body>
</html>