Astro + React islands + MDX with a theme system (terminal, concrete, nostromo, overgrowth), USMT Dash case study, work/log/sound/models/about/ contact pages, RSS, self-hosted contact form over SMTP, /media proxy to Nextcloud, Dockerfile for Coolify, and a GitHub Action that mirrors main to Gitea.
This commit is contained in:
64 files changed
+9066
No files matched your search
@@ -0,0 +1,161 @@
|
||||
---
|
||||
import Base from '../layouts/Base.astro';
|
||||
import { SITE } from '../lib/site';
|
||||
---
|
||||
|
||||
<Base title="Contact" description="Hire Johan Sandoval or get in touch.">
|
||||
<section class="wrap section layout">
|
||||
<div class="stack side">
|
||||
<p class="label label--accent">// 06 — Open channel</p>
|
||||
<h1>Contact</h1>
|
||||
<p class="lead">
|
||||
Hiring, freelance, collaborations, or you just want to talk about a game, a model or a riff.
|
||||
I read everything.
|
||||
</p>
|
||||
<dl class="readout">
|
||||
<dt>Mail</dt>
|
||||
<dd><a href={`mailto:${SITE.email}`}>{SITE.email}</a></dd>
|
||||
<dt>Base</dt>
|
||||
<dd>{SITE.location} · open to remote</dd>
|
||||
<dt>Status</dt>
|
||||
<dd class="accent">{SITE.availability.text}</dd>
|
||||
<dt>Résumé</dt>
|
||||
<dd><a href={SITE.resume}>PDF ↓</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<form class="panel stack" data-tab="Transmit" method="post" action="/api/contact">
|
||||
<div class="status" role="status" aria-live="polite"></div>
|
||||
|
||||
<label>
|
||||
<span class="label">Name</span>
|
||||
<input name="name" autocomplete="name" required maxlength="120" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="label">Email</span>
|
||||
<input name="email" type="email" autocomplete="email" required maxlength="200" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="label">Reason</span>
|
||||
<select name="reason">
|
||||
<option value="hiring">Hiring / job opportunity</option>
|
||||
<option value="freelance">Freelance project</option>
|
||||
<option value="collab">Collaboration</option>
|
||||
<option value="music">Music</option>
|
||||
<option value="other">Something else</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span class="label">Message</span>
|
||||
<textarea name="message" rows="7" required minlength="10" maxlength="5000"></textarea>
|
||||
</label>
|
||||
<label class="hp" aria-hidden="true">
|
||||
Leave this empty <input name="website" tabindex="-1" autocomplete="off" />
|
||||
</label>
|
||||
|
||||
<button class="btn btn--primary" type="submit">Send transmission →</button>
|
||||
</form>
|
||||
</section>
|
||||
</Base>
|
||||
|
||||
<style>
|
||||
.layout {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
|
||||
gap: var(--space-8);
|
||||
align-items: start;
|
||||
}
|
||||
.side {
|
||||
--stack-gap: var(--space-5);
|
||||
}
|
||||
.lead {
|
||||
font-size: var(--step-1);
|
||||
}
|
||||
form {
|
||||
--stack-gap: var(--space-4);
|
||||
margin-top: var(--space-6);
|
||||
}
|
||||
label {
|
||||
display: grid;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
width: 100%;
|
||||
padding: 0.7em 0.8em;
|
||||
background: var(--bg-sunken);
|
||||
border: var(--border-w) solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
color: var(--fg);
|
||||
}
|
||||
input:focus,
|
||||
select:focus,
|
||||
textarea:focus {
|
||||
border-color: var(--accent);
|
||||
outline: none;
|
||||
box-shadow: var(--glow);
|
||||
}
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
.hp {
|
||||
position: absolute;
|
||||
left: -10000px;
|
||||
}
|
||||
.status:empty {
|
||||
display: none;
|
||||
}
|
||||
.status {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border: 1px solid currentColor;
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--step--1);
|
||||
}
|
||||
.status.ok {
|
||||
color: var(--accent);
|
||||
}
|
||||
.status.err {
|
||||
color: var(--signal);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function setup() {
|
||||
const form = document.querySelector<HTMLFormElement>('form[action="/api/contact"]');
|
||||
if (!form) return;
|
||||
const status = form.querySelector<HTMLElement>('.status')!;
|
||||
const button = form.querySelector<HTMLButtonElement>('button[type=submit]')!;
|
||||
const show = (ok: boolean, msg: string) => {
|
||||
status.className = `status ${ok ? 'ok' : 'err'}`;
|
||||
status.textContent = `${ok ? '■ RECEIVED' : '■ ERROR'} — ${msg}`;
|
||||
};
|
||||
|
||||
// Messages from the no-JS fallback redirect
|
||||
const params = new URL(location.href).searchParams;
|
||||
if (params.has('sent')) show(true, "Thanks, I'll get back to you soon.");
|
||||
if (params.get('error')) show(false, params.get('error')!);
|
||||
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
button.disabled = true;
|
||||
button.textContent = 'Transmitting…';
|
||||
try {
|
||||
const res = await fetch(form.action, {
|
||||
method: 'POST',
|
||||
body: new FormData(form),
|
||||
headers: { accept: 'application/json' },
|
||||
});
|
||||
const data = await res.json();
|
||||
show(res.ok, res.ok ? "Thanks, I'll get back to you soon." : data.message);
|
||||
if (res.ok) form.reset();
|
||||
} catch {
|
||||
show(false, 'Network error. Please email me directly.');
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
button.textContent = 'Send transmission →';
|
||||
}
|
||||
});
|
||||
}
|
||||
document.addEventListener('astro:page-load', setup);
|
||||
</script>
|
||||
Reference in new issue
Block a user