theme modale etape

This commit is contained in:
Valentin
2024-09-11 19:53:18 +02:00
parent c2d8eb99cf
commit ebb3ceb6d5
6 changed files with 270 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -8,13 +8,25 @@ export const useContentStore = defineStore('content', {
title: '',
adresse: {},
etape_number: '',
dates: {},
dates: {
start: {
d: '',
m: '',
y: '',
},
end: {
d: '',
m: '',
y: '',
},
},
geofield: {},
galeries: [],
parties: [],
saison: {},
thematiques: [],
vignette: {},
couleur: '',
},
page: {
title: '',
@@ -41,7 +53,20 @@ export const useContentStore = defineStore('content', {
this.etape.title = etape.attributes.title;
this.etape.adresse = etape.attributes.field_adresse;
this.etape.etape_number = etape.attributes.field_arret_numero;
this.etape.dates = etape.attributes.field_dates;
//this.etape.dates = etape.attributes.field_dates;
this.etape.dates = {
start: {
d: etape.attributes.field_dates.value.split('-')[2],
m: new Intl.DateTimeFormat('fr-FR', { month: 'long' }).format(new Date(etape.attributes.field_dates.value)),
y: etape.attributes.field_dates.value.split('-')[0],
},
end: {
d: etape.attributes.field_dates.end_value.split('-')[2],
m: new Intl.DateTimeFormat('fr-FR', { month: 'long' }).format(new Date(etape.attributes.field_dates.end_value)),
y: etape.attributes.field_dates.end_value.split('-')[0],
},
}
this.etape.geofield = etape.attributes.field_geofield;
this.etape.galeries = await this.fetchEtapeContent('field_galleries', etape.relationships);
const partiesFetch = await this.fetchEtapeContent('field_parties', etape.relationships);
@@ -55,6 +80,7 @@ export const useContentStore = defineStore('content', {
this.etape.thematiques = await this.fetchEtapeContent('field_thematiques', etape.relationships);
const vignetteFetch = await this.fetchEtapeContent('field_vignette', etape.relationships);
this.etape.vignette = { url: vignetteFetch.attributes.uri.url, alt: etape.attributes.field_vignette_alt };
this.etape.couleur = etape.attributes.field_couleur;
this.setActiveItemInMenu();
break;
}

View File

@@ -2,17 +2,31 @@
<Transition>
<div v-if="isEtapeValid">
<header>
<h1>{{etape.adresse.locality}}, {{ etape.adresse.postal_code }}</h1>
<h2>{{etape.title}}</h2>
<div>
<p>Étape n°{{etape.etape_number}}</p>
<p>Du {{etape.dates.value}} au {{ etape.dates.end_value }}</p>
<div class="cover">
<img :src="etape.vignette.url" :alt="etape.vignette.alt">
</div>
<div class="cartouche" :style="{ backgroundColor: etape.couleur }">
<p>Étape n°{{etape.etape_number}}</p>
<p>Du {{etape.dates.start.d}} {{etape.dates.start.m}} au {{ etape.dates.end.d }} {{ etape.dates.end.m }} {{ etape.dates.end.y }}</p>
</div>
<div class="brand-pattern" :style="{ backgroundColor: etape.couleur }">
<div class="pattern"></div>
</div>
<div class="locality">
<div class="top-triangle"></div>
<div class="locality-title">
<h1>{{etape.title}} <em>({{ etape.adresse.postal_code }})</em></h1>
</div>
</div>
<img :src="etape.vignette.url" :alt="etape.vignette.alt">
</header>
<main>
<div v-for="partie in etape.parties">
<h3 v-html="partie.title"></h3>
<div v-for="partie in etape.parties" class="partie">
<div class="partie-title">
<h3>
<div class="underline" :style="{ backgroundColor: etape.couleur }"></div>
<p v-html="partie.title"></p>
</h3>
</div>
<p v-html="partie.text"></p>
</div>
</main>
@@ -20,6 +34,7 @@
<!--
<div v-if="loading">Loading...</div>
<div v-if="error">{{ error }}</div>
{{etape.adresse.locality}}
-->
<div><pre>{{href}}</pre></div>

View File

@@ -7,6 +7,7 @@ $body-margin-bottom: 4vh;
$sm-font-size: 0.8rem;
$m-font-size: 1.4rem;
$l-font-size: 1.8rem;
$xl-font-size: 2.4rem;
$main-color: #1a1918;
$main-color-light: #635b58;
@@ -490,6 +491,16 @@ body{
}
}
}
> .user-login-form {
height: 90vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
> div {
margin: 20px 0;
}
}
}
}
> #content-modale > div {
@@ -502,11 +513,118 @@ body{
img {
width: 100%;
height: auto;
object-fit: cover;
}
> div {
width: 100%;
overflow: hidden;
}
> header {
margin-bottom: 3rem;
> .cover {
max-height: 60vh;
display: flex;
justify-content: center;
overflow: hidden;
position: relative;
z-index: 0;
}
> .cartouche {
position: absolute;
top: 2rem;
padding: 1rem 1.5rem;
background-color: $brand-color;
z-index: 1;
> p {
margin-block-start: 0;
margin-block-end: 0;
}
> p:last-of-type {
font-weight: bold;
}
}
> .brand-pattern {
display: block;
width: 100%;
height: 120px;
> .pattern {
display: block;
width: 100%;
height: 100%;
background-image: url(/themes/custom/caravane/assets/imgs/motif-caravane-invert-tile.png);
background-size: 300px;
background-size: repeat;
}
}
> .locality {
position: relative;
z-index: 1;
width: 50%;
margin-left: 25%;
margin-top: -245px;
> .top-triangle {
display: block;
width: 100%;
height: 100px;
display: flex;
clip-path: polygon(-1% 100%, 50% 0, 101% 100%);
background-color: white;
margin-bottom: -1px;
}
> .locality-title {
min-height: 115px;
display: block;
background-color: white;
padding: 1rem 2rem;
display: flex;
align-items: center;
> h1 {
width: 100%;
font-size: $xl-font-size;
margin-block-start: 0;
margin-block-end: 0;
font-family: 'Joost', sans-serif;
text-align: center;
> em {
font-style: normal;
font-weight: lighter;
}
}
}
}
}
> main {
width: 100%;
padding: 0 5vw;
box-sizing: border-box;
> .partie {
display: inline-block;
> .partie-title {
> h3 {
position: relative;
display: inline-block;
> p {
display: inline-block;
font-size: $l-font-size;
font-family: 'Joost', sans-serif;
margin: 0;
z-index: 1;
position: relative;
padding: 0 0.5rem;
}
> .underline {
z-index: 0;
left: 0;
top: 1.4rem;
position: absolute;
width: 100%;
display: inline-block;
height: 1rem;
}
}
}
}
}
}
}
}