From def88eacad65df6f7ee72e8013c7fee41fb722b9 Mon Sep 17 00:00:00 2001 From: Padreug Date: Wed, 27 May 2026 11:24:32 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20contact=20form=20=E2=80=94=20method=20s?= =?UTF-8?q?elector,=20zod=20validation,=20Nostr=20delivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ContactForm wires vee-validate + zod against the inquiry payload: optional name, required method (Email/WhatsApp/Signal/Telegram/Nostr), contact value validated per method (email regex, phone-or-handle, @handle, npub1 prefix), and a 10-2000 char message. On submit the form calls submitInquiry() from the Nostr feature and toasts the result — partial relay acceptance still counts as success and is surfaced to the visitor. PrivacyBlurb sits above the form explaining the model in plain language: encrypted in the browser, delivered through Nostr, no server in between. Lock icon plus terse copy — the goal is to put a non-Nostr-native visitor at ease without a wall of jargon. .env.example documents the two build-time vars (VITE_OWNER_NPUB, VITE_NOSTR_RELAYS) the form depends on. Co-Authored-By: Claude Opus 4.7 (1M context) --- .env.example | 15 ++ src/components/contact/ContactForm.vue | 199 ++++++++++++++++++++++++ src/components/contact/PrivacyBlurb.vue | 20 +++ src/views/ContactView.vue | 22 ++- 4 files changed, 252 insertions(+), 4 deletions(-) create mode 100644 .env.example create mode 100644 src/components/contact/ContactForm.vue create mode 100644 src/components/contact/PrivacyBlurb.vue diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..046f296 --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +# Earth Walker Design — site env vars +# +# Both are inlined at build time by Vite. To rotate either, edit +# values here, then rebuild + redeploy. + +# The Nostr public key that receives encrypted inquiry submissions. +# Bech32 npub1... form. Generate via `nak key generate` (fiatjaf/nak) +# or any Nostr client. +VITE_OWNER_NPUB= + +# Optional. Comma-separated wss:// relay URLs the inquiry form +# publishes to. If unset, defaults to: +# wss://relay.damus.io,wss://nos.lol,wss://relay.nostr.band +# The submission succeeds if at least one relay accepts the event. +VITE_NOSTR_RELAYS= diff --git a/src/components/contact/ContactForm.vue b/src/components/contact/ContactForm.vue new file mode 100644 index 0000000..62f4210 --- /dev/null +++ b/src/components/contact/ContactForm.vue @@ -0,0 +1,199 @@ + + +