mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-13 05:20:28 +08:00
- Remove Rust-side `eval(INITIAL_LOADING_OVERLAY)` that prematurely dismissed the overlay before React/MUI theme was ready - Defer `window.show()` from Rust `activate_window` to an inline `<script>` in index.html, executed after the themed overlay is in DOM - Remove `useAppInitialization` hook (duplicate of `useLoadingOverlay` with no themeReady gate) - Simplify overlay to pure theme-colored background — no spinner or loading text — so fast startup feels instant - Simplify `hideInitialOverlay` API and reduce overlay fade to 0.2s - Clean up unused CSS variables (spinner-track, spinner-top, etc.)
70 lines
1.5 KiB
HTML
70 lines
1.5 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link
|
|
rel="shortcut icon"
|
|
href="./assets/image/logo.ico"
|
|
type="image/x-icon"
|
|
/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Clash Verge</title>
|
|
<style>
|
|
:root {
|
|
--bg-color: #f5f5f5;
|
|
--text-color: #333;
|
|
color-scheme: light;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg-color: #2e303d;
|
|
--text-color: #ffffff;
|
|
color-scheme: dark;
|
|
}
|
|
}
|
|
|
|
html,
|
|
body {
|
|
width: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
#root {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
#initial-loading-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
background: var(--bg-color);
|
|
z-index: 9999;
|
|
transition: opacity 0.2s ease-out;
|
|
}
|
|
|
|
#initial-loading-overlay[data-hidden='true'] {
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="initial-loading-overlay"></div>
|
|
<script>
|
|
if (window.__TAURI_INTERNALS__) {
|
|
window.__TAURI_INTERNALS__
|
|
.invoke('plugin:window|show', { label: 'main' })
|
|
.catch(function () {});
|
|
window.__TAURI_INTERNALS__
|
|
.invoke('plugin:window|set_focus', { label: 'main' })
|
|
.catch(function () {});
|
|
}
|
|
</script>
|
|
<div id="root"></div>
|
|
<script type="module" src="./main.tsx"></script>
|
|
</body>
|
|
</html>
|