Skip to content

Commit 8b3033d

Browse files
committed
fix(responsive): various sizing and css fix for mobile views
1 parent 77df7b2 commit 8b3033d

File tree

10 files changed

+114
-90
lines changed

10 files changed

+114
-90
lines changed

src/components/AppComponent.vue

+25-33
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const onBack = () => {
9393
<RouterView v-slot="{ Component }">
9494
<main
9595
ref="mainRef"
96-
:class="{ 'full-height': !isAuthenticated, 'loading': !Component }"
96+
:class="{ loading: !Component }"
9797
@touchstart.passive="NavbarService.hideDrawer"
9898
>
9999
<GridBackground v-if="!Component" :size="20" />
@@ -192,22 +192,12 @@ const onBack = () => {
192192
flex-direction: column;
193193
align-items: center;
194194
justify-content: center;
195-
min-height: layout.$safe-content-height;
196-
margin-top: layout.$safe-navbar-height;
195+
min-height: layout.$content-height;
197196
padding-right: calc(#{layout.$safe-area-inset-right} / 1.5);
198197
padding-left: calc(#{layout.$safe-area-inset-left} / 1.5);
199198
transition:
200199
min-height 0.5s var(--n-bezier),
201200
margin-top 0.5s var(--n-bezier);
202-
203-
&.full-height {
204-
min-height: var(--full-height);
205-
margin-top: 0;
206-
207-
:deep(.loading-container) {
208-
padding-top: layout.$safe-navbar-height;
209-
}
210-
}
211201
}
212202
213203
footer {
@@ -218,10 +208,15 @@ const onBack = () => {
218208
}
219209
220210
:deep(.root-panel-wrapper.n-drawer) {
211+
padding-top: layout.$safe-navbar-height;
221212
transition: all 0.3s var(--n-bezier);
222213
223214
.n-drawer-content-wrapper {
224215
overscroll-behavior: none;
216+
217+
.loading-container {
218+
min-height: calc(var(--height-90-dvh) - #{layout.$safe-navbar-height});
219+
}
225220
}
226221
}
227222
@@ -231,17 +226,28 @@ const onBack = () => {
231226
}
232227
}
233228
229+
&.floating {
230+
header {
231+
top: layout.$floating-navbar-offset;
232+
left: calc(50% - #{layout.$floating-navbar-width} / 2);
233+
width: layout.$floating-navbar-width;
234+
}
235+
}
236+
234237
&.reverse {
235238
header {
236239
top: auto;
237-
bottom: calc(0% - #{layout.$safe-area-inset-bottom});
240+
bottom: calc(0% - #{layout.$safe-area-inset-top});
238241
flex-direction: column-reverse;
242+
243+
> :first-child {
244+
padding-bottom: calc(#{layout.$safe-area-inset-bottom / 2});
245+
}
239246
}
240247
241248
main {
242-
min-height: layout.$bottom-content-height;
249+
min-height: layout.$safe-bottom-content-height;
243250
margin-top: 0;
244-
margin-bottom: layout.$safe-navbar-height;
245251
}
246252
247253
footer {
@@ -250,7 +256,10 @@ const onBack = () => {
250256
}
251257
252258
:deep(.root-panel-wrapper.n-drawer) {
253-
padding-bottom: layout.$header-navbar-height;
259+
padding-top: layout.$safe-area-inset-top;
260+
padding-bottom: calc(
261+
#{layout.$safe-navbar-height} + #{layout.$safe-area-inset-bottom / 2}
262+
);
254263
}
255264
256265
&.watching {
@@ -259,22 +268,5 @@ const onBack = () => {
259268
}
260269
}
261270
}
262-
263-
&.floating {
264-
header {
265-
top: layout.$floating-navbar-offset;
266-
left: calc(50% - #{layout.$floating-navbar-width} / 2);
267-
width: layout.$floating-navbar-width;
268-
}
269-
270-
main {
271-
min-height: var(--full-height);
272-
margin-top: 0;
273-
}
274-
275-
:deep(.root-panel-wrapper.n-drawer) {
276-
margin-top: layout.$floating-navbar-height;
277-
}
278-
}
279271
}
280272
</style>

src/components/common/buttons/FloatingButton.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ const emit = defineEmits<{
7777
}
7878
7979
&.reverse {
80-
right: 1.5rem;
81-
bottom: calc(1rem + #{layout.$header-navbar-height});
80+
right: calc(1.5rem + #{layout.$safe-area-inset-right});
81+
bottom: calc(1rem + #{layout.$safe-bottom-navbar-height});
8282
transition-delay: 0.5s;
8383
8484
&.open {
85-
right: 1.5rem;
86-
bottom: calc(1rem + #{layout.$header-open-drawer-height});
85+
bottom: calc(1rem + #{layout.$safe-bottom-open-drawer-height});
8786
transition-delay: 0s;
8887
}
8988
}

src/components/common/list/ListItemPanel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ const onTagClick = (url?: string) => {
460460
background: var(--bg-color-80);
461461
}
462462
463-
// stylelint-disable-next-line selector-class-pattern -- framework overriding
463+
// stylelint-disable-next-line selector-class-pattern -- framework override
464464
.n-tag.n-tag--icon.tag.badge .n-tag__icon {
465465
margin: 0;
466466
}

src/components/common/list/ListScroll.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const topInset = computed(() => {
205205
return parseInt(inset, 10);
206206
});
207207
const listPaddingTop = computed(() => {
208-
const offset = topInset.value;
208+
const offset = topInset.value / 2;
209209
if (listOptions?.value?.paddingTop) return offset + listOptions.value.paddingTop;
210210
if (floating.value) return offset + Header.navbarHeight + Header.floatingOffset + 14;
211211
if (reverse.value && isWatching.value) return offset + 16 + Watching.Height;
@@ -335,11 +335,9 @@ const listPaddingBottom = computed(() => {
335335
@include animation.fade-in;
336336
337337
.list-scroll {
338-
height: var(--full-height);
339-
margin-top: calc(0% - #{layout.$safe-navbar-height});
338+
height: layout.$content-height;
340339
transition: margin-top 0.5s var(--n-bezier);
341340
342-
&.floating,
343341
&.reverse {
344342
margin-top: calc(0% - #{layout.$safe-area-inset-top});
345343
}

src/components/container/ContainerComponent.ce.vue

+14-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import MessageProvider from '~/components/container/MessageProvider.vue';
1616
import NotificationProvider from '~/components/container/NotificationProvider.vue';
1717
import { NavbarService } from '~/services/navbar.service';
1818
import { useAppStateStoreRefs } from '~/stores/app-state.store';
19+
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
1920
import { useExtensionSettingsStoreRefs } from '~/stores/settings/extension.store';
2021
import { lazyComponent } from '~/utils/lazy.utils';
2122
import { addCustomProgressProperty } from '~/utils/style.utils';
@@ -32,6 +33,7 @@ const override: GlobalThemeOverrides = {
3233
const { drawer, open, dropdown } = NavbarService;
3334
const { enabledRoutes, backgroundColor } = useExtensionSettingsStoreRefs();
3435
const { root, floating, reverse } = useAppStateStoreRefs();
36+
const { isWatching } = useWatchingStoreRefs();
3537
3638
onBeforeMount(() => addCustomProgressProperty());
3739
</script>
@@ -65,6 +67,7 @@ onBeforeMount(() => addCustomProgressProperty());
6567
open ? 'drawer-visible' : '',
6668
floating ? 'floating' : '',
6769
reverse ? 'reverse' : '',
70+
isWatching ? 'watching' : '',
6871
]
6972
.filter(Boolean)
7073
.join(' ')
@@ -84,6 +87,7 @@ onBeforeMount(() => addCustomProgressProperty());
8487
dropdown ? 'dropdown-visible' : '',
8588
floating ? 'floating' : '',
8689
reverse ? 'reverse' : '',
90+
isWatching ? 'watching' : '',
8791
]
8892
.filter(Boolean)
8993
.join(' ')
@@ -169,7 +173,11 @@ onBeforeMount(() => addCustomProgressProperty());
169173
}
170174
171175
&.reverse {
172-
top: 0.5rem;
176+
top: calc(#{layout.$safe-area-inset-top} + 0.5rem);
177+
}
178+
179+
&.watching {
180+
top: calc(#{layout.$top-safe-watching-height} + 0.5rem);
173181
}
174182
}
175183
@@ -198,7 +206,11 @@ onBeforeMount(() => addCustomProgressProperty());
198206
}
199207
200208
&.reverse {
201-
top: 0.5rem;
209+
top: calc(#{layout.$safe-area-inset-top} + 0.5rem);
210+
211+
&.watching {
212+
top: calc(#{layout.$top-safe-watching-height} + 0.5rem);
213+
}
202214
}
203215
204216
&:not(.reverse, .floating) {

src/components/views/about/AboutComponent.vue

+18-12
Original file line numberDiff line numberDiff line change
@@ -133,25 +133,25 @@ const openRelease = (url?: string) => {
133133
134134
.container {
135135
width: 100%;
136-
height: layout.$safe-content-height;
136+
height: layout.$content-height;
137137
background: transparent;
138138
transition: padding 0.5s var(--n-bezier);
139139
140140
&.watching {
141141
padding-bottom: layout.$safe-watching-height;
142142
}
143143
144-
&.reverse {
145-
margin-bottom: layout.$header-navbar-height;
144+
.card {
145+
@include mixin.hover-background($from: var(--bg-black-50), $to: var(--bg-color-80));
146146
147-
&.watching {
148-
padding-top: layout.$top-safe-watching-height;
149-
padding-bottom: 0;
150-
}
147+
margin-top: layout.$safe-navbar-height;
148+
margin-bottom: layout.$safe-area-inset-bottom;
151149
}
152150
153-
.card {
154-
@include mixin.hover-background($from: var(--bg-black-50), $to: var(--bg-color-80));
151+
.link {
152+
:deep(.label) {
153+
padding: 0.15rem;
154+
}
155155
}
156156
157157
&.floating {
@@ -160,9 +160,15 @@ const openRelease = (url?: string) => {
160160
}
161161
}
162162
163-
.link {
164-
:deep(.label) {
165-
padding: 0.15rem;
163+
&.reverse {
164+
.card {
165+
margin-top: layout.$safe-area-inset-top;
166+
margin-bottom: layout.$header-navbar-height;
167+
}
168+
169+
&.watching {
170+
padding-top: layout.$top-safe-watching-height;
171+
padding-bottom: 0;
166172
}
167173
}
168174
}

src/components/views/checkin/CheckinComponent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ const onClick = () => {
411411
}
412412
413413
&.reverse {
414-
height: layout.$top-safe-watching-height;
414+
height: layout.$watching-height;
415415
padding-top: layout.$safe-area-inset-top;
416416
417417
&:active,

0 commit comments

Comments
 (0)