Develop #17
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
@@ -1,11 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {ref, onMounted} from "vue";
|
import {ref, onMounted, h} from "vue";
|
||||||
import izitoast from "./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 "./copyToclipboard";
|
import copyToclipboard from "@/shared/copyToclipboard";
|
||||||
import ContextMenu from '@imengyu/vue3-context-menu'
|
import ContextMenu from "@imengyu/vue3-context-menu";
|
||||||
|
import CustomButton from '@/components/UI/CustomButton.vue'
|
||||||
|
|
||||||
const numbers = ref([]); // Инициализируем массив с пустыми строками
|
const numbers = ref([]); // Инициализируем массив с пустыми строками
|
||||||
const clickCount = ref(1); // Счетчик нажатий
|
const clickCount = ref(1); // Счетчик нажатий
|
||||||
@@ -36,7 +37,7 @@ function setNumber(item) {
|
|||||||
clickCount.value++;
|
clickCount.value++;
|
||||||
} else {
|
} else {
|
||||||
//если нажимаем на ранее отмеченную клетку, то выводится ошибка
|
//если нажимаем на ранее отмеченную клетку, то выводится ошибка
|
||||||
if (numbers.value[item.index].variable.at(-1) === clickCount.value - 1) {
|
if (item.variable.at(-1) === clickCount.value - 1) {
|
||||||
izitoast.error({
|
izitoast.error({
|
||||||
title: "Ошибка",
|
title: "Ошибка",
|
||||||
message: "Нельзя выбирать один и тот же aruco маркер 2 раза подряд",
|
message: "Нельзя выбирать один и тот же aruco маркер 2 раза подряд",
|
||||||
@@ -44,7 +45,7 @@ function setNumber(item) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
listOfTrips.value.push(item);
|
listOfTrips.value.push(item);
|
||||||
numbers.value[item.index].variable.push(clickCount.value);
|
item.variable.push(clickCount.value);
|
||||||
clickCount.value++;
|
clickCount.value++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,31 +90,35 @@ async function saveResult() {
|
|||||||
finallyText.value = textOfCode.replace("<<main>>", mainCode.value);
|
finallyText.value = textOfCode.replace("<<main>>", mainCode.value);
|
||||||
if (isUsedPlatform) {
|
if (isUsedPlatform) {
|
||||||
finallyText.value = finallyText.value.replace("<<ColorDetect>>", colorDetectClass.value);
|
finallyText.value = finallyText.value.replace("<<ColorDetect>>", colorDetectClass.value);
|
||||||
|
} else {
|
||||||
|
finallyText.value = finallyText.value.replace("<<ColorDetect>>", '');
|
||||||
}
|
}
|
||||||
if (isUsedQR) {
|
if (isUsedQR) {
|
||||||
finallyText.value = finallyText.value.replace("<<qr_function>>", QRDetectClass.value);
|
finallyText.value = finallyText.value.replace("<<qr_function>>", QRDetectClass.value);
|
||||||
|
} else {
|
||||||
|
finallyText.value = finallyText.value.replace("<<qr_function>>", '');
|
||||||
}
|
}
|
||||||
isModalVisible.value = true;}
|
isModalVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
function cancel() {
|
function cancel() {
|
||||||
|
|
||||||
if (clickCount.value === 1) {
|
if (clickCount.value === 1) {
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
numbers.value[listOfTrips.value.at(-1).index].variable.pop();
|
|
||||||
listOfTrips.value.pop();
|
|
||||||
clickCount.value--;
|
|
||||||
}
|
}
|
||||||
|
listOfTrips.value.at(-1).variable.pop();
|
||||||
|
listOfTrips.value.pop();
|
||||||
|
clickCount.value--;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanResult() {
|
function cleanResult() {
|
||||||
clickCount.value = 1;
|
clickCount.value = 1;
|
||||||
|
listOfTrips.value.forEach(item => {
|
||||||
|
item.isPlatform = false;
|
||||||
|
item.isQR = false;
|
||||||
|
item.variable = [];
|
||||||
|
item.BgImg = 'images/ArUco-marker.jpg'
|
||||||
|
})
|
||||||
listOfTrips.value = [];
|
listOfTrips.value = [];
|
||||||
for (let i = 0; i < 100; i++) {
|
|
||||||
numbers.value[i].variable = [];
|
|
||||||
numbers.value[i].BgImg = 'images/ArUco-marker.jpg'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обрабатываем нажатие Ctrl + Z
|
// Обрабатываем нажатие Ctrl + Z
|
||||||
@@ -158,43 +163,67 @@ function handleDownloadBtn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createPlatform(item, color) {
|
function createPlatform(item, color) {
|
||||||
if (!item.isPlatform) {
|
if (!item.variable.length) {
|
||||||
|
item.variable.push(clickCount.value);
|
||||||
listOfTrips.value.push(item)
|
listOfTrips.value.push(item)
|
||||||
numbers.value[item.index].variable.push(clickCount.value);
|
clickCount.value++
|
||||||
}
|
}
|
||||||
item['isPlatform'] = true
|
item.isPlatform = true;
|
||||||
numbers.value[item.index].BgImg = `images/${color}-platform.jpg`
|
item.isQR = false;
|
||||||
clickCount.value++
|
item.BgImg = `images/${color}-platform.jpg`
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletePlatform(item) {
|
function deletePlatform(item) {
|
||||||
item['isPlatform'] = false
|
item.BgImg = 'images/ArUco-marker.jpg'
|
||||||
const index = listOfTrips.value.indexOf(item);
|
item.isPlatform = false
|
||||||
if (index !== -1) {
|
|
||||||
listOfTrips.value.splice(index, 1);
|
|
||||||
}
|
|
||||||
numbers.value[item.index].BgImg = 'images/ArUco-marker.jpg'
|
|
||||||
clickCount.value--
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createQR(item) {
|
function createQR(item) {
|
||||||
if (!item.isQR) {
|
if (!item.variable.length) {
|
||||||
|
item.variable.push(clickCount.value);
|
||||||
listOfTrips.value.push(item)
|
listOfTrips.value.push(item)
|
||||||
numbers.value[item.index].variable.push(clickCount.value);
|
clickCount.value++
|
||||||
}
|
}
|
||||||
item['isQR'] = true
|
item.isPlatform = false;
|
||||||
numbers.value[item.index].BgImg = `images/qr.jpg`
|
item.isQR = true;
|
||||||
clickCount.value++
|
item.BgImg = `images/qr.jpg`
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteQR(item) {
|
function deleteQR(item) {
|
||||||
item['isQR'] = false
|
item.BgImg = 'images/ArUco-marker.jpg'
|
||||||
|
item.isQR = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function deletePointMap(item) {
|
||||||
const index = listOfTrips.value.indexOf(item);
|
const index = listOfTrips.value.indexOf(item);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
|
const deletedIndex = item.variable.at(-1)
|
||||||
|
listOfTrips.value.forEach(square => {
|
||||||
|
square.variable.map(itemVariable => {
|
||||||
|
if (itemVariable === deletedIndex) {
|
||||||
|
square.variable = []
|
||||||
|
}
|
||||||
|
if (itemVariable > deletedIndex) {
|
||||||
|
square.variable[square.variable.indexOf(itemVariable)]--
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
listOfTrips.value.splice(index, 1);
|
listOfTrips.value.splice(index, 1);
|
||||||
|
clickCount.value--
|
||||||
|
item.isQR = false
|
||||||
|
item.isPlatform = false
|
||||||
|
item.BgImg = 'images/ArUco-marker.jpg'
|
||||||
}
|
}
|
||||||
numbers.value[item.index].BgImg = 'images/ArUco-marker.jpg'
|
}
|
||||||
clickCount.value--
|
|
||||||
|
function createIcon(src) {
|
||||||
|
return h('img', {
|
||||||
|
src: src,
|
||||||
|
style: {
|
||||||
|
width: '20px',
|
||||||
|
height: '20px',
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function onContextMenu(e, item) {
|
function onContextMenu(e, item) {
|
||||||
@@ -204,44 +233,52 @@ function onContextMenu(e, item) {
|
|||||||
y: e.y,
|
y: e.y,
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: "Платформы",
|
label: "Платформа",
|
||||||
|
icon: createIcon('icons/base_square.webp'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
label: "Белая",
|
label: "Белая",
|
||||||
onClick: () => createPlatform(item, 'white'),
|
onClick: () => createPlatform(item, 'white'),
|
||||||
|
icon: createIcon('icons/white_square.webp'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Синяя",
|
label: "Синяя",
|
||||||
onClick: () => createPlatform(item, 'blue'),
|
onClick: () => createPlatform(item, 'blue'),
|
||||||
|
icon: createIcon('icons/blue_square.webp'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Красная",
|
label: "Красная",
|
||||||
onClick: () => createPlatform(item, 'red'),
|
onClick: () => createPlatform(item, 'red'),
|
||||||
|
icon: createIcon('icons/red_square.webp'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Удалить",
|
label: "Удалить",
|
||||||
onClick: () => deletePlatform(item),
|
onClick: () => deletePlatform(item),
|
||||||
|
icon: createIcon('icons/trash.webp'),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "QR код",
|
label: "QR код",
|
||||||
|
icon: createIcon('icons/qr_code.png'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
label: "Добавить",
|
label: "Добавить",
|
||||||
onClick: () => createQR(item)
|
onClick: () => createQR(item),
|
||||||
|
icon: createIcon('icons/plus.webp')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Удалить",
|
label: "Удалить",
|
||||||
onClick: () => deleteQR(item)
|
onClick: () => deleteQR(item),
|
||||||
|
icon: createIcon('icons/trash.webp')
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Отмена",
|
label: "Удалить",
|
||||||
onClick: () => {
|
icon: createIcon('icons/trash.webp'),
|
||||||
alert('Здесь ещё предстоит написать код')
|
onClick: () => deletePointMap(item),
|
||||||
}
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@@ -259,24 +296,27 @@ function onContextMenu(e, item) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button @click="saveResult">Сохранить</button>
|
<custom-button class="actions__btn">Сохранить</custom-button>
|
||||||
<button @click="cleanResult">Очистить</button>
|
<custom-button class="actions__btn" @click="cleanResult">Очистить</custom-button>
|
||||||
<button @click="cancel">Отменить</button>
|
<custom-button class="actions__btn" @click="cancel">Отменить</custom-button>
|
||||||
</div>
|
</div>
|
||||||
<MyDropMenu/>
|
<MyDropMenu/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<MyDialog v-show="isModalVisible" @close="isModalVisible = false" class="dialogWindow"
|
<MyDialog
|
||||||
: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>
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<main>
|
||||||
<p v-if="listOfTrips.length">Скопируйте или скачайте ваш код</p>
|
<p v-if="listOfTrips.length">Скопируйте или скачайте ваш код</p>
|
||||||
<p v-else>Выстройте маршрут перед сохранением кода.</p>
|
<p v-else>Выстройте маршрут перед сохранением кода.</p>
|
||||||
</template>
|
</main>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div v-if="listOfTrips.length">
|
<div v-if="listOfTrips.length">
|
||||||
<button @click="handleDownloadBtn">Скачать код</button>
|
<button @click="handleDownloadBtn">Скачать код</button>
|
||||||
@@ -290,6 +330,7 @@ function onContextMenu(e, item) {
|
|||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
background-image: radial-gradient(#383838e2, #222222);
|
background-image: radial-gradient(#383838e2, #222222);
|
||||||
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
@@ -345,19 +386,16 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
margin-left: 10px;
|
margin: 3px 0 0 10px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.actions button {
|
.actions button {
|
||||||
border: 2px solid rgb(251, 251, 251);
|
padding: 20px 35px;
|
||||||
padding: 15px 30px;
|
//background-color: red;
|
||||||
font-size: 15px;
|
|
||||||
background-color: #383838;
|
|
||||||
color: white;
|
|
||||||
cursor: pointer;
|
|
||||||
margin: 5px;
|
|
||||||
transition: 0.3s;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,119 +1,127 @@
|
|||||||
<template>
|
<template>
|
||||||
<transition name="modal-fade">
|
<transition name="modal-fade">
|
||||||
<div class="modal-backdrop" @click="closeModal">
|
<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="closeModal" aria-label="Закрыть модальное окно">
|
<button class="modal-btn-close" @click.stop="$emit('update:show', false)"
|
||||||
×
|
aria-label="Закрыть модальное окно">
|
||||||
</button>
|
×
|
||||||
</header>
|
</button>
|
||||||
<section class="modal-body">
|
</header>
|
||||||
<slot name="body">Тело по умолчанию</slot>
|
<section class="modal-body">
|
||||||
</section>
|
<slot>Тело по умолчанию</slot>
|
||||||
<footer :class="['modal-footer', isSuccess ? 'modal-footer-success': 'modal-footer-error']">
|
</section>
|
||||||
<slot name="footer">
|
<footer :class="['modal-footer', isSuccess ? 'modal-footer-success': 'modal-footer-error']">
|
||||||
<button @click="closeModal">Закрыть</button>
|
<slot name="footer">
|
||||||
</slot>
|
<button @click.stop="$emit('update:show', false)">Закрыть</button>
|
||||||
</footer>
|
</slot>
|
||||||
</div>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</div>
|
||||||
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit = defineEmits(['close'])
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isSuccess: {
|
isSuccess: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
}
|
},
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
function closeModal() {
|
|
||||||
emit('close');
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.modal-backdrop {
|
.modal-backdrop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
z-index: 501;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
background: #2f2f2f;
|
background: #2f2f2f;
|
||||||
box-shadow: 2px 2px 20px 1px;
|
box-shadow: 2px 2px 20px 1px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-header,
|
.modal-header,
|
||||||
.modal-footer {
|
.modal-footer {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-header {
|
.modal-header {
|
||||||
border-bottom: 1px solid #eeeeee;
|
border-bottom: 1px solid #eeeeee;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
|
||||||
.modal-header-success {
|
|
||||||
color: #4AAE9B;
|
|
||||||
}
|
|
||||||
.modal-header-error {
|
|
||||||
color: red;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-header [type = 'button'] {
|
.modal-header-success {
|
||||||
color: red;
|
color: #4AAE9B;
|
||||||
font-size: 25px;
|
}
|
||||||
|
|
||||||
|
.modal-header-error {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header button {
|
||||||
|
color: red;
|
||||||
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-footer {
|
.modal-footer {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
border-top: 1px solid white;
|
border-top: 1px solid white;
|
||||||
}
|
}
|
||||||
.modal-footer [type = 'button'] {
|
|
||||||
justify-content: flex-end;
|
.modal-footer button {
|
||||||
border-top: 1px solid white;
|
justify-content: flex-end;
|
||||||
padding: 5px;
|
border-top: 1px solid white;
|
||||||
|
padding: 5px;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
.modal-footer-success [type = 'button'] {
|
|
||||||
background-color: #4AAE9B;
|
.modal-footer-success button {
|
||||||
border: none;
|
background-color: #4AAE9B;
|
||||||
margin: 3px;
|
border: none;
|
||||||
|
margin: 3px;
|
||||||
}
|
}
|
||||||
.modal-footer-error [type = 'button'] {
|
|
||||||
background: red;
|
.modal-footer-error button {
|
||||||
border: none;
|
background: red;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-body {
|
.modal-body {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
color: white
|
color: white
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-btn-close {
|
.modal-btn-close {
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: red;
|
color: red;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,120 +1,220 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navigation-wrapper">
|
<div class="navigation-wrapper">
|
||||||
<!-- Кнопка Бургер -->
|
<!-- Кнопка Бургер -->
|
||||||
<button
|
<button
|
||||||
class="burger-btn"
|
class="burger-btn"
|
||||||
@click="toggleMenu"
|
@click="toggleMenu"
|
||||||
:class="{ 'is-active': isOpen }"
|
:class="{ 'is-active': isOpen }"
|
||||||
aria-label="Menu"
|
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>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- Затемнение заднего фона (Overlay) -->
|
<!-- Затемнение заднего фона (Overlay) -->
|
||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
<div v-if="isOpen" class="overlay" @click="closeMenu"></div>
|
<div v-if="isOpen" class="overlay" @click="closeMenu"></div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<!-- Выпадающая панель -->
|
<!-- Выпадающая панель -->
|
||||||
<transition name="slide">
|
<transition name="slide">
|
||||||
<aside v-if="isOpen" class="side-panel">
|
<aside v-if="isOpen" class="side-panel">
|
||||||
<div class="menu-header">
|
<div class="menu-header">
|
||||||
<h1>SkyVue</h1>
|
<h1>SkyVue</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="menu-content">
|
<nav class="menu-content">
|
||||||
<a href="https://clover.coex.tech/ru/simple_offboard.html" target="_blank">COEX Автономный полет</a>
|
<custom-button @click="openInfoCard(link)" v-for="link in links">{{ link.title }}</custom-button>
|
||||||
<slot>
|
</nav>
|
||||||
<p class="placeholder">Здесь будут ваши ссылки...</p>
|
</aside>
|
||||||
</slot>
|
</transition>
|
||||||
</nav>
|
<MyDialog
|
||||||
</aside>
|
isSuccess
|
||||||
</transition>
|
v-model:show="isModalVisible"
|
||||||
</div>
|
>
|
||||||
|
<template #header>
|
||||||
|
<strong>{{ infoCard.title }}</strong>
|
||||||
|
</template>
|
||||||
|
<main>
|
||||||
|
<p>{{ infoCard.body }}</p>
|
||||||
|
</main>
|
||||||
|
<template #footer>
|
||||||
|
<custom-button title="Посмотреть на stepike">Курс</custom-button>
|
||||||
|
<custom-button title="Посмотреть в официальной документации">Документация</custom-button>
|
||||||
|
<custom-button>ОК</custom-button>
|
||||||
|
</template>
|
||||||
|
</MyDialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import {ref} from 'vue';
|
||||||
|
import MyDialog from "@/components/MyDialog.vue";
|
||||||
|
import CustomButton from '@/components/UI/CustomButton.vue'
|
||||||
|
|
||||||
const isOpen = ref(false);
|
const isOpen = ref(false);
|
||||||
|
const isModalVisible = ref(false);
|
||||||
|
const infoCard = ref({})
|
||||||
|
|
||||||
const toggleMenu = () => {
|
const toggleMenu = () => {
|
||||||
isOpen.value = !isOpen.value;
|
isOpen.value = !isOpen.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeMenu = () => {
|
const closeMenu = () => {
|
||||||
isOpen.value = false;
|
isOpen.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function openInfoCard(obj) {
|
||||||
|
isModalVisible.value = true
|
||||||
|
infoCard.value = obj
|
||||||
|
}
|
||||||
|
|
||||||
|
const links = [
|
||||||
|
{
|
||||||
|
title: 'Что такое ROS?',
|
||||||
|
body: 'ROS — переводится как robot operation system',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '2',
|
||||||
|
body: 'Информация для учащихся 2',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '3',
|
||||||
|
body: 'Информация для учащихся 3',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '4',
|
||||||
|
body: 'Информация для учащихся 4',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '5',
|
||||||
|
body: 'Информация для учащихся 5',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '6',
|
||||||
|
body: 'Информация для учащихся 6',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '7',
|
||||||
|
body: 'Информация для учащихся 7',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '8',
|
||||||
|
body: 'Информация для учащихся 8',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '9',
|
||||||
|
body: 'Информация для учащихся 9',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '0',
|
||||||
|
body: 'Информация для учащихся 0',
|
||||||
|
hrefToDoc: 'https://clover.coex.tech/ru/simple_offboard.html',
|
||||||
|
hrefToCourse: 'https://stepic.org'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
// Экспортируем методы, если захотим управлять меню извне
|
// Экспортируем методы, если захотим управлять меню извне
|
||||||
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;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
background: rgba(255, 255, 255, 0.508);
|
background: rgba(255, 255, 255, 0.508);
|
||||||
border: 1px solid #383838;
|
border: 1px solid #383838;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
h1{
|
|
||||||
text-align: center;
|
h1 {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Анимация бургера в крестик */
|
/* Анимация бургера в крестик */
|
||||||
.is-active .line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
|
.is-active .line:nth-child(1) {
|
||||||
.is-active .line:nth-child(2) { opacity: 0; }
|
transform: translateY(6px) rotate(45deg);
|
||||||
.is-active .line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
|
}
|
||||||
|
|
||||||
|
.is-active .line:nth-child(2) {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-active .line:nth-child(3) {
|
||||||
|
transform: translateY(-6px) rotate(-45deg);
|
||||||
|
}
|
||||||
|
|
||||||
/* Боковая панель */
|
/* Боковая панель */
|
||||||
.side-panel {
|
.side-panel {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
background: white;
|
background: white;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
padding: 0 20px 20px;
|
padding: 0 20px 20px;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Затемнение фона */
|
/* Затемнение фона */
|
||||||
.overlay {
|
.overlay {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
z-index: 999;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Анимации появления */
|
/* Анимации появления */
|
||||||
.slide-enter-active, .slide-leave-active { transition: transform 0.3s ease; }
|
.slide-enter-active, .slide-leave-active {
|
||||||
.slide-enter-from, .slide-leave-to { transform: translateX(-100%); }
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
.fade-enter-active, .fade-leave-active { transition: opacity 0.3s ease; }
|
.slide-enter-from, .slide-leave-to {
|
||||||
.fade-enter-from, .fade-leave-to { opacity: 0; }
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
|
|
||||||
.placeholder {
|
.fade-enter-active, .fade-leave-active {
|
||||||
color: #00e44c;
|
transition: opacity 0.3s ease;
|
||||||
/* цвет текста */
|
}
|
||||||
font-style: italic;
|
|
||||||
|
.fade-enter-from, .fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
isSuccess: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
to: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<a v-if="to" :href="props.to" class="btn">
|
||||||
|
<slot/>
|
||||||
|
</a>
|
||||||
|
<button v-else class="btn">
|
||||||
|
<slot/>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.btn {
|
||||||
|
border: 2px solid white;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.3s;
|
||||||
|
padding: 5px;
|
||||||
|
background-color: #383838;
|
||||||
|
color: white;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import copy from 'copy-to-clipboard';
|
import copy from 'copy-to-clipboard';
|
||||||
import iziToast from '@/iziToast.js';
|
import iziToast from '@/shared/iziToast.js';
|
||||||
|
|
||||||
function copyToclipboard(text) {
|
function copyToclipboard(text) {
|
||||||
try {
|
try {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import iziToast from "izitoast"
|
import iziToast from 'iziToast';
|
||||||
|
|
||||||
iziToast.settings({
|
iziToast.settings({
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||