v0.1.0-pre.044

This commit is contained in:
2026-07-25 18:07:51 +02:00
parent e2a349c739
commit c2dbd207d3
25 changed files with 624 additions and 86 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 KiB

View File

@@ -0,0 +1,18 @@
<!-- file: kb-app-demo-desktop/frontend/main.html -->
<!-- version: 1 -->
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Khadhroony Bot3</title>
<style>body{font-family:sans-serif;margin:0;background:#111827;color:#f9fafb}main{max-width:900px;margin:8rem auto;padding:2rem}code{color:#93c5fd}</style>
</head>
<body>
<main>
<h1>Khadhroony Bot3</h1>
<p>La fenêtre splash de <code>kb-app-demo-desktop</code> est migrée.</p>
<p>La fenêtre principale sera complétée dans la prochaine tranche.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,8 @@
/* file: kb-app-demo-desktop/frontend/sass/splash.scss */
/* version: 1 */
html, body { width: 100%; height: 100%; margin: 0; background: transparent; overflow: hidden; }
body { display: grid; place-items: center; font-family: sans-serif; }
#splash-container { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 1rem; opacity: 0; background: radial-gradient(circle, #1f2937, #030712); color: #f9fafb; }
#splash-container img { width: min(55vw, 420px); max-height: 55vh; object-fit: contain; }
#splash-container h1 { margin: 0; letter-spacing: .08em; }
#messages-container { min-height: 1.5rem; color: #d1d5db; }

View File

@@ -0,0 +1,19 @@
<!-- file: kb-app-demo-desktop/frontend/splash.html -->
<!-- version: 1 -->
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chargement — Khadhroony Bot3</title>
<link rel="stylesheet" href="sass/splash.scss" />
</head>
<body>
<main id="splash-container">
<img src="imgs/splash.png" alt="Khadhroony Bot3" />
<h1>Khadhroony Bot3</h1>
<div id="messages-container" aria-live="polite"></div>
</main>
<script type="module" src="ts/splash.ts"></script>
</body>
</html>

View File

@@ -0,0 +1,40 @@
// file: kb-app-demo-desktop/frontend/ts/splash.ts
// version: 1
import { listen } from "@tauri-apps/api/event";
type SplashOrder = {
order: string;
msg: string | null;
status: string | null;
duration_ms: number | null;
};
const container = document.querySelector<HTMLElement>("#splash-container");
const messages = document.querySelector<HTMLElement>("#messages-container");
function duration(order: SplashOrder): number {
if (typeof order.duration_ms !== "number" || !Number.isFinite(order.duration_ms) || order.duration_ms <= 0) {
return 500;
}
return order.duration_ms;
}
async function applyOrder(order: SplashOrder): Promise<void> {
if (!container) {
return;
}
if (order.order === "add_msg" && messages && order.msg) {
messages.textContent = order.msg;
messages.dataset.status = order.status ?? "info";
return;
}
if (order.order === "fadein" || order.order === "fadeout") {
container.style.transition = `opacity ${duration(order)}ms ease-in-out`;
container.style.opacity = order.order === "fadein" ? "1" : "0";
}
}
void listen<SplashOrder>("splash", event => {
void applyOrder(event.payload);
});