Fix UI for mobile (#2293)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2022-10-11 09:40:09 +03:00 committed by GitHub
parent ca6e5edcf8
commit e72eb9bc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 3 deletions

View File

@ -68,6 +68,9 @@
--timing-main: cubic-bezier(0.25, 0.46, 0.45, 0.94);
// transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
:root {
--app-height: 100%;
}
::-webkit-scrollbar {
width: 6px;
@ -110,3 +113,10 @@ body {
background-color: var(--body-color);
user-select: none;
}
html,
body {
height: var(--app-height);
width: 100%;
overflow: hidden;
}

View File

@ -39,6 +39,8 @@
on:input
autocomplete="off"
placeholder=" "
spellcheck="false"
autocapitalize="off"
/>
{:else}
<input
@ -53,6 +55,8 @@
on:input
autocomplete="off"
placeholder=" "
spellcheck="false"
autocapitalize="off"
/>
{/if}
{#if label}

View File

@ -68,6 +68,8 @@
$: $deviceInfo.docHeight = docHeight
$: $deviceInfo.isPortrait = isPortrait
$: $deviceInfo.isMobile = isMobile
$: document.documentElement.style.setProperty('--app-height', `${docHeight}px`)
</script>
<svelte:window bind:innerWidth={docWidth} bind:innerHeight={docHeight} />
@ -127,7 +129,9 @@
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
// height: 100vh;
height: 100%;
// height: var(--app-height);
.status-bar {
min-height: var(--status-bar-height);
@ -163,7 +167,7 @@
}
.app {
height: calc(100vh - var(--status-bar-height));
height: calc(100% - var(--status-bar-height));
// min-width: 600px;
// min-height: 480px;

View File

@ -41,5 +41,5 @@ export function fetchMetadataLocalStorage<T> (id: Metadata<T>): T | null {
}
export function checkMobile (): boolean {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|Opera Mini/i.test(navigator.userAgent)
}