]> git.ayabusa.dev Git - rusty-slicer.git/commitdiff
changed main page layout and fixed some bugs 1.0.0
authorayabusa <lebgpub@gmail.com>
Sun, 17 Mar 2024 14:40:00 +0000 (15:40 +0100)
committerayabusa <lebgpub@gmail.com>
Sun, 17 Mar 2024 14:40:00 +0000 (15:40 +0100)
src-tauri/Cargo.lock
src-tauri/Cargo.toml
src-tauri/src/main.rs
src-tauri/tauri.conf.json
src/about.html
src/done.html [new file with mode: 0644]
src/index.html
src/styles.css

index 345338041b61cb382456593149e053efb4adb653..041c9b8322b4f360c82b483ac3622fa46bbe1e93 100644 (file)
@@ -3178,7 +3178,7 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
 
 [[package]]
 name = "rusty-slicer"
-version = "0.0.1"
+version = "1.0.0"
 dependencies = [
  "lazy_static",
  "native-dialog",
index 6d0e5d35ab0f510ac622be240545fea3260845ac..1732086eaf7b85ded6376487235be001a395fcf8 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "rusty-slicer"
-version = "0.0.1"
+version = "1.0.0"
 description = "An app to slice your playlist into multiple files"
 authors = ["Ayabusa"]
 edition = "2021"
index 6c4fb8b5c646a0470b0b833c75b41dc02b5f11ae..bbad7e65631294bdebab34ee6bedad8af8e3d2ed 100644 (file)
@@ -75,13 +75,13 @@ async fn slice_button(app: tauri::AppHandle, chapter: String, fileformat: String
     };*/
 
     // create the progress window
-    let _about_window = tauri::WindowBuilder::new(
+    let _progress_window = tauri::WindowBuilder::new(
         &app,
         "progress", /* the unique window label */
         tauri::WindowUrl::App("progress.html".into())
         ).build().expect("failed to create progress window");
-        _about_window.set_title("Slicing progress").unwrap();
-        _about_window.set_size(Size::Physical(PhysicalSize { width: 400, height: 100 })).unwrap();
+        _progress_window.set_title("Slicing progress").unwrap();
+        _progress_window.set_size(Size::Physical(PhysicalSize { width: 400, height: 100 })).unwrap();
 
     for i in 0..time_codes.len(){
         let args: Vec<String>;
@@ -91,7 +91,9 @@ async fn slice_button(app: tauri::AppHandle, chapter: String, fileformat: String
         output_file.set_extension(&fileformat);
 
         if i+1<time_codes.len() {
-            args = vec!["-i".to_owned(), 
+            args = vec![
+                "-y".to_owned(), // overwrite existing files
+                "-i".to_owned(), 
                 FILE_PATH.lock().unwrap().to_owned(),
                 "-ss".to_owned(),
                 time_codes[i].to_owned(),
@@ -101,7 +103,9 @@ async fn slice_button(app: tauri::AppHandle, chapter: String, fileformat: String
                 //format!("{:?}", output_file),
                 output_file.display().to_string()];
         }else { // case for the last song
-            args = vec!["-i".to_owned(), 
+            args = vec![
+                "-y".to_owned(), // overwrite existing files
+                "-i".to_owned(), 
                 FILE_PATH.lock().unwrap().to_owned(),
                 "-ss".to_owned(),
                 time_codes[i].to_owned(),
@@ -116,6 +120,15 @@ async fn slice_button(app: tauri::AppHandle, chapter: String, fileformat: String
         // update progress bar on frontend
         app.emit_all("progress_state_changed", Payload { message: format!("{}", (i+1)*100/time_codes.len()) }).unwrap();
     }
+    _progress_window.close().unwrap(); // close the progress window, before creating the done one
+
+    let _done_window = tauri::WindowBuilder::new(
+        &app,
+        "done", /* the unique window label */
+        tauri::WindowUrl::App("done.html".into())
+        ).build().expect("failed to create done window");
+        _done_window.set_title("Rusty Slicer").unwrap();
+        _done_window.set_size(Size::Physical(PhysicalSize { width: 400, height: 100 })).unwrap();
 }
 
 #[tauri::command]
index aa6ab263b2889004b96ed603ac3cc6f9b47d7453..80b1c01694658096d1880a6f9e7dbbf433336ec8 100644 (file)
@@ -6,7 +6,7 @@
   },
   "package": {
     "productName": "rusty-slicer",
-    "version": "0.0.1"
+    "version": "1.0.0"
   },
   "tauri": {
     "allowlist": {
@@ -24,8 +24,8 @@
         "fullscreen": false,
         "resizable": true,
         "title": "Rusty slicer",
-        "width": 450,
-        "height": 950
+        "width": 830,
+        "height": 700
       }
     ],
     "security": {
index 8a0f0a85aa17f5cbd6a454855429bf3c192a19fd..d41c22edca2c1ce0c49b442ebb64c7feedd63b47 100644 (file)
@@ -9,7 +9,7 @@
 
 <body>
     <div class="about_main">
-    <h1> Rusty Slicer V0.0.1 </h1>
+    <h1> Rusty Slicer V1.0.0 </h1>
     <h2 class="credit"> Credit </h2>
     <p class="credit">
         <b>
diff --git a/src/done.html b/src/done.html
new file mode 100644 (file)
index 0000000..9282616
--- /dev/null
@@ -0,0 +1,12 @@
+<!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>
+</head>
+
+<body>
+    <p class="credit" id="progress_label"> Finished slicing :D </p> 
+</body>
\ No newline at end of file
index 4b17d471a5015ed20762eb930f7a26387337e13b..0bf8cf8b33506171a9c3620679323ce347d3d666 100644 (file)
     <div class="main-container">
       <div>
         <h3>Welcome to the Rusty slicer! <img src="assets/cat-vibe-vibe-cat.gif"></h1>
-        <div class="select-file">
-          <div>
-            <h4><b> Input file </b></h4>
-            <p id="fileLocation"> no location choosen </p>
-          </div>
-          <button id="fileButton">choose file ðŸ“‚</button>
-        </div>
 
-        <div>
-          <h4><b> Chapter list (timecode - song name) </b></h4>
-          <textarea id="chapterList" rows="30" cols="10000" placeholder="0:00 - my first song
+        <div class="action-container">
+          <div>
+            <h4><b> Chapter list (timecode - song name) </b></h4>
+            <textarea id="chapterList" rows="30" cols="10000" placeholder="0:00 - my first song
 3:30 - another one
 13:37 - one more time - Daft punk"></textarea>
-          <p id="errorLabel" style="color: red;"></p>
-        </div>
+            <p id="errorLabel" style="color: red;"></p>
+          </div>
 
-        <div class="select-file">
           <div>
-            <p><b> Output folder </b> </p>
-            <p id="folderLocation"> no location choosen </p>
-          </div>
-          <button id="folderButton">choose folder ðŸ“‚</button>
-        </div>
+            <div class="select-file">
+              <div>
+                <h4><b> Input file </b></h4>
+                <p id="fileLocation"> no location choosen </p>
+              </div>
+              <button id="fileButton">choose file ðŸ“‚</button>
+            </div>
 
-        <div class="select-file">
-          <p><b> output type </b></p>
-          <select id="fileFormatSelect">
-            <option value="mp3">mp3 (recommended)</option>
-            <option value="ogg">ogg</option>
-            <option value="flac">flac (really long)</option>
-            <option value="m4a">m4a</option>
-          </select>
-        </div>
+            <div class="select-file">
+              <div>
+                <p><b> Output folder </b> </p>
+                <p id="folderLocation"> no location choosen </p>
+              </div>
+              <button id="folderButton">choose folder ðŸ“‚</button>
+            </div>
 
-        <button class="slice-button" id="sliceButton"> Slice ðŸ”ª</button>
+            <div class="select-file">
+              <p><b> output type </b></p>
+              <select id="fileFormatSelect">
+                <option value="mp3">mp3 (recommended)</option>
+                <option value="ogg">ogg</option>
+                <option value="flac">flac (really long)</option>
+                <option value="m4a">m4a</option>
+              </select>
+            </div>
+            <br> <br> 
+            <button class="slice-button" id="sliceButton"> Slice ðŸ”ª</button>
+          </div>
+        </div>
       </div>
 
         <footer>
           <br>
           <div class="select-file">
-            <div>
+            <div class="credit_main">
               made by <a target="_blank" href="https://www.ayabusa.dev">
                 ayabusa
               </a> ;D 
index 80b8e396343732b088ed9866b6a6d8b4371ccc30..e8e20ce02fda300f505e102abffb9c0d7c01a17a 100644 (file)
@@ -17,7 +17,8 @@
 }
 
 textarea {
-  width: 100%;
+  width: 95%;
+  flex: 1;
 }
 
 img{
@@ -42,6 +43,13 @@ img{
   height: 97vh;
 }
 
+.action-container{
+  display: grid;
+  grid-auto-flow: column;
+  grid-auto-columns: 1fr;
+
+}
+
 ::-moz-selection { /* Code for Firefox */
   color: #ffffff;
   background: #d88939;
@@ -56,6 +64,10 @@ a {
   color: #d88939;
 }
 
+.credit_main {
+  margin-left: auto;
+  margin-right: auto;
+}
 .credit {
   text-align: center;
 }
@@ -107,6 +119,7 @@ button {
   border-color: #292829;
   color: #292829;
   background-color: #d88939;
+  float: right;
 }
 
 .slice-button:hover{