chore(app): improved scrolling into view for main tabs

This commit is contained in:
2026-02-12 03:32:01 +01:00
parent 89dc265e1b
commit d9faa486d2
4 changed files with 11 additions and 12 deletions
+3 -2
View File
@@ -74,13 +74,14 @@ const routes: Array<RouteRecordRaw> = [
const router = createRouter({ const router = createRouter({
scrollBehavior(to, from, savedPosition) { scrollBehavior(to, from, savedPosition) {
console.log(to.name);
if ( if (
(to.name == 'SceneryView' || to.name == 'DriverView') && (to.name == 'SceneryView' || to.name == 'DriverView' || to.name == 'PlayerProfileView') &&
from.name !== to.name && from.name !== to.name &&
from.query['view'] === undefined && from.query['view'] === undefined &&
!savedPosition !savedPosition
) )
return { el: `.app_main`, behavior: 'instant', top: -13 }; return { el: `.app_main`, behavior: 'smooth', top: 0 };
if (savedPosition) return savedPosition; if (savedPosition) return savedPosition;
}, },
+1 -1
View File
@@ -47,6 +47,6 @@ const chosenTrain = computed(() =>
margin: 0 auto; margin: 0 auto;
padding: 1em 0; padding: 1em 0;
max-width: var(--max-container-width); max-width: var(--max-container-width);
min-height: calc(100vh - 7em); min-height: 100vh;
} }
</style> </style>
+3 -5
View File
@@ -488,7 +488,7 @@ async function fetchPlayerJournal(playerId: string) {
const response = await apiStore.client.get<API.PlayerJournal.Data>('api/getPlayerJournal', { const response = await apiStore.client.get<API.PlayerJournal.Data>('api/getPlayerJournal', {
params: { params: {
playerId: playerId, playerId: playerId,
countLimit: 30 dateScope: '14d'
} }
}); });
@@ -545,6 +545,8 @@ $tileColor: #181818;
.profile-view { .profile-view {
display: flex; display: flex;
justify-content: center; justify-content: center;
height: 100vh;
min-height: 500px;
} }
.no-data-found { .no-data-found {
@@ -573,8 +575,6 @@ $tileColor: #181818;
max-width: var(--max-container-width); max-width: var(--max-container-width);
width: 100%; width: 100%;
// height: calc(100vh - 0.5em);
min-height: 900px;
padding: 1rem 0; padding: 1rem 0;
text-align: center; text-align: center;
@@ -582,8 +582,6 @@ $tileColor: #181818;
.view-container > div { .view-container > div {
position: relative; position: relative;
// border-radius: 0.5em;
} }
.profile-sidebar { .profile-sidebar {
+4 -4
View File
@@ -135,6 +135,10 @@ function setViewMode(componentName: string) {
&-view { &-view {
display: flex; display: flex;
justify-content: center; justify-content: center;
height: 100vh;
min-height: 500px;
max-height: 2000px;
} }
&-offline { &-offline {
@@ -181,10 +185,6 @@ function setViewMode(componentName: string) {
background-color: #181818; background-color: #181818;
border-radius: 0.5em; border-radius: 0.5em;
padding: 1em 0.5em; padding: 1em 0.5em;
height: calc(100vh - 0.5em);
min-height: 500px;
max-height: 2000px;
} }
.scenery-left { .scenery-left {