Poprawki responsywności

This commit is contained in:
2022-09-30 14:56:49 +02:00
parent 4ec544e8a9
commit a65b09981b
6 changed files with 46 additions and 76 deletions
+1 -1
View File
@@ -45,7 +45,7 @@
font-size: 1rem; font-size: 1rem;
@include smallScreen() { @include smallScreen() {
font-size: calc(0.5rem + 1.3vw); font-size: calc(0.55rem + 1vw);
} }
} }
@@ -64,6 +64,7 @@ export default defineComponent({
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.5em;
.dispatcher { .dispatcher {
font-size: 2em; font-size: 2em;
@@ -82,17 +83,15 @@ export default defineComponent({
} }
&_name { &_name {
margin-right: 0.4em;
cursor: pointer; cursor: pointer;
margin-right: 0.25em;
} }
&_likes { &_likes {
img { img {
height: 0.7em; height: 0.7em;
margin-right: 0.25em; margin: 0 0.25em;
} }
margin-right: 1.5em;
} }
} }
@@ -10,11 +10,17 @@
<span class="text--grayed"> <span class="text--grayed">
{{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }} {{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }}
</span> </span>
<!--
<button class="btn--image" v-if="!timetableOnly">
<a :href="`${$route.path}?station=${$route.query.station}&timetableOnly=1`">
<img :src="getIcon('view')" alt="View image" />
</a>
</button> -->
</h3> </h3>
<div class="timetable-checkpoints" v-if="station && station.generalInfo?.checkpoints"> <div class="timetable-checkpoints" v-if="station && station.generalInfo?.checkpoints">
<span v-for="(cp, i) in station.generalInfo.checkpoints" :key="i"> <span v-for="(cp, i) in station.generalInfo.checkpoints" :key="i">
{{ i > 0 && '&bull;' || '' }} {{ (i > 0 && '&bull;') || '' }}
<button <button
:key="cp.checkpointName" :key="cp.checkpointName"
@@ -185,6 +191,10 @@ export default defineComponent({
type: Object as PropType<Station>, type: Object as PropType<Station>,
required: true, required: true,
}, },
timetableOnly: {
type: Boolean,
},
}, },
data: () => ({ data: () => ({
@@ -252,6 +262,10 @@ export default defineComponent({
selectCheckpoint(cp: { checkpointName: string }) { selectCheckpoint(cp: { checkpointName: string }) {
this.selectedCheckpoint = cp.checkpointName; this.selectedCheckpoint = cp.checkpointName;
}, },
showTimetableOnlyView() {
this.$router.push(`${this.$route.fullPath}&timetableOnly=1`);
},
}, },
mounted() { mounted() {
@@ -295,7 +309,7 @@ export default defineComponent({
h3 { h3 {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 1.4em; font-size: 1.3em;
} }
} }
-1
View File
@@ -18,7 +18,6 @@ const routes: Array<RouteRecordRaw> = [
path: '/scenery', path: '/scenery',
name: 'SceneryView', name: 'SceneryView',
component: () => import('../views/SceneryView.vue'), component: () => import('../views/SceneryView.vue'),
props: true,
}, },
{ {
path: '/journal', path: '/journal',
-60
View File
@@ -250,66 +250,6 @@ button.btn--image {
} }
} }
// .btn {
// background: none;
// cursor: pointer;
// font-size: 1em;
// &--text {
// background: none;
// color: white;
// transition: color 0.3s;
// &:hover:not(:disabled),
// &:focus:not(:disabled) {
// color: $accentCol;
// }
// &.checked {
// color: var(--clr-primary);
// font-weight: bold;
// }
// }
// &--image {
// display: flex;
// padding: 0.4em 1em;
// font-weight: bold;
// font-size: 1em;
// border-radius: 0.75em 0.75em 0 0;
// background-color: #1b1b1b;
// img {
// height: 1.3em;
// margin-right: 0.5rem;
// }
// }
// &--option {
// cursor: pointer;
// color: white;
// background-color: #333;
// border-radius: 0.25em;
// padding: 0.25em 0.5em;
// &.checked {
// color: var(--clr-primary);
// font-weight: bold;
// background-color: #3c3c3c;
// }
// }
// &:disabled {
// opacity: 0.65;
// }
// }
.return-btn { .return-btn {
display: none; display: none;
justify-content: center; justify-content: center;
+26 -8
View File
@@ -8,16 +8,16 @@
</action-button> </action-button>
</div> </div>
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper"> <div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper" :data-timetable-only="timetableOnly">
<div class="scenery-left"> <div class="scenery-left" v-if="!timetableOnly">
<div class="scenery-actions"> <div class="scenery-actions">
<button v-if="!timetableOnly" class="back-btn btn" :title="$t('scenery.return-btn')" @click="navigateTo('/')"> <button class="back-btn btn" :title="$t('scenery.return-btn')" @click="navigateTo('/')">
<img :src="getIcon('back')" alt="Back to scenery" /> <img :src="getIcon('back')" alt="Back to scenery" />
</button> </button>
</div> </div>
<SceneryHeader :station="stationInfo" /> <SceneryHeader :station="stationInfo" />
<SceneryInfo :station="stationInfo" :timetableOnly="timetableOnly" /> <SceneryInfo :station="stationInfo" />
</div> </div>
<div class="scenery-right"> <div class="scenery-right">
@@ -33,7 +33,12 @@
</div> </div>
<keep-alive> <keep-alive>
<component :is="currentViewCompontent" :station="stationInfo" :key="currentViewCompontent"></component> <component
:is="currentViewCompontent"
:station="stationInfo"
:timetableOnly="timetableOnly"
:key="currentViewCompontent"
></component>
</keep-alive> </keep-alive>
</div> </div>
</div> </div>
@@ -41,7 +46,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent, PropType } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import routerMixin from '../mixins/routerMixin'; import routerMixin from '../mixins/routerMixin';
import { useStore } from '../store/store'; import { useStore } from '../store/store';
@@ -68,7 +73,9 @@ export default defineComponent({
SceneryTimetablesHistory, SceneryTimetablesHistory,
SceneryDispatchersHistory, SceneryDispatchersHistory,
}, },
mixins: [routerMixin, imageMixin], mixins: [routerMixin, imageMixin],
data: () => ({ data: () => ({
viewModes: [ viewModes: [
{ {
@@ -89,17 +96,22 @@ export default defineComponent({
currentViewCompontent: 'SceneryTimetable', currentViewCompontent: 'SceneryTimetable',
onlineFrom: -1, onlineFrom: -1,
}), }),
activated() { activated() {
this.loadSelectedCheckpoint(); this.loadSelectedCheckpoint();
}, },
setup() { setup() {
const route = useRoute(); const route = useRoute();
const store = useStore(); const store = useStore();
const timetableOnly = computed(() => (route.query['timetable_only'] == '1' ? true : false));
const timetableOnly = computed(() => (route.query['timetableOnly'] == '1' ? true : false));
const isComponentVisible = computed(() => route.path === '/scenery'); const isComponentVisible = computed(() => route.path === '/scenery');
const stationInfo = computed(() => { const stationInfo = computed(() => {
return store.stationList.find((station) => station.name === route.query.station?.toString().replace(/_/g, ' ')); return store.stationList.find((station) => station.name === route.query.station?.toString().replace(/_/g, ' '));
}); });
return { return {
timetableOnly, timetableOnly,
isComponentVisible, isComponentVisible,
@@ -111,11 +123,13 @@ export default defineComponent({
setViewMode(componentName: string) { setViewMode(componentName: string) {
this.currentViewCompontent = componentName; this.currentViewCompontent = componentName;
}, },
loadSelectedCheckpoint() { loadSelectedCheckpoint() {
if (!this.stationInfo?.generalInfo?.checkpoints) return; if (!this.stationInfo?.generalInfo?.checkpoints) return;
if (this.stationInfo.generalInfo.checkpoints.length == 0) return; if (this.stationInfo.generalInfo.checkpoints.length == 0) return;
this.selectedCheckpoint = this.stationInfo.generalInfo.checkpoints[0].checkpointName; this.selectedCheckpoint = this.stationInfo.generalInfo.checkpoints[0].checkpointName;
}, },
selectCheckpoint(cp: { checkpointName: string }) { selectCheckpoint(cp: { checkpointName: string }) {
this.selectedCheckpoint = cp.checkpointName; this.selectedCheckpoint = cp.checkpointName;
}, },
@@ -169,8 +183,12 @@ button.back-btn {
max-width: 1700px; max-width: 1700px;
margin: 1rem 0; margin: 1rem 0;
text-align: center; text-align: center;
&[data-timetable-only='true'] {
grid-template-columns: 1fr;
max-width: 1000px;
}
} }
.scenery-left { .scenery-left {