Исправили ошибки на которые указал тестировщик

This commit is contained in:
alisagerasimova
2026-03-16 14:59:27 +03:00
parent f7ae74dd9b
commit b43057e750
4 changed files with 92 additions and 60 deletions
+28 -24
View File
@@ -1,7 +1,7 @@
<script setup> <script setup>
import {ref, onMounted, h} from "vue"; import { ref, onMounted, h } from "vue";
import izitoast from "@/shared/izitoast"; import izitoast from "@/shared/izitoast";
import {useEventListener} from "@vueuse/core"; import { useEventListener } from "@vueuse/core";
import MyDialog from "@/components/MyDialog.vue"; import MyDialog from "@/components/MyDialog.vue";
import MyDropMenu from "@/components/MyDropMenu.vue"; import MyDropMenu from "@/components/MyDropMenu.vue";
import copyToclipboard from "@/shared/copyToclipboard"; import copyToclipboard from "@/shared/copyToclipboard";
@@ -112,7 +112,7 @@ function cancel() {
function cleanResult() { function cleanResult() {
clickCount.value = 1; clickCount.value = 1;
listOfTrips.value.forEach(item => { numbers.value.forEach(item => {
item.isPlatform = false; item.isPlatform = false;
item.isQR = false; item.isQR = false;
item.variable = []; item.variable = [];
@@ -142,7 +142,7 @@ function copyAndToast(text) {
function handleDownloadBtn() { function handleDownloadBtn() {
// Создание файла // Создание файла
const downloadUrl = ref(''); const downloadUrl = ref('');
const blob = new Blob([finallyText.value], {type: 'text/plain'}); const blob = new Blob([finallyText.value], { type: 'text/plain' });
downloadUrl.value = URL.createObjectURL(blob); downloadUrl.value = URL.createObjectURL(blob);
// Задержка для избежания ошибок в некоторых браузерах // Задержка для избежания ошибок в некоторых браузерах
setTimeout(() => { setTimeout(() => {
@@ -174,8 +174,10 @@ function createPlatform(item, color) {
} }
function deletePlatform(item) { function deletePlatform(item) {
item.BgImg = 'images/ArUco-marker.jpg' if (item.isPlatform) {
item.isPlatform = false item.BgImg = 'images/ArUco-marker.jpg'
item.isPlatform = false
}
} }
function createQR(item) { function createQR(item) {
@@ -190,8 +192,10 @@ function createQR(item) {
} }
function deleteQR(item) { function deleteQR(item) {
item.BgImg = 'images/ArUco-marker.jpg' if (item.isQR) {
item.isQR = true item.BgImg = 'images/ArUco-marker.jpg'
item.isQR = false
}
} }
function deletePointMap(item) { function deletePointMap(item) {
@@ -288,9 +292,8 @@ function onContextMenu(e, item) {
<template> <template>
<div class="wraper"> <div class="wraper">
<div class="grid"> <div class="grid">
<div class="square" v-for="(item, index) in numbers" :data-key="index" :key="index" <div class="square" v-for="(item, index) in numbers" :data-key="index" :key="index" @click="setNumber(item)"
@click="setNumber(item)" @contextmenu.prevent="onContextMenu($event, item)" @contextmenu.prevent="onContextMenu($event, item)" :style="{ backgroundImage: `url(${item.BgImg})` }">
:style="{backgroundImage: `url(${item.BgImg})`}">
{{ numbers[index].variable.join(", ") }} {{ numbers[index].variable.join(", ") }}
</div> </div>
</div> </div>
@@ -300,15 +303,11 @@ function onContextMenu(e, item) {
<custom-button class="actions__btn" @click="cleanResult">Очистить</custom-button> <custom-button class="actions__btn" @click="cleanResult">Очистить</custom-button>
<custom-button class="actions__btn" @click="cancel">Отменить</custom-button> <custom-button class="actions__btn" @click="cancel">Отменить</custom-button>
</div> </div>
<MyDropMenu/> <MyDropMenu />
</div> </div>
<MyDialog <MyDialog v-model:show="isModalVisible" class="dialogWindow" :is-success=Boolean(listOfTrips.length)>
v-model:show="isModalVisible"
class="dialogWindow"
:is-success=Boolean(listOfTrips.length)
>
<template #header> <template #header>
<strong v-if="listOfTrips.length">Код готов!</strong> <strong v-if="listOfTrips.length">Код готов!</strong>
<strong v-else>Код не готов!</strong> <strong v-else>Код не готов!</strong>
@@ -328,13 +327,17 @@ function onContextMenu(e, item) {
</template> </template>
<style> <style>
* {
font-family: 'Courier New', Courier, monospace;
}
html { html {
background-image: radial-gradient(#383838e2, #222222); background-image: radial-gradient(#23aae3e2, #222222);
font-size: 18px; font-size: 18px;
} }
:root { :root {
--side: 70px; --side: 75px;
} }
.wraper { .wraper {
@@ -346,7 +349,7 @@ html {
display: grid; display: grid;
padding: 3px; padding: 3px;
grid-template-columns: repeat(10, var(--side)); grid-template-columns: repeat(10, var(--side));
gap: 10px; gap: 5px;
user-select: none; user-select: none;
} }
@@ -364,9 +367,10 @@ html {
color: white; color: white;
text-shadow: -1px -1px 0 black, text-shadow: -1px -1px 0 black,
1px -1px 0 black, 1px -1px 0 black,
-1px 1px 0 black, -1px 1px 0 black,
1px 1px 0 black; 1px 1px 0 black;
box-sizing: border-box;
} }
.square:hover { .square:hover {
@@ -396,6 +400,6 @@ html {
.actions button { .actions button {
padding: 20px 35px; padding: 20px 35px;
/* background-color: red; */ /* background-color: red; */
} }
</style> </style>
+12 -7
View File
@@ -2,19 +2,19 @@
<transition name="modal-fade"> <transition name="modal-fade">
<div class="modal-backdrop" v-if="show" @click.stop="$emit('update:show', false)"> <div class="modal-backdrop" v-if="show" @click.stop="$emit('update:show', false)">
<div class="modal" @click.stop> <div class="modal" @click.stop>
<header :class="['modal-header', isSuccess ? 'modal-header-success': 'modal-header-error']"> <header :class="['modal-header', isSuccess ? 'modal-header-success' : 'modal-header-error']">
<slot name="header"> <slot name="header">
<strong>Заголовок по умолчанию</strong> <strong>Заголовок по умолчанию</strong>
</slot> </slot>
<button class="modal-btn-close" @click.stop="$emit('update:show', false)" <button class="modal-btn-close" @click.stop="$emit('update:show', false)"
aria-label="Закрыть модальное окно"> aria-label="Закрыть модальное окно">
× ×
</button> </button>
</header> </header>
<section class="modal-body"> <section class="modal-body">
<slot>Тело по умолчанию</slot> <slot>Тело по умолчанию</slot>
</section> </section>
<footer :class="['modal-footer', isSuccess ? 'modal-footer-success': 'modal-footer-error']"> <footer :class="['modal-footer', isSuccess ? 'modal-footer-success' : 'modal-footer-error']">
<slot name="footer"> <slot name="footer">
<button @click.stop="$emit('update:show', false)">Закрыть</button> <button @click.stop="$emit('update:show', false)">Закрыть</button>
</slot> </slot>
@@ -38,6 +38,10 @@ const props = defineProps({
</script> </script>
<style> <style>
:root {
--successColor: #4ee882
}
.modal-backdrop { .modal-backdrop {
position: fixed; position: fixed;
top: 0; top: 0;
@@ -74,7 +78,7 @@ const props = defineProps({
} }
.modal-header-success { .modal-header-success {
color: #4AAE9B; color: var(--successColor);
} }
.modal-header-error { .modal-header-error {
@@ -89,17 +93,18 @@ const props = defineProps({
.modal-footer { .modal-footer {
justify-content: flex-end; justify-content: flex-end;
border-top: 1px solid white; border-top: 1px solid white;
} }
.modal-footer button { .modal-footer button {
justify-content: flex-end; justify-content: flex-end;
border-top: 1px solid white; border-top: 1px solid white;
padding: 5px; padding: 5px;
color: white; color: rgb(0, 0, 0);
} }
.modal-footer-success button { .modal-footer-success button {
background-color: #4AAE9B; background-color: var(--successColor);
border: none; border: none;
margin: 3px; margin: 3px;
} }
@@ -124,4 +129,4 @@ const props = defineProps({
color: red; color: red;
background: transparent; background: transparent;
} }
</style> </style>
+43 -26
View File
@@ -1,12 +1,7 @@
<template> <template>
<div class="navigation-wrapper"> <div class="navigation-wrapper">
<!-- Кнопка Бургер --> <!-- Кнопка Бургер -->
<button <button class="burger-btn" @click="toggleMenu" :class="{ 'is-active': isOpen }" aria-label="Menu">
class="burger-btn"
@click="toggleMenu"
:class="{ 'is-active': isOpen }"
aria-label="Menu"
>
<span class="line"></span> <span class="line"></span>
<span class="line"></span> <span class="line"></span>
<span class="line"></span> <span class="line"></span>
@@ -29,10 +24,7 @@
</nav> </nav>
</aside> </aside>
</transition> </transition>
<MyDialog <MyDialog isSuccess v-model:show="isModalVisible">
isSuccess
v-model:show="isModalVisible"
>
<template #header> <template #header>
<strong>{{ infoCard.title }}</strong> <strong>{{ infoCard.title }}</strong>
</template> </template>
@@ -40,16 +32,18 @@
<p>{{ infoCard.body }}</p> <p>{{ infoCard.body }}</p>
</main> </main>
<template #footer> <template #footer>
<custom-button title="Посмотреть на stepike">Курс</custom-button> <div class="navigation-wrapper__footer">
<custom-button title="Посмотреть в официальной документации">Документация</custom-button> <custom-button :to="infoCard.hrefToCourse" title="Посмотреть на Stepik">Курс</custom-button>
<custom-button>ОК</custom-button> <custom-button :to="infoCard.hrefToDoc" title="Посмотреть в официальной документации">Документация</custom-button>
<custom-button @click="isModalVisible = false">ОК</custom-button>
</div>
</template> </template>
</MyDialog> </MyDialog>
</div> </div>
</template> </template>
<script setup> <script setup>
import {ref} from 'vue'; import { ref } from 'vue';
import MyDialog from "@/components/MyDialog.vue"; import MyDialog from "@/components/MyDialog.vue";
import CustomButton from '@/components/UI/CustomButton.vue' import CustomButton from '@/components/UI/CustomButton.vue'
@@ -73,9 +67,9 @@ function openInfoCard(obj) {
const links = [ const links = [
{ {
title: 'Что такое ROS?', title: 'Что такое ROS?',
body: 'ROS — переводится как robot operation system', body: 'ROS (Robot Operating System) — экосистема для программирования роботов с открытым исходным кодом',
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html', hrefToDoc: 'https://www.ros.org/',
hrefToCourse: 'https://stepic.org' hrefToCourse: 'https://stepik.org/lesson/2260739/step/1?unit=2294748'
}, },
{ {
title: '2', title: '2',
@@ -134,15 +128,17 @@ const links = [
] ]
// Экспортируем методы, если захотим управлять меню извне // Экспортируем методы, если захотим управлять меню извне
defineExpose({open: () => (isOpen.value = true), close: closeMenu}); defineExpose({ open: () => (isOpen.value = true), close: closeMenu });
</script> </script>
<style scoped> <style scoped>
.burger-btn { .burger-btn {
position: fixed; /* Она всегда на одном месте при скролле */ position: fixed;
/* Она всегда на одном месте при скролле */
top: 20px; top: 20px;
left: 20px; left: 20px;
z-index: 9999; /* Максимальный приоритет, чтобы быть ПОВЕРХ всего */ z-index: 9999;
/* Максимальный приоритет, чтобы быть ПОВЕРХ всего */
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
@@ -158,10 +154,17 @@ h1 {
text-align: center; text-align: center;
} }
.menu-content {
display: flex;
flex-direction: column;
gap: 10px;
}
.line { .line {
width: 100%; width: 100%;
height: 4px; height: 4px;
background-color: #383838; /* Ярко-красный цвет для теста */ background-color: #383838;
/* Ярко-красный цвет для теста */
transition: all 0.3s ease; transition: all 0.3s ease;
} }
@@ -185,7 +188,8 @@ h1 {
left: 0; left: 0;
width: 240px; width: 240px;
height: 100%; height: 100%;
background: white; background-image: radial-gradient(#23aae3e2, #222222);
color: white;
z-index: 1000; z-index: 1000;
padding: 0 20px 20px; padding: 0 20px 20px;
overflow-y: scroll; overflow-y: scroll;
@@ -199,22 +203,35 @@ h1 {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
z-index: 2; z-index: 2;
background-color: #333333;
opacity: 90%;
display: flex;
}
.navigation-wrapper__footer {
display: flex;
gap: 10px;
width: 100%;
} }
/* Анимации появления */ /* Анимации появления */
.slide-enter-active, .slide-leave-active { .slide-enter-active,
.slide-leave-active {
transition: transform 0.3s ease; transition: transform 0.3s ease;
} }
.slide-enter-from, .slide-leave-to { .slide-enter-from,
.slide-leave-to {
transform: translateX(-100%); transform: translateX(-100%);
} }
.fade-enter-active, .fade-leave-active { .fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
} }
.fade-enter-from, .fade-leave-to { .fade-enter-from,
.fade-leave-to {
opacity: 0; opacity: 0;
} }
</style> </style>
+9 -3
View File
@@ -13,11 +13,11 @@ const props = defineProps({
</script> </script>
<template> <template>
<a v-if="to" :href="props.to" class="btn"> <a v-if="to" :href="props.to" target="_blank" class="btn">
<slot/> <slot />
</a> </a>
<button v-else class="btn"> <button v-else class="btn">
<slot/> <slot />
</button> </button>
</template> </template>
@@ -31,5 +31,11 @@ const props = defineProps({
color: white; color: white;
width: 100%; width: 100%;
font-size: 17px; font-size: 17px;
text-decoration: none;
box-sizing: border-box;
text-align: center;
font-family: 'Courier New', Courier, monospace;
margin: 0;
} }
</style> </style>