diff --git a/README.md b/README.md index 75842c4..891f4ef 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,2 @@ -# sv +# IT Tools -Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). - -## Creating a project - -If you're seeing this, you've probably already done this step. Congrats! - -```sh -# create a new project in the current directory -npx sv create - -# create a new project in my-app -npx sv create my-app -``` - -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: - -```sh -npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open -``` - -## Building - -To create a production version of your app: - -```sh -npm run build -``` - -You can preview the production build with `npm run preview`. - -> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. diff --git a/package-lock.json b/package-lock.json index df3a8dd..f2e10ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,9 @@ "": { "name": "it-tools", "version": "0.0.1", + "dependencies": { + "@tauri-apps/api": "^2.9.0" + }, "devDependencies": { "@sveltejs/adapter-static": "^3.0.10", "@sveltejs/kit": "^2.47.1", @@ -1209,6 +1212,16 @@ "vite": "^5.2.0 || ^6 || ^7" } }, + "node_modules/@tauri-apps/api": { + "version": "2.9.0", + "resolved": "https://registry.npmmirror.com/@tauri-apps/api/-/api-2.9.0.tgz", + "integrity": "sha512-qD5tMjh7utwBk9/5PrTA/aGr3i5QaJ/Mlt7p8NilQ45WgbifUNPyKWsA63iQ8YfQq6R8ajMapU+/Q8nMcPRLNw==", + "license": "Apache-2.0 OR MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + } + }, "node_modules/@tauri-apps/cli": { "version": "2.9.2", "resolved": "https://registry.npmmirror.com/@tauri-apps/cli/-/cli-2.9.2.tgz", diff --git a/package.json b/package.json index cbddc94..09f6d5e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.0.1", "type": "module", "scripts": { - "tauri": "tauri", + "tauri": "tauri", "dev": "vite dev", "build": "vite build", "preview": "vite preview", @@ -28,5 +28,8 @@ "tailwindcss": "^4.1.14", "typescript": "^5.9.3", "vite": "^7.1.10" + }, + "dependencies": { + "@tauri-apps/api": "^2.9.0" } } diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index c135d7f..0f60700 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -6,6 +6,12 @@ "main" ], "permissions": [ - "core:default" + "core:default", + "core:window:allow-close", + "core:window:allow-minimize", + "core:window:allow-maximize", + "core:window:allow-unmaximize", + "core:window:allow-toggle-maximize", + "core:window:allow-start-dragging" ] } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 90c7591..9e28cff 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -2,9 +2,9 @@ "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "it-tools", "version": "0.1.0", - "identifier": "com.tauri.dev", + "identifier": "cn.nopj.ittools", "build": { - "frontendDist": "../public", + "frontendDist": "../src", "devUrl": "http://localhost:5173", "beforeDevCommand": "npm run dev", "beforeBuildCommand": "npm run build" @@ -35,4 +35,5 @@ "icons/icon.ico" ] } + } diff --git a/src/app.css b/src/app.css index d4b5078..5a491d0 100644 --- a/src/app.css +++ b/src/app.css @@ -1 +1,10 @@ @import 'tailwindcss'; + + +:global(body) { + + background-color: #1f1f1f; /* 示例:一个深灰色 */ + min-height: 100vh; + min-width: 100vw; + margin: 0; /* 移除浏览器默认的 body 边距 */ +} \ No newline at end of file diff --git a/src/lib/assets/icon/close.svg b/src/lib/assets/icon/close.svg new file mode 100644 index 0000000..1128373 --- /dev/null +++ b/src/lib/assets/icon/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/lib/components/layout/Header.svelte b/src/lib/components/layout/Header.svelte new file mode 100644 index 0000000..502d151 --- /dev/null +++ b/src/lib/components/layout/Header.svelte @@ -0,0 +1,59 @@ + + +
+
+ 🎉 我的Tauri Svelte应用 +
+ +
+ + + +
+
+ + diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a50d726..3fbf87b 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,6 +1,7 @@ @@ -8,5 +9,6 @@ +
{@render children()} diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts new file mode 100644 index 0000000..09a24d3 --- /dev/null +++ b/src/routes/+layout.ts @@ -0,0 +1,2 @@ +export const ssr = false; +export const prerender = true; \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 6b76bd9..7fa16b9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,5 @@
-

123{title}

+

112323{title}

{description}