Initial commit

This commit is contained in:
Bianca Fürstenau 2025-02-09 08:22:57 +01:00
commit 96033b4b9f
15 changed files with 6300 additions and 0 deletions

5542
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

28
src-tauri/Cargo.toml Normal file
View file

@ -0,0 +1,28 @@
[package]
name = "bkbh"
version = "0.1.0"
description = "A Tauri App"
authors = ["Bianca Fürstenau"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "bkbh_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rusqlite = {version = "^0.33", features = ["backup", "bundled"] }
rand = {version = "^0.9"}
chrono = {version = "^0.4"}
tokio = {version = "^1.43"}

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

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

90
src-tauri/src/lib.rs Normal file
View file

@ -0,0 +1,90 @@
use rusqlite::{Connection, ToSql, types::ToSqlOutput};
use rand::prelude::*;
use tokio::sync::Mutex;
use tauri::{Manager, State};
use chrono::offset::Utc;
struct AppState {
db: Connection,
acc: i64,
}
#[derive(Clone, Copy)]
enum Store {
Aldi,
Rewe,
}
impl TryFrom<&str> for Store {
type Error = ();
fn try_from(s: &str) -> Result<Self, Self::Error> {
match s {
"aldi" => Ok(Store::Aldi),
"rewe" => Ok(Store::Rewe),
_ => Err(()),
}
}
}
impl ToSql for Store {
fn to_sql(&self) -> rusqlite::Result<ToSqlOutput<'_>> {
match self {
Store::Aldi => 0.to_sql(),
Store::Rewe => 1.to_sql(),
}
}
}
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
async fn swap(store: &str, state: State<'_, Mutex<AppState>>) -> Result<(), ()> {
let state = state.lock().await;
let mut rng = rand::rng();
let store: Store = store.try_into()?;
state.db.execute(
"INSERT INTO swap VALUES (?1, ?2, ?3, ?4, ?5)",
(
rng.random::<i64>(),
store,
state.acc,
Utc::now().timestamp(),
false,
),
).map_err(|_| ())?;
Ok(())
}
#[tauri::command]
async fn count(state: State<'_, Mutex<AppState>>) -> Result<String, ()> {
let state = state.lock().await;
let mut stmt = state.db.prepare("SELECT COUNT(*) FROM swap").unwrap();
let mut rows = stmt.query([]).unwrap();
let row = rows.next().unwrap().unwrap();
let cnt: u64 = row.get_unwrap(0);
Ok(cnt.to_string())
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
let mut rng = rand::rng();
let db = Connection::open_in_memory().expect("Failed to create DB.");
let acc = rng.random::<i64>();
db.execute(
"CREATE TABLE swap (
rand INTEGER,
store INTEGER,
account INTEGER,
time INTEGER,
cancellation BOOL
)",
(),
).unwrap();
let state = AppState { db, acc };
tauri::Builder::default()
.setup(|app| {app.manage(Mutex::new(state)); Ok(())})
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![swap, count])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

6
src-tauri/src/main.rs Normal file
View file

@ -0,0 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
bkbh_lib::run()
}

33
src-tauri/tauri.conf.json Normal file
View file

@ -0,0 +1,33 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "bkbh",
"version": "0.1.0",
"identifier": "de.mathebau.bkbh",
"build": {
"frontendDist": "../src"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"title": "bkbh",
"width": 800,
"height": 600
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}

1
src/assets/aldi.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.2 KiB

87
src/assets/dm.svg Normal file
View file

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="26.17"
height="17.99"
id="svg8819"
version="1.1"
inkscape:version="0.48.1 "
sodipodi:docname="Neues Dokument 3">
<defs
id="defs8821" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="28.838184"
inkscape:cx="13.085001"
inkscape:cy="8.9950048"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1024"
inkscape:window-height="678"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1" />
<metadata
id="metadata8824">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-185.59787,-361.11766)">
<g
id="g3924"
transform="matrix(1.25,0,0,-1.25,187.11859,376.17053)">
<path
inkscape:connector-curvature="0"
d="m 0,0 c 0.192,-0.683 0.581,-1.548 0.581,-1.548 0,0 3.169,1.771 7.426,1.477 0.967,-0.069 1.816,-0.337 1.816,-0.337 0,0 -1.735,1.136 -2.083,1.246 C 6.069,1.256 4.479,1.378 3.538,1.412 3.538,1.412 1.229,1.146 0,0 M 18.346,1.3 C 17.488,0.716 15.766,0.068 13.11,0.738 12.856,0.805 12.614,0.869 12.38,0.941 10.704,1.667 9.002,2.455 8.312,2.967 c 1.921,-0.302 5.212,-0.592 10.032,0.254 0,0 0.268,-0.665 0.422,-1.5 L 18.346,1.3"
style="fill:#ed1c24;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3926" />
</g>
<g
id="g3928"
transform="matrix(1.25,0,0,-1.25,210.57484,374.01933)">
<path
inkscape:connector-curvature="0"
d="M 0,0 C -0.108,-0.101 -0.201,-0.173 -0.421,-0.319 -1.279,-0.904 -3,-1.653 -5.656,-0.983 c -0.254,0.066 -0.496,0.133 -0.73,0.203 -2.422,0.713 -3.887,1.642 -7.113,2.035 -2.748,-0.078 -4.472,-0.384 -5.683,-0.821 0.062,-0.904 0.259,-1.588 0.416,-2.155 0.23,0.114 1.925,0.983 3.538,1.413 0.756,0.204 1.567,0.338 2.31,0.295 2.48,-0.158 4.48,-1.443 6.698,-2.487 1.54,-0.431 4.843,-0.71 6.306,-0.219 0,0 0.202,1.141 -0.086,2.719"
style="fill:#ffc50b;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3930" />
</g>
<g
id="g3932"
transform="matrix(1.25,0,0,-1.25,207.24609,371.96303)">
<path
inkscape:connector-curvature="0"
d="m 0,0 -1.454,0 0.528,3.289 c 0.108,0.538 0.031,0.742 -0.214,0.742 -0.495,0 -1.388,-1.31 -1.593,-2.593 L -2.964,0 -4.416,0 -3.873,3.289 c 0.108,0.538 0.033,0.742 -0.214,0.742 -0.495,0 -1.363,-1.293 -1.601,-2.562 L -5.967,0 l -1.452,0 0.785,4.124 0,0.032 C -6.87,4.198 -7.223,4.242 -7.536,4.264 l 0.205,1.003 c 0.772,0.087 1.504,0.13 2.309,0.097 C -5.108,4.944 -5.248,4.46 -5.431,3.986 l 0.022,-0.001 c 0.484,0.83 0.999,1.467 1.944,1.467 0.634,0 1.046,-0.334 1.046,-1.056 0,-0.129 -0.032,-0.268 -0.086,-0.484 l 0.011,-0.01 c 0.493,0.894 1.093,1.55 2.036,1.55 1.042,0 1.253,-0.755 1.06,-1.756 L 0,0 z M -8.81,0.001 -10.272,0 c 0.065,0.387 0.191,0.816 0.395,1.386 l -0.022,0 c -0.459,-0.774 -1.114,-1.516 -1.943,-1.516 -0.849,0 -1.275,0.55 -1.275,1.701 0,2.026 1.048,3.881 3.401,3.881 0.128,0 0.257,-0.012 0.461,-0.043 l 0.235,1.239 0,0.009 C -9.256,6.7 -9.608,6.743 -9.922,6.765 l 0.206,1.004 c 0.744,0.072 1.507,0.129 2.398,0.096 L -8.81,0.001 z m -1.189,4.232 c -0.999,0 -1.587,-1.411 -1.587,-2.403 0,-0.407 0.102,-0.589 0.317,-0.589 0.569,0 1.53,1.639 1.72,2.662 l 0.051,0.263 c -0.14,0.032 -0.297,0.067 -0.501,0.067"
style="fill:#143f90;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3934" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

291
src/assets/edeka.svg Normal file
View file

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="200.40892mm"
height="242.35304mm"
viewBox="0 0 200.40892 242.35304"
version="1.1"
id="svg2010"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2007">
<linearGradient
id="SVGID_1_"
gradientUnits="userSpaceOnUse"
x1="-305.52081"
y1="-414.49149"
x2="446.6221"
y2="485.20499"
gradientTransform="matrix(1,0,0,-1,0.04,73.439)">
<stop
offset="0"
style="stop-color:#0E347A"
id="stop2" />
<stop
offset="0.25"
style="stop-color:#003D84"
id="stop4" />
<stop
offset="0.5423"
style="stop-color:#00549E"
id="stop6" />
<stop
offset="0.75"
style="stop-color:#0062AE"
id="stop8" />
<stop
offset="1"
style="stop-color:#0075BE"
id="stop10" />
</linearGradient>
<linearGradient
id="SVGID_2_"
gradientUnits="userSpaceOnUse"
x1="-300.25659"
y1="-411.15161"
x2="450.08759"
y2="493.03949"
gradientTransform="matrix(0.26458333,0,0,-0.26458333,85.303469,145.55963)">
<stop
offset="0"
style="stop-color:#0E347A"
id="stop15" />
<stop
offset="0.25"
style="stop-color:#003D84"
id="stop17" />
<stop
offset="0.5423"
style="stop-color:#00549E"
id="stop19" />
<stop
offset="0.75"
style="stop-color:#0062AE"
id="stop21" />
<stop
offset="1"
style="stop-color:#0075BE"
id="stop23" />
</linearGradient>
<clipPath
id="SVGID_4_">
<use
xlink:href="#SVGID_3_"
overflow="visible"
id="use31" />
</clipPath>
<clipPath
id="SVGID_6_">
<use
xlink:href="#SVGID_5_"
overflow="visible"
id="use45" />
</clipPath>
<clipPath
id="SVGID_8_">
<use
xlink:href="#SVGID_7_"
overflow="visible"
id="use59" />
</clipPath>
<clipPath
id="SVGID_10_">
<use
xlink:href="#SVGID_9_"
overflow="visible"
id="use71" />
</clipPath>
<clipPath
id="SVGID_12_">
<use
xlink:href="#SVGID_11_"
overflow="visible"
id="use85" />
</clipPath>
<linearGradient
id="SVGID_13_"
gradientUnits="userSpaceOnUse"
x1="-284.42899"
y1="-398.69849"
x2="428.12701"
y2="473.103"
gradientTransform="matrix(0.26458333,0,0,-0.26458333,85.303469,145.55963)">
<stop
offset="0"
style="stop-color:#FFD400"
id="stop96" />
<stop
offset="0.9"
style="stop-color:#FFE500"
id="stop98" />
<stop
offset="1"
style="stop-color:#FFE500"
id="stop100" />
</linearGradient>
<linearGradient
id="SVGID_14_"
gradientUnits="userSpaceOnUse"
x1="-209.6492"
y1="-330.509"
x2="357.15991"
y2="390.14819"
gradientTransform="matrix(0.26458333,0,0,-0.26458333,85.303469,145.55963)">
<stop
offset="0"
style="stop-color:#0E347A"
id="stop139" />
<stop
offset="0.25"
style="stop-color:#003D84"
id="stop141" />
<stop
offset="0.5423"
style="stop-color:#00549E"
id="stop143" />
<stop
offset="0.75"
style="stop-color:#0062AE"
id="stop145" />
<stop
offset="1"
style="stop-color:#0075BE"
id="stop147" />
</linearGradient>
<path
id="SVGID_3_"
d="m -285.437,466.849 v -867.048 l 6.943,-6.199 h 706.352 l 6.79,5.229 v 867.928 l -6.089,5.467 H -279.47 Z m -14.481,-891.92 c -2.314,0 -4.202,1.872 -4.202,4.186 v 907.608 c 0,2.314 1.888,4.186 4.202,4.186 h 749.043 c 2.319,0 4.206,-1.877 4.206,-4.186 v -907.608 c 0,-2.314 -1.887,-4.186 -4.206,-4.186 z" />
<path
id="SVGID_5_"
d="m -285.437,466.849 v -867.048 l 6.943,-6.199 h 706.352 l 6.79,5.229 v 867.928 l -6.089,5.467 H -279.47 Z m -14.481,-891.92 c -2.314,0 -4.202,1.872 -4.202,4.186 v 907.608 c 0,2.314 1.888,4.186 4.202,4.186 h 749.043 c 2.319,0 4.206,-1.877 4.206,-4.186 v -907.608 c 0,-2.314 -1.887,-4.186 -4.206,-4.186 z" />
<path
id="SVGID_7_"
d="m -285.437,466.849 v -867.048 l 6.943,-6.199 h 706.352 l 6.79,5.229 v 867.928 l -6.089,5.467 H -279.47 Z m -14.481,-891.92 c -2.314,0 -4.202,1.872 -4.202,4.186 v 907.608 c 0,2.314 1.888,4.186 4.202,4.186 h 749.043 c 2.319,0 4.206,-1.877 4.206,-4.186 v -907.608 c 0,-2.314 -1.887,-4.186 -4.206,-4.186 z" />
<path
id="SVGID_9_"
d="m -285.437,466.849 v -867.048 l 6.943,-6.199 h 706.352 l 6.79,5.229 v 867.928 l -6.089,5.467 H -279.47 Z m -14.481,-891.92 c -2.314,0 -4.202,1.872 -4.202,4.186 v 907.608 c 0,2.314 1.888,4.186 4.202,4.186 h 749.043 c 2.319,0 4.206,-1.877 4.206,-4.186 v -907.608 c 0,-2.314 -1.887,-4.186 -4.206,-4.186 z" />
<path
id="SVGID_11_"
d="m -285.437,466.849 v -867.048 l 6.943,-6.199 h 706.352 l 6.79,5.229 v 867.928 l -6.089,5.467 H -279.47 Z m -14.481,-891.92 c -2.314,0 -4.202,1.872 -4.202,4.186 v 907.608 c 0,2.314 1.888,4.186 4.202,4.186 h 749.043 c 2.319,0 4.206,-1.877 4.206,-4.186 v -907.608 c 0,-2.314 -1.887,-4.186 -4.206,-4.186 z" />
</defs>
<g
id="layer1"
transform="translate(-4.8278042,-13.66219)">
<polygon
fill="url(#SVGID_1_)"
points="-285.437,-400.199 -285.437,467.598 -279.469,472.226 428.559,472.226 434.648,466.759 434.648,-401.169 427.858,-406.399 -278.494,-406.399 "
id="polygon13"
style="fill:url(#SVGID_1_)"
transform="matrix(0.26458333,0,0,0.26458333,85.292886,126.12889)" />
<path
fill="url(#SVGID_2_)"
d="M 9.7710145,249.84753 V 20.242907 L 11.608016,18.602755 H 198.49698 l 1.79653,1.383506 V 249.62555 l -1.61105,1.44647 H 11.349783 Z M 5.9395833,13.66219 c -0.6122458,0 -1.1117791,0.4953 -1.1117791,1.107546 V 254.90769 c 0,0.61224 0.4995333,1.10754 1.1117791,1.10754 H 204.12388 c 0.61357,0 1.11284,-0.49662 1.11284,-1.10754 V 14.769736 c 0,-0.612246 -0.49927,-1.107546 -1.11284,-1.107546 z"
id="path26"
style="fill:url(#SVGID_2_);stroke-width:0.264583" />
<g
id="g40"
transform="matrix(0.26458333,0,0,0.26458333,85.292886,126.12889)">
<g
id="g38">
<defs
id="defs29" />
<clipPath
id="clipPath3847">
<use
xlink:href="#SVGID_3_"
overflow="visible"
id="use3845" />
</clipPath>
<g
transform="translate(1.037872e-6)"
clip-path="url(#SVGID_4_)"
id="g36" />
</g>
</g>
<g
id="g54"
transform="matrix(0.26458333,0,0,0.26458333,85.292886,126.12889)">
<g
id="g52">
<defs
id="defs43" />
<clipPath
id="clipPath3857">
<use
xlink:href="#SVGID_5_"
overflow="visible"
id="use3855" />
</clipPath>
<g
clip-path="url(#SVGID_6_)"
id="g50" />
</g>
</g>
<g
id="g80"
transform="matrix(0.26458333,0,0,0.26458333,85.292886,126.12889)">
<g
id="g66">
<defs
id="defs57" />
<clipPath
id="clipPath3867">
<use
xlink:href="#SVGID_7_"
overflow="visible"
id="use3865" />
</clipPath>
<g
clip-path="url(#SVGID_8_)"
id="g64" />
</g>
<g
id="g78">
<defs
id="defs69" />
<clipPath
id="clipPath3876">
<use
xlink:href="#SVGID_9_"
overflow="visible"
id="use3874" />
</clipPath>
<g
clip-path="url(#SVGID_10_)"
id="g76" />
</g>
</g>
<g
id="g94"
transform="matrix(0.26458333,0,0,0.26458333,85.292886,126.12889)">
<g
id="g92">
<defs
id="defs83" />
<clipPath
id="clipPath3886">
<use
xlink:href="#SVGID_11_"
overflow="visible"
id="use3884" />
</clipPath>
<g
clip-path="url(#SVGID_12_)"
id="g90" />
</g>
</g>
<path
fill="url(#SVGID_13_)"
d="m 11.41831,18.60249 c -0.906727,0 -1.6472955,0.741892 -1.6472955,1.647296 V 249.42473 c 0,0.90646 0.7405685,1.64729 1.6472955,1.64729 h 187.22684 c 0.90673,0 1.64836,-0.74189 1.64836,-1.64729 V 20.249786 c 0,-0.905139 -0.7419,-1.647296 -1.64836,-1.647296 z"
id="path103"
style="fill:url(#SVGID_13_);stroke-width:0.264583" />
<path
fill="url(#SVGID_14_)"
d="m 28.932668,205.82483 v 26.05485 0.002 h 25.626483 v -6.16902 H 36.835507 v -4.19444 h 17.723644 v -5.69357 H 36.835507 v -4.12432 h 17.723644 v -5.87508 z m 38.548997,6.16823 h 3.895725 c 5.619486,0 9.267031,1.97062 9.267031,6.71301 0,5.21785 -3.028156,6.89875 -9.267031,7.0059 h -3.895725 z m -7.57211,-6.16823 V 231.881 H 72.83789 c 9.603052,0 15.490561,-4.60005 15.490561,-13.13736 0,-8.0645 -5.79808,-12.91881 -15.490561,-12.91881 z m 81.444575,0 -9.80123,11.24771 v -11.24771 h -7.90707 V 231.881 h 7.90707 v -5.55678 l 4.12856,-3.75761 7.05035,9.31439 h 9.63666 l -11.42736,-14.57299 10.74976,-11.48185 h -10.33674 z m 26.74646,6.2865 h 0.89403 l 3.24564,8.65056 h -7.17073 z m -5.65599,-6.2865 -8.71882,26.05617 h 7.84701 l 1.59412,-4.67254 h 11.01989 l 1.41711,4.67254 h 7.77478 l -8.81512,-26.05617 z m -69.831487,0 V 231.881 h 25.624897 v -6.05896 h -17.72205 v -4.3045 h 17.72205 v -5.69357 h -17.72205 v -4.12433 l 17.5969,0.099 v -5.9862 z M 28.932668,40.055701 V 190.87561 H 178.20159 V 150.20783 H 74.119797 V 134.83871 H 178.20159 V 95.133218 H 74.119797 V 81.043098 H 178.20159 V 40.055701 Z"
id="path150"
style="fill:url(#SVGID_14_);stroke-width:0.264583" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

11
src/assets/lidl.svg Normal file
View file

@ -0,0 +1,11 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60">
<path fill="#0050aa" d="M0.522 0.522h58.957v58.957h-58.957z"></path>
<path fill="#fff" d="M59.478 0.522v58.957h-58.957v-58.957h58.957zM60 0h-60v60h60v-60z"></path>
<path fill="#fff000" d="M30 3.85c-14.442 0-26.15 11.708-26.15 26.15s11.708 26.15 26.15 26.15c14.438 0 26.144-11.702 26.15-26.139v-0.001c0-14.444-11.706-26.154-26.149-26.16h-0.001z"></path>
<path fill="#e60a14" d="M28.377 30.736l-4.617-4.617-5.322 5.332v1.79l1.341-1.346 3.715 3.725-1.372 1.367 0.892 0.897 7.43-7.44v-1.784l-2.066 2.077z"></path>
<path fill="#0050aa" d="M6.824 25.148h8.223v1.774h-1.372v5.739l4.763-2.65v4.857h-11.614v-1.784h1.377v-6.162h-1.377v-1.774zM41.494 25.148v1.774h1.377v6.162h-1.377v1.784h11.624v-4.857l-4.769 2.65v-5.739h1.377v-1.774h-8.233z"></path>
<path fill="#e60a14" d="M23.082 19.623c1.616 0 2.927 1.31 2.927 2.927s-1.31 2.927-2.927 2.927c-1.616 0-2.927-1.31-2.927-2.927 0-0.004 0-0.007 0-0.011v0.001c0 0 0 0 0 0 0-1.611 1.306-2.917 2.917-2.917 0.004 0 0.007 0 0.011 0h-0.001z"></path>
<path fill="#e60a14" d="M30 2.087c-0.002 0-0.003 0-0.005 0-15.419 0-27.918 12.499-27.918 27.918s12.499 27.918 27.918 27.918c15.417 0 27.915-12.496 27.918-27.913v-0c-0.003-15.417-12.497-27.915-27.912-27.923h-0.001zM30 56.155c-14.442 0-26.15-11.708-26.15-26.15s11.708-26.15 26.15-26.15c14.442 0 26.15 11.708 26.15 26.15 0 0.004 0 0.007 0 0.011v-0.001c-0.012 14.434-11.714 26.131-26.149 26.134h-0z"></path>
<path fill="#0050aa" d="M36.913 25.148h-7.826v1.774h1.372v6.162h-1.388v1.784h7.826c5.812 0 5.885-9.72 0.016-9.72z"></path>
<path fill="#fff000" d="M35.812 31.826h-0.391v-3.652h0.329c1.717 0 1.717 3.652 0.063 3.652z"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

1
src/assets/rewe.svg Normal file
View file

@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.81 208.4"><defs><style>.cls-1{fill:#cc071e;}.cls-2{fill:#fff;}</style></defs><title>Zeichenfläche 2</title><rect class="cls-1" width="599.81" height="208.4"/><path class="cls-2" d="M64.56,175.26c7.92,0,11.67-3.75,11.67-11.46v-42.1h.42L101.25,164c4.59,7.92,8.55,11.26,15.63,11.26h24.8c6,0,11-2.29,11-7.09q0-2.81-2.5-6.88l-30.43-45C139.39,109,147.93,95,147.93,78.34c0-28.14-16.67-44.81-60.44-44.81H44.76C37,33.52,33.3,37.28,33.3,45.2v118.6c0,7.71,3.75,11.46,11.46,11.46ZM76.23,95.64V66H85.4c12.3,0,17.51,5.21,17.51,14.8S97.7,95.64,85.4,95.64Zm180.92,79.62c7.92,0,11.67-3.75,11.67-11.46V153.58c0-7.92-3.75-11.67-11.67-11.67H210.46V120.65h34.18c7.92,0,11.67-3.75,11.67-11.46V99c0-7.92-3.75-11.67-11.67-11.67H210.46V66.87H250.9c7.92,0,11.67-3.75,11.67-11.46V45.2c0-7.92-3.75-11.67-11.67-11.67H178.16c-7.71,0-11.46,3.75-11.46,11.67v118.6c0,7.71,3.75,11.46,11.46,11.46ZM388,44.78c-1.67-7.92-5.63-11.26-14.38-11.26H355.95c-8.75,0-12.71,3.33-14.38,11.26L327.39,114.4H327L315.51,44.78c-1.25-7.92-5.21-11.26-14.38-11.26H284c-7.09,0-11,3.13-11,9.38a20,20,0,0,0,.63,4.58l27.3,116.3c1.88,7.71,5.63,11.46,15.42,11.46h17.09c8.75,0,12.71-3.34,14.38-11.26l15.63-76.08h.42L379.5,164c1.67,7.92,5.63,11.26,14.38,11.26H411c9.8,0,13.55-3.75,15.42-11.46l27.3-116.3a19.9,19.9,0,0,0,.63-4.58c0-6.25-4.17-9.38-11-9.38H428.69c-9.17,0-13.13,3.33-14.38,11.26L402.84,114.4h-.42L388,44.78ZM555.21,175.26c7.92,0,11.67-3.75,11.67-11.46V153.58c0-7.92-3.75-11.67-11.67-11.67H508.52V120.65H542.7c7.92,0,11.67-3.75,11.67-11.46V99c0-7.92-3.75-11.67-11.67-11.67H508.52V66.87H549c7.92,0,11.67-3.75,11.67-11.46V45.2c0-7.92-3.75-11.67-11.67-11.67H476.21c-7.71,0-11.46,3.75-11.46,11.67v118.6c0,7.71,3.75,11.46,11.46,11.46Z"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

1
src/assets/tegut.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.7 KiB

70
src/index.html Normal file
View file

@ -0,0 +1,70 @@
<!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>Tauri App</title>
<script type="module" src="/main.js" defer></script>
</head>
<body>
<main class="container">
<form class="column" id="aldi-form">
<button type="submit">
<img
src="/assets/aldi.svg"
class="logo"
alt="ALDI-Süd-Logo"
/>
</button>
</form>
<form class="column" id="edeka-form">
<button type="submit">
<img
src="/assets/edeka.svg"
class="logo"
alt="Edeka-Logo"
/>
</button>
</form>
<form class="column" id="dm-form">
<button type="submit">
<img
src="/assets/dm.svg"
class="logo"
alt="dm-Logo"
/>
</button>
</form>
<form class="column" id="lidl-form">
<button type="submit">
<img
src="/assets/lidl.svg"
class="logo"
alt="Lidl-Logo"
/>
</button>
</form>
<form class="column" id="rewe-form">
<button type="submit">
<img
src="/assets/rewe.svg"
class="logo"
alt="Rewe-Logo"
/>
</button>
</form>
<form class="column" id="tegut-form">
<button type="submit">
<img
src="/assets/tegut.svg"
class="logo"
alt="Tegut-Logo"
/>
</button>
</form>
<p id="cnt-msg"></p>
</main>
</body>
</html>

30
src/main.js Normal file
View file

@ -0,0 +1,30 @@
const { invoke } = window.__TAURI__.core;
let cntMsgEl;
// async function greet() {
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
// greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value });
//}
async function aldi() {
await invoke("swap", { store: "aldi" });
cntMsgEl.textContent = await invoke("count", {});
}
async function rewe() {
invoke("swap", { store: "rewe" });
cntMsgEl.textContent = await invoke("count", {});
}
window.addEventListener("DOMContentLoaded", () => {
cntMsgEl = document.querySelector("#cnt-msg");
document.querySelector("#aldi-form").addEventListener("submit", (e) => {
e.preventDefault();
aldi();
});
document.querySelector("#rewe-form").addEventListener("submit", (e) => {
e.preventDefault();
rewe();
});
});

106
src/styles.css Normal file
View file

@ -0,0 +1,106 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color: #0f0f0f;
background-color: #f6f6f6;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
.container {
margin: 0;
display: flex;
flex-direction: row;
justify-content: center;
text-align: center;
}
.logo {
padding: 0em 0em;
will-change: filter;
transition: 0.75s;
max-height: 2cm;
width: 3cm;
}
.row {
display: flex;
justify-content: center;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
h1 {
text-align: center;
}
button {
width: 3.5cm;
height: 2.5cm;
border-radius: 8px;
border: 1px solid transparent;
padding: 0.5em 0.5em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
color: #0f0f0f;
background-color: #ffffff;
transition: border-color 0.25s;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}
button {
cursor: pointer;
}
button:hover {
border-color: #396cd8;
}
button:active {
border-color: #396cd8;
background-color: #e8e8e8;
}
input,
button {
outline: none;
}
#greet-input {
margin-right: 5px;
}
@media (prefers-color-scheme: dark) {
:root {
color: #f6f6f6;
background-color: #2f2f2f;
}
a:hover {
color: #24c8db;
}
input,
button {
color: #ffffff;
background-color: #0f0f0f98;
}
button:active {
background-color: #0f0f0f69;
}
}