diff --git a/package.json b/package.json index 101a6f7..2f1b588 100644 --- a/package.json +++ b/package.json @@ -14,14 +14,15 @@ "@tauri-apps/api": "^1.4.0" }, "devDependencies": { + "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/vite-plugin-svelte": "^2.4.2", + "@tauri-apps/cli": "^1.4.0", "@tsconfig/svelte": "^5.0.0", "svelte": "^4.0.5", "svelte-check": "^3.4.6", "svelte-preprocess": "^5.0.0", "tslib": "^2.6.0", "typescript": "^5.0.2", - "vite": "^4.4.4", - "@tauri-apps/cli": "^1.4.0" + "vite": "^4.4.4" } } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index aaba7e7..e32feae 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -3,7 +3,7 @@ "beforeDevCommand": "yarn dev", "beforeBuildCommand": "yarn build", "devPath": "http://localhost:1420", - "distDir": "../dist", + "distDir": "../build", "withGlobalTauri": false }, "package": { @@ -21,7 +21,7 @@ "bundle": { "active": true, "targets": "all", - "identifier": "com.tauri.dev", + "identifier": "com.comicinfo.editor", "icon": [ "icons/32x32.png", "icons/128x128.png", diff --git a/src/+layout.ts b/src/+layout.ts new file mode 100644 index 0000000..9b6b3ca --- /dev/null +++ b/src/+layout.ts @@ -0,0 +1,2 @@ +export const prerender = true +export const ssr = false \ No newline at end of file diff --git a/src/lib/IntegerInput.svelte b/src/lib/IntegerInput.svelte index 1cf94b5..76d6696 100644 --- a/src/lib/IntegerInput.svelte +++ b/src/lib/IntegerInput.svelte @@ -4,6 +4,12 @@ export let negative = false; + export let defaultValue = 0; + + if (typeof value === "undefined") { + value = defaultValue; + } + function inputInteger(event: Event & {currentTarget: (EventTarget & HTMLInputElement)}) { let newValue = event.currentTarget.value; @@ -11,7 +17,7 @@ newValue = newValue.slice(1, newValue.length) } - if (!isNaN(Number(newValue))) { + if (newValue != "" && !isNaN(Number(newValue))) { value = Number(newValue); } else if (negative && newValue.startsWith("-")) { @@ -20,8 +26,8 @@ } } else if (newValue === "") { - event.currentTarget.value = "0"; - value = 0; + event.currentTarget.value = defaultValue.toString(); + value = defaultValue; } else { event.currentTarget.value = value.toString(); diff --git a/src/lib/MetadataInput.svelte b/src/lib/MetadataInput.svelte index e712351..4e898a7 100644 --- a/src/lib/MetadataInput.svelte +++ b/src/lib/MetadataInput.svelte @@ -2,21 +2,37 @@ import {writable} from "svelte/store"; import type {Writable} from "svelte/store"; import IntegerInput from "./IntegerInput.svelte"; + import TextInput from "./TextInput.svelte"; + let seriesTitle = ""; + let volumeTitle = ""; let volumeNumber = 0; let chapterNumber = 0; - let pageCount = 0; + let pageCount = 1; let chapterCount = 0; + let summary = ""; + let releaseYear: number; + let releaseMonth: number; + let releaseDay: number; + let author: string; + let typesetter: string; + let editor: string; + let translator: string; + let publisher: string; + let tags: Vec; + let genre = "Hentai"; + let lang = "en"; + let ageRating = "18+";

Metadata

-
+
-
+
@@ -26,34 +42,36 @@
-
+


-
+ + +
- + - + -
+
- + -
+

- +
diff --git a/src/lib/Sidebar.svelte b/src/lib/Sidebar.svelte index 43b35e9..e3c2df2 100644 --- a/src/lib/Sidebar.svelte +++ b/src/lib/Sidebar.svelte @@ -36,8 +36,8 @@ } .sidebar-button img { - width: 100%; - height: 100%; + width: 70%; + height: 70%; object-fit: contain; } diff --git a/src/lib/TextInput.svelte b/src/lib/TextInput.svelte new file mode 100644 index 0000000..fece087 --- /dev/null +++ b/src/lib/TextInput.svelte @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/src/styles.css b/src/styles.css index fcfd6d7..0b27055 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,5 +1,5 @@ :root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; + font-family: Courier New; font-size: 16px; line-height: 24px; font-weight: 400; @@ -23,6 +23,7 @@ body, html { * { box-sizing: border-box; + font-family: inherit; } .app { diff --git a/svelte.config.js b/svelte.config.js index de2ddd6..7c4ee9e 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,7 +1,15 @@ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; +import adapter from '@sveltejs/adapter-static'; export default { // Consult https://svelte.dev/docs#compile-time-svelte-preprocess // for more information about preprocessors preprocess: vitePreprocess(), + kit: { + adapter: adapter({ + pages: 'build', + assets: 'build', + fallback: 'index.html' + }) + }, }; diff --git a/yarn.lock b/yarn.lock index 88e5ecf..a23f859 100644 --- a/yarn.lock +++ b/yarn.lock @@ -173,6 +173,11 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@sveltejs/adapter-static@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@sveltejs/adapter-static/-/adapter-static-2.0.3.tgz#616836c30bdce4d673a2e26c0f5ffbd5c1bc7c67" + integrity sha512-VUqTfXsxYGugCpMqQv1U0LIdbR3S5nBkMMDmpjGVJyM6Q2jHVMFtdWJCkeHMySc6mZxJ+0eZK3T7IgmUCDrcUQ== + "@sveltejs/vite-plugin-svelte-inspector@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-1.0.4.tgz#c99fcb73aaa845a3e2c0563409aeb3ee0b863add"