refactor(app): styles cleanup; minor code improvements

This commit is contained in:
2025-12-18 00:39:17 +01:00
parent cb6ea1edb2
commit 5d32145f13
7 changed files with 93 additions and 99 deletions
-13
View File
@@ -1,13 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"
/>
</svg>

Before

Width:  |  Height:  |  Size: 341 B

+29 -30
View File
@@ -14,7 +14,7 @@
class="header-text"
:class="headerName"
>
<span class="header_wrapper">
<div class="header_wrapper">
<div v-html="$t(`sceneries.headers.${headerName}`)"></div>
<img
@@ -23,7 +23,7 @@
:src="`/images/icon-arrow-${activeSorter.dir == 1 ? 'asc' : 'desc'}.svg`"
alt="sort icon"
/>
</span>
</div>
</th>
<th
@@ -52,14 +52,14 @@
</thead>
<tbody>
<router-link
<tr
v-for="station in filteredStationList"
class="a-row"
role="row"
tabindex="0"
:key="station.name"
@click.right.prevent="openForumSite($event, station.generalInfo?.url)"
@keydown.space.prevent="openForumSite($event, station.generalInfo?.url)"
:to="getSceneryRoute(station)"
@click="getSceneryRoute(station)"
@keydown.enter="getSceneryRoute(station)"
>
<td class="station-name" :class="station.generalInfo?.availability">
<b v-if="station.generalInfo?.project" style="color: salmon">{{
@@ -314,7 +314,7 @@
>
{{ station.onlineInfo?.scheduledTrainCount.confirmed ?? '-' }}
</td>
</router-link>
</tr>
</tbody>
</table>
@@ -384,15 +384,13 @@ export default defineComponent({
methods: {
getSceneryRoute(station: Station) {
// TODO: Hide tooltips when navigating away
return {
this.$router.push({
name: 'SceneryView',
query: {
station: station.name,
region: this.$route.query.region || undefined
}
};
});
},
openDonationCard(e: Event) {
@@ -459,17 +457,28 @@ table {
width: 100%;
min-width: 1250px;
white-space: wrap;
}
thead {
thead {
position: sticky;
top: 0;
}
z-index: 50;
}
thead tr {
thead tr {
background-color: var(--clr-bg3);
}
}
thead th {
background-color: var(--clr-bg3);
white-space: pre-wrap;
padding: 0.5em 0.25em;
cursor: pointer;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
thead th {
&.station {
width: 12em;
}
@@ -506,17 +515,9 @@ table {
width: 5em;
}
}
}
padding: 0.5em 0.25em;
background-color: var(--clr-bg3);
white-space: pre-wrap;
cursor: pointer;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
span {
thead th .header_wrapper {
display: flex;
align-items: center;
justify-content: center;
@@ -525,12 +526,9 @@ table {
width: 1.5em;
vertical-align: middle;
}
}
}
}
tr,
.a-row {
tbody tr {
background-color: $rowCol;
vertical-align: middle;
@@ -550,6 +548,7 @@ tr,
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
height: 2.5em;
&.inactive {
opacity: 0.2;
+3 -3
View File
@@ -38,7 +38,8 @@ export const useMainStore = defineStore('mainStore', {
modalLastClickedTarget: null,
currentLocale: 'pl',
isMigrateInfoCardOpen: false
isMigrateInfoCardOpen: false,
pinnedStationNames: []
}) as MainStoreState,
actions: {
@@ -431,7 +432,6 @@ export const useMainStore = defineStore('mainStore', {
return {
name: scenery.name,
generalInfo: {
...scenery,
authors: scenery.authors?.split(',').map((a) => a.trim()),
@@ -446,7 +446,7 @@ export const useMainStore = defineStore('mainStore', {
},
allStationInfo(): Station[] {
const onlineUnsavedStations = this.activeSceneryList
const onlineUnsavedStations: Station[] = this.activeSceneryList
.filter(
(scenery) =>
this.stationList.findIndex((st) => st.name == scenery.name) == -1 &&
+21 -1
View File
@@ -89,7 +89,8 @@ select {
font-size: 1em;
}
input, select {
input,
select {
background: none;
color: white;
font-size: 1em;
@@ -358,3 +359,22 @@ a.a-button {
background-color: #aaa;
margin: 0.5em 0;
}
.g-checkbox {
position: relative;
display: inline-block;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
display: flex;
justify-content: center;
align-items: center;
input {
position: absolute;
width: 1px;
height: 1px;
}
}
-6
View File
@@ -39,9 +39,3 @@
color: #aefff8;
}
}
.icon-heart {
-webkit-mask: url(images/icon-heart.svg) no-repeat center;
mask: url(images/icon-heart.svg) no-repeat center;
mask-size: 1em;
}
-4
View File
@@ -62,7 +62,3 @@
transform: translateY(-50%);
padding-right: 0.5em;
}
select.search-input {
}
-2
View File
@@ -95,9 +95,7 @@ export interface TrainTimetableData {
export interface Station {
name: string;
generalInfo?: StationGeneralInfo;
onlineInfo?: ActiveScenery;
}