From 6d0bef598761f7040aeee37daeae8892e5103e77 Mon Sep 17 00:00:00 2001 From: ayabusa Date: Sun, 3 Mar 2024 17:33:22 +0100 Subject: [PATCH] added file format support --- src-tauri/src/main.rs | 7 +- src/index.html | 6 +- src/main.js | 2 +- src/stars.scss | 147 ------------------------------------------ 4 files changed, 9 insertions(+), 153 deletions(-) delete mode 100644 src/stars.scss diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a8b241c..a667aaf 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -35,7 +35,7 @@ async fn select_folder_button(app: tauri::AppHandle) { } #[tauri::command] -async fn slice_button(app: tauri::AppHandle, chapter: String){ +async fn slice_button(app: tauri::AppHandle, chapter: String, fileformat: String){ // Try to format the chapters and panic if it was not able to let formated_chapters = match format_chapter(&chapter) { Ok(res) => res, @@ -63,9 +63,10 @@ async fn slice_button(app: tauri::AppHandle, chapter: String){ for i in 0..time_codes.len(){ let args: Vec; + // create the path to the output file let mut output_file: PathBuf = PathBuf::from(&FOLDER_PATH.lock().unwrap().to_owned()); output_file.push(format!("{:02} - {}", i+1, title_names[i])); - output_file.set_extension("mp3"); + output_file.set_extension(&fileformat); if i+1

output type

- + - + diff --git a/src/main.js b/src/main.js index 6264076..de17f80 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,7 @@ function select_folder_button_pressed(){ } function slice_button_pressed(){ - invoke("slice_button", {chapter: document.getElementById("chapterList").value}) + invoke("slice_button", {chapter: document.getElementById("chapterList").value, fileformat: document.getElementById("fileFormatSelect").value}) } function about_button_pressed(){ diff --git a/src/stars.scss b/src/stars.scss deleted file mode 100644 index 3b4dc91..0000000 --- a/src/stars.scss +++ /dev/null @@ -1,147 +0,0 @@ -@mixin translate50 -{ - -webkit-transform: translate(-50, -50%); - -ms-transform: translate(-50, -50%); - -o-transform: translate(-50, -50%); - transform: translate(-50, -50%); -} - -@mixin roundedCorners -{ - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; -} - -@mixin rotateBase -{ - -webkit-transform: rotate3d(-1, 1, 0, 0deg); - -ms-transform: rotate3d(-1, 1, 0, 0deg); - -o-transform: rotate3d(-1, 1, 0, 0deg); - transform: rotate3d(-1, 1, 0, 0deg); -} - -@mixin rotateRight -{ - -webkit-transform: rotate3d(-1, 1, 0, 30deg); - -ms-transform: rotate3d(-1, 1, 0, 30deg); - -o-transform: rotate3d(-1, 1, 0, 30deg); - transform: rotate3d(-1, 1, 0, 30deg); -} - -@mixin rotateLeft -{ - -webkit-transform: rotate3d(-1, 1, 0, -30deg); - -ms-transform: rotate3d(-1, 1, 0, -30deg); - -o-transform: rotate3d(-1, 1, 0, -30deg); - transform: rotate3d(-1, 1, 0, -30deg); -} - -// n is number of stars generated -@function generateStars ($n) -{ - $value: '#{0} #{random(2000)}px #{random(2000)}px #FFF'; - - @for $i from 2 through $n - { - $value: '#{$value} , #{random(2000)}px #{random(2000)}px #FFF'; - } - - @return unquote($value); -} - -$stars-small: generateStars(700); -$stars-medium: generateStars(200); -$stars-big: generateStars(100); - -body -{ - overflow: hidden; -} - -#stars-container -{ - height: 200vh; - width: 200%; - background: radial-gradient(ellipse at bottom, #1B2735 0%, #191F24 100%); - overflow: hidden; - @include translate50; -} - -#stars -{ - width: 1px; - height: 1px; - background: transparent; - box-shadow: $stars-small; - animation : animateStars 28.5s ease-in-out infinite; - @include roundedCorners; - - &::after - { - content: " "; - position: absolute; - margin: auto; - top: 0; left: 0; right: 0; bottom: 0; - width: 1px; - height: 1px; - background: transparent; - box-shadow: $stars-small; - @include roundedCorners; - } -} - -#stars2 -{ - width: 2px; - height: 2px; - background: transparent; - box-shadow: $stars-medium; - animation : animateStars 30s ease-in-out infinite; - @include roundedCorners; - - &::after - { - content: " "; - position: absolute; - margin: auto; - top: 0; left: 0; right: 0; bottom: 0; - width: 2px; - height: 2px; - background: transparent; - box-shadow: $stars-medium; - @include roundedCorners; - } -} - -#stars3 -{ - width: 3px; - height: 3px; - background: transparent; - box-shadow: $stars-big; - animation : animateStars 31.5s ease-in-out infinite; - @include roundedCorners; - - &:after - { - content: " "; - position: absolute; - margin: auto; - top: 0; left: 0; right: 0; bottom: 0; - width: 3px; - height: 3px; - background: transparent; - box-shadow: $stars-big; - @include roundedCorners; - } -} - -@keyframes animateStars -{ - 0%{@include rotateBase;} - 25%{@include rotateRight;} - 50%{@include rotateBase;} - 75%{@include rotateLeft;} - 100%{@include rotateBase;} -} \ No newline at end of file