Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dev-haunt/llms.txt
Use this file to discover all available pages before exploring further.
DoorbellForm is a theatrical four-stage contact experience: visitors first see a physical doorbell mounted on a wood panel, press it to trigger a “DING… DONG…” animation, and are then presented with a “Visitor’s Log” form. On submission the page flickers and a confirmation message appears. The component manages all UI state internally and requires no props.
Component Stages
The form cycles through four internal states managed by a singleuseState hook:
| State | What the user sees |
|---|---|
doorbell | A wood-grained panel with a round brass doorbell button and “Press to enter” label. |
ringing | The same panel, button disabled, with a pulsing “DING… DONG…” text below. |
form | An off-white “Visitor’s Log” panel with Name, Email, and Message fields. |
submitted | A “Message Received” confirmation with a “Return to Porch” reset button. |
The transition from
ringing to form is automatic — a 2-second setTimeout fires after the button press, so visitors experience the doorbell ring before the form slides in.Fields
The Visitor’s Log form contains three required fields:| Label | Input type | Placeholder | Tailwind classes |
|---|---|---|---|
| Name (Living or Dead) | text | John Doe | border-b-2 border-night/20 focus:border-pumpkin outline-none transition-colors |
| Ethereal Address (Email) | email | ghost@example.com | same as above |
| Message from beyond | textarea | I summon thee for a project... | same + resize-none |
bg-[#f4f1ea]), with only a bottom border visible — the colour transitions from border-night/20 to border-pumpkin on focus.
Submit Button
The “Leave Message” button is styled to match the brass doorbell aesthetic:animate-flicker to document.body for a 1.5-second light-flicker effect before switching to the submitted state.
Doorbell Button Design
The doorbell itself uses a nested shadow trick to simulate a physical press:shadow-[0_4px_0_#2a2a2a] creates a raised-button illusion; active:translate-y-1 combined with removing the shadow on press makes it feel like the button physically depresses.
Usage
Backend Integration
The form is client-side only by default — theonSubmit handler triggers the flicker animation and advances to the submitted state without sending data anywhere. Wire up your preferred form service by replacing the onSubmit logic in DoorbellForm.js.
Animations Summary
Framer Motion transitions between stages
Framer Motion transitions between stages
All stage transitions are wrapped in
AnimatePresence with mode="wait", so the exiting stage fully animates out before the next one enters.| Transition | initial | animate | exit |
|---|---|---|---|
| Doorbell → Form | opacity: 0, scale: 0.8 | opacity: 1, scale: 1 | opacity: 0, scale: 1.2, blur: 10px |
| Form → Submitted | opacity: 0, y: 20 | opacity: 1, y: 0 | opacity: 0, y: -20 |
| Submitted → Reset | opacity: 0, scale: 0.8 | opacity: 1, scale: 1 | — |