updated form

This commit is contained in:
Keep Creating Online
2025-02-02 15:32:01 -05:00
parent 3c75e2b546
commit cb89950f92

View File

@@ -3,17 +3,19 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Content Appeals Form</title> <title>Content Appeals Form</title>
<!-- You can style the form as needed -->
<style> <style>
body { body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
margin: 20px; margin: 20px;
max-width: 600px; max-width: 600px;
background-color: #000; /* black or very dark background */
color: #fff; /* all text in white */
} }
label { label {
display: inline-block; display: inline-block;
margin: 8px 0 4px 0; margin: 8px 0 4px 0;
font-weight: bold; font-weight: bold;
color: #fff;
} }
input, input,
textarea, textarea,
@@ -22,6 +24,9 @@
padding: 6px; padding: 6px;
margin-bottom: 16px; margin-bottom: 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #234566; /* dark blue */
color: #fff; /* white text inside inputs */
border: 1px solid #888; /* border color for contrast */
} }
button { button {
padding: 10px 16px; padding: 10px 16px;
@@ -31,6 +36,10 @@
h2, h2,
h3 { h3 {
margin-top: 24px; margin-top: 24px;
color: #fff;
}
p {
color: #fff;
} }
</style> </style>
</head> </head>
@@ -139,11 +148,13 @@
<h3>5. Declaration</h3> <h3>5. Declaration</h3>
<p> <p>
By submitting this appeal, you confirm that: By submitting this appeal, you confirm that:<br />
<br />- You are the original creator or authorized representative of the - You are the original creator or authorized representative of the
content in question. <br />- Your appeal is submitted in good faith and content in question.<br />
aligns with bitvids policies. <br />- You understand that final - Your appeal is submitted in good faith and aligns with bitvids
decisions are at the discretion of bitvids moderation process. policies.<br />
- You understand that final decisions are at the discretion of bitvids
moderation process.
</p> </p>
<label for="signature">Signature (Digital or Written)</label> <label for="signature">Signature (Digital or Written)</label>
<input type="text" id="signature" name="signature" required /> <input type="text" id="signature" name="signature" required />
@@ -175,7 +186,7 @@
signEvent, signEvent,
nip04, nip04,
relayInit, relayInit,
} from "https://cdn.jsdelivr.net/npm/nostr-tools/+esm"; } from "https://cdn.jsdelivr.net/npm/nostr-tools@1.14.1/+esm";
// ---- Configure target npubs and relays here ---- // ---- Configure target npubs and relays here ----
const targetNpubs = [ const targetNpubs = [
@@ -209,13 +220,10 @@
const ephemeralPrivKey = generatePrivateKey(); const ephemeralPrivKey = generatePrivateKey();
const ephemeralPubKeyHex = getPublicKey(ephemeralPrivKey); const ephemeralPubKeyHex = getPublicKey(ephemeralPrivKey);
// Convert form data to a text block (or JSON string if you prefer) // Convert form data to JSON
const formText = JSON.stringify(dataObject, null, 2); const formText = JSON.stringify(dataObject, null, 2);
// For each target npub: // Send to each target
// 1) Convert to hex
// 2) Encrypt the form data with ephemeral key
// 3) Create and publish an event to each relay
for (const npub of targetNpubs) { for (const npub of targetNpubs) {
try { try {
const decoded = nip19.decode(npub); const decoded = nip19.decode(npub);
@@ -249,6 +257,7 @@
// Publish to configured relays // Publish to configured relays
for (const relayUrl of Object.keys(relays)) { for (const relayUrl of Object.keys(relays)) {
const relay = relayInit(relayUrl); const relay = relayInit(relayUrl);
relay.on("connect", () => { relay.on("connect", () => {
console.log(`Connected to ${relayUrl}`); console.log(`Connected to ${relayUrl}`);
}); });
@@ -266,7 +275,7 @@
console.error(`Failed to publish to ${relayUrl}:`, reason); console.error(`Failed to publish to ${relayUrl}:`, reason);
}); });
// Close the relay after a short delay or after publish // Close the relay after a short delay
setTimeout(() => { setTimeout(() => {
relay.close(); relay.close();
}, 3000); }, 3000);
@@ -276,7 +285,7 @@
} }
} }
// (Optional) Clear or reset the form // Optional: reset the form
form.reset(); form.reset();
alert("Your appeal has been submitted via Nostr DMs."); alert("Your appeal has been submitted via Nostr DMs.");
}); });