Poprawiono wygląd modalu RJ

This commit is contained in:
2022-07-13 16:34:38 +02:00
parent 0af7b68138
commit aaec23d210
4 changed files with 145 additions and 127 deletions
+3 -4
View File
@@ -27,7 +27,7 @@
} }
// APP // APP
.app { #app {
color: white; color: white;
font-size: 1rem; font-size: 1rem;
@@ -40,8 +40,8 @@
.app_container { .app_container {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
height: 100vh;
min-height: 800px; min-height: 100vh;
header { header {
flex: 0 0 auto; flex: 0 0 auto;
@@ -213,7 +213,6 @@
font-weight: bold; font-weight: bold;
padding: 0.1em 0.5em; padding: 0.1em 0.5em;
color: paleturquoise; color: paleturquoise;
} }
.options { .options {
+2 -3
View File
@@ -1,5 +1,4 @@
<template> <template>
<div class="app">
<div class="app_container"> <div class="app_container">
<!-- <div class="wip-alert"> <!-- <div class="wip-alert">
<img class="icon-error" :src="iconError" alt="error" /> <img class="icon-error" :src="iconError" alt="error" />
@@ -78,7 +77,6 @@
<div style="display: none">&int; ukryta taktyczna całka do programowania w HTMLu</div> <div style="display: none">&int; ukryta taktyczna całka do programowania w HTMLu</div>
</footer> </footer>
</div> </div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -129,7 +127,8 @@ export default defineComponent({
return this.options.regions.map((region) => { return this.options.regions.map((region) => {
const regionStationCount = const regionStationCount =
this.store.apiData.stations?.filter((station) => station.region == region.id && station.isOnline).length || 0; this.store.apiData.stations?.filter((station) => station.region == region.id && station.isOnline).length || 0;
const regionTrainCount = this.store.apiData.trains?.filter((train) => train.region == region.id && train.online).length || 0; const regionTrainCount =
this.store.apiData.trains?.filter((train) => train.region == region.id && train.online).length || 0;
return { return {
id: region.id, id: region.id,
+55 -34
View File
@@ -1,7 +1,8 @@
<template> <template>
<div class="card-dimmer"></div> <div class="train-modal" @keydown.esc="closeModal">
<div class="train-modal" v-click-outside="closeModal" @keydown.esc="closeModal"> <div class="modal_background" @click="closeModal"></div>
<transition name="top-info-bar-anim"> <div class="modal_content" ref="content" tabindex="0">
<!-- <transition name="top-info-bar-anim">
<div class="top-info-bar" v-if="isTopBarVisible"> <div class="top-info-bar" v-if="isTopBarVisible">
<span v-if="chosenTrain.timetableData"> <span v-if="chosenTrain.timetableData">
<b class="text--primary">{{ chosenTrain.timetableData.category }} {{ chosenTrain.trainNo }}</b> <b class="text--primary">{{ chosenTrain.timetableData.category }} {{ chosenTrain.trainNo }}</b>
@@ -16,13 +17,12 @@
{{ chosenTrain.speed }}km/h {{ chosenTrain.speed }}km/h
</span> </span>
</div> </div>
</transition> </transition> -->
<button class="btn exit" @click="closeModal"> <button class="btn exit" @click="closeModal">
<img :src="icons.exit" alt="close card" /> <img :src="icons.exit" alt="close card" />
</button> </button>
<div class="content" tabindex="0" ref="content">
<TrainInfo :train="chosenTrain" :extended="false" ref="trainInfo" /> <TrainInfo :train="chosenTrain" :extended="false" ref="trainInfo" />
<TrainSchedule :train="chosenTrain" tabindex="0" /> <TrainSchedule :train="chosenTrain" tabindex="0" />
</div> </div>
@@ -66,13 +66,17 @@ export default defineComponent({
contentEl.focus(); contentEl.focus();
}); });
document.body.style.overflowY = 'hidden';
// document.body.blur();
contentEl.addEventListener('scroll', this.handleContentScroll); // contentEl.addEventListener('scroll', this.handleContentScroll);
}, },
deactivated() { deactivated() {
(this.$refs['content'] as HTMLElement).removeEventListener('scroll', this.handleContentScroll); document.body.style.overflowY = 'scroll';
this.isTopBarVisible = false;
// (this.$refs['content'] as HTMLElement).removeEventListener('scroll', this.handleContentScroll);
// this.isTopBarVisible = false;
}, },
methods: { methods: {
@@ -112,12 +116,9 @@ export default defineComponent({
top: 0; top: 0;
right: 0; right: 0;
margin: 1em 2em; margin: 0.5em 1em;
background-color: #000000;
outline: 2px solid white;
padding: 0.25em; padding: 0.25em;
border-radius: 50%;
z-index: 101; z-index: 101;
@@ -129,22 +130,44 @@ export default defineComponent({
.train-modal { .train-modal {
position: fixed; position: fixed;
top: 1em; top: 0;
left: 50%; left: 0;
text-align: left; width: 100%;
height: 100%;
transform: translateX(-50%);
background-color: #202020;
color: white;
z-index: 100; z-index: 100;
width: 95vw; display: flex;
justify-content: center;
border: 1px solid gray; text-align: left;
overflow: hidden;
} }
.modal_background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
background-color: rgba(0, 0, 0, 0.55);
}
.modal_content {
position: relative;
overflow-y: scroll;
margin-top: 1em;
width: 95vw;
height: 95vh;
background-color: #1a1a1a;
}
.top-info-bar { .top-info-bar {
position: absolute; position: absolute;
top: 0; top: 0;
@@ -163,29 +186,27 @@ export default defineComponent({
background-color: #000000dd; background-color: #000000dd;
} }
.content {
overflow: auto;
max-height: 95vh;
}
@include midScreen { @include midScreen {
.exit { .exit {
top: auto; margin: 0.5em;
bottom: 0;
margin: 1em;
img { img {
width: 1.75rem; width: 1.75rem;
} }
} }
.content {
padding-bottom: 3em;
}
.top-info-bar { .top-info-bar {
padding: 0.5em 1em; padding: 0.5em 1em;
} }
} }
@include smallScreen {
.train-modal {
font-size: 1.05em;
}
.modal_content {
max-height: 75vh;
}
}
</style> </style>
@@ -179,7 +179,6 @@ $stopNameClr: #22a8d1;
} }
.train-schedule { .train-schedule {
background-color: #202020;
padding: 0 0.25em; padding: 0 0.25em;
@include smallScreen() { @include smallScreen() {