mirror of
https://github.com/bitbaum/s-ink.git
synced 2026-12-04 04:27:42 +01:00
The mailto: lost enquiries three ways. It cannot carry the reference images that ARE the enquiry, it does nothing at all for a visitor with no mail client configured, and it hands the visitor to another app at the exact moment they had decided to act. The form asks for the five things needed to answer with a price rather than a question — name, email, idea, placement, size — plus up to three reference photos, and confirmation the visitor is 18. Nothing more: every extra box costs enquiries, and leaving out placement or size costs a whole round-trip on every single one. lib/enquiry.ts is the SSOT. The form renders from it and the API validates against it, so a field cannot end up required in the browser and optional on the server. Labels are keyed by field id, so adding a field breaks all seven dictionaries until translated. Delivery is Resend's REST API over fetch — no SDK for one POST — from a domain already verified in the account, with reply-to set to the visitor so answering is one keypress in his normal inbox. Verified end to end: a real send with an attachment reached a real mailbox, last_event=delivered. Anti-spam is a honeypot plus a minimum fill time, not a CAPTCHA, which taxes every real visitor to inconvenience a bot. BUG FOUND WHILE TESTING, now pinned: the first version sent the render timestamp and let the server subtract it from its own clock. A visitor whose phone runs fast produces a negative elapsed time, reads as "faster than a human could type", and the enquiry is silently discarded — while they are shown "Sent." A lost booking indistinguishable from a delivered one. The duration is now measured entirely in the browser and the check fails open on anything nonsensical. Also: hero and sticky CTAs scroll to the form rather than opening mail, the "what to send" checklist is gone (the fields ask the same three things), and the section title no longer says "Email to discuss". 92 tests, up from 74. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
214 lines
4.0 KiB
CSS
214 lines
4.0 KiB
CSS
.form {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
gap: 1.1rem 1rem;
|
|
}
|
|
|
|
.field {
|
|
display: grid;
|
|
gap: 0.45rem;
|
|
margin: 0;
|
|
align-content: start;
|
|
}
|
|
|
|
/* Idea and references get the full width; name/email and placement/size pair
|
|
up, which is also the order someone thinks in. */
|
|
.field[data-wide='true'] {
|
|
grid-column: 1 / -1;
|
|
}
|
|
|
|
.label {
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.input {
|
|
width: 100%;
|
|
padding: 0.7rem 0.8rem;
|
|
font: inherit;
|
|
font-size: 0.95rem;
|
|
color: var(--color-text);
|
|
background: var(--color-surface);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: 0;
|
|
transition:
|
|
border-color var(--dur-fast) var(--ease-out),
|
|
background var(--dur-fast) var(--ease-out);
|
|
}
|
|
|
|
.input:focus-visible {
|
|
outline: none;
|
|
border-color: var(--color-accent);
|
|
background: var(--color-bg-raised);
|
|
}
|
|
|
|
.input[aria-invalid='true'] {
|
|
border-color: var(--color-accent);
|
|
}
|
|
|
|
textarea.input {
|
|
resize: vertical;
|
|
min-height: 6.5rem;
|
|
}
|
|
|
|
/* Hints are sentences, so they drop the micro treatment the labels use. Set in
|
|
the same uppercase spacing they compete with the accent error text beside
|
|
them, and the thing that should catch the eye is the error. */
|
|
.hint,
|
|
.files {
|
|
color: var(--color-text-muted);
|
|
text-transform: none;
|
|
letter-spacing: 0;
|
|
font-size: 0.78rem;
|
|
}
|
|
|
|
.files {
|
|
color: var(--color-text);
|
|
}
|
|
|
|
/* Errors use the accent rather than a red found nowhere else on the site —
|
|
there is exactly one attention colour here and inventing a second for
|
|
failure states is how a palette starts to leak. */
|
|
.error {
|
|
color: var(--color-accent);
|
|
}
|
|
|
|
.file {
|
|
width: 100%;
|
|
font: inherit;
|
|
font-size: 0.8rem;
|
|
color: var(--color-text-muted);
|
|
padding: 0.55rem 0;
|
|
}
|
|
|
|
.file::file-selector-button {
|
|
font: inherit;
|
|
font-size: var(--text-micro);
|
|
letter-spacing: var(--tracking-micro);
|
|
text-transform: uppercase;
|
|
margin-right: 0.9rem;
|
|
padding: 0.55rem 1rem;
|
|
color: var(--color-text);
|
|
background: transparent;
|
|
border: 1px solid var(--color-border-strong);
|
|
cursor: pointer;
|
|
transition: border-color var(--dur-fast) var(--ease-out);
|
|
}
|
|
|
|
.file::file-selector-button:hover {
|
|
border-color: var(--color-accent);
|
|
}
|
|
|
|
.age {
|
|
grid-column: 1 / -1;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.65rem;
|
|
/* 44px minimum touch target, which a bare checkbox is not. */
|
|
min-height: 2.75rem;
|
|
font-size: 0.9rem;
|
|
color: var(--color-text-muted);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.age input {
|
|
width: 1.1rem;
|
|
height: 1.1rem;
|
|
accent-color: var(--color-accent);
|
|
flex: none;
|
|
}
|
|
|
|
.age[data-invalid='true'] {
|
|
color: var(--color-accent);
|
|
}
|
|
|
|
/* Off-screen, not display:none — some bots skip inputs they can tell are
|
|
hidden, and this one is meant to look fillable. */
|
|
.trap {
|
|
position: absolute;
|
|
left: -9999px;
|
|
width: 1px;
|
|
height: 1px;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.submit {
|
|
grid-column: 1 / -1;
|
|
justify-self: start;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.9rem;
|
|
min-height: 3rem;
|
|
padding: 0.9rem 1.6rem;
|
|
font: inherit;
|
|
font-weight: 500;
|
|
letter-spacing: -0.01em;
|
|
color: var(--color-on-accent);
|
|
background: var(--color-accent);
|
|
border: none;
|
|
cursor: pointer;
|
|
transition: transform var(--dur-fast) var(--ease-out);
|
|
}
|
|
|
|
.submit:hover:not(:disabled) .arrow {
|
|
transform: translateX(4px);
|
|
}
|
|
|
|
.submit:disabled {
|
|
opacity: 0.62;
|
|
cursor: progress;
|
|
}
|
|
|
|
.arrow {
|
|
transition: transform var(--dur-fast) var(--ease-out);
|
|
}
|
|
|
|
.failure,
|
|
.privacy {
|
|
grid-column: 1 / -1;
|
|
margin: 0;
|
|
}
|
|
|
|
.failure {
|
|
color: var(--color-accent);
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.failureLink {
|
|
color: inherit;
|
|
}
|
|
|
|
.privacy {
|
|
color: var(--color-text-muted);
|
|
line-height: 1.5;
|
|
text-transform: none;
|
|
letter-spacing: 0;
|
|
}
|
|
|
|
.sent {
|
|
display: grid;
|
|
gap: 0.6rem;
|
|
padding: 2rem 0;
|
|
border-top: 1px solid var(--color-accent);
|
|
}
|
|
|
|
.sentTitle {
|
|
margin: 0;
|
|
font-size: clamp(1.6rem, 4vw, 2.4rem);
|
|
font-weight: 700;
|
|
letter-spacing: -0.03em;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.sentBody {
|
|
margin: 0;
|
|
max-width: 40ch;
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
@media (max-width: 34rem) {
|
|
.form {
|
|
grid-template-columns: minmax(0, 1fr);
|
|
}
|
|
}
|