noe.sh/controls/index.html

64 lines
1.3 KiB
HTML

<!DOCTYPE html>
<title>noe control panel</title>
<link rel="preconnect" href="https://fonts.bunny.net" />
<link
href="https://fonts.bunny.net/css?family=atkinson-hyperlegible:400,400i,700,700i"
rel="stylesheet"
/>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/3.4.2/gl-matrix-min.js"
referrerpolicy="no-referrer"
></script>
<style>
:root {
font-family: "Atkinson Hyperlegible", sans-serif;
background-color: black;
color: #efefef;
}
section {
padding: 2em;
}
.hidden {
user-select: none;
pointer-events: none;
opacity: 0.2;
}
</style>
<div id="preconnect">
<form>
<label for="publickey">Public Key</label>
<input id="publickey" />
<input type="submit" value="Connect" />
<button>Generate</button>
</form>
</div>
<div class="hidden" id="controls"></div>
<script defer async>
const setPkForm = (pk) => (document.querySelector("#publickey").value = pk);
const boot = () => {
const existingKey = localStorage.getItem("keypair");
if (existingKey) {
const { publicKey, privateKey } = JSON.parse(existingKey);
setPkForm(publicKey);
}
};
const generateKeys = async () => {
await crypto.subtle.generateKey(
{
name: "ECDH",
namedCurve: "P-384",
},
false,
["encrypt", "decrypt"]
);
};
setTimeout(boot, 0);
</script>