improved splash screen action

This commit is contained in:
2026-03-17 22:09:50 +08:00
parent 3cc4f5366d
commit 2a485f9a0b
4 changed files with 30 additions and 11 deletions

View File

@@ -36,10 +36,10 @@ pub fn open_splash_window() {
let webview_window = match tauri::WebviewWindowBuilder::new( let webview_window = match tauri::WebviewWindowBuilder::new(
app_handle, app_handle,
SPLASH_WINDOW_LABEL, SPLASH_WINDOW_LABEL,
tauri::WebviewUrl::App("/splash".into()), tauri::WebviewUrl::App("/splash.html".into()),
) )
.title("Friendolls Splash") .title("Friendolls Splash")
.inner_size(600.0, 300.0) .inner_size(800.0, 400.0)
.resizable(false) .resizable(false)
.decorations(false) .decorations(false)
.transparent(true) .transparent(true)

View File

@@ -1,9 +0,0 @@
<div id="splash" class="w-screen h-screen object-contain bg-base-100"></div>
<style>
#splash {
background-image: url("../../assets/media/splash-dev.jpeg");
background-size: cover;
background-position: center;
}
</style>

View File

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

28
static/splash.html Normal file
View File

@@ -0,0 +1,28 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Friendolls</title>
<script>
document.addEventListener("contextmenu", function (e) {
e.preventDefault();
});
</script>
</head>
<body style="width: 100%; height: 100%">
<div id="splash"></div>
<style>
* {
margin: 0;
}
#splash {
background-image: url("/splash-dev.jpeg");
background-size: cover;
background-position: center;
width: 800px;
height: 400px;
}
</style>
</body>
</html>