diff --git a/public/regions/auverge-rhône-alpes.svg b/public/regions/auverge-rhône-alpes.svg new file mode 100644 index 0000000..1050758 --- /dev/null +++ b/public/regions/auverge-rhône-alpes.svg @@ -0,0 +1,56 @@ + + + + + + diff --git a/public/regions/bourgogne-franche-comte.svg b/public/regions/bourgogne-franche-comte.svg new file mode 100644 index 0000000..693bfba --- /dev/null +++ b/public/regions/bourgogne-franche-comte.svg @@ -0,0 +1,39 @@ + + + + + + diff --git a/public/regions/bretagne.svg b/public/regions/bretagne.svg new file mode 100644 index 0000000..f0f0f1d --- /dev/null +++ b/public/regions/bretagne.svg @@ -0,0 +1,38 @@ + + + + + + diff --git a/public/regions/centre-val-de-loire.svg b/public/regions/centre-val-de-loire.svg new file mode 100644 index 0000000..8f5b085 --- /dev/null +++ b/public/regions/centre-val-de-loire.svg @@ -0,0 +1,34 @@ + + + + + + diff --git a/public/regions/corse.svg b/public/regions/corse.svg new file mode 100644 index 0000000..622ac04 --- /dev/null +++ b/public/regions/corse.svg @@ -0,0 +1,23 @@ + + + + + + diff --git a/public/regions/grand-est.svg b/public/regions/grand-est.svg new file mode 100644 index 0000000..9cfb9f7 --- /dev/null +++ b/public/regions/grand-est.svg @@ -0,0 +1,42 @@ + + + + + + diff --git a/public/regions/guadeloupe.svg b/public/regions/guadeloupe.svg new file mode 100644 index 0000000..e4627d6 --- /dev/null +++ b/public/regions/guadeloupe.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/public/regions/guyane.svg b/public/regions/guyane.svg new file mode 100644 index 0000000..bc804eb --- /dev/null +++ b/public/regions/guyane.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/public/regions/hauts-de-france.svg b/public/regions/hauts-de-france.svg new file mode 100644 index 0000000..74b8981 --- /dev/null +++ b/public/regions/hauts-de-france.svg @@ -0,0 +1,29 @@ + + + + + + diff --git a/public/regions/martinique.svg b/public/regions/martinique.svg new file mode 100644 index 0000000..3a5f377 --- /dev/null +++ b/public/regions/martinique.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/public/regions/mayotte.svg b/public/regions/mayotte.svg new file mode 100644 index 0000000..1895157 --- /dev/null +++ b/public/regions/mayotte.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/public/regions/normandie.svg b/public/regions/normandie.svg new file mode 100644 index 0000000..966787d --- /dev/null +++ b/public/regions/normandie.svg @@ -0,0 +1,31 @@ + + + + + + diff --git a/public/regions/nouvelle-aquitaine.svg b/public/regions/nouvelle-aquitaine.svg new file mode 100644 index 0000000..d18c669 --- /dev/null +++ b/public/regions/nouvelle-aquitaine.svg @@ -0,0 +1,55 @@ + + + + + + diff --git a/public/regions/occitanie.svg b/public/regions/occitanie.svg new file mode 100644 index 0000000..27e2445 --- /dev/null +++ b/public/regions/occitanie.svg @@ -0,0 +1,45 @@ + + + + + + diff --git a/public/regions/pays-de-la-loire.svg b/public/regions/pays-de-la-loire.svg new file mode 100644 index 0000000..b0a3fd1 --- /dev/null +++ b/public/regions/pays-de-la-loire.svg @@ -0,0 +1,32 @@ + + + + + + diff --git a/public/regions/provence-alpes-côte-d'azur.svg b/public/regions/provence-alpes-côte-d'azur.svg new file mode 100644 index 0000000..5f17bf8 --- /dev/null +++ b/public/regions/provence-alpes-côte-d'azur.svg @@ -0,0 +1,36 @@ + + + + + + diff --git a/public/regions/réunion.svg b/public/regions/réunion.svg new file mode 100644 index 0000000..2cef1f7 --- /dev/null +++ b/public/regions/réunion.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/src/assets/main.css b/src/assets/main.css index fead8e7..3b5aefa 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -5,7 +5,7 @@ @tailwind utilities; body { - @apply text-slate-300 bg-slate-950 + @apply text-slate-100 bg-slate-950 } @layer components { diff --git a/src/components/RepButton.vue b/src/components/RepButton.vue index 42fdf48..ddd7e52 100644 --- a/src/components/RepButton.vue +++ b/src/components/RepButton.vue @@ -20,7 +20,7 @@ const elementTag = computed(() => (props.href ? "a" : "button")); diff --git a/src/components/RepInfo.vue b/src/components/RepInfo.vue index 29101d2..5ce2f1c 100644 --- a/src/components/RepInfo.vue +++ b/src/components/RepInfo.vue @@ -25,35 +25,52 @@ const repMandate = computed(() => { return parliamentMandate; }); -const repSocials = { - twitter: computed(() => - props.rep.acteur.adresses.adresse.find( - (adr) => adr["typeLibelle"] === "Twitter" - ) - ), - facebook: computed(() => - props.rep.acteur.adresses.adresse.find( - (adr) => adr["typeLibelle"] === "Facebook" - ) - ), - instagram: computed(() => - props.rep.acteur.adresses.adresse.find( - (adr) => adr["typeLibelle"] === "Instagram" - ) - ), - linkedin: computed(() => - props.rep.acteur.adresses.adresse.find( - (adr) => adr["typeLibelle"] === "Linkedin" - ) - ), -}; +const repTwitter = computed(() => + props.rep.acteur.adresses.adresse.find( + (adr) => adr["typeLibelle"] === "Twitter" + ) +); +const repFacebook = computed(() => { + const data = props.rep.acteur.adresses.adresse.find( + (adr) => adr["typeLibelle"] === "Facebook" + ); + if (data) { + data.valElec = String(data.valElec).replace(/^(.*[\\/])/, ""); + } + return data; +}); +const repInstagram = computed(() => { + const data = props.rep.acteur.adresses.adresse.find( + (adr) => adr["typeLibelle"] === "Instagram" + ); + return data; +}); +const repLinkedin = computed(() => { + const data = props.rep.acteur.adresses.adresse.find( + (adr) => adr["typeLibelle"] === "Linkedin" + ); + if (data) { + data.valElec = String(data.valElec).replace(/^(.*[\\/])/, ""); + } + return data; +}); + +const regionBgFile = computed( + () => + `regions/${String(repMandate.value?.election?.lieu.region) + .toLocaleLowerCase() + .replace(" ", "-")}.svg` +);