feat: design system, layout e componenti di base
- token, font self-hosted (Fraunces e Inter, sottoinsieme latin) con preload - BaseLayout con head completo (SEO, Open Graph, favicon) e JSON-LD dello studio - intestazione con barra superiore, navigazione e sottomenu servizi accessibili - menu mobile con dialog modale e alternativa senza JavaScript - footer con P.IVA, recapiti, servizi, orari e link legali - componenti: Logo, Icon (Lucide inline), Hero, card servizio, scheda professionista, badge abilitazione, card sede, mappa click-to-load, modulo di contatto, banda CTA, breadcrumb, intestazioni di sezione - generate-icons.mjs: marchio, favicon, apple-touch-icon e immagine OG - collection dei servizi e dei link utili con schemi Zod Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
This commit is contained in:
58 files changed
+5077
-16
No files matched your search
@@ -0,0 +1,72 @@
|
||||
---
|
||||
/**
|
||||
* Badge testuale di un'abilitazione o iscrizione (nessun logo di enti, brief §2.4): icona in
|
||||
* oro su riquadro navy, testo e nome del professionista.
|
||||
*/
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
interface Props {
|
||||
testo: string;
|
||||
professionista: string;
|
||||
icona: string;
|
||||
/** id del professionista, usato dai controlli automatici sui titoli. */
|
||||
personaId?: string;
|
||||
}
|
||||
|
||||
const { testo, professionista, icona, personaId } = Astro.props;
|
||||
---
|
||||
|
||||
<li class="badge" data-person={personaId}>
|
||||
<span class="badge__icon">
|
||||
<Icon name={icona} size={20} />
|
||||
</span>
|
||||
<span class="badge__body">
|
||||
<span class="badge__text">{testo}</span>
|
||||
<span class="badge__who">{professionista}</span>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<style>
|
||||
.badge {
|
||||
display: grid;
|
||||
grid-template-columns: 40px minmax(0, 1fr);
|
||||
gap: var(--space-3);
|
||||
align-items: start;
|
||||
padding: var(--space-4) var(--space-5);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.badge__icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
background: var(--navy-800);
|
||||
color: var(--gold-300);
|
||||
}
|
||||
|
||||
.badge__icon :global(svg) {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.badge__text {
|
||||
display: block;
|
||||
margin: 0 0 0.4rem;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-700);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.badge__who {
|
||||
display: inline-flex;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
color: var(--navy-700);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
/** Percorso di navigazione delle pagine interne (i dati strutturati sono in BaseLayout). */
|
||||
import type { Crumb } from '../lib/seo';
|
||||
|
||||
interface Props {
|
||||
/** Voci dopo la home; l'ultima è la pagina corrente. */
|
||||
items: Crumb[];
|
||||
}
|
||||
|
||||
const { items } = Astro.props;
|
||||
const all = [{ name: 'Home', href: '/' }, ...items];
|
||||
---
|
||||
|
||||
<nav class="breadcrumb" aria-label="Percorso">
|
||||
<ol role="list">
|
||||
{all.map((c, i) =>
|
||||
i === all.length - 1 ? (
|
||||
<li>
|
||||
<span aria-current="page">{c.name}</span>
|
||||
</li>
|
||||
) : (
|
||||
<li>
|
||||
<a href={c.href}>{c.name}</a>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<style>
|
||||
.breadcrumb ol {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem 0.5rem;
|
||||
margin: 0 0 var(--space-4);
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.breadcrumb li + li::before {
|
||||
content: '/';
|
||||
margin-right: 0.5rem;
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.breadcrumb a {
|
||||
color: var(--ink-600);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.breadcrumb a:hover {
|
||||
color: var(--navy-900);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.breadcrumb [aria-current='page'] {
|
||||
color: var(--ink-700);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,365 @@
|
||||
---
|
||||
/**
|
||||
* Modulo di contatto (brief §10.1). La modalità si imposta in src/data/studio.ts
|
||||
* (`contactForm.mode`):
|
||||
* - `off` (predefinita): nessun modulo, al suo posto la card «Scrivici una e-mail»;
|
||||
* - `php`: invio a /contact.php (deploy/optional-php-form/contact.php);
|
||||
* - `endpoint`: invio all'URL configurato.
|
||||
*
|
||||
* Anti-spam senza cookie né servizi terzi: campo trappola nascosto (honeypot) e tempo minimo
|
||||
* di compilazione (`ts`). Validazione HTML5 nativa; con JavaScript i messaggi d'errore sono in
|
||||
* italiano, accanto ai campi e annunciati dagli screen reader.
|
||||
*/
|
||||
import { contactForm, studio } from '../data/studio';
|
||||
import { modulo, scriviEmail } from '../data/testi';
|
||||
import { mailtoHref, telHref } from '../lib/format';
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
const mode = contactForm.mode;
|
||||
const action = mode === 'php' ? contactForm.phpAction : contactForm.endpoint;
|
||||
if (mode === 'endpoint' && !/^https:\/\//.test(action)) {
|
||||
throw new Error('contactForm.mode = "endpoint" richiede un URL https:// in contactForm.endpoint');
|
||||
}
|
||||
const telefono = studio.telefoni[0];
|
||||
const c = modulo.campi;
|
||||
---
|
||||
|
||||
{mode === 'off' ? (
|
||||
<div class="mail-card" data-contact-mode="off">
|
||||
<h2>{scriviEmail.titolo}</h2>
|
||||
<p>{scriviEmail.testo}</p>
|
||||
<a class="btn btn--primary btn--block" href={mailtoHref(studio.email, scriviEmail.oggetto)}>
|
||||
<Icon name="mail" size={18} />
|
||||
{scriviEmail.pulsante} {studio.email}
|
||||
</a>
|
||||
<p class="mail-card__note">
|
||||
{scriviEmail.nota} <a href={telHref(telefono)}>{telefono.display}</a>.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<form
|
||||
class="contact-form"
|
||||
action={action}
|
||||
method="post"
|
||||
accept-charset="UTF-8"
|
||||
data-contact-form
|
||||
data-min-seconds={contactForm.tempoMinimoSecondi}
|
||||
data-contact-mode={mode}
|
||||
aria-labelledby="modulo-titolo"
|
||||
>
|
||||
<h2 id="modulo-titolo">{modulo.titolo}</h2>
|
||||
<p class="contact-form__intro">{modulo.intro}</p>
|
||||
<p class="contact-form__legend">{modulo.legenda}</p>
|
||||
|
||||
<div class="contact-form__summary" data-form-summary tabindex="-1" hidden>
|
||||
<p>{modulo.errori.titolo}</p>
|
||||
<ul data-form-summary-list />
|
||||
</div>
|
||||
<p class="visually-hidden" aria-live="polite" data-form-status />
|
||||
|
||||
<div class="field__row">
|
||||
<div class="field">
|
||||
<label for="cf-nome">
|
||||
{c.nome.label} <span aria-hidden="true">*</span>
|
||||
</label>
|
||||
<input
|
||||
id="cf-nome"
|
||||
name="nome"
|
||||
type="text"
|
||||
autocomplete="name"
|
||||
required
|
||||
maxlength="120"
|
||||
placeholder={c.nome.placeholder}
|
||||
aria-describedby="cf-nome-err"
|
||||
/>
|
||||
<p class="field__error" id="cf-nome-err" hidden />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="cf-email">
|
||||
{c.email.label} <span aria-hidden="true">*</span>
|
||||
</label>
|
||||
<input
|
||||
id="cf-email"
|
||||
name="email"
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
inputmode="email"
|
||||
required
|
||||
maxlength="160"
|
||||
placeholder={c.email.placeholder}
|
||||
aria-describedby="cf-email-err"
|
||||
/>
|
||||
<p class="field__error" id="cf-email-err" hidden />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field__row">
|
||||
<div class="field">
|
||||
<label for="cf-telefono">
|
||||
{c.telefono.label} <span aria-hidden="true">*</span>
|
||||
</label>
|
||||
<input
|
||||
id="cf-telefono"
|
||||
name="telefono"
|
||||
type="tel"
|
||||
autocomplete="tel"
|
||||
inputmode="tel"
|
||||
required
|
||||
minlength="6"
|
||||
maxlength="25"
|
||||
pattern="[0-9 +().\/\-]{6,25}"
|
||||
placeholder={c.telefono.placeholder}
|
||||
aria-describedby="cf-telefono-err"
|
||||
/>
|
||||
<p class="field__error" id="cf-telefono-err" hidden />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="cf-oggetto">
|
||||
{c.oggetto.label} <span aria-hidden="true">*</span>
|
||||
</label>
|
||||
<input
|
||||
id="cf-oggetto"
|
||||
name="oggetto"
|
||||
type="text"
|
||||
required
|
||||
maxlength="160"
|
||||
placeholder={c.oggetto.placeholder}
|
||||
aria-describedby="cf-oggetto-err"
|
||||
/>
|
||||
<p class="field__error" id="cf-oggetto-err" hidden />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="cf-messaggio">
|
||||
{c.messaggio.label} <span aria-hidden="true">*</span>
|
||||
</label>
|
||||
<textarea
|
||||
id="cf-messaggio"
|
||||
name="messaggio"
|
||||
rows="6"
|
||||
required
|
||||
minlength="10"
|
||||
maxlength="5000"
|
||||
placeholder={c.messaggio.placeholder}
|
||||
aria-describedby="cf-messaggio-err"
|
||||
/>
|
||||
<p class="field__error" id="cf-messaggio-err" hidden />
|
||||
</div>
|
||||
|
||||
<div class="contact-form__trap" aria-hidden="true">
|
||||
<label for="cf-sito">Lascia vuoto questo campo</label>
|
||||
<input id="cf-sito" name="sito_web" type="text" tabindex="-1" autocomplete="off" />
|
||||
</div>
|
||||
<input type="hidden" name="ts" value="" data-form-ts />
|
||||
|
||||
<div class="consent">
|
||||
<input
|
||||
id="cf-privacy"
|
||||
name="privacy"
|
||||
type="checkbox"
|
||||
value="1"
|
||||
required
|
||||
aria-describedby="cf-privacy-err"
|
||||
/>
|
||||
<label for="cf-privacy">
|
||||
{modulo.consenso.prima}
|
||||
<a href="/privacy-policy/">{modulo.consenso.link}</a>
|
||||
{modulo.consenso.dopo} <span aria-hidden="true">*</span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="field__error" id="cf-privacy-err" hidden />
|
||||
|
||||
<button class="btn btn--primary btn--block" type="submit">
|
||||
{modulo.invia}
|
||||
<Icon name="arrow-right" size={18} />
|
||||
</button>
|
||||
|
||||
<p class="contact-form__note">
|
||||
{modulo.informativa} <a href="/privacy-policy/">Privacy policy</a>.
|
||||
</p>
|
||||
<p class="contact-form__note">{modulo.nota}</p>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{mode !== 'off' && <script>
|
||||
import '../scripts/form';
|
||||
</script>}
|
||||
|
||||
<style>
|
||||
.mail-card,
|
||||
.contact-form {
|
||||
padding: var(--space-6);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.mail-card h2,
|
||||
.contact-form h2 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.mail-card > p {
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.mail-card .btn {
|
||||
margin-block: var(--space-3);
|
||||
overflow-wrap: anywhere;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.mail-card__note {
|
||||
margin: 0;
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.contact-form__intro {
|
||||
color: var(--ink-600);
|
||||
font-size: var(--fs-sm);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.contact-form__summary {
|
||||
margin-bottom: var(--space-4);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border: 1px solid var(--error);
|
||||
border-left-width: 4px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: #fdf3f2;
|
||||
color: var(--ink-900);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.contact-form__summary p {
|
||||
margin: 0 0 0.25rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.contact-form__summary ul {
|
||||
padding-left: 1.2rem;
|
||||
}
|
||||
|
||||
.contact-form__summary a {
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
.field {
|
||||
display: grid;
|
||||
gap: 0.4rem;
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
.field label {
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
color: var(--ink-700);
|
||||
}
|
||||
|
||||
.field label span,
|
||||
.consent label span {
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
.field input,
|
||||
.field textarea {
|
||||
width: 100%;
|
||||
min-height: var(--tap);
|
||||
padding: 0.75rem 0.95rem;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid #b9c3cf;
|
||||
background: var(--white);
|
||||
color: var(--ink-900);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.field input::placeholder,
|
||||
.field textarea::placeholder {
|
||||
color: var(--ink-600);
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.field input:focus,
|
||||
.field textarea:focus {
|
||||
border-color: var(--navy-700);
|
||||
box-shadow: 0 0 0 4px var(--navy-100);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.field input[aria-invalid='true'],
|
||||
.field textarea[aria-invalid='true'] {
|
||||
border-color: var(--error);
|
||||
}
|
||||
|
||||
.field textarea {
|
||||
min-height: 140px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.field__row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0 var(--space-4);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.field__row {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.field__error {
|
||||
margin: 0;
|
||||
color: var(--error);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.contact-form__trap {
|
||||
position: absolute;
|
||||
left: -10000px;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.consent {
|
||||
display: flex;
|
||||
gap: 0.65rem;
|
||||
align-items: flex-start;
|
||||
margin: var(--space-4) 0 var(--space-2);
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.consent input {
|
||||
flex: none;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
margin-top: 0.1rem;
|
||||
accent-color: var(--navy-800);
|
||||
}
|
||||
|
||||
.consent label {
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
.contact-form .btn {
|
||||
margin-top: var(--space-4);
|
||||
}
|
||||
|
||||
.contact-form__legend {
|
||||
margin: 0 0 var(--space-5);
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.contact-form__note {
|
||||
margin: var(--space-3) 0 0;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
/** Banda navy di invito all'azione (brief §6.3): titolo, testo, preventivo e telefono. */
|
||||
import { studio } from '../data/studio';
|
||||
import { ctaBand } from '../data/testi';
|
||||
import { telHref } from '../lib/format';
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
const telefono = studio.telefoni[0];
|
||||
---
|
||||
|
||||
<section class="cta-band" aria-labelledby="cta-band-titolo">
|
||||
<div class="container cta-band__inner">
|
||||
<div>
|
||||
<h2 id="cta-band-titolo">{ctaBand.titolo}</h2>
|
||||
<p>{ctaBand.testo}</p>
|
||||
</div>
|
||||
<div class="cta-band__actions">
|
||||
<a class="btn btn--gold" href={ctaBand.pulsante.href}>
|
||||
{ctaBand.pulsante.label}
|
||||
<Icon name="arrow-right" size={18} />
|
||||
</a>
|
||||
<a class="btn btn--ghost-light" href={telHref(telefono)}>
|
||||
<Icon name="phone" size={18} />
|
||||
<span class="visually-hidden">Telefono</span>
|
||||
{telefono.display}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.cta-band {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: var(--navy-800);
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
.cta-band::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 420px;
|
||||
height: 420px;
|
||||
border-radius: 50%;
|
||||
border: 60px solid rgba(184, 144, 46, 0.18);
|
||||
right: -140px;
|
||||
top: -180px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.cta-band__inner {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-6);
|
||||
padding-block: var(--space-8);
|
||||
}
|
||||
|
||||
.cta-band__inner > :first-child {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cta-band h2 {
|
||||
color: var(--white);
|
||||
margin-bottom: 0.4rem;
|
||||
font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.3rem);
|
||||
}
|
||||
|
||||
.cta-band p {
|
||||
margin: 0;
|
||||
max-width: 40rem;
|
||||
color: var(--on-dark);
|
||||
}
|
||||
|
||||
.cta-band__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-3);
|
||||
flex: none;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.cta-band__inner {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,220 @@
|
||||
---
|
||||
/**
|
||||
* Footer di tutte le pagine (brief §7.7): studio e sedi, contatti, servizi, orari e riga legale
|
||||
* con P.IVA (art. 35 D.P.R. 633/1972) e link alle pagine legali.
|
||||
*/
|
||||
import { navLegale } from '../data/navigazione';
|
||||
import { denominazione, sedePrincipale, studio } from '../data/studio';
|
||||
import { buildYear } from '../lib/build';
|
||||
import { addressLine, hoursLine, mailtoHref, telHref } from '../lib/format';
|
||||
import { servizioHref, type Servizio } from '../lib/servizi';
|
||||
import Logo from './Logo.astro';
|
||||
|
||||
interface Props {
|
||||
servizi: Servizio[];
|
||||
}
|
||||
|
||||
const { servizi } = Astro.props;
|
||||
const sedi = [sedePrincipale, ...studio.sedi.filter((s) => s.id !== sedePrincipale.id)];
|
||||
const ds = studio.datiSocietari;
|
||||
const datiSocietari = [
|
||||
ds.sedeLegale && `Sede legale: ${ds.sedeLegale}`,
|
||||
ds.ufficioRegistroImprese &&
|
||||
ds.numeroRea &&
|
||||
`Registro Imprese di ${ds.ufficioRegistroImprese}, REA ${ds.numeroRea}`,
|
||||
ds.capitaleSociale && `Capitale sociale ${ds.capitaleSociale}`,
|
||||
ds.socioUnico === true && 'Società con socio unico',
|
||||
ds.inLiquidazione === true && 'Società in liquidazione',
|
||||
].filter(Boolean) as string[];
|
||||
---
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="container">
|
||||
<div class="footer__grid">
|
||||
<div class="footer__studio">
|
||||
<Logo variant="dark" />
|
||||
<p>{studio.descrizioneBreve}</p>
|
||||
<ul role="list">
|
||||
{sedi.map((s) => (
|
||||
<li>{addressLine(s.indirizzo)}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 class="footer__title">Contatti</h2>
|
||||
<ul role="list">
|
||||
{studio.telefoni.map((t) => (
|
||||
<li>
|
||||
Tel. <a href={telHref(t)}>{t.display}</a>
|
||||
</li>
|
||||
))}
|
||||
<li>Fax {studio.fax.display}</li>
|
||||
<li>
|
||||
<a href={mailtoHref(studio.email)}>{studio.email}</a>
|
||||
</li>
|
||||
{studio.pec.map((p) => (
|
||||
<li>
|
||||
<span class="footer__label">{p.etichetta}:</span>
|
||||
<a href={mailtoHref(p.indirizzo)}>{p.indirizzo}</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<nav class="footer__services" aria-label="Servizi">
|
||||
<h2 class="footer__title">Servizi</h2>
|
||||
<ul role="list">
|
||||
{servizi.map((s) => (
|
||||
<li>
|
||||
<a href={servizioHref(s)}>{s.data.titolo}</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div>
|
||||
<h2 class="footer__title">Orari</h2>
|
||||
<ul role="list">
|
||||
<li>{studio.orari.giorniEsteso}</li>
|
||||
<li>{hoursLine()}</li>
|
||||
<li>{studio.orari.notaAsti}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer__legal">
|
||||
<div class="footer__legal-text">
|
||||
<p>{`© ${buildYear} ${denominazione} — P.IVA ${studio.partitaIva} — Tutti i diritti riservati`}</p>
|
||||
{datiSocietari.length > 0 && <p>{datiSocietari.join(' — ')}</p>}
|
||||
</div>
|
||||
<nav aria-label="Informazioni legali">
|
||||
<ul role="list">
|
||||
{navLegale.map((item) => (
|
||||
<li>
|
||||
<a
|
||||
href={item.href}
|
||||
aria-current={Astro.url.pathname === item.href ? 'page' : undefined}
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<style>
|
||||
.site-footer {
|
||||
background: var(--navy-900);
|
||||
color: var(--on-dark);
|
||||
padding-block: var(--space-8) var(--space-5);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.site-footer a {
|
||||
color: var(--on-dark);
|
||||
text-decoration: none;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.site-footer a:hover {
|
||||
color: var(--white);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.site-footer :global(.brand) {
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
.site-footer ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.site-footer li {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.site-footer p {
|
||||
color: var(--on-dark);
|
||||
}
|
||||
|
||||
.footer__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1.4fr 1fr 1fr 1fr;
|
||||
gap: var(--space-6);
|
||||
padding-bottom: var(--space-6);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
.footer__title {
|
||||
color: var(--white);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
.footer__label {
|
||||
display: block;
|
||||
color: var(--on-dark-muted);
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
.footer__legal {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--space-3) var(--space-5);
|
||||
padding-top: var(--space-4);
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
.footer__legal p {
|
||||
margin: 0;
|
||||
color: var(--on-dark-muted);
|
||||
}
|
||||
|
||||
.footer__legal-text {
|
||||
display: grid;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.footer__legal ul {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0 var(--space-4);
|
||||
}
|
||||
|
||||
.footer__legal li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer__legal a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: var(--tap);
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.footer__grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.footer__grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.site-footer li a {
|
||||
display: inline-block;
|
||||
padding-block: 0.3rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,137 @@
|
||||
---
|
||||
/**
|
||||
* Intestazione: barra superiore con sedi e recapiti (solo ≥ 960 px), logo, navigazione
|
||||
* principale con sottomenu dei servizi e menu mobile. L'intestazione resta fissa in alto
|
||||
* durante lo scorrimento; la barra superiore scorre via.
|
||||
*/
|
||||
import { sedePrincipale, studio } from '../data/studio';
|
||||
import { mailtoHref, telHref } from '../lib/format';
|
||||
import type { Servizio } from '../lib/servizi';
|
||||
import Icon from './Icon.astro';
|
||||
import Logo from './Logo.astro';
|
||||
import MobileMenu from './MobileMenu.astro';
|
||||
import Nav from './Nav.astro';
|
||||
|
||||
interface Props {
|
||||
servizi: Servizio[];
|
||||
}
|
||||
|
||||
const { servizi } = Astro.props;
|
||||
const telefono = studio.telefoni[0];
|
||||
const altreSedi = studio.sedi.filter((s) => s.id !== sedePrincipale.id);
|
||||
const sedi = [sedePrincipale, ...altreSedi];
|
||||
const short = (s: (typeof sedi)[number]) =>
|
||||
`${s.indirizzo.streetAddress.replace(',', '')}, ${s.indirizzo.locality}`;
|
||||
---
|
||||
|
||||
<header class="site-header">
|
||||
<div class="topbar">
|
||||
<div class="container topbar__inner">
|
||||
<ul class="topbar__list" role="list" aria-label="Sedi">
|
||||
{sedi.map((s) => (
|
||||
<li>
|
||||
<Icon name="map-pin" size={14} />
|
||||
<span>{short(s)}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<ul class="topbar__list" role="list" aria-label="Recapiti">
|
||||
<li>
|
||||
<Icon name="phone" size={14} />
|
||||
<a href={telHref(telefono)}>{telefono.display}</a>
|
||||
</li>
|
||||
<li>
|
||||
<Icon name="mail" size={14} />
|
||||
<a href={mailtoHref(studio.email)}>{studio.email}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site-header__bar">
|
||||
<div class="container site-header__inner">
|
||||
<Logo />
|
||||
<Nav servizi={servizi} />
|
||||
<MobileMenu servizi={servizi} />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<style>
|
||||
.site-header {
|
||||
--topbar-h: 2.25rem;
|
||||
position: sticky;
|
||||
top: calc(-1 * var(--topbar-h));
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
background: var(--navy-900);
|
||||
color: var(--on-dark);
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
.topbar__inner {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
min-height: var(--topbar-h);
|
||||
}
|
||||
|
||||
.topbar__list {
|
||||
display: flex;
|
||||
gap: var(--space-5);
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.topbar__list li {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.topbar__list :global(svg) {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
color: var(--gold-300);
|
||||
}
|
||||
|
||||
.topbar a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.topbar a:hover {
|
||||
color: var(--white);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.site-header__bar {
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
backdrop-filter: saturate(1.4) blur(10px);
|
||||
-webkit-backdrop-filter: saturate(1.4) blur(10px);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.site-header__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-6);
|
||||
min-height: var(--header-h);
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.site-header {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site-header__inner {
|
||||
min-height: 4.25rem;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,244 @@
|
||||
---
|
||||
/**
|
||||
* Hero della home: occhiello, titolo con seconda parte in corsivo, testo introduttivo, due
|
||||
* inviti all'azione, riga di fiducia e, a destra, illustrazione in CSS (forma navy e anello
|
||||
* oro, decorativi) con tre «fact card». Su mobile le card si impilano e l'illustrazione sparisce.
|
||||
*/
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
interface Props {
|
||||
eyebrow: string;
|
||||
titolo: string;
|
||||
titoloCorsivo: string;
|
||||
testo: string;
|
||||
ctaPrimaria: { label: string; href: string };
|
||||
ctaSecondaria: { label: string; href: string };
|
||||
fiducia: string[];
|
||||
fatti: { titolo: string; testo: string; icona: string }[];
|
||||
}
|
||||
|
||||
const { eyebrow, titolo, titoloCorsivo, testo, ctaPrimaria, ctaSecondaria, fiducia, fatti } =
|
||||
Astro.props;
|
||||
---
|
||||
|
||||
<section class="hero" aria-labelledby="hero-titolo">
|
||||
<div class="container hero__inner">
|
||||
<div class="hero__text">
|
||||
<p class="eyebrow">{eyebrow}</p>
|
||||
<h1 id="hero-titolo">
|
||||
{titolo} <em>{titoloCorsivo}</em>
|
||||
</h1>
|
||||
<p class="hero__lead">{testo}</p>
|
||||
<div class="hero__actions">
|
||||
<a class="btn btn--primary" href={ctaPrimaria.href}>
|
||||
{ctaPrimaria.label}
|
||||
<Icon name="arrow-right" size={18} />
|
||||
</a>
|
||||
<a class="btn btn--outline" href={ctaSecondaria.href}>
|
||||
{ctaSecondaria.label}
|
||||
</a>
|
||||
</div>
|
||||
<ul class="hero__trust" role="list">
|
||||
{fiducia.map((voce) => (
|
||||
<li>
|
||||
<Icon name="circle-check" size={18} />
|
||||
{voce}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="hero__visual">
|
||||
<div class="hero__blob" aria-hidden="true"></div>
|
||||
<div class="hero__ring" aria-hidden="true"></div>
|
||||
<ul class="hero__facts" role="list">
|
||||
{fatti.map((f, i) => (
|
||||
<li class:list={['fact', `fact--${i + 1}`]}>
|
||||
<span class="fact__icon">
|
||||
<Icon name={f.icona} size={20} />
|
||||
</span>
|
||||
<span>
|
||||
<strong>{f.titolo}</strong>
|
||||
<span>{f.testo}</span>
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.hero {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(180deg, var(--navy-050) 0%, var(--white) 100%);
|
||||
}
|
||||
|
||||
.hero__inner {
|
||||
display: grid;
|
||||
grid-template-columns: 1.15fr 0.85fr;
|
||||
gap: var(--space-8);
|
||||
align-items: center;
|
||||
padding-block: clamp(3rem, 8vw, 6.5rem);
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
margin-bottom: var(--space-5);
|
||||
max-width: 16ch;
|
||||
}
|
||||
|
||||
.hero h1 em {
|
||||
font-style: italic;
|
||||
color: var(--navy-700);
|
||||
}
|
||||
|
||||
.hero__lead {
|
||||
font-size: var(--fs-lg);
|
||||
color: var(--ink-600);
|
||||
max-width: 36rem;
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
|
||||
.hero__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-3);
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
|
||||
.hero__trust {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-3) var(--space-5);
|
||||
list-style: none;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-700);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.hero__trust li {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
}
|
||||
|
||||
.hero__trust :global(svg) {
|
||||
flex: none;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
color: var(--gold-700);
|
||||
}
|
||||
|
||||
.hero__visual {
|
||||
position: relative;
|
||||
min-height: 420px;
|
||||
}
|
||||
|
||||
.hero__blob {
|
||||
position: absolute;
|
||||
inset: 8% -6% 4% 6%;
|
||||
background: radial-gradient(120% 110% at 80% 10%, var(--navy-700) 0%, var(--navy-900) 70%);
|
||||
border-radius: 48% 52% 44% 56% / 52% 40% 60% 48%;
|
||||
}
|
||||
|
||||
.hero__ring {
|
||||
position: absolute;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
border-radius: 50%;
|
||||
border: 10px solid var(--gold-500);
|
||||
right: 4%;
|
||||
top: 2%;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.hero__facts {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.fact {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
gap: var(--space-3);
|
||||
align-items: flex-start;
|
||||
width: 300px;
|
||||
padding: var(--space-4) var(--space-5);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.fact__icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
flex: none;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
background: var(--gold-100);
|
||||
color: var(--gold-700);
|
||||
}
|
||||
|
||||
.fact__icon :global(svg) {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.fact strong {
|
||||
display: block;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--navy-900);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.fact strong + span {
|
||||
display: block;
|
||||
margin-top: 0.15rem;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.fact--1 {
|
||||
left: 0;
|
||||
top: 14%;
|
||||
}
|
||||
|
||||
.fact--2 {
|
||||
right: 2%;
|
||||
top: 42%;
|
||||
}
|
||||
|
||||
.fact--3 {
|
||||
left: 10%;
|
||||
bottom: 6%;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.hero__inner {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: var(--space-6);
|
||||
}
|
||||
|
||||
.hero__visual {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.hero__facts {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.hero__blob,
|
||||
.hero__ring {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fact {
|
||||
position: static;
|
||||
width: 100%;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
/**
|
||||
* Icona Lucide inserita come SVG inline a build time (nessun JavaScript, nessuna richiesta).
|
||||
* Decorativa per impostazione predefinita (`aria-hidden`); con `label` diventa un'immagine
|
||||
* con nome accessibile.
|
||||
*/
|
||||
import { icons } from '@iconify-json/lucide';
|
||||
|
||||
interface Props {
|
||||
name: string;
|
||||
size?: number;
|
||||
class?: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
const { name, size = 24, class: className, label } = Astro.props;
|
||||
|
||||
function resolveIcon(iconName: string, depth = 0): { body: string; width: number; height: number } {
|
||||
const icon = icons.icons[iconName];
|
||||
if (icon) {
|
||||
return {
|
||||
body: icon.body,
|
||||
width: icon.width ?? icons.width ?? 24,
|
||||
height: icon.height ?? icons.height ?? 24,
|
||||
};
|
||||
}
|
||||
const alias = icons.aliases?.[iconName];
|
||||
if (alias && depth < 5) return resolveIcon(alias.parent, depth + 1);
|
||||
throw new Error(`Icona Lucide sconosciuta: «${iconName}» (vedi https://lucide.dev/icons/)`);
|
||||
}
|
||||
|
||||
const { body, width, height } = resolveIcon(name);
|
||||
---
|
||||
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox={`0 0 ${width} ${height}`}
|
||||
class:list={['icon', className]}
|
||||
aria-hidden={label ? undefined : 'true'}
|
||||
role={label ? 'img' : undefined}
|
||||
aria-label={label}
|
||||
set:html={body}
|
||||
/>
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
/**
|
||||
* Marchio + logotipo dello Studio. Variante `dark` per i fondi navy (footer, menu mobile no).
|
||||
* Il marchio è un SVG con la «G» già convertita in tracciato (vedi scripts/generate-icons.mjs).
|
||||
*/
|
||||
import MarkDark from '../assets/logo-mark-dark.svg';
|
||||
import Mark from '../assets/logo-mark.svg';
|
||||
import { studio } from '../data/studio';
|
||||
|
||||
interface Props {
|
||||
variant?: 'light' | 'dark';
|
||||
/** Link della home; `null` per un logo non cliccabile. */
|
||||
href?: string | null;
|
||||
class?: string;
|
||||
}
|
||||
|
||||
const { variant = 'light', href = '/', class: className } = Astro.props;
|
||||
const tag = studio.sottotitolo.replace(/^Studio\s+/i, '');
|
||||
const isHome = Astro.url.pathname === '/';
|
||||
const MarkSvg = variant === 'dark' ? MarkDark : Mark;
|
||||
---
|
||||
|
||||
{href ? (
|
||||
<a
|
||||
class:list={['brand', `brand--${variant}`, className]}
|
||||
href={href}
|
||||
aria-current={isHome && href === '/' ? 'page' : undefined}
|
||||
>
|
||||
<MarkSvg class="brand__mark" width={44} height={44} aria-hidden="true" />
|
||||
<span class="brand__text">
|
||||
<span class="brand__name">{studio.nome}</span>
|
||||
<span class="brand__tag">{tag}</span>
|
||||
</span>
|
||||
</a>
|
||||
) : (
|
||||
<span class:list={['brand', `brand--${variant}`, className]}>
|
||||
<MarkSvg class="brand__mark" width={44} height={44} aria-hidden="true" />
|
||||
<span class="brand__text">
|
||||
<span class="brand__name">{studio.nome}</span>
|
||||
<span class="brand__tag">{tag}</span>
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
<style>
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
min-height: var(--tap);
|
||||
text-decoration: none;
|
||||
color: var(--navy-900);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.brand:hover {
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.brand__mark {
|
||||
flex: none;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.brand__text {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.brand__name {
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.35rem;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.brand__tag {
|
||||
display: block;
|
||||
margin-top: 0.35rem;
|
||||
font-family: var(--font-body);
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
letter-spacing: 0.16em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.brand--dark,
|
||||
.brand--dark:hover {
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
.brand--dark .brand__tag {
|
||||
color: var(--on-dark-muted);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,142 @@
|
||||
---
|
||||
/**
|
||||
* Mappa «click-to-load» (brief §10.2): nessuna richiesta a Google finché l'utente non preme
|
||||
* «Carica la mappa». Senza JavaScript restano i due link esterni (Google Maps, OpenStreetMap),
|
||||
* costruiti per indirizzo. La scelta viene ricordata per la sessione in sessionStorage.
|
||||
*/
|
||||
import { mappa } from '../data/testi';
|
||||
import { googleMapsUrl, openStreetMapUrl } from '../lib/format';
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
interface Props {
|
||||
embedUrl: string;
|
||||
title: string;
|
||||
/** Indirizzo da cercare nei link esterni. */
|
||||
query: string;
|
||||
/** Nome breve del luogo, per i nomi accessibili dei pulsanti. */
|
||||
place: string;
|
||||
compact?: boolean;
|
||||
}
|
||||
|
||||
const { embedUrl, title, query, place, compact = false } = Astro.props;
|
||||
---
|
||||
|
||||
<div
|
||||
class:list={['map-consent', { 'map-consent--compact': compact }]}
|
||||
data-map-consent
|
||||
data-map-src={embedUrl}
|
||||
data-map-title={title}
|
||||
>
|
||||
<div class="map-consent__placeholder" data-map-placeholder>
|
||||
<Icon name="map-pin" size={compact ? 28 : 36} class="map-consent__pin" />
|
||||
<p>
|
||||
{mappa.avviso} <a href="/cookie-policy/">{mappa.linkCookie}</a>).
|
||||
</p>
|
||||
<button type="button" class="btn btn--primary btn--sm js-only" data-map-load>
|
||||
{mappa.carica}
|
||||
<span class="visually-hidden"> ({place})</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="map-consent__frame" data-map-frame hidden></div>
|
||||
<div class="map-consent__actions">
|
||||
<a class="btn btn--outline btn--sm" href={googleMapsUrl(query)} rel="noopener">
|
||||
{mappa.apriGoogle}
|
||||
<span class="visually-hidden"> ({place})</span>
|
||||
</a>
|
||||
<a class="btn btn--outline btn--sm" href={openStreetMapUrl(query)} rel="noopener">
|
||||
{mappa.apriOsm}
|
||||
<span class="visually-hidden"> ({place})</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import '../scripts/map-consent';
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.map-consent {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.map-consent__placeholder,
|
||||
.map-consent__frame {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-lg);
|
||||
min-height: 260px;
|
||||
}
|
||||
|
||||
.map-consent__placeholder {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
align-content: center;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-6);
|
||||
text-align: center;
|
||||
background: repeating-linear-gradient(45deg, var(--navy-050) 0 12px, var(--white) 12px 24px);
|
||||
}
|
||||
|
||||
.map-consent__placeholder p {
|
||||
max-width: 46ch;
|
||||
margin: 0;
|
||||
padding: 0.35rem 0.6rem;
|
||||
border-radius: var(--radius-sm);
|
||||
background: rgba(255, 255, 255, 0.88);
|
||||
color: var(--ink-700);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.map-consent__placeholder :global(.map-consent__pin) {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
color: var(--navy-700);
|
||||
}
|
||||
|
||||
.map-consent__frame {
|
||||
overflow: hidden;
|
||||
background: var(--navy-050);
|
||||
}
|
||||
|
||||
.map-consent__frame :global(iframe) {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 320px;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.map-consent__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.map-consent--compact .map-consent__placeholder,
|
||||
.map-consent--compact .map-consent__frame {
|
||||
min-height: 200px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.map-consent--compact .map-consent__placeholder {
|
||||
padding: var(--space-4);
|
||||
}
|
||||
|
||||
.map-consent--compact .map-consent__placeholder p {
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
.map-consent--compact :global(.map-consent__pin) {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.map-consent--compact .map-consent__frame :global(iframe) {
|
||||
min-height: 240px;
|
||||
}
|
||||
|
||||
.map-consent--compact .map-consent__actions {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,254 @@
|
||||
---
|
||||
/**
|
||||
* Menu mobile (< 960 px): pulsante con `aria-controls`/`aria-expanded` che apre un <dialog>
|
||||
* modale a tutto schermo (sfondo inerte, chiusura con Esc o con il pulsante, focus gestito).
|
||||
* Senza JavaScript il pulsante è nascosto e le voci compaiono sotto il logo (vedi <noscript>
|
||||
* in BaseLayout).
|
||||
*/
|
||||
import { ctaHeader, isCurrentSection, navPrincipale } from '../data/navigazione';
|
||||
import { studio } from '../data/studio';
|
||||
import { mailtoHref, telHref } from '../lib/format';
|
||||
import { servizioHref, type Servizio } from '../lib/servizi';
|
||||
import Icon from './Icon.astro';
|
||||
import Logo from './Logo.astro';
|
||||
|
||||
interface Props {
|
||||
servizi: Servizio[];
|
||||
}
|
||||
|
||||
const { servizi } = Astro.props;
|
||||
const path = Astro.url.pathname;
|
||||
const current = (href: string) =>
|
||||
path === href ? 'page' : isCurrentSection(path, href) ? 'true' : undefined;
|
||||
const telefono = studio.telefoni[0];
|
||||
---
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="menu-toggle"
|
||||
aria-controls="menu-mobile"
|
||||
aria-expanded="false"
|
||||
data-menu-open
|
||||
>
|
||||
<Icon name="menu" size={22} />
|
||||
<span class="visually-hidden">Apri il menu</span>
|
||||
</button>
|
||||
|
||||
<dialog id="menu-mobile" class="mobile-menu" aria-label="Menu" data-menu>
|
||||
<div class="mobile-menu__head">
|
||||
<Logo />
|
||||
<button type="button" class="mobile-menu__close" data-menu-close>
|
||||
<Icon name="x" size={22} />
|
||||
<span class="visually-hidden">Chiudi il menu</span>
|
||||
</button>
|
||||
</div>
|
||||
<nav class="mobile-menu__nav" aria-label="Menu mobile">
|
||||
<ul class="mobile-menu__list" role="list">
|
||||
{navPrincipale.map((item) =>
|
||||
item.servizi ? (
|
||||
<li class="mobile-menu__item">
|
||||
<div class="mobile-menu__row">
|
||||
<a href={item.href} aria-current={current(item.href)}>
|
||||
{item.label}
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
class="mobile-menu__sub-toggle js-only"
|
||||
aria-expanded="false"
|
||||
aria-controls="menu-mobile-servizi"
|
||||
data-submenu-toggle
|
||||
>
|
||||
<Icon name="chevron-down" size={20} />
|
||||
<span class="visually-hidden">Sottomenu {item.label}</span>
|
||||
</button>
|
||||
</div>
|
||||
<ul class="mobile-menu__sub submenu-list" id="menu-mobile-servizi" role="list">
|
||||
{servizi.map((s) => (
|
||||
<li>
|
||||
<a href={servizioHref(s)} aria-current={current(servizioHref(s))}>
|
||||
{s.data.titolo}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</li>
|
||||
) : (
|
||||
<li class="mobile-menu__item">
|
||||
<div class="mobile-menu__row">
|
||||
<a href={item.href} aria-current={current(item.href)}>
|
||||
{item.label}
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
<div class="mobile-menu__contacts">
|
||||
<a class="btn btn--primary btn--block" href={ctaHeader.href}>
|
||||
{ctaHeader.label}
|
||||
</a>
|
||||
<a class="btn btn--outline btn--block" href={telHref(telefono)}>
|
||||
<Icon name="phone" size={18} />
|
||||
{telefono.display}
|
||||
</a>
|
||||
<a class="mobile-menu__mail" href={mailtoHref(studio.email)}>
|
||||
<Icon name="mail" size={18} />
|
||||
{studio.email}
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</dialog>
|
||||
|
||||
<style>
|
||||
.menu-toggle {
|
||||
display: none;
|
||||
margin-left: auto;
|
||||
width: var(--tap);
|
||||
height: var(--tap);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--line);
|
||||
background: var(--white);
|
||||
color: var(--navy-900);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.menu-toggle :global(svg) {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.menu-toggle {
|
||||
display: inline-flex;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-menu {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
margin: 0;
|
||||
padding: 0 var(--gutter) var(--space-6);
|
||||
border: 0;
|
||||
background: var(--white);
|
||||
color: var(--ink-900);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.mobile-menu::backdrop {
|
||||
background: rgba(11, 31, 51, 0.4);
|
||||
}
|
||||
|
||||
.mobile-menu__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-4);
|
||||
min-height: 4.25rem;
|
||||
border-bottom: 1px solid var(--line);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.mobile-menu__close,
|
||||
.mobile-menu__sub-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: none;
|
||||
width: var(--tap);
|
||||
height: var(--tap);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--line);
|
||||
background: var(--white);
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.mobile-menu__sub-toggle :global(svg) {
|
||||
transition: transform var(--dur) var(--ease);
|
||||
}
|
||||
|
||||
.mobile-menu__sub-toggle[aria-expanded='true'] :global(svg) {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.mobile-menu__list {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.mobile-menu__item {
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.mobile-menu__row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.mobile-menu__row a {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 3.25rem;
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.3rem;
|
||||
font-weight: 500;
|
||||
color: var(--navy-900);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.mobile-menu a[aria-current] {
|
||||
color: var(--navy-700);
|
||||
text-decoration: underline;
|
||||
text-decoration-color: var(--gold-500);
|
||||
text-decoration-thickness: 2px;
|
||||
text-underline-offset: 6px;
|
||||
}
|
||||
|
||||
.mobile-menu__sub {
|
||||
display: none;
|
||||
list-style: none;
|
||||
padding: 0 0 var(--space-3) var(--space-4);
|
||||
}
|
||||
|
||||
.mobile-menu__row:has(.mobile-menu__sub-toggle[aria-expanded='true']) + .mobile-menu__sub {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mobile-menu__sub a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: var(--tap);
|
||||
padding-block: 0.35rem;
|
||||
color: var(--ink-700);
|
||||
text-decoration: none;
|
||||
font-size: var(--fs-md);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.mobile-menu__contacts {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
margin-top: var(--space-5);
|
||||
}
|
||||
|
||||
.mobile-menu__mail {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
min-height: var(--tap);
|
||||
color: var(--navy-800);
|
||||
font-weight: 600;
|
||||
font-size: var(--fs-sm);
|
||||
text-decoration: none;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
:global(html:has(.mobile-menu[open])) {
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,245 @@
|
||||
---
|
||||
/**
|
||||
* Navigazione principale (desktop, ≥ 960 px). Il sottomenu «Servizi» si apre al passaggio del
|
||||
* mouse oppure con il pulsante freccia (tastiera e touch: `aria-expanded`, chiusura con Esc).
|
||||
* Senza JavaScript la voce «Servizi» porta comunque alla pagina con tutti i servizi.
|
||||
*/
|
||||
import { ctaHeader, isCurrentSection, navPrincipale } from '../data/navigazione';
|
||||
import { studio } from '../data/studio';
|
||||
import { telHref } from '../lib/format';
|
||||
import { servizioHref, type Servizio } from '../lib/servizi';
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
interface Props {
|
||||
servizi: Servizio[];
|
||||
}
|
||||
|
||||
const { servizi } = Astro.props;
|
||||
const path = Astro.url.pathname;
|
||||
const current = (href: string) =>
|
||||
path === href ? 'page' : isCurrentSection(path, href) ? 'true' : undefined;
|
||||
---
|
||||
|
||||
<nav class="nav" aria-label="Principale">
|
||||
<ul class="nav__list" role="list">
|
||||
{navPrincipale.map((item) =>
|
||||
item.servizi ? (
|
||||
<li class="nav__item nav__item--has-sub" data-submenu>
|
||||
<a href={item.href} aria-current={current(item.href)}>
|
||||
{item.label}
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
class="nav__sub-toggle js-only"
|
||||
aria-expanded="false"
|
||||
aria-controls="sottomenu-servizi"
|
||||
data-submenu-toggle
|
||||
>
|
||||
<Icon name="chevron-down" size={16} />
|
||||
<span class="visually-hidden">Sottomenu {item.label}</span>
|
||||
</button>
|
||||
<ul class="nav__sub" id="sottomenu-servizi" role="list">
|
||||
{servizi.map((s) => (
|
||||
<li>
|
||||
<a href={servizioHref(s)} aria-current={current(servizioHref(s))}>
|
||||
{s.data.titolo}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</li>
|
||||
) : (
|
||||
<li class="nav__item">
|
||||
<a href={item.href} aria-current={current(item.href)}>
|
||||
{item.label}
|
||||
</a>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
<div class="nav__cta">
|
||||
<a class="nav__phone" href={telHref(studio.telefoni[0])}>
|
||||
<Icon name="phone" size={16} />
|
||||
<span class="visually-hidden">Telefono</span>
|
||||
{studio.telefonoPrincipaleBreve}
|
||||
</a>
|
||||
<a class="btn btn--primary btn--sm" href={ctaHeader.href}>
|
||||
{ctaHeader.label}
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
import '../scripts/menu';
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.nav {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-5);
|
||||
}
|
||||
|
||||
.nav__list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.15rem;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav__item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav__item > a,
|
||||
.nav__sub-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: var(--tap);
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--ink-700);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.nav__item > a:hover,
|
||||
.nav__item > a[aria-current] {
|
||||
color: var(--navy-900);
|
||||
background: var(--navy-050);
|
||||
}
|
||||
|
||||
.nav__item > a[aria-current] {
|
||||
box-shadow: inset 0 -2px 0 var(--gold-500);
|
||||
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
|
||||
}
|
||||
|
||||
.nav__item--has-sub > a {
|
||||
padding-right: 0.3rem;
|
||||
}
|
||||
|
||||
.nav__sub-toggle {
|
||||
justify-content: center;
|
||||
min-width: 32px;
|
||||
padding: 0.5rem 0.4rem;
|
||||
margin-left: -0.15rem;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.nav__sub-toggle:hover {
|
||||
background: var(--navy-050);
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.nav__sub-toggle :global(svg) {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
transition: transform var(--dur) var(--ease);
|
||||
}
|
||||
|
||||
.nav__sub-toggle[aria-expanded='true'] :global(svg) {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.nav__sub {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 60;
|
||||
min-width: 21rem;
|
||||
padding: var(--space-2);
|
||||
list-style: none;
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
/* ponte invisibile tra voce e sottomenu, per non perdere l'hover */
|
||||
.nav__sub::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -0.6rem;
|
||||
height: 0.6rem;
|
||||
}
|
||||
|
||||
.nav__item--has-sub:hover .nav__sub,
|
||||
.nav__sub-toggle[aria-expanded='true'] + .nav__sub {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav__sub a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: var(--tap);
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--ink-700);
|
||||
text-decoration: none;
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 500;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.nav__sub a:hover,
|
||||
.nav__sub a[aria-current] {
|
||||
background: var(--navy-050);
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.nav__cta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.nav__phone {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
min-height: var(--tap);
|
||||
font-weight: 600;
|
||||
color: var(--navy-800);
|
||||
text-decoration: none;
|
||||
font-size: var(--fs-sm);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.nav__phone:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.nav__phone :global(svg) {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--gold-700);
|
||||
}
|
||||
|
||||
.nav__cta .btn {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.nav {
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.nav__phone {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
/** Testata delle pagine interne: percorso, titolo principale (unico <h1>) e sottotitolo. */
|
||||
import type { Crumb } from '../lib/seo';
|
||||
import Breadcrumb from './Breadcrumb.astro';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
breadcrumbs: Crumb[];
|
||||
}
|
||||
|
||||
const { title, subtitle, breadcrumbs } = Astro.props;
|
||||
---
|
||||
|
||||
<div class="page-head">
|
||||
<div class="container">
|
||||
<Breadcrumb items={breadcrumbs} />
|
||||
<h1>{title}</h1>
|
||||
{subtitle && <p class="page-head__lead">{subtitle}</p>}
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.page-head {
|
||||
background: var(--navy-050);
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding-block: var(--space-7) var(--space-6);
|
||||
}
|
||||
|
||||
.page-head h1 {
|
||||
max-width: 22ch;
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.page-head__lead {
|
||||
font-size: var(--fs-lg);
|
||||
color: var(--ink-600);
|
||||
max-width: 44rem;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
/** Rete di professionisti esterni con cui collabora lo Studio (brief §4.4). */
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
interface Props {
|
||||
partner: { nome: string; descrizione: string; icona: string }[];
|
||||
}
|
||||
|
||||
const { partner } = Astro.props;
|
||||
---
|
||||
|
||||
<ul class="partners" role="list">
|
||||
{partner.map((p) => (
|
||||
<li class="partner">
|
||||
<Icon name={p.icona} size={22} />
|
||||
<span>
|
||||
<strong>{p.nome}</strong>
|
||||
<span>{p.descrizione}</span>
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<style>
|
||||
.partners {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: var(--space-4);
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.partner {
|
||||
display: flex;
|
||||
gap: var(--space-3);
|
||||
align-items: center;
|
||||
padding: var(--space-4);
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
border: 1px dashed #c3ccd6;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.partner :global(svg) {
|
||||
flex: none;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
color: var(--gold-700);
|
||||
}
|
||||
|
||||
.partner strong {
|
||||
display: block;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.partner strong + span {
|
||||
display: block;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.partners {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.partners {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,135 @@
|
||||
---
|
||||
/**
|
||||
* Scheda di un professionista: avatar con le iniziali, nome, qualifica principale, elenco
|
||||
* qualifiche (sintesi o completo), riferimento normativo (L. 4/2013 per il tributarista) e P.IVA.
|
||||
*/
|
||||
import type { Professionista } from '../data/studio';
|
||||
import { initials } from '../lib/format';
|
||||
|
||||
interface Props {
|
||||
persona: Professionista;
|
||||
/** `compact` = sintesi (home), `full` = tutte le qualifiche (pagina «Lo studio»). */
|
||||
variant?: 'compact' | 'full';
|
||||
headingLevel?: 2 | 3;
|
||||
}
|
||||
|
||||
const { persona, variant = 'compact', headingLevel = 3 } = Astro.props;
|
||||
const Heading = headingLevel === 2 ? 'h2' : 'h3';
|
||||
const qualifiche = variant === 'full' ? persona.qualifiche : persona.qualificheSintesi;
|
||||
---
|
||||
|
||||
<article class:list={['person', `person--${variant}`]} data-person={persona.id}>
|
||||
<span class="person__avatar" aria-hidden="true">
|
||||
{initials(persona.nome)}
|
||||
</span>
|
||||
<div class="person__body">
|
||||
<Heading class="person__name">{persona.nome}</Heading>
|
||||
<p class="person__role">{persona.qualificaPrincipale}</p>
|
||||
<ul class="person__list" role="list">
|
||||
{qualifiche.map((q) => (
|
||||
<li>{q}</li>
|
||||
))}
|
||||
</ul>
|
||||
{persona.riferimentoNormativo && <p class="person__law">{persona.riferimentoNormativo}</p>}
|
||||
<p class="person__meta">
|
||||
P.IVA {persona.partitaIva}
|
||||
{variant === 'full' && persona.pec && (
|
||||
<>
|
||||
<br />
|
||||
PEC <a href={`mailto:${persona.pec}`}>{persona.pec}</a>
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<style>
|
||||
.person {
|
||||
display: grid;
|
||||
grid-template-columns: 64px minmax(0, 1fr);
|
||||
gap: var(--space-4);
|
||||
padding: var(--space-5);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.person__avatar {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
background: var(--navy-800);
|
||||
color: var(--white);
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.35rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.person__name {
|
||||
margin: 0 0 0.15rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.person__role {
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
color: var(--gold-700);
|
||||
}
|
||||
|
||||
.person__list {
|
||||
display: grid;
|
||||
gap: 0.3rem;
|
||||
list-style: none;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.person--full .person__list {
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-700);
|
||||
}
|
||||
|
||||
.person__list li {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.person__list li::before {
|
||||
content: '';
|
||||
flex: none;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
margin-top: 0.55em;
|
||||
border-radius: 50%;
|
||||
background: var(--gold-500);
|
||||
}
|
||||
|
||||
.person__law {
|
||||
margin: 0.75rem 0 0;
|
||||
padding-top: 0.6rem;
|
||||
border-top: 1px dashed var(--line);
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-700);
|
||||
}
|
||||
|
||||
.person__meta {
|
||||
margin: 0.6rem 0 0;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.person__meta a {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.person {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
/** Intestazione di sezione: occhiello, titolo e sottotitolo facoltativo. */
|
||||
interface Props {
|
||||
eyebrow?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
/** id del titolo, per collegarlo alla sezione con aria-labelledby. */
|
||||
id?: string;
|
||||
level?: 2 | 3;
|
||||
class?: string;
|
||||
}
|
||||
|
||||
const { eyebrow, title, subtitle, id, level = 2, class: className } = Astro.props;
|
||||
const Heading = level === 2 ? 'h2' : 'h3';
|
||||
---
|
||||
|
||||
<div class:list={['section-head', className]}>
|
||||
{eyebrow && <p class="eyebrow">{eyebrow}</p>}
|
||||
<Heading id={id}>{title}</Heading>
|
||||
{subtitle && <p class="section-head__sub">{subtitle}</p>}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.section-head {
|
||||
max-width: 42rem;
|
||||
margin-bottom: var(--space-7);
|
||||
}
|
||||
|
||||
.section-head__sub {
|
||||
color: var(--ink-600);
|
||||
font-size: var(--fs-lg);
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,135 @@
|
||||
---
|
||||
/**
|
||||
* Card di una sede: indirizzo, mappa click-to-load, orari (o ricevimento su appuntamento) e
|
||||
* azioni. `full` aggiunge i pulsanti «Chiama» e «Indicazioni stradali» in evidenza.
|
||||
*/
|
||||
import type { Sede } from '../data/studio';
|
||||
import { studio } from '../data/studio';
|
||||
import { cityLine, googleDirectionsUrl, hoursLine, telHref } from '../lib/format';
|
||||
import Icon from './Icon.astro';
|
||||
import MapConsent from './MapConsent.astro';
|
||||
|
||||
interface Props {
|
||||
sede: Sede;
|
||||
variant?: 'compact' | 'full';
|
||||
headingLevel?: 2 | 3;
|
||||
}
|
||||
|
||||
const { sede, variant = 'compact', headingLevel = 3 } = Astro.props;
|
||||
const Heading = headingLevel === 2 ? 'h2' : 'h3';
|
||||
const telefono = studio.telefoni[0];
|
||||
---
|
||||
|
||||
<article class:list={['sede', `sede--${variant}`]} id={`sede-${sede.id}`}>
|
||||
<div class="sede__head">
|
||||
<Icon name="map-pin" size={20} />
|
||||
<Heading>{sede.nome}</Heading>
|
||||
</div>
|
||||
<address>
|
||||
{sede.indirizzo.streetAddress}
|
||||
<br />
|
||||
{cityLine(sede.indirizzo)}
|
||||
</address>
|
||||
|
||||
<MapConsent
|
||||
embedUrl={sede.mappa.embedUrl}
|
||||
title={sede.mappa.titolo}
|
||||
query={sede.ricercaMappa}
|
||||
place={sede.nome}
|
||||
compact={variant === 'compact'}
|
||||
/>
|
||||
|
||||
<div class="sede__hours">
|
||||
{sede.suAppuntamento ? (
|
||||
<>
|
||||
<strong>Ricevimento</strong>
|
||||
<span>Su appuntamento</span>
|
||||
<span>
|
||||
Per fissare un appuntamento: tel. <a href={telHref(telefono)}>{telefono.display}</a>
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<strong>Orari</strong>
|
||||
<span>{studio.orari.giorni}</span>
|
||||
<span>{hoursLine()}</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div class="sede__actions">
|
||||
<a
|
||||
class="btn btn--outline btn--sm"
|
||||
href={googleDirectionsUrl(sede.ricercaMappa)}
|
||||
rel="noopener"
|
||||
>
|
||||
Indicazioni stradali<span class="visually-hidden"> ({sede.nome})</span>
|
||||
<Icon name="arrow-right" size={16} />
|
||||
</a>
|
||||
{variant === 'full' && (
|
||||
<a class="btn btn--primary btn--sm" href={telHref(telefono)}>
|
||||
<Icon name="phone" size={16} />
|
||||
Chiama<span class="visually-hidden"> lo {telefono.display}</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<style>
|
||||
.sede {
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
align-content: start;
|
||||
padding: var(--space-5);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.sede__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.sede__head :global(svg) {
|
||||
flex: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: var(--gold-700);
|
||||
}
|
||||
|
||||
.sede__head :global(h2),
|
||||
.sede__head :global(h3) {
|
||||
margin: 0;
|
||||
font-size: var(--fs-h3);
|
||||
}
|
||||
|
||||
.sede address {
|
||||
color: var(--ink-700);
|
||||
}
|
||||
|
||||
.sede__hours {
|
||||
display: grid;
|
||||
gap: 0.2rem;
|
||||
padding-top: var(--space-3);
|
||||
border-top: 1px solid var(--line);
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.sede__hours strong {
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.sede__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.sede--compact .sede__actions .btn {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,128 @@
|
||||
---
|
||||
/**
|
||||
* Card di un servizio: icona, titolo, sommario e link «Approfondisci». L'intera card è
|
||||
* cliccabile (il link si estende su tutta la superficie) e si solleva leggermente al passaggio.
|
||||
*/
|
||||
import { servizioHref, type Servizio } from '../lib/servizi';
|
||||
import Icon from './Icon.astro';
|
||||
|
||||
interface Props {
|
||||
servizio: Servizio;
|
||||
/** id dell'elemento (sulla pagina /servizi/ è l'ancora del vecchio sito). */
|
||||
id?: string;
|
||||
/** Destinazione del redirect delle vecchie ancore (data-legacy-href). */
|
||||
legacy?: boolean;
|
||||
headingLevel?: 2 | 3;
|
||||
}
|
||||
|
||||
const { servizio, id, legacy = false, headingLevel = 3 } = Astro.props;
|
||||
const href = servizioHref(servizio);
|
||||
const Heading = headingLevel === 2 ? 'h2' : 'h3';
|
||||
---
|
||||
|
||||
<article class="card" id={id} data-legacy-href={legacy ? href : undefined}>
|
||||
<span class="card__icon">
|
||||
<Icon name={servizio.data.icona} size={24} />
|
||||
</span>
|
||||
<Heading class="card__title">{servizio.data.titolo}</Heading>
|
||||
<p>{servizio.data.sommario}</p>
|
||||
<a class="card__link" href={href}>
|
||||
Approfondisci<span class="visually-hidden"> ({servizio.data.titolo})</span>
|
||||
<Icon name="arrow-right" size={16} />
|
||||
</a>
|
||||
</article>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-5);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition:
|
||||
transform var(--dur) var(--ease),
|
||||
box-shadow var(--dur) var(--ease),
|
||||
border-color var(--dur) var(--ease);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: var(--shadow-md);
|
||||
border-color: var(--navy-100);
|
||||
}
|
||||
|
||||
.card:focus-within {
|
||||
border-color: var(--navy-700);
|
||||
}
|
||||
|
||||
.card__icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 12px;
|
||||
background: var(--navy-050);
|
||||
color: var(--navy-700);
|
||||
}
|
||||
|
||||
.card__icon :global(svg) {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.card__title {
|
||||
margin: 0.25rem 0 0;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.card p {
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
color: var(--ink-600);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.card__link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
align-self: flex-start;
|
||||
min-height: var(--tap);
|
||||
margin-top: var(--space-1);
|
||||
font-weight: 600;
|
||||
font-size: var(--fs-sm);
|
||||
text-decoration: none;
|
||||
color: var(--navy-800);
|
||||
}
|
||||
|
||||
/* l'area cliccabile copre l'intera card */
|
||||
.card__link::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
.card__link:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.card__link:focus-visible::after {
|
||||
outline: 3px solid var(--gold-500);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.card__link :global(svg) {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
transition: transform var(--dur) var(--ease);
|
||||
}
|
||||
|
||||
.card:hover .card__link :global(svg) {
|
||||
transform: translateX(3px);
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user