feat(splashscreen): implement a splash screen for application startup

This commit introduces a splash screen that enhances the user experience during application startup. It includes a new HTML file for the splash screen layout and a corresponding icon. The main application logic has been updated to close the splash screen once the main application is ready.

- Added a splash screen HTML and icon for improved visual feedback
- Updated main application logic to manage splash screen visibility
- Enhanced title bar branding with an image instead of SVG
This commit is contained in:
Christoph Brandau
2026-07-08 15:16:51 +02:00
parent 61a22987ba
commit cc179e9eef
7 changed files with 330 additions and 23 deletions
+15 -3
View File
@@ -477,8 +477,8 @@
.titlebar-brand {
display: flex;
align-items: center;
gap: 7px;
padding: 0 14px;
gap: 8px;
padding: 0 13px 0 11px;
height: 100%;
font-size: 13px;
font-weight: 700;
@@ -486,7 +486,19 @@
color: var(--color-bar-text);
border-right: 1px solid rgba(255,255,255,0.06);
}
.titlebar-brand svg { color: #ffd343; filter: drop-shadow(0 0 10px rgba(255,211,67,0.3)); flex-shrink: 0; }
.titlebar-brand-icon {
display: grid;
place-items: center;
width: 24px;
height: 24px;
flex: 0 0 24px;
}
.titlebar-brand-icon img {
width: 24px;
height: 24px;
object-fit: contain;
filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.tb-version {
margin-left: 1px;
+4 -18
View File
@@ -3,6 +3,7 @@
import { getVersion } from "@tauri-apps/api/app";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { CloudDownload, Download, FolderOpen, GitBranch, GitCompare, LoaderCircle, Minus, RefreshCw, Search, Settings, Upload, X } from "@lucide/svelte";
import iconUrl from "../../src-tauri/icons/icon.png";
export let branch: string = "";
export let ahead: number = 0;
@@ -44,24 +45,9 @@
<header class="titlebar" data-tauri-drag-region>
<!-- Brand -->
<div class="titlebar-brand" data-tauri-drag-region>
<svg
width="15"
height="15"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
data-tauri-drag-region
>
<circle cx="12" cy="18" r="3" />
<circle cx="6" cy="6" r="3" />
<circle cx="18" cy="6" r="3" />
<path d="M18 9v1a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V9" />
<line x1="12" y1="12" x2="12" y2="15" />
</svg>
<span class="titlebar-brand-icon" data-tauri-drag-region>
<img src={iconUrl} alt="" data-tauri-drag-region />
</span>
<span data-tauri-drag-region>GitLite</span>
{#if appVersion}
<span class="tb-version" data-tauri-drag-region title="Version {appVersion}">v{appVersion}</span>
+8 -1
View File
@@ -1,4 +1,5 @@
import { mount } from "svelte";
import { invoke } from "@tauri-apps/api/core";
import App from "./App.svelte";
import "./app.css";
@@ -9,4 +10,10 @@ if (!target) {
throw new Error("App target element was not found.");
}
export default mount(App, { target });
const app = mount(App, { target });
void invoke("close_splashscreen").catch(() => {
// Browser preview and failed startup paths should keep working without Tauri.
});
export default app;