From 3c5511f06739528e425ec9b02a164474aea67119 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Thu, 6 Mar 2025 19:03:49 +0100 Subject: [PATCH] result - show if chosen correct/incorrect answer --- app.vue | 9 ++++++ components/RightBarResult.vue | 59 ++++++++++++++++++++++++++++++----- nuxt.config.ts | 3 ++ pages/result.vue | 14 +++++++++ 4 files changed, 78 insertions(+), 7 deletions(-) diff --git a/app.vue b/app.vue index 3898d01..69e777a 100644 --- a/app.vue +++ b/app.vue @@ -11,4 +11,13 @@ @apply absolute top-[50%] left-[50%]; transform: translate(-50%, -50%); } +/* .page-enter-active, +.page-leave-active { + transition: all 0.4s; +} +.page-enter-from, +.page-leave-to { + opacity: 0; + filter: blur(1rem); +} */ diff --git a/components/RightBarResult.vue b/components/RightBarResult.vue index 003765a..5e94afa 100644 --- a/components/RightBarResult.vue +++ b/components/RightBarResult.vue @@ -23,6 +23,16 @@ const boxesAmount = computed(() => { return 0; } }); + +const countSwitchable = computed(() => { + if (isBasic.value) { + return props.countBasic; + } else if (isAdvanced.value) { + return props.countAdvanced; + } else { + return 0; + } +}); diff --git a/nuxt.config.ts b/nuxt.config.ts index 3fbdd88..4989320 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -10,6 +10,9 @@ export default defineNuxtConfig({ imports: { dirs: ["types/*.ts", "store/*.ts", "types/**/*.ts"], }, + // app: { + // pageTransition: { name: "page", mode: "out-in" }, + // }, runtimeConfig: { public: { cdn_url: process.env.CDN_URL, diff --git a/pages/result.vue b/pages/result.vue index d652176..5d1dbc2 100644 --- a/pages/result.vue +++ b/pages/result.vue @@ -97,6 +97,18 @@ open(); function changeNow(to: string) { now.value = to; } + +function changeCount(num: number) { + if (now.value == "basic") { + countBasic.value = num; + } else if (now.value == "advanced") { + countAdvanced.value = num; + } +} + +function nav(route: string) { + return navigateTo(route); +}