feat: Modification du design du bouton de la certitude
This commit is contained in:
@ -6,11 +6,16 @@
|
|||||||
--color-black: #000000;
|
--color-black: #000000;
|
||||||
--color-green: rgb(118, 148, 67);
|
--color-green: rgb(118, 148, 67);
|
||||||
|
|
||||||
--header-size-small: 64px;
|
--header-size-small: 48px;
|
||||||
--header-size-big: 128px;
|
--header-size-big: 128px;
|
||||||
--header-size: var(--header-size-small);
|
--header-size: var(--header-size-small);
|
||||||
|
|
||||||
--footer-size: 64px;
|
--footer-size: 48px;
|
||||||
|
|
||||||
|
--color-red: #c82606;
|
||||||
|
--color-orange: #df6a0f;
|
||||||
|
--color-light-green: #70bf41;
|
||||||
|
--color-dark-green: #00882b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* semantic color variables for this project */
|
/* semantic color variables for this project */
|
||||||
@ -127,3 +132,8 @@ header svg.color-text [fill]:not([fill=none]) {
|
|||||||
strong {
|
strong {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-red { background: var(--color-red); }
|
||||||
|
.bg-orange { background: var(--color-orange); }
|
||||||
|
.bg-light-green { background: var(--color-light-green); }
|
||||||
|
.bg-dark-green { background: var(--color-dark-green); }
|
||||||
|
@ -171,15 +171,15 @@ const weightCertitudes = ref(new Array(certitudes.length).fill(0));
|
|||||||
const weightAllCertitudes = ref(0);
|
const weightAllCertitudes = ref(0);
|
||||||
const certitudeResult = ref(selectCertitudeResult());
|
const certitudeResult = ref(selectCertitudeResult());
|
||||||
function selectCertitudeResult() {
|
function selectCertitudeResult() {
|
||||||
return certitudesResults
|
const certitude = certitudesResults.find(
|
||||||
.find(
|
|
||||||
(result) =>
|
(result) =>
|
||||||
result.weight_min <= weightAllCertitudes.value &&
|
result.weight_min <= weightAllCertitudes.value &&
|
||||||
result.weight_max >= weightAllCertitudes.value,
|
result.weight_max >= weightAllCertitudes.value,
|
||||||
)
|
);
|
||||||
?.translations.find(
|
const certitudeTrad = certitude?.translations.find(
|
||||||
(translation) => translation.languages_code == language,
|
(translation) => translation.languages_code == language,
|
||||||
);
|
);
|
||||||
|
return { ...certitudeTrad, color: certitude.color };
|
||||||
}
|
}
|
||||||
function displayCertitudeQuestions() {
|
function displayCertitudeQuestions() {
|
||||||
displayCertitude.value = !displayCertitude.value;
|
displayCertitude.value = !displayCertitude.value;
|
||||||
@ -257,18 +257,13 @@ watch(weightAllCertitudes, () => {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="displayCertitude" class="certitude_result">
|
<div class="certitude_result">
|
||||||
<button @click="displayCertitudeQuestions">
|
Niveau de certitude
|
||||||
<span
|
<button
|
||||||
>Niveau de certitude : {{ certitudeResult?.niveau }}<br />
|
@click="displayCertitudeQuestions"
|
||||||
<span v-html="certitudeResult?.description"></span>
|
:class="'bg-' + certitudeResult.color"
|
||||||
</span>
|
>
|
||||||
<span class="cross">✖️</span>
|
<span>{{ certitudeResult?.niveau }} </span>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div v-else class="certitude_result">
|
|
||||||
<button @click="displayCertitudeQuestions">
|
|
||||||
➕ Ajout un niveau de certitude
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!--button class="btn download" @click="() => share()" v-if="!sharing">
|
<!--button class="btn download" @click="() => share()" v-if="!sharing">
|
||||||
@ -327,16 +322,26 @@ watch(weightAllCertitudes, () => {
|
|||||||
|
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
.certitude_result
|
.certitude_result
|
||||||
|
padding-top: 1rem
|
||||||
|
font-size: 1.1rem
|
||||||
text-align: center
|
text-align: center
|
||||||
|
color: var(--color-highlight-text)
|
||||||
|
& *
|
||||||
|
font-weight: 800
|
||||||
button
|
button
|
||||||
display: flex
|
display: flex
|
||||||
|
width: 100%
|
||||||
|
color: var(--color-highlight-text)
|
||||||
justify-content: center
|
justify-content: center
|
||||||
flex-direction: row
|
flex-direction: row
|
||||||
align-items: center
|
align-items: center
|
||||||
margin: 1rem auto 0
|
margin: .2rem auto 0
|
||||||
|
border-radius: 0
|
||||||
|
border: none
|
||||||
|
font-weight: 900 !important
|
||||||
|
font-size: 1.1rem
|
||||||
padding: .3rem
|
padding: .3rem
|
||||||
.cross
|
|
||||||
margin-left: .5rem
|
|
||||||
.spin
|
.spin
|
||||||
bottom: 1.5rem
|
bottom: 1.5rem
|
||||||
right: 1.5rem
|
right: 1.5rem
|
||||||
@ -418,7 +423,7 @@ label
|
|||||||
justify-content: center
|
justify-content: center
|
||||||
|
|
||||||
h2
|
h2
|
||||||
font-size: 2rem
|
font-size: 1.5rem
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
line-height: 2.4rem
|
line-height: 2.4rem
|
||||||
& + h2
|
& + h2
|
||||||
@ -449,10 +454,10 @@ label
|
|||||||
|
|
||||||
.gradient
|
.gradient
|
||||||
padding: 0 1rem
|
padding: 0 1rem
|
||||||
height: 3rem
|
height: 2.5rem
|
||||||
background-image: linear-gradient(to right, red, red, rgb(255, 255, 0), rgb(255, 255, 0), green, green)
|
background-image: linear-gradient(to right, red, red, rgb(255, 255, 0), rgb(255, 255, 0), green, green)
|
||||||
display: flex
|
display: flex
|
||||||
margin: 2.5rem auto
|
margin: 1.5rem auto
|
||||||
align-items: center
|
align-items: center
|
||||||
border-radius: 3px
|
border-radius: 3px
|
||||||
max-width: 30rem
|
max-width: 30rem
|
||||||
@ -482,8 +487,8 @@ label
|
|||||||
content: ""
|
content: ""
|
||||||
border: 1px solid var(--color-highlight-text)
|
border: 1px solid var(--color-highlight-text)
|
||||||
border-radius: 3px
|
border-radius: 3px
|
||||||
top: -2.8rem
|
top: -1rem
|
||||||
bottom: -1.5rem
|
bottom: -1rem
|
||||||
position: absolute
|
position: absolute
|
||||||
width: 100%
|
width: 100%
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
@ -492,7 +497,7 @@ label
|
|||||||
justify-content: center
|
justify-content: center
|
||||||
|
|
||||||
&::after
|
&::after
|
||||||
content: attr(data-title)
|
content: ""
|
||||||
position: absolute
|
position: absolute
|
||||||
font-size: 1rem
|
font-size: 1rem
|
||||||
top: -2rem
|
top: -2rem
|
||||||
|
Reference in New Issue
Block a user