aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2026-01-13 14:31:37 +0800
committerHsiangNianian <i@jyunko.cn>2026-01-13 14:31:37 +0800
commitf878efe456e8f5c557f2cde9d71f120f3e0b38cd (patch)
treed6e54b7dc262502f2ef9dc011fcff6ad2aba2d54 /ui
parent225f87bf713492daef83a85e9e2a0bfdb0f9d23f (diff)
downloadDropOut-f878efe456e8f5c557f2cde9d71f120f3e0b38cd.tar.gz
DropOut-f878efe456e8f5c557f2cde9d71f120f3e0b38cd.zip
feat: add Minecraft DropOut launcher with version fetching and basic UI
- Implemented version manifest fetching from Mojang API. - Created launcher configuration and main launcher logic. - Added SVG and PNG icons for the application. - Developed a simple HTML/CSS interface for the launcher. - Integrated Tauri commands for backend communication. - Added utility functions for file operations and config parsing.
Diffstat (limited to 'ui')
-rw-r--r--ui/index.html19
-rw-r--r--ui/main.js15
-rw-r--r--ui/style.css57
3 files changed, 91 insertions, 0 deletions
diff --git a/ui/index.html b/ui/index.html
new file mode 100644
index 0000000..1acd3ab
--- /dev/null
+++ b/ui/index.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Minecraft 启动器</title>
+ <link rel="stylesheet" href="style.css">
+ <script src="main.js" defer></script>
+</head>
+<body>
+ <main class="container">
+ <h1>Minecraft DropOut Launcher</h1>
+ <div class="status-container">
+ <p id="status-text">准备就绪</p>
+ </div>
+ <button id="start-game-btn">开始游戏</button>
+ </main>
+</body>
+</html> \ No newline at end of file
diff --git a/ui/main.js b/ui/main.js
new file mode 100644
index 0000000..33099cd
--- /dev/null
+++ b/ui/main.js
@@ -0,0 +1,15 @@
+const { invoke } = window.__TAURI__.core;
+
+const startBtn = document.getElementById("start-game-btn");
+const statusText = document.getElementById("status-text");
+
+startBtn.addEventListener("click", async () => {
+ statusText.textContent = "正在获取 Manifest...";
+ try {
+ const response = await invoke("start_game");
+ statusText.textContent = response;
+ } catch (error) {
+ statusText.textContent = "错误: " + error;
+ console.error(error);
+ }
+});
diff --git a/ui/style.css b/ui/style.css
new file mode 100644
index 0000000..8820ebc
--- /dev/null
+++ b/ui/style.css
@@ -0,0 +1,57 @@
+body {
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+ background-color: #2c2f33;
+ color: #ffffff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ margin: 0;
+ user-select: none;
+}
+
+.container {
+ text-align: center;
+ background-color: #23272a;
+ padding: 2rem;
+ border-radius: 10px;
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
+ width: 300px;
+}
+
+h1 {
+ font-size: 1.2rem;
+ margin-bottom: 2rem;
+ color: #7289da;
+}
+
+.status-container {
+ margin-bottom: 1.5rem;
+ min-height: 1.5rem;
+}
+
+#status-text {
+ font-size: 0.9rem;
+ color: #99aab5;
+ margin: 0;
+}
+
+button {
+ background-color: #43b581;
+ color: white;
+ border: none;
+ padding: 10px 20px;
+ border-radius: 5px;
+ font-size: 1rem;
+ cursor: pointer;
+ transition: background-color 0.2s;
+ width: 100%;
+}
+
+button:hover {
+ background-color: #3ca374;
+}
+
+button:active {
+ background-color: #358f66;
+}