small changes

This commit is contained in:
2026-04-20 14:01:43 +02:00
parent 9126b6b494
commit 8a2c235c3d
8 changed files with 86 additions and 30 deletions
+2
View File
@@ -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; }
+2
View File
@@ -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' },
+1
View File
@@ -5,6 +5,7 @@ export type Submission = {
id: string;
name: string;
dog: string;
phone: string;
message: string;
createdAt: string;
ip?: string;
+4 -3
View File
@@ -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',
+37 -21
View File
@@ -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 @@
<label for="cf-dog">{c['contact.label_dog']}</label>
<input id="cf-dog" name="dog" type="text" placeholder={c['contact.placeholder_dog']} />
</div>
<div class="form-group">
<label for="cf-phone">{c['contact.label_phone']}</label>
<input id="cf-phone" name="phone" type="tel" placeholder={c['contact.placeholder_phone']} required />
</div>
<div class="form-group">
<label for="cf-msg">{c['contact.label_msg']}</label>
<textarea id="cf-msg" name="message" placeholder={c['contact.placeholder_msg']} required></textarea>
@@ -330,26 +339,31 @@
</div>
<div class="contact-info-side">
<h3>{c['contact.info_title']}</h3>
<div class="contact-item">
<div class="contact-icon"><span class="material-symbols-outlined" aria-hidden="true">call</span></div>
<div>
<p class="contact-item-label">{c['contact.phone_label']}</p>
<p class="contact-item-value">{c['contact.phone_value']}</p>
</div>
</div>
<div class="contact-item">
<div class="contact-icon"><span class="material-symbols-outlined" aria-hidden="true">mail</span></div>
<div>
<p class="contact-item-label">{c['contact.email_label']}</p>
<p class="contact-item-value">{c['contact.email_value']}</p>
</div>
</div>
<div class="contact-item">
<div class="contact-icon"><span class="material-symbols-outlined" aria-hidden="true">forum</span></div>
<div>
<p class="contact-item-label">{c['contact.wa_label']}</p>
<p class="contact-item-value">{c['contact.wa_value']}</p>
</div>
<div class="contact-items">
<a class="contact-item" href={telHref}>
<div class="contact-icon"><span class="material-symbols-outlined" aria-hidden="true">call</span></div>
<div class="contact-item-text">
<p class="contact-item-label">{c['contact.phone_label']}</p>
<p class="contact-item-value">{c['contact.phone_value']}</p>
</div>
<span class="contact-item-chev material-symbols-outlined" aria-hidden="true">arrow_forward</span>
</a>
<a class="contact-item" href={mailHref}>
<div class="contact-icon"><span class="material-symbols-outlined" aria-hidden="true">mail</span></div>
<div class="contact-item-text">
<p class="contact-item-label">{c['contact.email_label']}</p>
<p class="contact-item-value">{c['contact.email_value']}</p>
</div>
<span class="contact-item-chev material-symbols-outlined" aria-hidden="true">arrow_forward</span>
</a>
<a class="contact-item" href={waHref} target="_blank" rel="noopener noreferrer">
<div class="contact-icon"><span class="material-symbols-outlined" aria-hidden="true">forum</span></div>
<div class="contact-item-text">
<p class="contact-item-label">{c['contact.wa_label']}</p>
<p class="contact-item-value">{c['contact.wa_value']}</p>
</div>
<span class="contact-item-chev material-symbols-outlined" aria-hidden="true">arrow_forward</span>
</a>
</div>
<div class="contact-map"><div id="map-container"></div></div>
</div>
@@ -391,7 +405,9 @@
<p>{c['footer.copyright']}</p>
<div class="powered-by">
<span>{c['footer.powered']}</span>
<img src={img.cima_logo.src} alt={img.cima_logo.alt} />
<a href="https://cimaprogetti.it" target="_blank" rel="noopener noreferrer">
<img src={img.cima_logo.src} alt={img.cima_logo.alt} />
</a>
</div>
</div>
</div>
+7 -1
View File
@@ -192,7 +192,13 @@
<span class="score-chip {scoreClass('geo', a.geoScore)}">GEO {a.geoScore}</span>
</div>
</header>
{#if slot.kind === 'multiline'}
{#if slot.id === 'footer.powered'}
<select name="slot:{slot.id}" bind:value={values[slot.id]}>
<option value="Powered by">Powered by</option>
<option value="Built by">Built by</option>
<option value="In collab with">In collab with</option>
</select>
{:else if slot.kind === 'multiline'}
<textarea name="slot:{slot.id}" bind:value={values[slot.id]} rows="3"></textarea>
{:else}
<input name="slot:{slot.id}" type="text" bind:value={values[slot.id]} />
@@ -44,6 +44,7 @@
<time>{fmt(s.createdAt)}</time>
<span class="name">{s.name}</span>
{#if s.dog}<span class="dog">Cane: {s.dog}</span>{/if}
{#if s.phone}<a class="phone" href="tel:{s.phone}">{s.phone}</a>{/if}
</header>
<div class="msg">{s.message}</div>
<div class="meta">
+32 -5
View File
@@ -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; }