chore: added hiding rolling stock preview on hover

This commit is contained in:
2026-03-15 23:18:36 +01:00
parent dc0b0315e0
commit f7499fe431
5 changed files with 15 additions and 8 deletions
+9 -5
View File
@@ -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>