Compare commits

..

8 Commits

Author SHA1 Message Date
Spythere 4859a265e7 Merge pull request #43 from Spythere/development
v1.9.1
2025-04-04 23:52:28 +02:00
Spythere 82d051a7a4 bump: compatible simulator version 2025-04-04 21:58:06 +02:00
Spythere c9ad50b01e feat: turning around rolling stock 2025-04-04 20:53:09 +02:00
Spythere 50f573e8c6 fix: data tooltip sizing 2025-04-04 20:11:18 +02:00
Spythere f1720c88e8 bump: v1.9.1 2025-04-04 19:43:39 +02:00
Spythere efefebe202 refactor: changed icons library 2025-04-04 19:43:17 +02:00
Spythere 218f616df4 chore: updated gitignore 2025-04-04 18:52:47 +02:00
Spythere 8d737f6429 chore: adjusted flex gap 2025-04-04 18:52:04 +02:00
10 changed files with 111 additions and 4883 deletions
+3
View File
@@ -24,5 +24,8 @@ pnpm-debug.log*
*.sw?
node_modules
# Lock files
*.lock
# Dev files
stockInfoDev.json
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "pojazdownik",
"version": "1.9.0",
"version": "1.9.1",
"private": true,
"type": "module",
"scripts": {
@@ -12,8 +12,8 @@
"format": "prettier --write src/"
},
"dependencies": {
"@heroicons/vue": "^2.2.0",
"axios": "^1.4.0",
"lucide-vue-next": "^0.487.0",
"pinia": "^2.0.17",
"prettier": "^3.0.3",
"vue": "^3.2.37",
+13 -22
View File
@@ -16,19 +16,16 @@
<div class="storage-item-top-actions">
<button class="btn btn--icon" @click="chooseStorageStock(storageEntry.id)">
<ArrowRightEndOnRectangleIcon style="width: 25px" />
<LogIn />
</button>
<button class="btn btn--icon" @click="toggleStorageEntryExpand(storageEntry.id)">
<ChevronDownIcon
v-if="!expandedEntries.includes(storageEntry.id)"
style="width: 25px"
/>
<ChevronUpIcon v-else style="width: 25px" />
<ChevronDown v-if="!expandedEntries.includes(storageEntry.id)" />
<ChevronUp v-else />
</button>
<button class="btn btn--icon" @click="removeStockIndexFromStorage(storageEntry.id)">
<TrashIcon style="width: 25px" />
<Trash2 />
</button>
</div>
</div>
@@ -62,24 +59,16 @@
<script lang="ts">
import { defineComponent } from 'vue';
import {
ArrowRightEndOnRectangleIcon,
ChevronDownIcon,
ChevronUpIcon,
FolderArrowDownIcon,
TrashIcon,
} from '@heroicons/vue/20/solid';
import { useStore } from '../../store';
import stockMixin from '../../mixins/stockMixin';
import { ChevronDown, ChevronUp, LogIn, Trash2 } from 'lucide-vue-next';
export default defineComponent({
components: {
ChevronDownIcon,
ChevronUpIcon,
FolderArrowDownIcon,
TrashIcon,
ArrowRightEndOnRectangleIcon,
ChevronDown,
ChevronUp,
LogIn,
Trash2,
},
mixins: [stockMixin],
@@ -112,7 +101,9 @@ export default defineComponent({
},
new Map() as Map<string, number>
)
).map(([stockName, count]) => `${count}x ${stockName.replace(/_/g, ' ')}`).join(', ');
)
.map(([stockName, count]) => `${count}x ${stockName.replace(/_/g, ' ')}`)
.join(', ');
},
removeStockIndexFromStorage(stockName: string) {
let removeConfirm = confirm(this.$t('storage.remove-confirm'));
@@ -184,10 +175,10 @@ ul.storage-list > li {
.storage-item-top {
display: flex;
align-items: center;
gap: 0.5em;
}
.storage-item-top > h3 {
font-size: 1.2em;
width: 100%;
text-align: left;
margin: 0;
+62 -31
View File
@@ -7,7 +7,7 @@
:data-button-tooltip="$t('stocklist.action-upload-file')"
>
<input type="file" @change="uploadStockFromFile" ref="conFile" accept=".con,.txt" />
<FolderPlusIcon />
<FolderUp :stroke-width="2.5" />
</button>
<button
@@ -15,7 +15,7 @@
@click="uploadStockFromClipboard"
:data-button-tooltip="$t('stocklist.action-upload-clipboard')"
>
<ClipboardDocumentCheckIcon />
<ClipboardPaste :stroke-width="2.5" />
</button>
<button
@@ -25,7 +25,7 @@
@click="downloadStock"
:data-button-tooltip="$t('stocklist.action-download')"
>
<ArrowDownTrayIcon />
<FolderDown :stroke-width="2.5" />
</button>
<button
@@ -35,7 +35,7 @@
@click="copyToClipboard"
:data-button-tooltip="$t('stocklist.action-copy')"
>
<DocumentDuplicateIcon />
<ClipboardCopy :stroke-width="2.5" />
</button>
<button
@@ -45,7 +45,7 @@
@click="saveStockDataToStorage"
:data-button-tooltip="$t('stocklist.action-bookmark')"
>
<BookmarkIcon />
<Bookmark :stroke-width="2.5" />
</button>
<button
@@ -55,7 +55,7 @@
@click="resetStock"
:data-button-tooltip="$t('stocklist.action-reset')"
>
<ArrowUturnLeftIcon />
<ListRestart :stroke-width="2.5" />
</button>
<button
@@ -65,7 +65,17 @@
@click="shuffleCars"
:data-button-tooltip="$t('stocklist.action-shuffle')"
>
<ArrowPathIcon />
<Shuffle :stroke-width="2.5" />
</button>
<button
class="btn btn--image"
:data-disabled="stockIsEmpty"
:disabled="stockIsEmpty"
@click="turnAroundCars"
:data-button-tooltip="$t('stocklist.action-switch')"
>
<Repeat :stroke-width="2.5" />
</button>
</div>
@@ -75,7 +85,7 @@
:tabindex="store.chosenStockListIndex == -1 ? -1 : 0"
@click="stockListUtils.moveUpStock(store.chosenStockListIndex)"
>
<ChevronUpIcon />
<ChevronUp :stroke-width="2.5" />
{{ $t('stocklist.action-move-up') }}
</button>
@@ -84,7 +94,7 @@
:tabindex="store.chosenStockListIndex == -1 ? -1 : 0"
@click="stockListUtils.moveDownStock(store.chosenStockListIndex)"
>
<ChevronDownIcon />
<ChevronDown :stroke-width="2.5" />
{{ $t('stocklist.action-move-down') }}
</button>
@@ -93,7 +103,7 @@
:tabindex="store.chosenStockListIndex == -1 ? -1 : 0"
@click="stockListUtils.removeStock(store.chosenStockListIndex)"
>
<TrashIcon />
<Trash2 :stroke-width="2.5" />
{{ $t('stocklist.action-remove') }}
</button>
</div>
@@ -108,33 +118,38 @@ import { isTractionUnit } from '../../../utils/vehicleUtils';
import { useFileUtils } from '../../../utils/fileUtils';
import stockMixin from '../../../mixins/stockMixin';
import { useStockListUtils } from '../../../utils/stockListUtils';
import {
ArrowDownTrayIcon,
ArrowPathIcon,
ArrowUturnLeftIcon,
BookmarkIcon,
ChevronDownIcon,
ChevronUpIcon,
ClipboardDocumentCheckIcon,
DocumentDuplicateIcon,
FolderPlusIcon,
TrashIcon,
} from '@heroicons/vue/20/solid';
Bookmark,
ChevronDown,
ChevronUp,
ClipboardCopy,
ClipboardPaste,
Download,
FolderDown,
FolderUp,
ListRestart,
Repeat,
Shuffle,
Trash2,
} from 'lucide-vue-next';
export default defineComponent({
mixins: [stockMixin],
components: {
ArrowDownTrayIcon,
ArrowPathIcon,
ArrowUturnLeftIcon,
BookmarkIcon,
ChevronDownIcon,
ChevronUpIcon,
ClipboardDocumentCheckIcon,
DocumentDuplicateIcon,
FolderPlusIcon,
TrashIcon,
Bookmark,
ChevronDown,
ChevronUp,
ClipboardCopy,
ClipboardPaste,
Download,
FolderUp,
ListRestart,
Repeat,
Shuffle,
FolderDown,
Trash2,
},
data: () => ({
@@ -196,6 +211,22 @@ export default defineComponent({
}
},
turnAroundCars() {
if (this.store.stockList.length <= 1) return;
const isFirstTractionUnit = isTractionUnit(this.store.stockList[0].vehicleRef);
const sliceToSwap = isFirstTractionUnit
? this.store.stockList.slice(1)
: this.store.stockList.slice();
sliceToSwap.reverse();
if (isFirstTractionUnit) sliceToSwap.unshift(this.store.stockList[0]);
this.store.stockList = sliceToSwap;
},
downloadStock() {
if (this.store.stockList.length == 0) return alert(this.$t('stocklist.alert-empty'));
+18 -12
View File
@@ -1,20 +1,26 @@
<template>
<div class="stock_specs">
<div class="stock-specs">
<div v-if="store.chosenStorageStockName || chosenRealComposition">
<b class="bookmarked-stock-info" v-if="store.chosenStorageStockName">
<b v-if="store.chosenStorageStockName">
<span
class="text--accent"
:title="store.chosenStorageStockName.length > 41 ? store.chosenStorageStockName : ''"
>
<BookmarkIcon />
<BookmarkCheck :size="19" />
{{ store.chosenStorageStockName.slice(0, 40) }}
{{ store.chosenStorageStockName.length > 41 ? '...' : '' }}
</span>
</b>
<span v-if="store.chosenStorageStockName && chosenRealComposition"> | </span>
<b class="real-stock-info" v-if="chosenRealComposition">
<span class="text--accent">
<img :src="getIconURL(chosenRealComposition.type)" :alt="chosenRealComposition.type" />
<img
class="real-stock-icon"
:src="getIconURL(chosenRealComposition.type)"
:alt="chosenRealComposition.type"
/>
{{ chosenRealComposition.number }} {{ chosenRealComposition.name }}
</span>
</b>
@@ -40,10 +46,10 @@
import { defineComponent } from 'vue';
import { useStore } from '../../../store';
import imageMixin from '../../../mixins/imageMixin';
import { BookmarkIcon } from '@heroicons/vue/20/solid';
import { BookmarkCheck } from 'lucide-vue-next';
export default defineComponent({
components: { BookmarkIcon },
components: { BookmarkCheck },
mixins: [imageMixin],
@@ -62,11 +68,11 @@ export default defineComponent({
</script>
<style scoped>
.bookmarked-stock-info,
.real-stock-info {
svg,
img {
height: 1.3ch;
}
.real-stock-icon {
height: 1.3ch;
}
.stock-specs svg {
vertical-align: text-top;
}
</style>
+1
View File
@@ -68,6 +68,7 @@
"action-copy": "COPY TO CLIPBOARD",
"action-reset": "RESET",
"action-shuffle": "SHUFFLE",
"action-switch": "TURN AROUND",
"action-bookmark": "BOOKMARK",
"mass": "Mass",
"mass-accepted": "accepted",
+1
View File
@@ -68,6 +68,7 @@
"action-copy": "SKOPIUJ DO SCHOWKA",
"action-reset": "ZRESETUJ",
"action-shuffle": "PRZETASUJ",
"action-switch": "ODWRÓĆ",
"action-bookmark": "ZAPISZ",
"mass": "Masa",
"mass-accepted": "dopuszczalna",
+1 -1
View File
@@ -64,7 +64,7 @@ export const useStore = defineStore({
chosenStorageStockName: '',
chosenStorageStockString: '',
compatibleSimulatorVersion: '2024.3.1',
compatibleSimulatorVersion: '2025.1.1',
}),
getters: {
+10 -1
View File
@@ -128,14 +128,23 @@ button {
&:hover::after,
&:focus-visible::after {
position: absolute;
transform: translateX(10px);
content: attr(data-tooltip);
color: white;
background: black;
border-radius: 0.5em;
margin: 0 0.75em;
padding: 0.5em;
max-width: 300px;
z-index: 100;
@media screen and (max-width: $breakpointSm) {
left: 50%;
transform: translate(-50%, 3ex);
text-align: center;
}
}
}
-4814
View File
File diff suppressed because it is too large Load Diff