2026-02-06 16:55:15 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<title>Direct Message</title>
|
|
|
|
|
<style>
|
2026-02-15 05:39:10 +00:00
|
|
|
*,
|
|
|
|
|
*::before,
|
|
|
|
|
*::after {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-06 16:55:15 +00:00
|
|
|
body {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding-top: 50px;
|
|
|
|
|
min-height: 120vh;
|
|
|
|
|
margin: 0;
|
2026-02-15 05:39:10 +00:00
|
|
|
font-family: system-ui, -apple-system, sans-serif;
|
|
|
|
|
background: #060a10;
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#fractal-canvas {
|
2026-05-21 11:13:36 +00:00
|
|
|
image-rendering: auto;
|
2026-02-06 16:55:15 +00:00
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
z-index: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-container {
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
2026-02-15 05:39:10 +00:00
|
|
|
background: rgba(10, 14, 20, 0.55);
|
|
|
|
|
backdrop-filter: blur(16px);
|
|
|
|
|
-webkit-backdrop-filter: blur(16px);
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
|
|
|
border-radius: 16px;
|
2026-02-06 16:55:15 +00:00
|
|
|
color: #fff;
|
2026-02-15 05:39:10 +00:00
|
|
|
padding: 2.5rem 3rem;
|
2026-02-06 16:55:15 +00:00
|
|
|
width: 90%;
|
2026-02-15 05:39:10 +00:00
|
|
|
max-width: 560px;
|
2026-02-06 16:55:15 +00:00
|
|
|
min-height: 400px;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-15 05:39:10 +00:00
|
|
|
.back-link {
|
2026-02-06 16:55:15 +00:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
2026-02-15 05:39:10 +00:00
|
|
|
margin-top: 0.5rem;
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-15 05:39:10 +00:00
|
|
|
.back-link a {
|
2026-02-06 16:55:15 +00:00
|
|
|
text-decoration: none;
|
2026-02-15 05:39:10 +00:00
|
|
|
color: rgba(255, 255, 255, 0.4);
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
letter-spacing: 0.04em;
|
|
|
|
|
transition: color 250ms ease;
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-15 05:39:10 +00:00
|
|
|
.back-link a:hover {
|
|
|
|
|
color: rgba(255, 255, 255, 0.7);
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input-group {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
label {
|
|
|
|
|
display: block;
|
|
|
|
|
margin-bottom: 5px;
|
2026-02-15 05:39:10 +00:00
|
|
|
font-weight: 300;
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
letter-spacing: 0.04em;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
color: rgba(255, 255, 255, 0.6);
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input[type="text"],
|
|
|
|
|
input[type="password"] {
|
|
|
|
|
width: 100%;
|
2026-02-15 05:39:10 +00:00
|
|
|
padding: 10px 12px;
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: rgba(255, 255, 255, 0.06);
|
2026-02-06 16:55:15 +00:00
|
|
|
color: #fff;
|
2026-02-15 05:39:10 +00:00
|
|
|
font-family: inherit;
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
transition: border-color 250ms ease, box-shadow 250ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input[type="text"]:focus,
|
|
|
|
|
input[type="password"]:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: rgba(120, 200, 220, 0.3);
|
|
|
|
|
box-shadow: 0 0 0 3px rgba(120, 200, 220, 0.1);
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textarea {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 120px;
|
2026-02-15 05:39:10 +00:00
|
|
|
padding: 10px 12px;
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
|
border-radius: 8px;
|
2026-02-06 16:55:15 +00:00
|
|
|
resize: vertical;
|
2026-02-15 05:39:10 +00:00
|
|
|
background: rgba(255, 255, 255, 0.06);
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-family: inherit;
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
transition: border-color 250ms ease, box-shadow 250ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textarea:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: rgba(120, 200, 220, 0.3);
|
|
|
|
|
box-shadow: 0 0 0 3px rgba(120, 200, 220, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button[type="submit"] {
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
background: rgba(255, 255, 255, 0.08);
|
|
|
|
|
color: rgba(255, 255, 255, 0.75);
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-family: inherit;
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
letter-spacing: 0.06em;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
transition: all 250ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button[type="submit"]:hover {
|
2026-02-06 16:55:15 +00:00
|
|
|
color: #fff;
|
2026-02-15 05:39:10 +00:00
|
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|
|
|
|
transform: translateY(-1px);
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expandable-section {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
2026-02-15 05:39:10 +00:00
|
|
|
|
2026-02-06 16:55:15 +00:00
|
|
|
.expandable-header {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
padding: 10px;
|
2026-02-15 05:39:10 +00:00
|
|
|
background: rgba(255, 255, 255, 0.06);
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
color: rgba(255, 255, 255, 0.5);
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
transition: all 250ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expandable-header:hover {
|
|
|
|
|
color: rgba(255, 255, 255, 0.7);
|
|
|
|
|
border-color: rgba(255, 255, 255, 0.15);
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
2026-02-15 05:39:10 +00:00
|
|
|
|
2026-02-06 16:55:15 +00:00
|
|
|
.expandable-content {
|
|
|
|
|
display: none;
|
|
|
|
|
padding: 10px;
|
2026-02-15 05:39:10 +00:00
|
|
|
background: rgba(255, 255, 255, 0.03);
|
|
|
|
|
border-radius: 0 0 8px 8px;
|
|
|
|
|
color: rgba(255, 255, 255, 0.6);
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes fadeInUp {
|
|
|
|
|
from {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transform: translateY(12px);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
}
|
2026-02-06 16:55:15 +00:00
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<script src="/routes/contact/pkg/message_tools.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
const { make_salt, make_key_bytes, box_message } = wasm_bindgen;
|
|
|
|
|
var serverPublicKey;
|
|
|
|
|
|
|
|
|
|
async function run() {
|
|
|
|
|
await wasm_bindgen();
|
|
|
|
|
await fetchPublicKey();
|
|
|
|
|
|
|
|
|
|
const form = document.getElementById("message-form");
|
|
|
|
|
form.addEventListener("submit", (event) => {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
submit();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
async function fetchPublicKey() {
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch("/api/pubkey");
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const pubkeyJSON = await response.text();
|
|
|
|
|
serverPublicKey = JSON.parse(pubkeyJSON);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("Error fetching public key:", error);
|
|
|
|
|
document.getElementById("status").textContent =
|
|
|
|
|
"Failed to load public key.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function submit() {
|
|
|
|
|
const user = document.getElementById("name").value;
|
|
|
|
|
const password = document.getElementById("password").value;
|
|
|
|
|
const message = document.getElementById("message").value;
|
|
|
|
|
|
|
|
|
|
const salt = make_salt();
|
|
|
|
|
|
|
|
|
|
const makeKeyBytesArgs = {
|
|
|
|
|
name: String(user),
|
|
|
|
|
password: String(password),
|
|
|
|
|
salt: [...salt],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const keyBytes = make_key_bytes(JSON.stringify(makeKeyBytesArgs));
|
|
|
|
|
|
|
|
|
|
const boxMessageArgs = {
|
|
|
|
|
user: String(user),
|
|
|
|
|
salt: [...salt],
|
|
|
|
|
user_sk: [...keyBytes],
|
|
|
|
|
remote_pk: [...serverPublicKey],
|
|
|
|
|
plaintext: String(message),
|
|
|
|
|
};
|
|
|
|
|
const boxed = box_message(JSON.stringify(boxMessageArgs));
|
|
|
|
|
const boxedObj = JSON.parse(boxed);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch("/api/publish", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify(boxedObj),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const result = await response.json();
|
|
|
|
|
alert("Sent!");
|
|
|
|
|
location.reload();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
alert("Failed to send message: " + error.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
run();
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
function toggleSection() {
|
|
|
|
|
const content = document.getElementById("expandableContent");
|
|
|
|
|
const header = document.querySelector(".expandable-header");
|
|
|
|
|
if (content.style.display === "block") {
|
|
|
|
|
content.style.display = "none";
|
|
|
|
|
header.innerHTML = "How to use ▼";
|
|
|
|
|
} else {
|
|
|
|
|
content.style.display = "block";
|
|
|
|
|
header.innerHTML = "How to use ▲";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2026-07-24 08:51:40 +00:00
|
|
|
<link rel="preload" href="/routes/root/dist-strips.bin?v=1" as="fetch" crossorigin />
|
2026-07-24 09:06:42 +00:00
|
|
|
<script defer src="/routes/root/fractal-gl.js?v=13"></script>
|
2026-02-06 16:55:15 +00:00
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<canvas id="fractal-canvas"></canvas>
|
|
|
|
|
|
|
|
|
|
<div class="form-container">
|
|
|
|
|
<form id="message-form">
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
<label for="name">Name</label>
|
|
|
|
|
<input type="text" id="name" name="name" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
<label for="password">Password (optional)</label>
|
|
|
|
|
<input type="password" id="password" name="password" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
<label for="message">Message</label>
|
|
|
|
|
<textarea id="message" name="message"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-group">
|
2026-02-15 05:39:10 +00:00
|
|
|
<button type="submit">Submit</button>
|
2026-02-06 16:55:15 +00:00
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<div class="expandable-section">
|
|
|
|
|
<div class="expandable-header" onclick="toggleSection()">
|
|
|
|
|
How to use ▼
|
|
|
|
|
</div>
|
|
|
|
|
<div class="expandable-content" id="expandableContent">
|
|
|
|
|
<p>
|
|
|
|
|
Tell me who you are, and add an optional password. If I do not
|
|
|
|
|
otherwise have your contact information, please tell me the best way
|
|
|
|
|
to reach you back.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-15 05:39:10 +00:00
|
|
|
<nav class="back-link">
|
|
|
|
|
<a href="/contact">back to contact</a>
|
2026-02-06 16:55:15 +00:00
|
|
|
</nav>
|
|
|
|
|
|
2026-07-24 08:51:40 +00:00
|
|
|
<!-- fractal background loaded via deferred <script> in <head> -->
|
|
|
|
|
|
2026-02-06 16:55:15 +00:00
|
|
|
</body>
|
|
|
|
|
</html>
|