Lokomotywy EP07 i EP08 są przeznaczone jedynie do ruchu pasażerskiego!
@@ -173,6 +189,7 @@ import { useStore } from '../store';
import warningsMixin from '../mixins/warningsMixin';
import imageMixin from '../mixins/imageMixin';
import stockPreviewMixin from '../mixins/stockPreviewMixin';
+import { IStock } from '../types';
export default defineComponent({
name: 'stock-list',
@@ -194,6 +211,16 @@ export default defineComponent({
draggedVehicleID: -1,
}),
+ watch: {
+ 'store.chosenStockListIndex': {
+ handler(id: number) {
+ (this.$refs['thumbnails'] as HTMLElement)
+ .querySelector(`div:nth-child(${id + 1})`)
+ ?.scrollIntoView({ block: 'nearest', inline: 'start', behavior: 'smooth' });
+ },
+ },
+ },
+
computed: {
stockString() {
return this.store.stockList
@@ -218,6 +245,10 @@ export default defineComponent({
return this.tooManyLocomotives || this.trainTooHeavy || this.trainTooLong || this.locoNotSuitable;
},
+ stockImageError(e: Event, stock: IStock): void {
+ (e.target as HTMLImageElement).src = `images/${stock.useType}-unknown.png`;
+ },
+
copyToClipboard() {
// if (this.stockHasWarnings()) {
// alert('Jazda tym pociągiem jest niezgodna z regulaminem symulatora! Zmień parametry zestawienia!');
@@ -381,10 +412,6 @@ export default defineComponent({
diff --git a/src/components/TrainImageSection.vue b/src/components/TrainImageSection.vue
index b905b1a..2384c20 100644
--- a/src/components/TrainImageSection.vue
+++ b/src/components/TrainImageSection.vue
@@ -83,8 +83,6 @@ export default defineComponent({
watch: {
chosenVehicle(vehicle: Vehicle, prevVehicle: Vehicle) {
- console.log(vehicle);
-
if (vehicle && vehicle.type != prevVehicle?.type) {
this.store.imageLoading = true;
}
diff --git a/src/styles/global.scss b/src/styles/global.scss
index 6ee3950..632e281 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -3,7 +3,7 @@
$breakpointMd: 960px;
$breakpointSm: 550px;
-$bgColor: #2c3149;
+$bgColor: #2b3552;
$textColor: #fff;
$secondaryColor: #222;
$accentColor: #e4c428;
@@ -86,6 +86,8 @@ button.btn {
outline: none;
background-color: #222;
+ border-radius: 8px;
+ font-weight: bold;
transition: all 250ms;
@@ -120,15 +122,6 @@ button.btn {
outline: 1px solid white;
}
}
-
- &--choice {
- padding: 0.25em 0.3em;
- background-color: #222;
-
- &:focus-visible {
- outline: 1px solid white;
- }
- }
}
select,