This commit is contained in:
ayabusa 2024-02-14 17:01:21 +01:00
parent 6dd5a84c60
commit 12e7049dad
28 changed files with 4005 additions and 2 deletions

View File

@ -1,2 +1,7 @@
# Rusty-slicer
[WIP] A tool to slice single file playlist into multiple tracks
# Tauri + Vanilla
This template should help get you started developing with Tauri in vanilla HTML, CSS and Javascript.
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)

4
src-tauri/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/

3744
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

21
src-tauri/Cargo.toml Normal file
View File

@ -0,0 +1,21 @@
[package]
name = "test-tauri"
version = "0.0.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.5", features = [] }
[dependencies]
tauri = { version = "1.5", features = ["shell-open"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
[features]
# this feature is used for production builds or when `devPath` points to the filesystem
# DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]

3
src-tauri/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

15
src-tauri/src/main.rs Normal file
View File

@ -0,0 +1,15 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

44
src-tauri/tauri.conf.json Normal file
View File

@ -0,0 +1,44 @@
{
"build": {
"devPath": "../src",
"distDir": "../src",
"withGlobalTauri": true
},
"package": {
"productName": "rusty-slicer",
"version": "0.0.0"
},
"tauri": {
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true
}
},
"windows": [
{
"fullscreen": false,
"resizable": true,
"title": "Rusty slicer",
"width": 400,
"height": 800
}
],
"security": {
"csp": null
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "dev.ayabusa.slicer",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

47
src/index.html Normal file
View File

@ -0,0 +1,47 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rusty slicer</title>
<script type="module" src="/main.js" defer></script>
</head>
<!-- Made by ayabusa (www.ayabusa.dev) with pain, because making html and css is awfully painfull :) -->
<body>
<div class="main-container">
<h3>Welcome to the Rusty slicer! <img src="assets/cat-vibe-vibe-cat.gif"></h1>
<div class="select-file">
<p><b> Input file </b> <br> no location choosen </p>
<button type="file-button">choose file 📂</button>
</div>
<div class="chapter-list">
<textarea rows="30">nothing for now</textarea>
</div>
<div class="select-file">
<p><b> Output folder </b> <br> no location choosen </p>
<button type="file-button">choose folder 📂</button>
</div>
<div class="select-file">
<p><b> output type </b></p>
<select>
<option value="mp3">mp3</option>
<option value="ogg">ogg</option>
<option value="flac">flac</option>
<option value="m4a">m4a</option>
</select>
</div>
<button class="slice-button" type="button"> Slice 🔪</button>
<footer>
<br>
made by ayabusa ;D</footer>
</div>
</body>
</html>

18
src/main.js Normal file
View File

@ -0,0 +1,18 @@
const { invoke } = window.__TAURI__.tauri;
let greetInputEl;
let greetMsgEl;
async function greet() {
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value });
}
window.addEventListener("DOMContentLoaded", () => {
greetInputEl = document.querySelector("#greet-input");
greetMsgEl = document.querySelector("#greet-msg");
document.querySelector("#greet-form").addEventListener("submit", (e) => {
e.preventDefault();
greet();
});
});

2
src/protocol.css Normal file

File diff suppressed because one or more lines are too long

100
src/styles.css Normal file
View File

@ -0,0 +1,100 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
color: #f6f6f6;
background-color: #292829;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
textarea {
width: 100%;
}
img{
height: 2em;
width: 2em;
}
.select-file {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
row-gap: 0;
}
p{
}
.row {
display: flex;
justify-content: center;
}
h1 {
text-align: center;
}
input,
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.5em 0.5em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
color: #ffffff;
background-color: #292829;
transition: border-color 0.25s, color 0.25s;
border-color: #ffffff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}
button {
cursor: pointer;
}
button:hover {
border-color: #d88939;
color: #d88939;
}
button:active {
border-color: #d88939;
background-color: #353435;
}
input,
button {
outline: none;
}
.slice-button{
border-color: #292829;
color: #292829;
background-color: #d88939;
}
.slice-button:hover{
border-color: #d88939;
color: #d88939;
background-color: #292829;
}
.slice-button:active {
background-color: #353435;
}
#greet-input {
margin-right: 5px;
}