From ccccf038d92961cb44599a01590358e3f4d626a2 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Tue, 16 Dec 2025 09:32:27 +0100 Subject: [PATCH] ui i18n english, fix locale routes, theme toggle minor: - change background for category list for dark theme compatibility - try to 'fix' video playback errors in console --- app.vue | 11 ++- components/EndModal.vue | 8 ++- components/MediaBox.vue | 34 ++++++---- components/question/Basic.vue | 4 +- i18n/locales/de.json | 6 ++ i18n/locales/en.json | 122 ++++++++++++++++++---------------- i18n/locales/pl.json | 6 ++ i18n/locales/ua.json | 6 ++ middleware/exam.ts | 6 +- middleware/result.ts | 3 +- pages/anomaly.vue | 2 +- pages/exam.vue | 6 +- pages/index.vue | 43 +++++++++++- pages/result.vue | 36 +++++----- store/themeStore.ts | 13 ++++ 15 files changed, 205 insertions(+), 101 deletions(-) create mode 100644 store/themeStore.ts diff --git a/app.vue b/app.vue index 4346316..856794d 100644 --- a/app.vue +++ b/app.vue @@ -1,5 +1,14 @@ + + diff --git a/components/EndModal.vue b/components/EndModal.vue index 7b75a00..ed814ec 100644 --- a/components/EndModal.vue +++ b/components/EndModal.vue @@ -21,8 +21,12 @@ watchEffect(() => {

{{ $t('examEnd') }}

{{ $t('doYouReallyWantToEndExam') }}
-
Tak
-
Nie
+
+ {{ $t('yes') }} +
+
+ {{ $t('no') }} +
diff --git a/components/MediaBox.vue b/components/MediaBox.vue index 452d52a..ba479b7 100644 --- a/components/MediaBox.vue +++ b/components/MediaBox.vue @@ -4,8 +4,6 @@ import { joinURL } from 'ufo'; const runtimeConfig = useRuntimeConfig(); const cdnUrl = runtimeConfig.public.cdn_url; -const route = useRoute(); - const emit = defineEmits(['mediaload']); const props = defineProps<{ @@ -25,18 +23,23 @@ const media = computed(() => { return { name: dotSplit?.join('.'), type }; }); -const video = ref(); +const video = useTemplateRef('video'); function onVideoLoad() { - if (route.path === '/exam') { - video.value.play(); - let duration = video.value.duration; - if (isNaN(duration) || duration == Infinity) { - duration = 0; - } - setTimeout(() => { - emit('mediaload'); - }, duration * 1000); + if (props.phase != 'result') { + const videoPlayInterval = setInterval(() => { + if (video.value) { + video.value.play(); + let duration = video.value.duration; + if (isNaN(duration) || duration == Infinity) { + duration = 0; + } + setTimeout(() => { + emit('mediaload'); + }, duration * 1000); + clearInterval(videoPlayInterval); + } + }, 1000); } } @@ -44,8 +47,11 @@ function onVideoLoad() {