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

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();
});
});