gonna try nfd

main
Bel LaPointe 2023-12-27 20:51:02 -05:00
parent 2645c63bf5
commit 4f69c24e44
3 changed files with 1074 additions and 0 deletions

1000
src/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

11
src/Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "src"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
dioxus = "0.4.3"
dioxus-web = "0.4.3"
#dioxus-desktop = "0.4.3"

63
src/src/main.rs Normal file
View File

@ -0,0 +1,63 @@
#![allow(non_snake_case)]
// import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
use dioxus::prelude::*;
fn main() {
// launch the dioxus app in a webview
// dioxus_desktop::launch(App);
dioxus_web::launch(App);
}
// define a component that renders a div with the text "Hello, world!"
fn App(cx: Scope) -> Element {
let file = use_state(cx, String::new);
cx.render(rsx! {
header {
h1 { "home-video-blue-extractinator" }
}
main {
rsx! {
div {
input {
r#type: "file",
onchange: |evt| {
to_owned![file];
async move {
match &evt.files {
Some(file_engine) => {
match file_engine.files().iter().nth(0) {
Some(f) => {
file.set("...".to_string());
match file_engine.read_file_to_string(f).await {
Some(content) => { file.set("ok".to_string()); },
None => {},
};
match file_engine.get_native_file(f).await {
Some(f) => { file.set(format!("{:?}", f.type_id())); },
None => { file.set("failed to get native file".to_string()); },
};
},
None => {},
};
}
None => {},
};
}
},
},
input { r#type: "button", value: "analyze", onclick: move |evt| { analyze(evt); } }
input { r#type: "button", value: "clipify", onclick: move |evt| { clipify(evt); } }
}
h2 { file.get().clone() }
}
}
})
}
fn analyze(evt: Event<MouseData>) {
eprintln!("analyze");
}
fn clipify(evt: Event<MouseData>) {
eprintln!("clipify");
}