diff --git a/src/admin.css b/src/admin.css index babdb8a..9447201 100644 --- a/src/admin.css +++ b/src/admin.css @@ -226,6 +226,8 @@ } .sub-row .name { color: var(--accent-dark); font-weight: 700; font-size: 14px; } .sub-row .dog { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; } +.sub-row .phone { color: var(--accent-dark); font-size: 13px; font-weight: 600; text-decoration: none; } +.sub-row .phone:hover { text-decoration: underline; } .sub-row .msg { font-size: 14px; color: var(--text); line-height: 1.55; white-space: pre-wrap; } .sub-row .meta { color: var(--text-muted); font-size: 12px; } diff --git a/src/lib/content/defaults.ts b/src/lib/content/defaults.ts index 01811e3..1098eff 100644 --- a/src/lib/content/defaults.ts +++ b/src/lib/content/defaults.ts @@ -133,6 +133,8 @@ export const DEFAULT_SLOTS: CopySlot[] = [ { id: 'contact.placeholder_name', section: 'Contact', label: 'Placeholder — Name', kind: 'inline', value: 'Nome e Cognome' }, { id: 'contact.label_dog', section: 'Contact', label: 'Label — Dog', kind: 'inline', value: 'Come si chiama il tuo cane?' }, { id: 'contact.placeholder_dog', section: 'Contact', label: 'Placeholder — Dog', kind: 'inline', value: 'Il nome del peloso...' }, + { id: 'contact.label_phone', section: 'Contact', label: 'Label — Phone', kind: 'inline', value: 'Numero di telefono' }, + { id: 'contact.placeholder_phone', section: 'Contact', label: 'Placeholder — Phone', kind: 'inline', value: '+39 ...' }, { id: 'contact.label_msg', section: 'Contact', label: 'Label — Message', kind: 'inline', value: 'Il tuo messaggio' }, { id: 'contact.placeholder_msg', section: 'Contact', label: 'Placeholder — Message', kind: 'inline', value: 'Raccontami di te e del tuo cane...' }, { id: 'contact.submit', section: 'Contact', label: 'Submit button', kind: 'inline', value: 'Invia il messaggio' }, diff --git a/src/lib/server/submissions.ts b/src/lib/server/submissions.ts index d15b206..0c533ec 100644 --- a/src/lib/server/submissions.ts +++ b/src/lib/server/submissions.ts @@ -5,6 +5,7 @@ export type Submission = { id: string; name: string; dog: string; + phone: string; message: string; createdAt: string; ip?: string; diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 88969dd..7c37c37 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -13,13 +13,14 @@ export const actions: Actions = { const data = await request.formData(); const name = String(data.get('name') ?? '').trim(); const dog = String(data.get('dog') ?? '').trim(); + const phone = String(data.get('phone') ?? '').trim(); const message = String(data.get('message') ?? '').trim(); - if (!name || !message) { - return fail(400, { error: 'Compila almeno nome e messaggio.', name, dog, message }); + if (!name || !phone || !message) { + return fail(400, { error: 'Compila nome, telefono e messaggio.', name, dog, phone, message }); } - const entry = addSubmission({ name, dog, message, ip: getClientAddress() }); + const entry = addSubmission({ name, dog, phone, message, ip: getClientAddress() }); addNotification({ type: 'submission', title: 'Nuova richiesta dal form', diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index d2ee8e0..3410277 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -17,6 +17,11 @@ if (form?.success) submitted = true; }); + const phoneDigits = $derived((c['contact.phone_value'] ?? '').replace(/\D/g, '')); + const telHref = $derived(phoneDigits ? `tel:+${phoneDigits}` : '#'); + const waHref = $derived(phoneDigits ? `https://wa.me/${phoneDigits}` : '#'); + const mailHref = $derived(`mailto:${c['contact.email_value'] ?? ''}`); + onMount(() => { const onScroll = () => { scrolled = window.scrollY > 20; @@ -312,6 +317,10 @@ +
+ + +
@@ -330,26 +339,31 @@

{c['contact.info_title']}

-
-
-
-

{c['contact.phone_label']}

-

{c['contact.phone_value']}

-
-
-
-
-
-

{c['contact.email_label']}

-

{c['contact.email_value']}

-
-
-
-
-
-

{c['contact.wa_label']}

-

{c['contact.wa_value']}

-
+
@@ -391,7 +405,9 @@

{c['footer.copyright']}

{c['footer.powered']} - {img.cima_logo.alt} + + {img.cima_logo.alt} +
diff --git a/src/routes/admin/copy/+page.svelte b/src/routes/admin/copy/+page.svelte index fffb1cf..fb52d96 100644 --- a/src/routes/admin/copy/+page.svelte +++ b/src/routes/admin/copy/+page.svelte @@ -192,7 +192,13 @@ GEO {a.geoScore} - {#if slot.kind === 'multiline'} + {#if slot.id === 'footer.powered'} + + {:else if slot.kind === 'multiline'} {:else} diff --git a/src/routes/admin/submissions/+page.svelte b/src/routes/admin/submissions/+page.svelte index 8d42609..18a2aa7 100644 --- a/src/routes/admin/submissions/+page.svelte +++ b/src/routes/admin/submissions/+page.svelte @@ -44,6 +44,7 @@ {s.name} {#if s.dog}Cane: {s.dog}{/if} + {#if s.phone}{s.phone}{/if}
{s.message}
diff --git a/src/site.css b/src/site.css index 40887a1..c418078 100644 --- a/src/site.css +++ b/src/site.css @@ -397,12 +397,36 @@ } .btn-submit:hover { opacity: 0.92; } .btn-submit:disabled { opacity: 0.6; cursor: not-allowed; } -.contact-info-side { flex: 45%; padding: 64px; background: rgba(235, 232, 222, 0.4); } +.contact-info-side { + flex: 45%; padding: 64px; background: rgba(235, 232, 222, 0.4); + display: flex; flex-direction: column; +} .contact-info-side h3 { font-family: 'Newsreader', serif; font-size: 26px; - color: var(--navy); font-weight: 700; margin-bottom: 40px; + color: var(--navy); font-weight: 700; margin-bottom: 28px; +} +.contact-items { display: flex; flex-direction: column; gap: 12px; } +.contact-item { + display: flex; align-items: center; gap: 18px; + padding: 14px 18px; + background: rgba(255, 255, 255, 0.55); + border: 1px solid rgba(0, 29, 54, 0.06); + border-radius: 18px; + text-decoration: none; color: inherit; + transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease; +} +.contact-item:hover { + background: #fff; + border-color: rgba(0, 29, 54, 0.12); + box-shadow: 0 8px 20px rgba(0, 29, 54, 0.08); + transform: translateY(-1px); +} +.contact-item:hover .contact-item-chev { transform: translateX(3px); opacity: 1; } +.contact-item-text { flex: 1; min-width: 0; } +.contact-item-chev { + color: var(--gold); font-size: 20px; opacity: 0.5; + transition: transform 0.18s ease, opacity 0.18s ease; } -.contact-item { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; } .contact-icon { width: 52px; height: 52px; background: var(--cream); border-radius: 50%; @@ -413,10 +437,13 @@ font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 3px; } -.contact-item-value { font-size: 17px; font-weight: 700; color: var(--navy); } +.contact-item-value { + font-size: 17px; font-weight: 700; color: var(--navy); + overflow: hidden; text-overflow: ellipsis; white-space: nowrap; +} .contact-map { border-radius: 28px; overflow: hidden; height: 200px; - margin-top: 24px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); + margin-top: auto; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); } #map-container { width: 100%; height: 100%; border-radius: 28px; } .leaflet-container { font-family: 'Manrope', sans-serif; }