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({
scrollBehavior(to, from, savedPosition) {
console.log(to.name);
if (
(to.name == 'SceneryView' || to.name == 'DriverView') &&
(to.name == 'SceneryView' || to.name == 'DriverView' || to.name == 'PlayerProfileView') &&
from.name !== to.name &&
from.query['view'] === undefined &&
!savedPosition
)
return { el: `.app_main`, behavior: 'instant', top: -13 };
return { el: `.app_main`, behavior: 'smooth', top: 0 };
if (savedPosition) return savedPosition;
},
+1 -1
View File
@@ -47,6 +47,6 @@ const chosenTrain = computed(() =>
margin: 0 auto;
padding: 1em 0;
max-width: var(--max-container-width);
min-height: calc(100vh - 7em);
min-height: 100vh;
}
</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', {
params: {
playerId: playerId,
countLimit: 30
dateScope: '14d'
}
});
@@ -545,6 +545,8 @@ $tileColor: #181818;
.profile-view {
display: flex;
justify-content: center;
height: 100vh;
min-height: 500px;
}
.no-data-found {
@@ -573,8 +575,6 @@ $tileColor: #181818;
max-width: var(--max-container-width);
width: 100%;
// height: calc(100vh - 0.5em);
min-height: 900px;
padding: 1rem 0;
text-align: center;
@@ -582,8 +582,6 @@ $tileColor: #181818;
.view-container > div {
position: relative;
// border-radius: 0.5em;
}
.profile-sidebar {
+4 -4
View File
@@ -135,6 +135,10 @@ function setViewMode(componentName: string) {
&-view {
display: flex;
justify-content: center;
height: 100vh;
min-height: 500px;
max-height: 2000px;
}
&-offline {
@@ -181,10 +185,6 @@ function setViewMode(componentName: string) {
background-color: #181818;
border-radius: 0.5em;
padding: 1em 0.5em;
height: calc(100vh - 0.5em);
min-height: 500px;
max-height: 2000px;
}
.scenery-left {