diff --git a/.gitignore b/.gitignore index 649ba59..c2103c0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ coverage *.sw? # app -src/data.json +src/*.json public/answers public/homepage.webp public/logo.png diff --git a/scripts/fetchData.js b/scripts/fetchData.js index b4f3cef..85fa2a7 100644 --- a/scripts/fetchData.js +++ b/scripts/fetchData.js @@ -30,6 +30,32 @@ async function fetchAsset(uuid) { return fetch(url); } +async function fetchCertitudesData() { + const fields = ["*", "translations.*"]; + const url = `/items/certitudes?${fields + .map((item) => `fields[]=${item}`) + .join("&")}`; + let certitudes = (await fetchJSONApi(url)).data; + await fs.writeFile( + "./src/certitudes.json", + JSON.stringify(certitudes), + "utf8", + ); +} + +async function fetchCertitudesResultsData() { + const fields = ["*", "translations.*"]; + const url = `/items/certitudes_results?${fields + .map((item) => `fields[]=${item}`) + .join("&")}`; + let certitudes = (await fetchJSONApi(url)).data; + await fs.writeFile( + "./src/certitudesResults.json", + JSON.stringify(certitudes), + "utf8", + ); +} + async function fetchScoresData() { const fields = [ "*", @@ -312,6 +338,8 @@ async function fetchHomepageData() { async function fetchData() { await fetchHomepageData(); + await fetchCertitudesData(); + await fetchCertitudesResultsData(); await fetchScoresData(); } diff --git a/src/assets/base.css b/src/assets/base.css index 8486a9e..79e1581 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -123,3 +123,7 @@ header svg.color-text [stroke] { header svg.color-text [fill]:not([fill=none]) { fill: var(--color-header-text) } + +strong { + font-weight: bold; +} diff --git a/src/components/Certitude.vue b/src/components/Certitude.vue new file mode 100644 index 0000000..d4201a9 --- /dev/null +++ b/src/components/Certitude.vue @@ -0,0 +1,184 @@ + + + + + + {{ translation.title }} + + + + + + + {{ answer.title }} + + + + + + + + + + + + + + + + diff --git a/src/components/Question.vue b/src/components/Question.vue index 57c7d5b..81eb08a 100644 --- a/src/components/Question.vue +++ b/src/components/Question.vue @@ -298,9 +298,9 @@ legend height: calc(1rem - 6px) &:checked + label > div text-shadow: -0.06ex 0 0 currentColor, 0.06ex 0 0 currentColor - &:not(:checked) + label > div::before + &:checked + label > div::before background-color: var(--color-green) - &:not(:checked) + label > div::after + &:checked + label > div::after background-color: white .main diff --git a/src/components/Score.vue b/src/components/Score.vue index 4dd3595..97f6d5f 100644 --- a/src/components/Score.vue +++ b/src/components/Score.vue @@ -1,12 +1,15 @@ @@ -187,6 +219,15 @@ async function share() { @nextQuestion="nextQuestion" /> + + + + + @@ -216,6 +257,20 @@ async function share() { + + + Niveau de certitude : + {{ certitudeResult?.niveau }} + + + ✖️ + + + + + ➕ Ajout un niveau de certitude + + - + @@ -271,6 +326,17 @@ async function share() {