mirror of
https://github.com/Spythere/genera-tor.git
synced 2026-05-03 13:38:12 +00:00
Responsywność, sidebar
This commit is contained in:
+19
-12
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="rozkaz">
|
<div class="rozkaz">
|
||||||
<OrderNVue v-if="orderType == 'N'" />
|
<keep-alive>
|
||||||
<OrderSVue v-if="orderType == 'S'" />
|
<component :is="chosenOrderComponent"></component>
|
||||||
|
</keep-alive>
|
||||||
|
|
||||||
<section class="info">
|
<section class="info">
|
||||||
<table class="info-table">
|
<table class="info-table">
|
||||||
@@ -60,12 +61,6 @@ import OrderSVue from './OrderS.vue';
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { OrderNVue, OrderSVue },
|
components: { OrderNVue, OrderSVue },
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
orderType: 'N',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
|
||||||
@@ -74,6 +69,12 @@ export default defineComponent({
|
|||||||
info: store.orderInfo,
|
info: store.orderInfo,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
chosenOrderComponent() {
|
||||||
|
return this.store.chosenOrderType == 'OrderS' ? OrderSVue : OrderNVue;
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -81,13 +82,15 @@ export default defineComponent({
|
|||||||
@import '../styles/global.scss';
|
@import '../styles/global.scss';
|
||||||
|
|
||||||
.rozkaz {
|
.rozkaz {
|
||||||
width: 500px;
|
max-width: 500px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: black;
|
color: black;
|
||||||
|
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
box-shadow: 0 0 15px 2px white;
|
box-shadow: 0 0 15px 2px white;
|
||||||
|
|
||||||
|
font-family: initial;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -98,6 +101,10 @@ export default defineComponent({
|
|||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 550px) {
|
||||||
|
font-size: 3vw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex-row {
|
.flex-row {
|
||||||
@@ -125,9 +132,9 @@ input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5em;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5em;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-section {
|
.table-section {
|
||||||
|
|||||||
@@ -212,6 +212,8 @@ import { useStore } from '../store/store';
|
|||||||
type OrderRowRange = 1 | 2 | 3 | 4 | 5;
|
type OrderRowRange = 1 | 2 | 3 | 4 | 5;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
name: 'OrderN',
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const order = reactive(store.orderN);
|
const order = reactive(store.orderN);
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ import { defineComponent } from 'vue';
|
|||||||
import { useStore } from '../store/store';
|
import { useStore } from '../store/store';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
name: 'OrderS',
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<section class="sidebar">
|
||||||
|
<div class="sidebar_content">
|
||||||
|
<button
|
||||||
|
v-for="orderType in orderTypeList"
|
||||||
|
:key="orderType.id"
|
||||||
|
@click="selectOrderType(orderType.id)"
|
||||||
|
:data-selected="store.chosenOrderType == orderType.id"
|
||||||
|
>
|
||||||
|
{{ orderType.name }}
|
||||||
|
|
||||||
|
<div class="bar"></div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import { useStore } from '../store/store';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
orderTypeList: [
|
||||||
|
{
|
||||||
|
id: 'OrderN',
|
||||||
|
name: 'N',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'OrderS',
|
||||||
|
name: 'S',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'OrderO',
|
||||||
|
name: 'O',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
store: useStore(),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
selectOrderType(type: string) {
|
||||||
|
this.store.chosenOrderType = type;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '../styles/global.scss';
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
|
||||||
|
transform: translateY(-50%);
|
||||||
|
width: 50px;
|
||||||
|
max-height: 250px;
|
||||||
|
height: 95vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar_content {
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: repeat(3, 1fr);
|
||||||
|
gap: 0.25em;
|
||||||
|
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
& > button {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
color: white;
|
||||||
|
background-color: #000000aa;
|
||||||
|
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
height: 100%;
|
||||||
|
width: 4px;
|
||||||
|
|
||||||
|
transform: translateX(100%);
|
||||||
|
transition: all 200ms ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-selected='true'] .bar {
|
||||||
|
transform: translateX(0);
|
||||||
|
|
||||||
|
background-color: $accentCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"orderN": {
|
|
||||||
"header": "Rozkaz pisemny \"N\" nr {0} dla pociągu nr {1} dnia {2} {3}r.",
|
|
||||||
"row1": "1. Od {0} do {1} tor nr {2} jest zamknięty, ruch jednotorowy dwukierunkowy wprowadzono po torze nr {3}",
|
|
||||||
"row2": "2. ZEZWALAM po otrzymaniu ${0}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+5
-2
@@ -3,6 +3,8 @@ import { defineStore } from 'pinia';
|
|||||||
export const useStore = defineStore('store', {
|
export const useStore = defineStore('store', {
|
||||||
state: () => {
|
state: () => {
|
||||||
return {
|
return {
|
||||||
|
chosenOrderType: 'OrderN',
|
||||||
|
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
stationName: '',
|
stationName: '',
|
||||||
checkpointName: '',
|
checkpointName: '',
|
||||||
@@ -80,10 +82,10 @@ export const useStore = defineStore('store', {
|
|||||||
chosenRows: [1],
|
chosenRows: [1],
|
||||||
|
|
||||||
header: {
|
header: {
|
||||||
orderNo: '',
|
orderNo: '1',
|
||||||
trainNo: '',
|
trainNo: '',
|
||||||
for: 'pociągu',
|
for: 'pociągu',
|
||||||
date: '',
|
date: new Date().toLocaleDateString('pl-PL', { day: '2-digit', month: 'long' }),
|
||||||
},
|
},
|
||||||
|
|
||||||
row1: {
|
row1: {
|
||||||
@@ -116,3 +118,4 @@ export const useStore = defineStore('store', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+18
-8
@@ -1,3 +1,5 @@
|
|||||||
|
@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@400;600&display=swap');
|
||||||
|
|
||||||
$bgCol: #313638;
|
$bgCol: #313638;
|
||||||
$accentCol: #0defff;
|
$accentCol: #0defff;
|
||||||
|
|
||||||
@@ -6,23 +8,31 @@ html {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
|
||||||
|
font-family: 'Libre Franklin', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.g-button {
|
button {
|
||||||
outline: 2px solid white;
|
|
||||||
border: none;
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
background: none;
|
||||||
|
|
||||||
|
transition: all 150ms ease-in;
|
||||||
|
font-family: 'Libre Franklin', sans-serif;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1em;
|
||||||
|
|
||||||
|
&.g-button {
|
||||||
|
outline: 2px solid white;
|
||||||
background: none;
|
background: none;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
}
|
||||||
font-size: 1em;
|
|
||||||
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 150ms ease-in;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: $accentCol;
|
color: $accentCol;
|
||||||
|
|||||||
+8
-3
@@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<SideBar />
|
||||||
|
|
||||||
<div class="home">
|
<div class="home">
|
||||||
<div class="home_container">
|
<div class="home_container">
|
||||||
<div class="order_container">
|
<div class="order_container">
|
||||||
@@ -23,8 +25,9 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import OrderVue from '../components/Order.vue';
|
import OrderVue from '../components/Order.vue';
|
||||||
import { useStore } from '../store/store';
|
import { useStore } from '../store/store';
|
||||||
|
import SideBar from '../components/SideBar.vue';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { OrderVue },
|
components: { OrderVue, SideBar },
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
@@ -44,11 +47,11 @@ export default defineComponent({
|
|||||||
.home {
|
.home {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
padding: 1em;
|
||||||
|
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
||||||
@@ -57,17 +60,19 @@ export default defineComponent({
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order_container {
|
.order_container {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.message_container {
|
.message_container {
|
||||||
padding: 0 1em;
|
padding: 0 1em;
|
||||||
width: 500px;
|
max-width: 500px;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user