Merge branch 'dev-denzel' into cja_new

This commit is contained in:
cja committed 2025-06-03 09:36:58 +03:00
commit 7b107c7d34
8 files changed
+161 -81

No files matched your search

@@ -6,7 +6,7 @@
max-width="800"
persistent
>
<v-card class="rounded-lg">
<v-card class="rounded-lg" color="cards">
<v-card-title class="text-h5 font-weight-medium px-4 py-3 bg-teal-darken-4 text-white d-flex align-center">
<span>Назначение теста</span>
<v-spacer></v-spacer>
@@ -116,7 +116,7 @@
</div>
</v-card-text>
<v-divider></v-divider>
<v-card-actions class="pa-4">
<v-card-actions class="pa-4" color="cards">
<v-spacer />
<v-btn
color="grey"
@@ -294,3 +294,25 @@ export default {
}
};
</script>
<style scoped>
:deep(.v-card) {
background-color: rgb(var(--v-theme-cards));
}
:deep(.v-card-text) {
color: rgb(var(--v-theme-text_carous));
}
:deep(.v-label) {
color: rgb(var(--v-theme-text_carous));
}
:deep(.v-field) {
background-color: rgb(var(--v-theme-cards));
}
:deep(.v-text-field) {
background-color: rgb(var(--v-theme-cards));
}
</style>
@@ -2,7 +2,7 @@
<v-container :class="{ 'pa-4': !isDialog, 'pa-0': isDialog }">
<v-row class="justify-center" :class="{ 'mt-6': !isDialog, 'ma-0': isDialog }">
<v-col :cols="isDialog ? 12 : '12'" :md="isDialog ? 12 : '8'" :lg="isDialog ? 12 : '6'" class="pa-0">
<v-card :elevation="isDialog ? 0 : 2" class="rounded-lg">
<v-card :elevation="isDialog ? 0 : 2" class="rounded-lg" color="cards">
<v-card-title v-if="!isDialog" class="text-h6 font-weight-bold">Информация</v-card-title>
<v-card-text :class="[
'd-flex flex-column ga-6',
@@ -14,7 +14,7 @@
<div class="d-flex align-center mb-3">
<v-icon icon="mdi-clock-outline" color="teal-darken-2" class="mr-2" />
<span class="text-body-1">
<strong>Время на прохождение:</strong> {{ data?.time }} {{ timeWordDeclension }}
<strong>Время на прохождение:</strong> {{ formatTime.value }} {{ formatTime.unit }}
</span>
</div>
@@ -42,8 +42,8 @@
</v-card-text>
<v-card-actions v-if="!isDialog" class="mx-2 my-4">
<v-btn
color="white"
class="ml-auto bg-teal-darken-1 px-9"
color="btn_text"
class="ml-auto px-9 text-white"
@click="startTest"
>
{{ isExamMode ? 'Начать' : 'Тренироваться' }}
@@ -72,6 +72,28 @@ export default {
const route = useRoute();
const isExamMode = computed(() => route.query.mode === 'exam');
const formatTime = computed(() => {
if (!props.data?.time) return { value: 0, unit: 'минут' };
const time = Number(props.data.time);
// Если число больше 60, значит это секунды (таймер запущен)
if (time > 60) {
const minutes = Math.floor(time / 60);
const seconds = time % 60;
return {
value: `${minutes} мин. ${seconds}`,
unit: 'сек.'
};
} else {
// Если меньше 60, значит это минуты (таймер не запущен)
return {
value: time,
unit: time === 1 ? 'минута' : time >= 2 && time <= 4 ? 'минуты' : 'минут'
};
}
});
const timeWordDeclension = computed(() => {
if (!props.data?.time) return 'минут';
@@ -92,7 +114,8 @@ export default {
return {
isExamMode,
timeWordDeclension,
formatDescription
formatDescription,
formatTime
};
}
};
@@ -102,6 +125,15 @@ export default {
.test-info {
padding: 16px;
border-radius: 8px;
background-color: rgba(0, 150, 136, 0.05);
background-color: rgba(var(--v-theme-btn_text), 0.05);
color: rgb(var(--v-theme-text_carous));
}
:deep(.v-card-text) {
color: rgb(var(--v-theme-text_carous));
}
:deep(.v-card-title) {
color: rgb(var(--v-theme-text_carous));
}
</style>
@@ -169,11 +169,12 @@ export default {
<style scoped>
.test-card {
border: 1px solid rgba(0, 0, 0, 0.05);
border: 1px solid rgba(var(--v-border-color), 0.12);
background-color: rgb(var(--v-theme-cards));
}
.passed-test {
border-left: 4px solid rgb(0, 150, 136);
border-left: 4px solid rgb(var(--v-theme-btn_text));
}
.search-field {
@@ -182,7 +183,7 @@ export default {
.test-info-item {
padding: 4px 12px;
background: rgba(0, 150, 136, 0.05);
background: rgba(var(--v-theme-btn_text), 0.05);
border-radius: 16px;
}
@@ -192,7 +193,8 @@ export default {
}
.status-badge.success {
background: rgba(0, 150, 136, 0.1);
background: rgba(var(--v-theme-btn_text), 0.1);
color: rgb(var(--v-theme-black_and_white));
}
.status-badge.error {
@@ -204,12 +206,13 @@ export default {
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.02);
background: rgba(var(--v-border-color), 0.05);
border-radius: 8px;
}
.test-description {
white-space: pre-wrap;
word-wrap: break-word;
color: rgb(var(--v-theme-text_carous));
}
</style>
@@ -282,7 +282,7 @@ export default {
<style>
.v-container {
background-color: #f5f5f5;
background-color: rgb(var(--v-theme-background));
border-radius: 8px;
}
@@ -296,11 +296,12 @@ export default {
.v-dialog .v-card {
border-radius: 8px;
background-color: rgb(var(--v-theme-cards));
}
.v-dialog .v-card-title {
background-color: #004d40;
color: white;
background-color: rgb(var(--v-theme-btn_text));
color: rgb(var(--v-theme-black_and_white));
padding: 16px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
@@ -308,31 +309,31 @@ export default {
.v-dialog .v-card-actions {
padding: 16px;
background-color: #f5f5f5;
background-color: rgb(var(--v-theme-background));
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
:deep(.v-label) {
margin-bottom: 8px;
color: #004d40;
color: rgb(var(--v-theme-btn_text));
}
:deep(.v-img) {
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.timer {
font-size: 1.2rem;
color: #004d40;
color: rgb(var(--v-theme-btn_text));
font-weight: bold;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-20px);
transform: translateY(20px);
}
to {
opacity: 1;
@@ -133,12 +133,13 @@ export default {
<style scoped>
.v-card {
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
background-color: rgb(var(--v-theme-cards));
}
.v-card-title {
background-color: #009688;
color: white;
background-color: rgb(var(--v-theme-btn_text));
color: rgb(var(--v-theme-black_and_white));
border-top-left-radius: 12px;
border-top-right-radius: 12px;
padding: 16px !important;
@@ -148,6 +149,7 @@ export default {
.v-checkbox {
margin-bottom: 12px;
transition: transform 0.2s;
color: rgb(var(--v-theme-text_carous));
}
.v-radio-group :deep(.v-radio:hover),
@@ -168,18 +170,19 @@ export default {
.v-card-actions {
padding: 16px;
background-color: #f5f5f5;
background-color: rgb(var(--v-theme-cards));
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
}
:deep(.v-label) {
margin-bottom: 8px;
color: rgb(var(--v-theme-text_carous));
}
:deep(.v-img) {
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
margin: 0 auto;
display: block;
}
@@ -318,6 +318,7 @@ export default {
.results-card {
max-width: 1200px;
margin: 0 auto;
background-color: rgb(var(--v-theme-cards));
}
.result-animation-container {
@@ -336,6 +337,7 @@ export default {
height: 100%;
transition: transform 0.3s ease;
border-radius: 12px;
background-color: rgb(var(--v-theme-cards));
}
.result-card:hover {
@@ -347,11 +349,11 @@ export default {
}
.success-light {
background-color: #E8F5E9 !important;
background-color: rgba(var(--v-theme-btn_text), 0.1) !important;
}
.error-light {
background-color: #FFEBEE !important;
background-color: rgba(244, 67, 54, 0.1) !important;
}
.bounce {
@@ -392,7 +394,7 @@ export default {
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
transform: translateY(20px);
}
to {
opacity: 1;
@@ -402,7 +404,7 @@ export default {
@media (max-width: 600px) {
.results-card {
padding: 16px !important;
margin: 0;
}
.result-card {
+32 -30
View File
@@ -1,4 +1,3 @@
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'
import { VCalendar } from 'vuetify/labs/VCalendar'
@@ -17,9 +16,7 @@ export default createVuetify({
VTimePicker,
},
theme: {
defaultTheme: 'light'
},
theme: {
defaultTheme: 'light',
themes: {
light: {
colors: {
@@ -51,35 +48,40 @@ export default createVuetify({
},
dark: {
colors: {
lampa: '#000000',
primary: '#1867C0',
secondary: '#5CBBF6',
main_theme: "#101311",
scrollbar: '#367F8A',
cards: '#F5F5F5',
text_grey: '#7A7A7A', //Цвет серого текста
text_carous: '#242424',
navigation: '#FDF5E6',
black_grey: '#3C3C3C',
modal_btn: '#1E88E5',
grey: '#7A7A7A',
yellow: '#F9A825',
more_details_btn: '#01579B',
loading_avatar: '#37474F',
bg_white: '#FFFFFF',
delete_btn: '#546E7A',
app_bar: '#212121',
black_and_white: '#101311',
grey_white: '#212121',
insert_table: '#323030',
btn_text: '#00897B',
select_list: '#E0EAE8',
btn_gray: '#E0E0E0'
lampa: '#121212',
primary: '#1E88E5',
secondary: '#64B5F6',
main_theme: "#121212",
scrollbar: '#4DB6AC',
cards: '#1E1E1E',
text_grey: '#B0BEC5',
text_carous: '#FFFFFF',
navigation: '#E0F2F1',
black_grey: '#B0BEC5',
modal_btn: '#2196F3',
grey: '#B0BEC5',
yellow: '#FFB300',
more_details_btn: '#29B6F6',
loading_avatar: '#90A4AE',
bg_white: '#1E1E1E',
delete_btn: '#78909C',
app_bar: '#1E1E1E',
black_and_white: '#FFFFFF',
grey_white: '#1E1E1E',
insert_table: '#1E1E1E',
btn_text: '#4DB6AC',
select_list: '#1E1E1E',
btn_gray: '#2C2C2C',
surface: '#1E1E1E',
background: '#121212',
'on-background': '#FFFFFF',
'on-surface': '#FFFFFF',
'card-background': '#1E1E1E'
},
},
},
options: {
customProperties: true
},
},
},
},
})
+36 -21
View File
@@ -17,23 +17,26 @@
<CatalogTest :activeTab="activeTab" :testingCard="getAllTests" title="Назначенные">
<template #buttons="{ cardValue }">
<v-btn
class="mr-2"
color="teal-lighten-5"
class="mr-2 custom-btn"
:color="$vuetify.theme.dark ? 'teal' : 'teal-lighten-5'"
variant="flat"
:size="$vuetify.display.smAndDown ? 'small' : 'default'"
elevation="0"
@click="goToTest(cardValue.id)"
>
<v-icon start icon="mdi-pencil" class="text-teal-darken-1" />
<span class="text-teal-darken-1">Тренироваться</span>
<v-icon start icon="mdi-pencil" :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : 'text-teal-darken-1'" />
<span :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : 'text-teal-darken-1'">Тренироваться</span>
</v-btn>
<v-btn
color="teal-darken-1"
class="custom-btn"
:color="$vuetify.theme.dark ? 'teal' : 'teal-darken-1'"
variant="flat"
:size="$vuetify.display.smAndDown ? 'small' : 'default'"
elevation="0"
@click="startTest(cardValue.id)"
>
<v-icon start icon="mdi-play" />
<span>Пройти тест</span>
<v-icon start icon="mdi-play" :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : undefined" />
<span :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : undefined">Пройти тест</span>
</v-btn>
</template>
</CatalogTest>
@@ -44,14 +47,15 @@
<CatalogTest :activeTab="activeTab" :testingCard="getAllTests" title="Завершенные">
<template #buttons="{ cardValue }">
<v-btn
class="mr-2"
color="teal-darken-1"
class="mr-2 custom-btn"
:color="$vuetify.theme.dark ? 'teal' : 'teal-lighten-5'"
variant="flat"
:size="$vuetify.display.smAndDown ? 'small' : 'default'"
elevation="0"
@click="showResults(cardValue.id)"
>
<v-icon start icon="mdi-chart-bar" />
<span>Результаты</span>
<v-icon start icon="mdi-chart-bar" :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : 'text-teal-darken-1'" />
<span :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : 'text-teal-darken-1'">Результаты</span>
</v-btn>
</template>
</CatalogTest>
@@ -63,13 +67,14 @@
<template #buttons="{ cardValue }">
<div v-if="accountStore.user.is_staff" class="d-flex" :class="{'position-relative': $vuetify.display.smAndDown, 'position-absolute top-0 right-0': $vuetify.display.mdAndUp}">
<v-btn
class="mr-2"
color="amber-lighten-5"
class="mr-2 custom-btn"
:color="$vuetify.theme.dark ? 'amber' : 'amber-lighten-5'"
variant="flat"
:size="$vuetify.display.smAndDown ? 'small' : 'default'"
elevation="0"
@click="openAddDialog(cardValue.id)"
>
<v-icon icon="mdi-account-plus" class="text-amber-darken-2" />
<v-icon icon="mdi-account-plus" :class="$vuetify.theme.dark ? 'text-amber-lighten-1' : 'text-amber-darken-2'" />
<v-tooltip
activator="parent"
location="top"
@@ -77,13 +82,14 @@
</v-btn>
<v-btn
v-if="cardValue.author === accountStore.user.id"
class="mr-2"
color="red-lighten-5"
class="mr-2 custom-btn"
:color="$vuetify.theme.dark ? 'red' : 'red-lighten-5'"
variant="flat"
:size="$vuetify.display.smAndDown ? 'small' : 'default'"
elevation="0"
@click="openDeleteDialog(cardValue.id)"
>
<v-icon icon="mdi-delete" class="text-red-darken-2" />
<v-icon icon="mdi-delete" :class="$vuetify.theme.dark ? 'text-red-lighten-1' : 'text-red-darken-2'" />
<v-tooltip
activator="parent"
location="top"
@@ -92,14 +98,15 @@
</div>
<v-btn
class="mr-2"
color="teal-lighten-5"
class="mr-2 custom-btn"
:color="$vuetify.theme.dark ? 'teal' : 'teal-lighten-5'"
variant="flat"
:size="$vuetify.display.smAndDown ? 'small' : 'default'"
elevation="0"
@click="goToTest(cardValue.id)"
>
<v-icon start icon="mdi-pencil" class="text-teal-darken-1" />
<span class="text-teal-darken-1">Тренироваться</span>
<v-icon start icon="mdi-pencil" :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : 'text-teal-darken-1'" />
<span :class="$vuetify.theme.dark ? 'text-teal-lighten-1' : 'text-teal-darken-1'">Тренироваться</span>
</v-btn>
</template>
</CatalogTest>
@@ -485,4 +492,12 @@ export default {
height: 100%;
overflow-y: auto;
}
:deep(.v-theme--dark .v-btn.custom-btn) {
background-color: rgba(var(--v-theme-surface-variant), 0.1) !important;
}
:deep(.v-theme--dark .v-btn.custom-btn:hover) {
background-color: rgba(var(--v-theme-surface-variant), 0.2) !important;
}
</style>