feat: enhance splash screen with dynamic theme support and improved styling

This commit is contained in:
Jason
2026-05-10 22:29:39 +08:00
parent 796515d3e8
commit b6b930ebb9
2 changed files with 343 additions and 198 deletions

View File

@@ -1001,6 +1001,8 @@ function createAgreementWindow() {
*/
function createSplashWindow(): BrowserWindow {
const isDev = !!process.env.VITE_DEV_SERVER_URL
const splashThemeId = configService?.get('themeId') || 'cloud-dancer'
const splashThemeMode = configService?.get('theme') || 'system'
const iconPath = isDev
? join(__dirname, '../public/icon.ico')
: (process.platform === 'darwin'
@@ -1008,8 +1010,8 @@ function createSplashWindow(): BrowserWindow {
: join(process.resourcesPath, 'icon.ico'))
splashWindow = new BrowserWindow({
width: 856,
height: 540,
width: 680,
height: 460,
resizable: false,
frame: false,
transparent: true,
@@ -1027,9 +1029,17 @@ function createSplashWindow(): BrowserWindow {
})
if (isDev) {
splashWindow.loadURL(`${process.env.VITE_DEV_SERVER_URL}splash.html`)
const splashUrl = new URL('splash.html', process.env.VITE_DEV_SERVER_URL)
splashUrl.searchParams.set('themeId', splashThemeId)
splashUrl.searchParams.set('themeMode', splashThemeMode)
splashWindow.loadURL(splashUrl.toString())
} else {
splashWindow.loadFile(join(__dirname, '../dist/splash.html'))
splashWindow.loadFile(join(__dirname, '../dist/splash.html'), {
query: {
themeId: splashThemeId,
themeMode: splashThemeMode
}
})
}
splashWindow.once('ready-to-show', () => {