mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
chore: added hiding rolling stock preview on hover
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<StockList :trainStockList="chosenTrain.stockList" :key="chosenTrain.id" />
|
||||
<StockList :trainStockList="chosenTrain.stockList" :key="chosenTrain.id" :showPreviews="true" />
|
||||
<TrainSchedule :train="chosenTrain" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:vehicle-string="vehicleString"
|
||||
:images="images"
|
||||
:image-fallbacks="imagesFallbacks"
|
||||
:show-previews="showPreviews"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -23,7 +24,8 @@ export default defineComponent({
|
||||
|
||||
props: {
|
||||
trainStockList: { type: Array as PropType<string[]>, required: true },
|
||||
tractionOnly: { type: Boolean, required: false }
|
||||
tractionOnly: { type: Boolean, required: false },
|
||||
showPreviews: { type: Boolean }
|
||||
},
|
||||
|
||||
data() {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
:src="`https://stacjownik.spythere.eu/static/thumbnails/${thumbnailImage}.png`"
|
||||
height="70"
|
||||
loading="lazy"
|
||||
data-tooltip-type="VehiclePreviewTooltip"
|
||||
:data-crosshair-cursor="showPreviews"
|
||||
:data-tooltip-type="showPreviews ? 'VehiclePreviewTooltip' : ''"
|
||||
:data-tooltip-content="vehicleString"
|
||||
@error="onImageError($event, imageFallbacks[imageIndex])"
|
||||
@load="onImageLoad"
|
||||
@@ -20,13 +21,14 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { computed, PropType, Ref, ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
vehicleString: { type: String, required: true },
|
||||
images: { type: Object as PropType<string[]>, required: true },
|
||||
imageFallbacks: { type: Object as PropType<string[]>, required: true }
|
||||
imageFallbacks: { type: Object as PropType<string[]>, required: true },
|
||||
showPreviews: { type: Boolean }
|
||||
});
|
||||
|
||||
const thumbRef = ref(null) as Ref<HTMLElement | null>;
|
||||
@@ -74,8 +76,10 @@ function onImageLoad() {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
cursor: crosshair;
|
||||
|
||||
padding: 0.5em 0;
|
||||
|
||||
&[data-crosshair-cursor='true'] {
|
||||
cursor: crosshair;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
: stockHistory[currentHistoryIndex].stockString
|
||||
).split(';')
|
||||
"
|
||||
:showPreviews="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TrainInfo :train="train" />
|
||||
|
||||
<div class="train-stats">
|
||||
<StockList :trainStockList="train.stockList" :tractionOnly="true" />
|
||||
<StockList :trainStockList="train.stockList" :tractionOnly="true" :showPreviews="true" />
|
||||
|
||||
<div>
|
||||
<span>{{ train.speed }}km/h</span>
|
||||
|
||||
Reference in New Issue
Block a user