Przywrócono wybór serwerów; poprawki wyglądu

This commit is contained in:
2022-06-13 17:20:11 +02:00
parent e9e4096ba1
commit bde5579f71
7 changed files with 93 additions and 82 deletions
+32 -10
View File
@@ -36,7 +36,7 @@
font-size: 1rem; font-size: 1rem;
@include smallScreen() { @include smallScreen() {
font-size: calc(0.3rem + 2vw); font-size: calc(0.4rem + 1.4vw);
} }
} }
@@ -94,6 +94,10 @@
} }
.header { .header {
&_body {
max-width: 21em;
}
&_container { &_container {
display: flex; display: flex;
justify-content: center; justify-content: center;
@@ -106,18 +110,16 @@
&_brand { &_brand {
img { img {
width: 22em; width: 100%;
} }
} }
&_info { &_info {
display: flex; display: grid;
justify-content: space-between; grid-template-columns: 1fr 1fr 1fr;
max-width: 100%;
font-size: 1.25em; font-size: 1.2em;
margin: 0 0.3em;
padding: 0.2em;
} }
&_links { &_links {
@@ -191,6 +193,7 @@
// COUNTER // COUNTER
.info_counter { .info_counter {
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
span { span {
@@ -200,10 +203,29 @@
img { img {
width: 1.35em; width: 1.35em;
} }
}
.region { // REGION SELECTION
color: paleturquoise; .info_region {
color: white;
font-weight: bold;
display: flex;
justify-content: flex-end;
.select-box_content button {
background-color: transparent;
font-weight: bold; font-weight: bold;
padding: 0.1em 0.5em;
color: paleturquoise;
}
.options {
font-size: 0.9em;
}
.arrow {
padding: 0;
} }
} }
+19 -9
View File
@@ -32,17 +32,20 @@
<span class="header_info"> <span class="header_info">
<Clock /> <Clock />
<div class="info_counter"> <div class="info_counter">
<span class="region" @click="changeRegion">
{{ store.region.value }}
</span>
<img src="@/assets/icon-dispatcher.svg" alt="icon dispatcher" /> <img src="@/assets/icon-dispatcher.svg" alt="icon dispatcher" />
<span class="text--primary">{{ onlineDispatchers.length }}</span> <span class="text--primary">{{ onlineDispatchers.length }}</span>
<span class="text--grayed">|</span> <span class="text--grayed"> / </span>
<span class="text--primary">{{ store.trainList.length }}</span> <span class="text--primary">{{ store.trainList.length }}</span>
<img src="@/assets/icon-train.svg" alt="icon train" /> <img src="@/assets/icon-train.svg" alt="icon train" />
</div> </div>
<span class="info_region">
<SelectBox :itemList="options.regions" :defaultItemIndex="0" @selected="changeRegion" />
</span>
</span> </span>
<span class="header_links"> <span class="header_links">
<router-link class="route" active-class="route-active" to="/" exact <router-link class="route" active-class="route-active" to="/" exact
>{{ $t('app.sceneries') }} >{{ $t('app.sceneries') }}
@@ -74,25 +77,31 @@
&copy; &copy;
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a> <a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
{{ new Date().getUTCFullYear() }} | v{{ VERSION }} {{ new Date().getUTCFullYear() }} | v{{ VERSION }}
<div style="display: none">&int; ukryta taktyczna całka do programowania w HTMLu</div>
</footer> </footer>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Clock from '@/components/App/Clock.vue'; import { computed, defineComponent, provide, ref } from 'vue';
import Clock from '@/components/App/Clock.vue';
import StorageManager from '@/scripts/managers/storageManager'; import StorageManager from '@/scripts/managers/storageManager';
import { computed, ComputedRef, defineComponent, provide, ref } from 'vue';
import packageInfo from '.././package.json'; import packageInfo from '.././package.json';
import StatusIndicator from './components/App/StatusIndicator.vue'; import options from '@/data/options.json';
import StatusIndicator from '@/components/App/StatusIndicator.vue';
import SelectBox from '@/components/Global/SelectBox.vue';
import { useStore } from './store/store'; import { useStore } from './store/store';
export default defineComponent({ export default defineComponent({
components: { components: {
Clock, Clock,
StatusIndicator, StatusIndicator,
SelectBox,
}, },
setup() { setup() {
@@ -120,6 +129,7 @@ export default defineComponent({
VERSION: packageInfo.version, VERSION: packageInfo.version,
updateModalVisible: false, updateModalVisible: false,
hasReleaseNotes: false, hasReleaseNotes: false,
options,
currentLang: 'pl', currentLang: 'pl',
@@ -156,8 +166,8 @@ export default defineComponent({
StorageManager.setBooleanValue('version_notes_read', true); StorageManager.setBooleanValue('version_notes_read', true);
}, },
changeRegion() { changeRegion(region: { id: string; value: string }) {
this.store.changeRegion({ id: 'cae', value: 'PL2' }); this.store.changeRegion(region);
}, },
changeLang(lang: string) { changeLang(lang: string) {
-1
View File
@@ -31,7 +31,6 @@ export default defineComponent({
.clock { .clock {
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
} }
</style> </style>
+1 -1
View File
@@ -288,7 +288,7 @@ export default defineComponent({
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
transform: translateX(11.6em); transform: translateX(12em);
z-index: 100; z-index: 100;
} }
+7 -10
View File
@@ -5,15 +5,13 @@
<span class="text--primary">{{ prefix }}</span> {{ computedSelectedItem.value }} <span class="text--primary">{{ prefix }}</span> {{ computedSelectedItem.value }}
</button> </button>
<ul class="options" :ref="(el) => (listRef = el)"> <ul class="options" :ref="(el) => (listRef = el as Element)">
<li class="option" v-for="(item, i) in itemList" :key="item.id"> <li class="option" v-for="(item, i) in itemList" :key="item.id">
<transition <transition
name="unfold" name="unfold"
:style=" :style="`
`
--delay-in: ${i * 55}ms; --delay-in: ${i * 55}ms;
--delay-out: ${(itemList.length - 1 - i) * 55}ms` --delay-out: ${(itemList.length - 1 - i) * 55}ms`"
"
> >
<label :for="item.id" v-if="listOpen"> <label :for="item.id" v-if="listOpen">
<input type="button" :id="item.id" name="select-box" @click="selectOption(item)" /> <input type="button" :id="item.id" name="select-box" @click="selectOption(item)" />
@@ -36,7 +34,7 @@
import { computed, defineComponent, Ref, ref } from '@vue/runtime-core'; import { computed, defineComponent, Ref, ref } from '@vue/runtime-core';
interface Item { interface Item {
id: string | number; id: string;
value: string; value: string;
} }
@@ -141,7 +139,8 @@ export default defineComponent({
.arrow { .arrow {
position: absolute; position: absolute;
top: 50%; top: 50%;
right: 0.5em; right: 0;
padding: 0.5em;
img { img {
vertical-align: middle; vertical-align: middle;
@@ -160,7 +159,7 @@ button.selected {
font-size: 1em; font-size: 1em;
padding: 0.35em 0.5em; padding: 0.35em 0.5em;
padding-right: 2em; margin-right: 1.4em;
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
@@ -181,8 +180,6 @@ button.selected {
height: 100%; height: 100%;
min-width: 12em;
text-align: center; text-align: center;
} }
@@ -9,29 +9,9 @@
<transition name="card-anim"> <transition name="card-anim">
<div class="card" v-if="isVisible"> <div class="card" v-if="isVisible">
<!-- <div class="card_exit" @click="closeCard"></div> -->
<div class="card_content"> <div class="card_content">
<div class="card_title flex">{{ $t('filters.title') }}</div> <div class="card_title flex">{{ $t('filters.title') }}</div>
<!-- <section class="card_regions">
<div class="regions_content">
<span v-for="region in inputs.regions" :key="region.id" :class="`region-${region.id}`">
<label>
<input
type="radio"
name="region"
:id="region.id"
:value="region"
v-model="currentRegion"
@change="handleChangeRegion"
/>
<span :class="{ checked: currentRegion.id === region.id }">
{{ region.value }}
</span>
</label>
</span>
</div>
</section> -->
<section class="card_options"> <section class="card_options">
<filter-option <filter-option
v-for="(option, i) in inputs.options" v-for="(option, i) in inputs.options"
@@ -282,9 +262,6 @@ export default defineComponent({
} }
} }
.filter-card {
font-size: 1em;
}
.card { .card {
&_btn { &_btn {
button { button {
@@ -292,15 +269,15 @@ export default defineComponent({
align-items: center; align-items: center;
padding: 0.5em 1em; padding: 0.5em 1em;
border-radius: 1em 1em 0 0; border-radius: 0.75em 0.75em 0 0;
/* border-radius: 0 0.9em 0.9em 0; */ font-size: 0.9em;
/* outline: 2px solid white; */ font-weight: bold;
} }
img { img {
width: 1.5em; width: 1.3em;
margin-right: 0.5em; margin-right: 0.25em;
} }
} }
+28 -22
View File
@@ -14,7 +14,6 @@
--clr-warning: #c59429; --clr-warning: #c59429;
} }
html { html {
scroll-behavior: smooth; scroll-behavior: smooth;
width: 100vw; width: 100vw;
@@ -24,7 +23,7 @@ body {
width: 100%; width: 100%;
margin: 0; margin: 0;
// font-family: "Open Sans", sans-serif; // font-family: "Open Sans", sans-serif;
font-family: "Quicksand", sans-serif; font-family: 'Quicksand', sans-serif;
overflow-x: hidden; overflow-x: hidden;
} }
@@ -52,7 +51,6 @@ body {
} }
} }
.g-tooltip { .g-tooltip {
position: relative; position: relative;
@@ -75,14 +73,14 @@ body {
background-color: gray; background-color: gray;
text-align: center; text-align: center;
border-radius: .5em; border-radius: 0.5em;
transition: opacity 0.3s; transition: opacity 0.3s;
padding: 0.25em; padding: 0.25em;
&::after { &::after {
content: ""; content: '';
position: absolute; position: absolute;
top: 100%; top: 100%;
left: 50%; left: 50%;
@@ -112,15 +110,13 @@ body {
} }
} }
button, button,
input, input,
select { select {
// font-family: "Open Sans", sans-serif; // font-family: "Open Sans", sans-serif;
border: none; border: none;
font-family: "Quicksand", sans-serif; font-family: 'Quicksand', sans-serif;
font-size: 1em; font-size: 1em;
} }
input { input {
@@ -152,13 +148,12 @@ input {
color: $accentCol; color: $accentCol;
font-weight: 600; font-weight: 600;
padding: .35em 0; padding: 0.35em 0;
} }
a { a {
display: inline-block; display: inline-block;
color: white; color: white;
text-decoration: none; text-decoration: none;
@@ -211,7 +206,8 @@ ul {
color: white; color: white;
transition: color 0.3s; transition: color 0.3s;
&:hover, &:focus { &:hover,
&:focus {
color: $accentCol; color: $accentCol;
} }
@@ -249,23 +245,22 @@ ul {
} }
.return-btn { .return-btn {
display: flex; display: none;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: fixed; position: fixed;
right: 2rem; right: 2.5rem;
bottom: 2rem; bottom: 4rem;
z-index: 100; z-index: 100;
width: 1.5em; width: 3.5rem;
height: 1.5em;
font-size: 2.3em; font-size: 3rem;
background-color: #333; background-color: #555;
outline: 3px solid #222;
color: white; color: white;
border-radius: 50%; border-radius: 50%;
@@ -278,4 +273,15 @@ ul {
img { img {
width: 1.3em; width: 1.3em;
} }
}
@include smallScreen() {
bottom: 1em;
right: 0;
left: 50%;
width: 1em;
height: 1em;
transform: translateX(-50%);
}
}