initial commit

This commit is contained in:
Neshura 2023-10-11 17:43:28 +02:00
parent fe64b2ac53
commit 9dcc10a191
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
44 changed files with 5101 additions and 0 deletions

59
src/App.svelte Normal file
View file

@ -0,0 +1,59 @@
<script lang="ts">
import Greet from './lib/Greet.svelte'
import MetadataInput from './lib/MetadataInput.svelte';
import Sidebar from "./lib/Sidebar.svelte";
let selectedTab: string = "input";
</script>
<main class="window">
<Sidebar bind:selectedTab />
<div class="main">
{#if selectedTab == "input"}
<MetadataInput />
{:else if selectedTab == "generate"}
<p>
Generate Mask is Showing here
</p>
{:else if selectedTab == "settings"}
<p>
Settings go here
</p>
{/if}
<div class="row">
<Greet />
</div>
</div>
</main>
<style>
.window {
display: grid;
grid-template-areas: "Nav Main";
grid-template-columns: 4rem calc(100% - 4rem);
box-sizing: border-box;
width: 100vw;
height: 100vh;
overflow: hidden;
}
.main {
grid-area: Main;
overflow: hidden;
}
.main p {
text-align: center;
}
.settings {
}
</style>

19
src/lib/Greet.svelte Normal file
View file

@ -0,0 +1,19 @@
<script lang="ts">
import { invoke } from "@tauri-apps/api/tauri"
let name = "";
let greetMsg = ""
async function greet(){
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
greetMsg = await invoke("greet", { name })
}
</script>
<div>
<form class="row" on:submit|preventDefault={greet}>
<input id="greet-input" placeholder="Enter a name..." bind:value={name} />
<button type="submit">Greet</button>
</form>
<p>{greetMsg}</p>
</div>

View file

@ -0,0 +1,82 @@
<script lang="ts">
</script>
<div class="metadataInput">
<h1>Metadata</h1>
<label for="series">Series:</label>
<input id="series" type="text"><br>
<label for="title">Title:</label>
<input id="title" type="text"><br>
<label for="volume">Volume:</label>
<input id="volume" type="text">
<label for="chapter">Chapter:</label>
<input id="chapter" type="text"> /
<input id="chapter_count" type="text"><br>
<label for="page_count">Page Count</label>
<input id="page_count" type="text"><br>
<label for="summary">Summary:</label><br>
<label for="summary"></label><input id="series" type="text"><br>
<label for="release_date">Release Date:</label>
<input id="release_date" type="text"><br>
<label for="author">Author:</label>
<input id="author" type="text">
<label for="typesetter">Typesetter:</label>
<input id="typesetter" type="text">
<label for="editor">Editor:</label>
<input id="editor" type="text"><br>
<label for="translator">Translator</label>
<input id="translator" type="text">
<label for="publisher">Publisher</label>
<input id="publisher" type="text"><br>
<label for="tags">Tags</label>
<input id="tags" type="text"><br>
<label for="genre">Genre</label>
<input id="genre" type="text">
<label for="lang">Language</label>
<input id="lang" type="text"><br>
<label for="age_rating">Age Rating</label>
<input id="age_rating" type="text"><br>
<input type="submit" value="Save"/>
</div>
<style>
.metadataInput {
height: 100%;
overflow: auto;
}
.metadataInput label, input[type="submit"] {
margin-left: 4rem;
}
.metadataInput h1 {
position: sticky;
top: 0;
margin: 0;
border-bottom: 2px solid black;
background-color: var(--color-bg);
padding: 1.3rem;
}
</style>

50
src/lib/Sidebar.svelte Normal file
View file

@ -0,0 +1,50 @@
<script lang="ts">
export let selectedTab: string = "input";
</script>
<div class="sidebar">
<button class="sidebar-button" class:active={selectedTab==="input"} on:click={() => {selectedTab="input"}}>
<img src="manual.svg" alt="Manual Input">
</button>
<button class="sidebar-button" class:active={selectedTab==="generate"} on:click={() => {selectedTab="generate"}}>
<img src="generate.svg" alt="Generate">
</button>
<button class="sidebar-button" class:active={selectedTab==="settings"} on:click={() => {selectedTab="settings"}}>
<img src="sliders.svg" alt="Settings">
</button>
</div>
<style>
.sidebar {
grid-area: Nav;
display: flex;
flex-direction: column;
border-right: 2px solid black;
}
.sidebar-button {
border: 2px solid transparent;
border-radius: 0;
width: 100%;
height: auto;
aspect-ratio: 1;
background-color: grey;
transition: border-color 0.25s;
cursor: pointer;
}
.sidebar-button img {
width: 100%;
height: 100%;
object-fit: contain;
}
.sidebar-button:hover {
border-color: white;
}
.active {
background-color: skyblue; /* TODO: change color */
}
</style>

8
src/main.ts Normal file
View file

@ -0,0 +1,8 @@
import "./styles.css";
import App from "./App.svelte";
const app = new App({
target: document.getElementById("app"),
});
export default app;

129
src/styles.css Normal file
View file

@ -0,0 +1,129 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
--color-bg: #f6f6f6;
color: #0f0f0f;
background-color: #f6f6f6;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
body, html {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
.app {
width: 100vw;
max-height: 100vh;
overflow: hidden;
}
.container {
margin: 0;
padding-top: 10vh;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: 0.75s;
}
.logo.tauri:hover {
filter: drop-shadow(0 0 2em #24c8db);
}
.row {
display: flex;
justify-content: center;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
h1 {
text-align: center;
}
input,
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
color: #0f0f0f;
background-color: #ffffff;
transition: border-color 0.25s;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}
button {
cursor: pointer;
}
button:hover {
border-color: #396cd8;
}
button:active {
border-color: #396cd8;
background-color: #e8e8e8;
}
input,
button {
outline: none;
}
#greet-input {
margin-right: 5px;
}
@media (prefers-color-scheme: dark) {
:root {
color: #f6f6f6;
background-color: #2f2f2f;
--color-bg: #2f2f2f;
}
a:hover {
color: #24c8db;
}
input,
button {
color: #ffffff;
background-color: #0f0f0f98;
}
button:active {
background-color: #0f0f0f69;
}
}

2
src/vite-env.d.ts vendored Normal file
View file

@ -0,0 +1,2 @@
/// <reference types="svelte" />
/// <reference types="vite/client" />