diff --git a/src/components/FranceMap.astro b/src/components/FranceMap.astro index 72dcacc..def4185 100644 --- a/src/components/FranceMap.astro +++ b/src/components/FranceMap.astro @@ -55,17 +55,15 @@ for (const [code] of entries) { { entries.map(([code, dept]) => { const colorId = colorsByDept.get(code) ?? 1; - const color = COLORS[colorId]; return ( ); diff --git a/src/components/VigilanceChip.astro b/src/components/VigilanceChip.astro index 4b822e1..346c5f3 100644 --- a/src/components/VigilanceChip.astro +++ b/src/components/VigilanceChip.astro @@ -6,15 +6,17 @@ interface Props { colorId: ColorId; phenomenonId?: PhenomenonId; showLevel?: boolean; + size?: 'sm' | 'lg'; } -const { colorId, phenomenonId, showLevel = false } = Astro.props; +const { colorId, phenomenonId, showLevel = false, size = 'sm' } = Astro.props; const phenomenon = phenomenonId ? PHENOMENA[phenomenonId] : null; -const colorClass = `vigilance-chip-${colorId}`; +// Glyphes redondants à la couleur (accessibilité daltonisme + niveaux de gris). +const GLYPHS: Record = { 1: '●', 2: '▲', 3: '◆', 4: '■' }; --- - - {phenomenon && } + + {phenomenon ? phenomenon.label : COLORS[colorId].name} {showLevel && — {COLOR_LABEL[colorId]}} diff --git a/src/components/VigilanceLegend.astro b/src/components/VigilanceLegend.astro index 3290569..c886123 100644 --- a/src/components/VigilanceLegend.astro +++ b/src/components/VigilanceLegend.astro @@ -1,22 +1,28 @@ --- -import { COLORS, COLOR_LABEL } from '../lib/phenomena'; +import VigilanceChip from './VigilanceChip.astro'; +import { COLOR_LABEL } from '../lib/phenomena'; import type { ColorId } from '../lib/phenomena'; +interface Props { + inline?: boolean; +} +const { inline = false } = Astro.props; const levels: ColorId[] = [1, 2, 3, 4]; +const NAMES: Record = { 1: 'Vert', 2: 'Jaune', 3: 'Orange', 4: 'Rouge' }; --- -
- Niveaux : +
+ Légende { levels.map((id) => ( - )) } diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index f27ae1a..7264562 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -23,6 +23,9 @@ const fullOgImage = ogImage.startsWith('http') ? ogImage : `${SITE}${ogImage}`; const umamiId = process.env.UMAMI_WEBSITE_ID; const umamiSrc = process.env.UMAMI_SRC ?? 'https://analytics.nocleus.com/script.js'; +const path = Astro.url.pathname; +const isActive = (p: string) => (p === '/' ? path === '/' : path.startsWith(p)); + const jsonLd = { '@context': 'https://schema.org', '@graph': [ @@ -44,7 +47,7 @@ const jsonLd = { '@type': 'Service', '@id': `${SITE}/#service`, name: 'Info Canicule', - serviceType: 'Service d\'information météorologique grand public', + serviceType: "Service d'information météorologique grand public", areaServed: { '@type': 'Country', name: 'France' }, audience: { '@type': 'PeopleAudience', audienceType: 'Grand public, personnes fragiles' }, provider: { @@ -69,7 +72,7 @@ const jsonLd = { - + {noindex ? : } @@ -90,68 +93,234 @@ const jsonLd = { - + + + + + + + {umamiId && ( )} - -
-
- - - Info Canicule + + + + -
+ +
-