switch over to tauri

This commit is contained in:
none
2023-01-13 21:58:31 +01:00
parent a462e83394
commit 981a2641c0
14 changed files with 3571 additions and 1627 deletions
+37
View File
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title id="pageTitle">IPass - x.x.x</title>
<script type="module" src="/main.js"></script>
</head>
<body>
<h1>IPass</h1>
<div class="container">
<table>
<thead>
<tr>
<td>Entry name</td>
<td>Username</td>
<td>Password</td>
</tr>
<tr>
<td class="entry_name">
ENTRY-NAME-HERE
</td>
<td class="hidden entry_user">
<input type="text" name="" id="" value="ENTRY-USERNAME-HERE">
</td>
<td class="hidden entry_pass">
<input type="text" name="" id="" value="ENTRY-PASSWORD-HERE">
</td>
</tr>
</thead>
</table>
</div>
</body>
</html>
+23
View File
@@ -0,0 +1,23 @@
const { invoke } = window.__TAURI__.tauri;
let greetInputEl;
let greetMsgEl;
async function greet() {
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value });
}
async function updateTitle() {
document.getElementById("pageTitle").innerText = `IPass - ${await invoke("get_version")}`;
}
window.addEventListener("DOMContentLoaded", () => {
updateTitle()
greetInputEl = document.querySelector("#greet-input");
greetMsgEl = document.querySelector("#greet-msg");
document
.querySelector("#greet-button")
.addEventListener("click", () => greet());
});
-37
View File
@@ -1,37 +0,0 @@
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
extern crate ip_lib;
fn main() {
let ver = option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x");
let event_loop = EventLoop::new();
WindowBuilder::new()
.with_title(format!("IPass - {ver}"))
.build(&event_loop).expect("Expected to create window");
event_loop.run(move |event, _, control_flow| {
control_flow.set_wait();
match event {
Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} => {
println!("The close button was pressed; stopping");
control_flow.set_exit();
},
Event::RedrawRequested(_) => {
//TODO: redraw application
},
_ => (),
}
});
}
+88
View File
@@ -0,0 +1,88 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
:root {
--green: #C2F9BB; /* links etc */
--fg-color: #303034; /* post background */
--bg-color: #1B1B1E; /* page background etc */
--text-color: #ECEAF1; /* text */
--blue-ish: #587291; /* buttons etc */
color: var(--text-color);
background-color: var(--bg-color);
}
a:hover {
color: #24c8db;
}
input,
button {
color: #ffffff;
background-color: #0f0f0f98;
}
.container {
margin: 0;
padding-top: 10vh;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
.row {
display: flex;
justify-content: center;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
h1 {
text-align: center;
}
input,
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
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;
}
input,
button {
outline: none;
}
#greet-input {
margin-right: 5px;
}