From 8d9856d4a0e469aa9343188dd6c32528881d578f Mon Sep 17 00:00:00 2001
From: HsiangNianian <i@jyunko.cn>
Date: Tue, 13 Jan 2026 16:36:02 +0800
Subject: feat: add game console component for logging game output and toggle
 visibility

---
 ui/src/App.svelte | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

(limited to 'ui/src/App.svelte')

diff --git a/ui/src/App.svelte b/ui/src/App.svelte
index 0e14cb0..de5faec 100644
--- a/ui/src/App.svelte
+++ b/ui/src/App.svelte
@@ -2,8 +2,10 @@
   import { invoke } from "@tauri-apps/api/core";
   import { onMount } from "svelte";
   import DownloadMonitor from "./lib/DownloadMonitor.svelte";
+  import GameConsole from "./lib/GameConsole.svelte";
 
   let status = "Ready";
+  let showConsole = false;
 
   interface Version {
       id: string;
@@ -149,20 +151,26 @@
 
     <!-- Bottom Bar -->
     <div class="h-24 bg-zinc-900 border-t border-zinc-800 flex items-center px-8 justify-between z-20 shadow-2xl">
-        <div class="flex items-center gap-4 cursor-pointer hover:opacity-80 transition-opacity" onclick={login} role="button" tabindex="0" onkeydown={(e) => e.key === 'Enter' && login()}>
-            <div class="w-12 h-12 rounded bg-gradient-to-tr from-indigo-500 to-purple-500 shadow-lg flex items-center justify-center text-white font-bold text-xl overflow-hidden">
-                {#if currentAccount}
-                    <img src={`https://minotar.net/avatar/${currentAccount.username}/48`} alt={currentAccount.username} class="w-full h-full">
-                {:else}
-                    ?
-                {/if}
-            </div>
-            <div>
-                <div class="font-bold text-white text-lg">{currentAccount ? currentAccount.username : "Click to Login"}</div>
-                <div class="text-xs text-zinc-400 flex items-center gap-1">
-                    <span class="w-1.5 h-1.5 rounded-full {currentAccount ? 'bg-green-500' : 'bg-zinc-500'}"></span> {currentAccount ? 'Ready' : 'Guest'}
+        <div class="flex items-center gap-4">
+             <div class="flex items-center gap-4 cursor-pointer hover:opacity-80 transition-opacity" onclick={login} role="button" tabindex="0" onkeydown={(e) => e.key === 'Enter' && login()}>
+                <div class="w-12 h-12 rounded bg-gradient-to-tr from-indigo-500 to-purple-500 shadow-lg flex items-center justify-center text-white font-bold text-xl overflow-hidden">
+                    {#if currentAccount}
+                        <img src={`https://minotar.net/avatar/${currentAccount.username}/48`} alt={currentAccount.username} class="w-full h-full">
+                    {:else}
+                        ?
+                    {/if}
+                </div>
+                <div>
+                    <div class="font-bold text-white text-lg">{currentAccount ? currentAccount.username : "Click to Login"}</div>
+                    <div class="text-xs text-zinc-400 flex items-center gap-1">
+                        <span class="w-1.5 h-1.5 rounded-full {currentAccount ? 'bg-green-500' : 'bg-zinc-500'}"></span> {currentAccount ? 'Ready' : 'Guest'}
+                    </div>
                 </div>
             </div>
+            <!-- Console Toggle -->
+            <button class="ml-4 text-xs text-zinc-500 hover:text-zinc-300 transition" onclick={() => showConsole = !showConsole}>
+                {showConsole ? 'Hide Logs' : 'Show Logs'}
+            </button>
         </div>
 
         <div class="flex items-center gap-4">
@@ -197,4 +205,6 @@
       <div class="font-mono text-sm whitespace-pre-wrap">{status}</div>
   </div>
   {/if}
+
+  <GameConsole visible={showConsole} />
 </div>
-- 
cgit v1.2.3-70-g09d2

