From b4e39f14ab02d0dd515bf136b0d8e5c7511d59bb Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 1 Feb 2022 01:27:55 +0100 Subject: [PATCH] =?UTF-8?q?Wygl=C4=85d=20karty=20SRJP=20(cz.1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TrainsView/TrainInfo.vue | 77 +++++++++++-------- src/components/TrainsView/TrainTable.vue | 6 -- .../TrainsView/TrainTimetableCard.vue | 13 +++- 3 files changed, 57 insertions(+), 39 deletions(-) diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index d2a7351..cffc898 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -52,7 +52,9 @@ - + + Not Found + @@ -120,6 +122,22 @@ + +
+ + + {{ `${~~(train[stat.name] * (stat.multiplier || 1))}${stat.unit}` }} + +
+ +
+ +
+ {{ (train[stat.prop] || '---') + (stat.unit || '') }} +
+
+
+
@@ -140,25 +158,19 @@ {{ displayLocoInfo(train.locoType) }}
- +
+ loco + car +
- - -
- - - {{ `${~~(train[stat.name] * (stat.multiplier || 1))}${stat.unit}` }} - -
- -
- -
- {{ (train[stat.prop] || '---') + (stat.unit || '') }} -
-
-
@@ -280,13 +292,9 @@ export default defineComponent({ onImageError(e: Event) { const imageEl = e.target as HTMLImageElement; + imageEl.src = require('@/assets/unknown.png'); - imageEl.hidden = true; - }, - - onImageLoad(e: Event) { - const imageEl = e.target as HTMLImageElement; - imageEl.hidden = false; + console.log('error'); }, }, }); @@ -304,16 +312,18 @@ export default defineComponent({ padding: 1em; &.extended-view { - grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(30em, 1fr)); grid-template-rows: 1fr; margin-top: 0.5em; } &.simple-view { - grid-template-columns: 4fr 1fr 2fr; + grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr; + gap: 0.5em; + &:hover { background: #424242; } @@ -322,7 +332,6 @@ export default defineComponent({ text-align: right; display: flex; - flex-direction: column; } @@ -447,10 +456,6 @@ export default defineComponent({ &-loco { width: 100%; text-align: center; - - img.train-image { - width: 15em; - } } &-cars { @@ -464,6 +469,16 @@ export default defineComponent({ color: var(--clr-primary); } } + + &-stock { + display: flex; + align-items: flex-end; + overflow-x: auto; + + img { + margin: 0 auto; + } + } } .stats { diff --git a/src/components/TrainsView/TrainTable.vue b/src/components/TrainsView/TrainTable.vue index f847b60..f302dd2 100644 --- a/src/components/TrainsView/TrainTable.vue +++ b/src/components/TrainsView/TrainTable.vue @@ -141,12 +141,6 @@ export default defineComponent({ showTrainTimetable(train: Train) { this.chosenTrain = train; - - this.$nextTick(() => { - const cardRef = this.$refs.card; - - (cardRef as any).$refs['card-inner'].focus(); - }); }, closeTimetableCard() { diff --git a/src/components/TrainsView/TrainTimetableCard.vue b/src/components/TrainsView/TrainTimetableCard.vue index 53da526..dd2f407 100644 --- a/src/components/TrainsView/TrainTimetableCard.vue +++ b/src/components/TrainsView/TrainTimetableCard.vue @@ -67,11 +67,20 @@ export default defineComponent({ position: fixed; top: 50%; left: 50%; - - z-index: 100; + + transform: translate(-50%, -50%); padding: 0.5em; + width: 100%; + max-width: 1000px; + + @include smallScreen { + width: 95%; + } + + z-index: 100; + border: 1px solid white; }