Zmiany w wyglądzie filtrów, responsywność

This commit is contained in:
2020-07-08 14:27:25 +02:00
parent fbda6b73ac
commit 5386887076
5 changed files with 178 additions and 151 deletions
+30 -29
View File
@@ -1,4 +1,5 @@
<template> <template>
<transition name="card-anim">
<div class="card" v-if="stationInfo"> <div class="card" v-if="stationInfo">
<div class="card-exit" @click="closeCard">X</div> <div class="card-exit" @click="closeCard">X</div>
@@ -54,7 +55,7 @@
<span <span
v-if="stationInfo.reqLevel" v-if="stationInfo.reqLevel"
:title="'Wymagany poziom dyżurnego: ' + stationInfo.reqLevel" :title="'Wymagany poziom dyżurnego: ' + stationInfo.reqLevel"
>{{parseInt(stationInfo.reqLevel) < 2 ? "L" : stationInfo.reqLevel}}</span> >{{(parseInt(stationInfo.reqLevel) < 2) ? "L" : stationInfo.reqLevel}}</span>
</div> </div>
<div class="station-info"></div> <div class="station-info"></div>
@@ -124,6 +125,7 @@
</div> </div>
</div> </div>
</div> </div>
</transition>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -149,27 +151,34 @@ export default Vue.extend({
} }
} }
.card-anim {
&-enter-active,
&-leave-active {
transition: all 0.25s ease-in-out;
}
&-enter,
&-leave-to {
opacity: 0;
}
}
.card { .card {
display: flex;
flex-direction: column;
position: fixed; position: fixed;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
z-index: 2; z-index: 2;
transform: translate(-50%, -50%);
background: #474747;
max-height: 95%;
overflow: auto; overflow: auto;
background: #474747;
box-shadow: 0 0 15px 5px #474747;
width: 65%; width: 65%;
max-width: 650px; max-width: 650px;
max-height: 95%;
box-shadow: 0 0 15px 5px #474747;
font-size: calc(0.6rem + 0.5vw); font-size: calc(0.6rem + 0.5vw);
@@ -181,9 +190,7 @@ export default Vue.extend({
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
padding: 1rem; padding: 1rem;
font-size: calc(1rem + 0.7vw); font-size: calc(1rem + 0.7vw);
cursor: pointer; cursor: pointer;
@@ -196,7 +203,6 @@ export default Vue.extend({
align-items: center; align-items: center;
text-align: center; text-align: center;
padding: 1em; padding: 1em;
& > div { & > div {
@@ -208,7 +214,6 @@ export default Vue.extend({
&-upper { &-upper {
background: #959595; background: #959595;
text-align: center; text-align: center;
padding: 0.2em; padding: 0.2em;
} }
} }
@@ -235,17 +240,16 @@ export default Vue.extend({
} }
&-icons { &-icons {
padding: 0.5rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 0.5rem;
img, img,
span { span {
margin: 0 0.5em;
width: 2.5em; width: 2.5em;
height: 2.5em; height: 2.5em;
margin: 0 0.5em;
} }
span { span {
@@ -257,9 +261,9 @@ export default Vue.extend({
font-weight: bold; font-weight: bold;
user-select: none;
-moz-user-select: none; -moz-user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
user-select: none;
} }
} }
} }
@@ -271,6 +275,8 @@ export default Vue.extend({
justify-content: center; justify-content: center;
align-items: center; align-items: center;
text-align: center;
@include smallScreen() { @include smallScreen() {
flex-direction: column; flex-direction: column;
} }
@@ -280,12 +286,12 @@ export default Vue.extend({
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border: 2px solid #ffbb00;
border-radius: 50%;
font-size: 1.3em;
width: 2em; width: 2em;
height: 2em; height: 2em;
font-size: 1.3em;
border: 2px solid #ffbb00;
border-radius: 50%;
} }
&-name { &-name {
@@ -298,8 +304,6 @@ export default Vue.extend({
margin-left: 0; margin-left: 0;
margin-top: 0.2em; margin-top: 0.2em;
} }
text-align: center;
} }
} }
@@ -327,7 +331,6 @@ export default Vue.extend({
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
&-content { &-content {
@@ -343,7 +346,6 @@ export default Vue.extend({
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
&-content { &-content {
@@ -369,7 +371,6 @@ export default Vue.extend({
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
+4 -2
View File
@@ -2,8 +2,10 @@
<div class="list"> <div class="list">
<Card :stationInfo="focusedStationInfo" :closeCard="closeCard" /> <Card :stationInfo="focusedStationInfo" :closeCard="closeCard" />
<!-- <div class="info">Ups! Brak stacji do wyświetlenia!</div> -->
<div class="table-wrapper"> <div class="table-wrapper">
<table class="table"> <table class="table" v-if="stations.length > 0">
<thead> <thead>
<tr> <tr>
<th>Stacja</th> <th>Stacja</th>
@@ -248,7 +250,7 @@ export default Vue.extend({
font-size: calc(0.6rem + 0.4vw); font-size: calc(0.6rem + 0.4vw);
@include smallScreen() { @include smallScreen() {
font-size: 0.5rem; font-size: 0.65rem;
} }
thead th { thead th {
+3 -4
View File
@@ -12,7 +12,7 @@
<transition name="slide"> <transition name="slide">
<keep-alive> <keep-alive>
<ListFilter v-if="filtersOpen" /> <ListFilter v-if="filtersOpen" :exit="() => filtersOpen = !filtersOpen" />
</keep-alive> </keep-alive>
</transition> </transition>
</div> </div>
@@ -45,15 +45,14 @@ export default Vue.extend({
.slide-enter, .slide-enter,
.slide-leave-to { .slide-leave-to {
transform: translateX(10px); transform: translate(-40%, -50%);
opacity: 0; opacity: 0;
} }
.options { .options {
position: relative;
font-size: calc(0.6rem + 0.9vw); font-size: calc(0.6rem + 0.9vw);
display: flex; // display: flex;
} }
button { button {
+36 -12
View File
@@ -1,5 +1,7 @@
<template> <template>
<div class="list-filter"> <div class="list-filter">
<div class="exit" @click="exitFilters">X</div>
<div class="list-filter-title">FILTRY</div>
<ul class="grid"> <ul class="grid">
<li class="grid-row"> <li class="grid-row">
<div class="grid-col" v-for="(el, i) in gridElements" :key="i"> <div class="grid-col" v-for="(el, i) in gridElements" :key="i">
@@ -275,6 +277,7 @@ export default Vue.extend({
} }
} }
}), }),
props: ["exit"],
methods: { methods: {
...mapActions(["setFilter", "resetFilters"]), ...mapActions(["setFilter", "resetFilters"]),
handleChange(e: any) { handleChange(e: any) {
@@ -303,6 +306,9 @@ export default Vue.extend({
this.twoWayOther = 0; this.twoWayOther = 0;
this.resetFilters(); this.resetFilters();
},
exitFilters() {
this.exit();
} }
} }
}); });
@@ -313,28 +319,46 @@ export default Vue.extend({
@import "../../styles/variables"; @import "../../styles/variables";
.list-filter { .list-filter {
position: absolute; position: fixed;
top: 100%; top: 50%;
left: 0; left: 50%;
padding: 0.3rem;
@include smallScreen() { overflow: auto;
width: 100vw; max-height: 90%;
}
padding: 0.4em;
background: rgba(black, 0.85);
white-space: nowrap; white-space: nowrap;
transform: translate(-50%, -50%);
font-size: calc(0.6rem + 0.4vw); font-size: calc(0.6rem + 0.4vw);
@include smallScreen() { @include smallScreen() {
font-size: 0.65rem; width: 100vw;
font-size: 0.75em;
} }
} }
.exit {
position: absolute;
top: 0;
right: 0;
padding: 0.4rem;
font-size: calc(1rem + 0.4vw);
cursor: pointer;
}
.list-filter-title {
text-align: center;
padding: 0.3rem;
font-size: 1.6em;
font-weight: bold;
}
.grid { .grid {
background: rgba(black, 0.65);
padding: 0.5rem;
&-row { &-row {
display: flex; display: flex;
justify-content: center; justify-content: center;
+1
View File
@@ -196,6 +196,7 @@ class Store extends VuexModule {
public filterStations() { public filterStations() {
this.filteredStations = this.stations.filter(station => { this.filteredStations = this.stations.filter(station => {
if ((station.nonPublic || !station.reqLevel) && this.filters['nonPublic']) return false; if ((station.nonPublic || !station.reqLevel) && this.filters['nonPublic']) return false;
if (!station.reqLevel) return true; if (!station.reqLevel) return true;