diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index de948fa..2cee9ae 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2,6 +2,25 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "NEIN" +version = "0.1.0" +dependencies = [ + "chrono", + "curl", + "openssl", + "rand 0.8.5", + "ring-compat", + "rusqlite", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-fs", + "tauri-plugin-opener", + "tokio", +] + [[package]] name = "addr2line" version = "0.24.2" @@ -304,25 +323,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bkbh" -version = "0.1.0" -dependencies = [ - "chrono", - "curl", - "openssl", - "rand 0.8.5", - "ring-compat", - "rusqlite", - "serde", - "serde_json", - "tauri", - "tauri-build", - "tauri-plugin-fs", - "tauri-plugin-opener", - "tokio", -] - [[package]] name = "block" version = "0.1.6" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 1cabfea..e2994ae 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "bkbh" +name = "NEIN" version = "0.1.0" -description = "A Tauri App" +description = "Buchhaltung für „Darmstadt sagt Nein zur Bezahlkarte!“" authors = ["Bianca Fürstenau"] edition = "2021" diff --git a/src-tauri/src/data_door.rs b/src-tauri/src/data_door.rs index 16b7d55..2d7b473 100644 --- a/src-tauri/src/data_door.rs +++ b/src-tauri/src/data_door.rs @@ -101,13 +101,15 @@ async fn push_key(id: &u64, key: &SigningKey) -> Result<(), ()> { Ok(()) } -fn push_db(id: &u64, db: &Connection) -> Result<(), ()> { - let file = format!("{:016X}.sqlite", id); - db.backup(DatabaseName::Main, "tmp.sqlite", None) +fn push_db(id: &u64, db: &Connection, app: tauri::AppHandle) -> Result<(), ()> { + let filename = format!("{:016X}.sqlite", id); + let path = app.path().resolve(&filename, tauri::path::BaseDirectory::Temp) .map_err(|e| println!("{:?}", e))?; - let buf = std::fs::read("tmp.sqlite") + db.backup(DatabaseName::Main, &path, None) .map_err(|e| println!("{:?}", e))?; - let mut client = put_client(&file, buf.as_ref())?; + let buf = std::fs::read(&path) + .map_err(|e| println!("{:?}", e))?; + let mut client = put_client(&filename, buf.as_ref())?; let perf = client.perform() .map_err(|e| println!("{:?}", e))?; Ok(()) @@ -115,10 +117,11 @@ fn push_db(id: &u64, db: &Connection) -> Result<(), ()> { #[tauri::command] pub async fn push_data( + app: tauri::AppHandle, state: State<'_, Mutex>, ) -> Result<(), ()> { let state = state.lock().await; push_key(&state.id, &state.key).await?; - push_db(&state.id, &state.db); + push_db(&state.id, &state.db, app); Ok(()) } diff --git a/src/assets/hessen_sagt_nein.otf b/src/assets/hessen_sagt_nein.otf new file mode 100644 index 0000000..46cb761 Binary files /dev/null and b/src/assets/hessen_sagt_nein.otf differ diff --git a/src/index.html b/src/index.html index 2ec4ca7..55e6d2f 100644 --- a/src/index.html +++ b/src/index.html @@ -9,7 +9,8 @@ -
+
+
-
-

-
-
+ +
+ + + +
+
+
+

+
+
+
-
+

diff --git a/src/styles.css b/src/styles.css index 7a4774e..5f44d56 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,5 +1,10 @@ +@font-face { + font-family: hessenSagtNein; + src: url(assets/hessen_sagt_nein.otf); +} + :root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; + font-family: Noto Sans, sans-serif; font-size: 16px; line-height: 24px; font-weight: 400; @@ -14,7 +19,7 @@ -webkit-text-size-adjust: 100%; } -.container { +.h-container { margin: auto; display: flex; flex-direction: row; @@ -24,6 +29,16 @@ gap: 3mm; } +.v-container { + margin: auto; + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: space-around; + text-align: center; + gap: 3mm; +} + .logo { margin: auto; padding: 0em 0em; @@ -76,6 +91,11 @@ button { cursor: pointer; } +.shout { + font-size: 1.2cm; + font-family: hessenSagtNein; +} + button:hover { border-color: #396cd8; }