Add after-hours callbacks and persistent ad attribution to all four landings

- The callback dialog switches its copy outside business hours
  (shared/business-hours.ts); such leads get a "нерабочее время" tag,
  a marker in the deal name and a line in the note in amoCRM.
- utm_*, yclid and gclid are read on page load and kept for 30 days
  (src/lib/attribution.ts), last tagged visit wins, and are sent with
  every lead.
- The callback dialog is rebuilt: focus trap, focus return, phone
  masking and a full-number check.
- fitnes drops the floating MobileCta; header and mobile bars follow
  the new dialog state in the other three.
- Add the latest design mockups under legacy/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yuriy.pandClaude Opus 5.5 committed 2026-09-23 20:53:40 +06:00
1 parent 56ff5839b8
commit a61d53962a
145 files changed
+9242 -523

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
/**
* When a manager can pick up the phone. Outside these hours the landing stops
* offering a direct call: every `tel:` link opens the callback form instead,
* and the lead is flagged so it is handled first thing on the next working day.
*/
export const businessHours = {
timeZone: 'Europe/Samara',
/** `Intl` short weekday names, as `formatToParts` returns them in en-US. */
workDays: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
openMinutes: 9 * 60,
closeMinutes: 18 * 60,
label: 'Пн–Пт, 09:00–18:00 по самарскому времени',
} as const
const clock = new Intl.DateTimeFormat('en-US', {
timeZone: businessHours.timeZone,
weekday: 'short',
hour: '2-digit',
minute: '2-digit',
hourCycle: 'h23',
})
export function isWithinBusinessHours(now: Date = new Date()): boolean {
const parts: Record<string, string> = {}
for (const part of clock.formatToParts(now)) parts[part.type] = part.value
const minutes = Number(parts.hour) * 60 + Number(parts.minute)
return (
(businessHours.workDays as readonly string[]).includes(parts.weekday) &&
minutes >= businessHours.openMinutes &&
minutes < businessHours.closeMinutes
)
}
+7 -1
View File
@@ -4,7 +4,8 @@ import { z } from 'zod'
export const leadFormIds = ['request', 'callback'] as const
export type LeadFormId = (typeof leadFormIds)[number]
export const utmKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'] as const
/** UTM tags plus the Yandex Direct and Google Ads click IDs. */
export const utmKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'yclid', 'gclid'] as const
const optionalText = (max: number) =>
z
@@ -30,6 +31,11 @@ export const leadSchema = z.object({
referrer: optionalText(500),
// partialRecord, not record: z.record over an enum requires every key.
utm: z.partialRecord(z.enum(utmKeys), z.string().max(300)).optional(),
/**
* The callback form was sent outside business hours, so the visitor was told
* to expect a call on the next working day rather than shortly.
*/
after_hours: z.boolean().optional(),
/** Honeypot. Bots fill it in; humans never see it. */
website: z.string().max(200).optional(),
})