Skip to content

Commit ee8ad29

Browse files
committed
fix(mobile): fix floating and progress
1 parent b14e115 commit ee8ad29

File tree

7 files changed

+35
-16
lines changed

7 files changed

+35
-16
lines changed

src/components/AppComponent.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ const onBack = () => {
131131
@mouseenter="footerOpen = true"
132132
@mouseleave="footerOpen = false"
133133
>
134-
<CheckinComponent v-if="isAuthenticated" :parent-element="footerRef" />
134+
<CheckinComponent
135+
v-if="isAuthenticated"
136+
:parent-element="footerRef"
137+
:reverse="reverse"
138+
/>
135139
</footer>
136140
<DebugProvider />
137141
</RouterView>

src/components/common/buttons/FloatingButton.vue

+2-8
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,13 @@ const emit = defineEmits<{
7777
}
7878
7979
&.reverse {
80-
$navbar-offset: calc(
81-
#{layout.$header-navbar-height} + #{layout.$safe-area-inset-bottom / 1.5}
82-
);
83-
8480
right: 1.5rem;
85-
bottom: calc(1rem + #{$navbar-offset});
81+
bottom: calc(1rem + #{layout.$header-navbar-height});
8682
transition-delay: 0.5s;
8783
8884
&.open {
89-
$navbar-open-offset: calc(#{layout.$header-drawer-height} + #{$navbar-offset});
90-
9185
right: 1.5rem;
92-
bottom: calc(1rem + #{$navbar-open-offset});
86+
bottom: calc(1rem + #{layout.$header-open-drawer-height});
9387
transition-delay: 0s;
9488
}
9589
}

src/components/container/ContainerComponent.ce.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ onBeforeMount(() => addCustomProgressProperty());
151151
top: layout.$safe-navbar-height;
152152
153153
&.drawer-visible {
154-
top: layout.$header-open-drawer-height;
154+
top: layout.$safe-header-open-drawer-height;
155155
}
156156
157157
&.floating {
@@ -186,7 +186,7 @@ onBeforeMount(() => addCustomProgressProperty());
186186
top: calc(#{layout.$safe-navbar-height} + 12px);
187187
188188
&.drawer-visible {
189-
top: calc(#{layout.$header-open-drawer-height} + 12px);
189+
top: calc(#{layout.$safe-header-open-drawer-height} + 12px);
190190
}
191191
192192
&.floating {

src/components/views/checkin/CheckinComponent.vue

+21-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const props = defineProps({
2424
type: HTMLElement,
2525
required: false,
2626
},
27+
reverse: {
28+
type: Boolean,
29+
required: false,
30+
default: false,
31+
},
2732
});
2833
2934
const i18n = useI18n('watching');
@@ -146,7 +151,11 @@ const onClick = () => {
146151

147152
<template>
148153
<div class="wrapper">
149-
<div class="container" :class="{ watching: isWatching, offset }" @click="onClick">
154+
<div
155+
class="container"
156+
:class="{ watching: isWatching, offset, reverse }"
157+
@click="onClick"
158+
>
150159
<span class="left">
151160
<NIcon class="icon" :component="icon" />
152161
<div class="column">
@@ -401,6 +410,17 @@ const onClick = () => {
401410
}
402411
}
403412
}
413+
414+
&.reverse {
415+
height: layout.$watching-height;
416+
padding-top: calc(#{layout.$safe-area-inset-top / 1.5});
417+
418+
&:active,
419+
&:focus-within,
420+
&:hover {
421+
height: layout.$watching-open-height;
422+
}
423+
}
404424
}
405425
406426
@media (width <= 600px) {

src/components/views/history/HistoryNavbar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const open = ref(false);
128128
flex-wrap: wrap;
129129
justify-content: center;
130130
max-width: min(36.5rem, 100dvw);
131-
max-height: calc(var(--full-height) - #{layout.$header-open-drawer-height});
131+
max-height: calc(var(--full-height) - #{layout.$safe-header-open-drawer-height});
132132
overflow: auto;
133133
scrollbar-width: thin;
134134
}

src/components/views/settings/SettingsComponent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ onDeactivated(() => {
237237
margin-bottom: layout.$header-navbar-height;
238238
239239
.card:first-child {
240-
margin-top: 0.5rem;
240+
margin-top: calc(#{layout.$safe-area-inset-top / 2});
241241
}
242242
}
243243
}

src/styles/layout.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ $safe-area-inset-left: var(--safe-area-inset-left);
66

77
// Element heights
88
$header-navbar-height: 2.75rem;
9-
$safe-navbar-height: calc(#{$header-navbar-height} + #{$safe-area-inset-top});
109
$header-drawer-height: 3.5rem;
11-
$header-open-drawer-height: calc(#{$safe-navbar-height} + #{$header-drawer-height});
10+
$header-open-drawer-height: calc(#{$header-navbar-height} + #{$header-drawer-height});
11+
$safe-navbar-height: calc(#{$header-navbar-height} + #{$safe-area-inset-top});
12+
$safe-header-open-drawer-height: calc(#{$safe-navbar-height} + #{$header-drawer-height});
1213
$safe-content-height: calc(var(--full-height) - #{$safe-navbar-height});
1314
$safe-full-height: calc(var(--full-height) - #{$safe-area-inset-top});
1415

0 commit comments

Comments
 (0)