Fixed some issues with the background image

This commit is contained in:
Alexis
2023-04-30 23:08:29 +02:00
parent 723f9770bb
commit e97eb670fa
3 changed files with 34 additions and 8 deletions

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 51.4 39.4" style="enable-background:new 0 0 51.4 39.4;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.1;fill:#FFF;}
</style>
<path class="st0" d="M26.9,38.3c0.3-0.2,0.4-0.4,0.4-0.7c0-0.6-0.1-1.2-0.1-1.8c0-0.5-0.2-0.8-0.6-0.9c-0.9-0.3-1.4-0.9-1.8-1.7
c-0.4-0.7-0.9-1-1.7-0.9c-0.2,0-0.5,0-0.7,0c-1,0-2-0.2-2.7-1c-0.3-0.4-0.7-0.5-1,0c-1,1.4-2.5,1.5-4,1.5c-0.4,0-0.5-0.1-0.5-0.4
c0-1.3-0.4-2.6-0.6-3.9c-0.1-0.6-0.3-0.9-0.9-0.9c-0.5,0-0.9-0.2-1.4-0.3c-0.9-0.2-1.4-0.8-1.5-1.7c-0.1-0.4-0.1-0.8-0.2-1.2
c0-0.8-0.2-1.5-1.3-1.4c-0.3,0-0.5-0.2-0.5-0.5c0-0.6-0.4-0.9-0.8-1.2c-0.4-0.3-0.9-0.5-1.2-1c-0.4-0.8-0.7-1.6,0.1-2.4
c0.3-0.3,0.3-0.7,0-1C5,16.1,5,15.3,5.4,14.4c0.3-0.7,0.3-1.2-0.4-1.7c-0.4-0.3-0.6-0.7-0.6-1.1c-0.1-0.6-0.3-1.1-0.8-1.4
C3,9.8,3.1,9.4,3.6,9C3.8,8.9,4,8.7,4,8.4C3.9,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6-0.1-0.9,0.1-1.1,0.7c-0.2,0.5-0.7,0.5-1.1,0.5c-1.1,0-2.2-0.1-3.3-0.1C26.8,38.4,26.8,38.4,26.9,38.3
C26.8,38.3,26.9,38.3,26.9,38.3z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -59,20 +59,17 @@ const regionBgFile = computed(
() => () =>
`regions/${String(repMandate.value?.election?.lieu.region) `regions/${String(repMandate.value?.election?.lieu.region)
.toLocaleLowerCase() .toLocaleLowerCase()
.replace(" ", "-")}.svg` .replace(/\s/g, "-")}.svg`
); );
</script> </script>
<template> <template>
<section class="py-8 md:py-0"> <section class="py-8 md:py-0 w-96 max-w-full">
<header <header class="relative">
:style="`background-image: url(/${regionBgFile}); background-position: center;`"
class="bg-contain bg-no-repeat"
>
<div class="text-center"> <div class="text-center">
<small class="text-base font-bold"> Votre député·e est... </small> <small class="text-base font-bold"> Votre député·e est... </small>
</div> </div>
<figure class="mt-4 mx-auto w-60 h-60 rounded-full overflow-hidden"> <figure class="mt-4 mx-auto w-44 h-44 rounded-full overflow-hidden">
<img <img
:src="repImage" :src="repImage"
:alt="repFullName" :alt="repFullName"
@@ -87,6 +84,11 @@ const regionBgFile = computed(
{{ repMandate?.election?.lieu.departement }} - {{ repMandate?.election?.lieu.departement }} -
{{ repMandate?.election?.lieu.numCirco }}e circonscription {{ repMandate?.election?.lieu.numCirco }}e circonscription
</h2> </h2>
<img
:src="regionBgFile"
class="absolute top-0 left-0 w-full h-full object-contain select-none -z-20 pointer-events-none"
/>
</header> </header>
<h3 class="mt-2 text-center font-medium text-lg"> <h3 class="mt-2 text-center font-medium text-lg">
@@ -107,7 +109,7 @@ const regionBgFile = computed(
</div> </div>
<menu <menu
class="mt-4 flex flex-col gap-y-4 md:flex-row md:gap-x-3 md:gap-y-0" class="mt-4 flex flex-col gap-y-4 md:justify-center md:flex-row md:gap-x-3 md:gap-y-0"
> >
<li v-if="repTwitter"> <li v-if="repTwitter">
<RepButton <RepButton